mirror of
https://github.com/cloudflare/cloudflare-python.git
synced 2026-01-16 23:01:03 +00:00
feat(api): update via SDK Studio (#1182)
This commit is contained in:
parent
efafb96456
commit
41a8d2246f
9 changed files with 61 additions and 1 deletions
|
|
@ -1,2 +1,2 @@
|
|||
configured_endpoints: 1256
|
||||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cb76af21f6fcf485b7e41586c3076cd45d25d6d04971c77ec814523b894dcb97.yml
|
||||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f86dcdd3b76e16dc467b91bfa22be2423bd847e93a59d892004b29812777d217.yml
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ class NetworksResource(SyncAPIResource):
|
|||
ip_network_encoded: str,
|
||||
*,
|
||||
account_id: str,
|
||||
tunnel_id: str,
|
||||
comment: str | NotGiven = NOT_GIVEN,
|
||||
virtual_network_id: str | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
|
|
@ -61,6 +62,8 @@ class NetworksResource(SyncAPIResource):
|
|||
|
||||
ip_network_encoded: IP/CIDR range in URL-encoded format
|
||||
|
||||
tunnel_id: UUID of the tunnel.
|
||||
|
||||
comment: Optional remark describing the route.
|
||||
|
||||
virtual_network_id: UUID of the virtual network.
|
||||
|
|
@ -81,6 +84,7 @@ class NetworksResource(SyncAPIResource):
|
|||
f"/accounts/{account_id}/teamnet/routes/network/{ip_network_encoded}",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"tunnel_id": tunnel_id,
|
||||
"comment": comment,
|
||||
"virtual_network_id": virtual_network_id,
|
||||
},
|
||||
|
|
@ -225,6 +229,7 @@ class AsyncNetworksResource(AsyncAPIResource):
|
|||
ip_network_encoded: str,
|
||||
*,
|
||||
account_id: str,
|
||||
tunnel_id: str,
|
||||
comment: str | NotGiven = NOT_GIVEN,
|
||||
virtual_network_id: str | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
|
|
@ -244,6 +249,8 @@ class AsyncNetworksResource(AsyncAPIResource):
|
|||
|
||||
ip_network_encoded: IP/CIDR range in URL-encoded format
|
||||
|
||||
tunnel_id: UUID of the tunnel.
|
||||
|
||||
comment: Optional remark describing the route.
|
||||
|
||||
virtual_network_id: UUID of the virtual network.
|
||||
|
|
@ -264,6 +271,7 @@ class AsyncNetworksResource(AsyncAPIResource):
|
|||
f"/accounts/{account_id}/teamnet/routes/network/{ip_network_encoded}",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"tunnel_id": tunnel_id,
|
||||
"comment": comment,
|
||||
"virtual_network_id": virtual_network_id,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ class RoutesResource(SyncAPIResource):
|
|||
*,
|
||||
account_id: str,
|
||||
network: str,
|
||||
tunnel_id: str,
|
||||
comment: str | NotGiven = NOT_GIVEN,
|
||||
virtual_network_id: str | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
|
|
@ -85,6 +86,8 @@ class RoutesResource(SyncAPIResource):
|
|||
|
||||
network: The private IPv4 or IPv6 range connected by the route, in CIDR notation.
|
||||
|
||||
tunnel_id: UUID of the tunnel.
|
||||
|
||||
comment: Optional remark describing the route.
|
||||
|
||||
virtual_network_id: UUID of the virtual network.
|
||||
|
|
@ -104,6 +107,7 @@ class RoutesResource(SyncAPIResource):
|
|||
body=maybe_transform(
|
||||
{
|
||||
"network": network,
|
||||
"tunnel_id": tunnel_id,
|
||||
"comment": comment,
|
||||
"virtual_network_id": virtual_network_id,
|
||||
},
|
||||
|
|
@ -260,6 +264,7 @@ class RoutesResource(SyncAPIResource):
|
|||
account_id: str,
|
||||
comment: str | NotGiven = NOT_GIVEN,
|
||||
network: str | NotGiven = NOT_GIVEN,
|
||||
tunnel_id: str | NotGiven = NOT_GIVEN,
|
||||
virtual_network_id: str | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
|
|
@ -282,6 +287,8 @@ class RoutesResource(SyncAPIResource):
|
|||
|
||||
network: The private IPv4 or IPv6 range connected by the route, in CIDR notation.
|
||||
|
||||
tunnel_id: UUID of the tunnel.
|
||||
|
||||
virtual_network_id: UUID of the virtual network.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
|
@ -302,6 +309,7 @@ class RoutesResource(SyncAPIResource):
|
|||
{
|
||||
"comment": comment,
|
||||
"network": network,
|
||||
"tunnel_id": tunnel_id,
|
||||
"virtual_network_id": virtual_network_id,
|
||||
},
|
||||
route_edit_params.RouteEditParams,
|
||||
|
|
@ -339,6 +347,7 @@ class AsyncRoutesResource(AsyncAPIResource):
|
|||
*,
|
||||
account_id: str,
|
||||
network: str,
|
||||
tunnel_id: str,
|
||||
comment: str | NotGiven = NOT_GIVEN,
|
||||
virtual_network_id: str | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
|
|
@ -356,6 +365,8 @@ class AsyncRoutesResource(AsyncAPIResource):
|
|||
|
||||
network: The private IPv4 or IPv6 range connected by the route, in CIDR notation.
|
||||
|
||||
tunnel_id: UUID of the tunnel.
|
||||
|
||||
comment: Optional remark describing the route.
|
||||
|
||||
virtual_network_id: UUID of the virtual network.
|
||||
|
|
@ -375,6 +386,7 @@ class AsyncRoutesResource(AsyncAPIResource):
|
|||
body=await async_maybe_transform(
|
||||
{
|
||||
"network": network,
|
||||
"tunnel_id": tunnel_id,
|
||||
"comment": comment,
|
||||
"virtual_network_id": virtual_network_id,
|
||||
},
|
||||
|
|
@ -531,6 +543,7 @@ class AsyncRoutesResource(AsyncAPIResource):
|
|||
account_id: str,
|
||||
comment: str | NotGiven = NOT_GIVEN,
|
||||
network: str | NotGiven = NOT_GIVEN,
|
||||
tunnel_id: str | NotGiven = NOT_GIVEN,
|
||||
virtual_network_id: str | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
|
|
@ -553,6 +566,8 @@ class AsyncRoutesResource(AsyncAPIResource):
|
|||
|
||||
network: The private IPv4 or IPv6 range connected by the route, in CIDR notation.
|
||||
|
||||
tunnel_id: UUID of the tunnel.
|
||||
|
||||
virtual_network_id: UUID of the virtual network.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
|
@ -573,6 +588,7 @@ class AsyncRoutesResource(AsyncAPIResource):
|
|||
{
|
||||
"comment": comment,
|
||||
"network": network,
|
||||
"tunnel_id": tunnel_id,
|
||||
"virtual_network_id": virtual_network_id,
|
||||
},
|
||||
route_edit_params.RouteEditParams,
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ class PrioritizeUpdateParams(TypedDict, total=False):
|
|||
|
||||
|
||||
class Certificate(TypedDict, total=False):
|
||||
id: str
|
||||
"""Identifier"""
|
||||
|
||||
priority: float
|
||||
"""The order/priority in which the certificate will be used in a request.
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,9 @@ class RouteCreateParams(TypedDict, total=False):
|
|||
network: Required[str]
|
||||
"""The private IPv4 or IPv6 range connected by the route, in CIDR notation."""
|
||||
|
||||
tunnel_id: Required[str]
|
||||
"""UUID of the tunnel."""
|
||||
|
||||
comment: str
|
||||
"""Optional remark describing the route."""
|
||||
|
||||
|
|
|
|||
|
|
@ -17,5 +17,8 @@ class RouteEditParams(TypedDict, total=False):
|
|||
network: str
|
||||
"""The private IPv4 or IPv6 range connected by the route, in CIDR notation."""
|
||||
|
||||
tunnel_id: str
|
||||
"""UUID of the tunnel."""
|
||||
|
||||
virtual_network_id: str
|
||||
"""UUID of the virtual network."""
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@ class NetworkCreateParams(TypedDict, total=False):
|
|||
account_id: Required[str]
|
||||
"""Cloudflare account ID"""
|
||||
|
||||
tunnel_id: Required[str]
|
||||
"""UUID of the tunnel."""
|
||||
|
||||
comment: str
|
||||
"""Optional remark describing the route."""
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ class TestNetworks:
|
|||
network = client.zero_trust.networks.routes.networks.create(
|
||||
ip_network_encoded="172.16.0.0%2F16",
|
||||
account_id="699d98642c564d2e855e9661899b7252",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
)
|
||||
assert_matches_type(Route, network, path=["response"])
|
||||
|
||||
|
|
@ -30,6 +31,7 @@ class TestNetworks:
|
|||
network = client.zero_trust.networks.routes.networks.create(
|
||||
ip_network_encoded="172.16.0.0%2F16",
|
||||
account_id="699d98642c564d2e855e9661899b7252",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
comment="Example comment for this route.",
|
||||
virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
)
|
||||
|
|
@ -40,6 +42,7 @@ class TestNetworks:
|
|||
response = client.zero_trust.networks.routes.networks.with_raw_response.create(
|
||||
ip_network_encoded="172.16.0.0%2F16",
|
||||
account_id="699d98642c564d2e855e9661899b7252",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
|
|
@ -52,6 +55,7 @@ class TestNetworks:
|
|||
with client.zero_trust.networks.routes.networks.with_streaming_response.create(
|
||||
ip_network_encoded="172.16.0.0%2F16",
|
||||
account_id="699d98642c564d2e855e9661899b7252",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
|
@ -67,12 +71,14 @@ class TestNetworks:
|
|||
client.zero_trust.networks.routes.networks.with_raw_response.create(
|
||||
ip_network_encoded="172.16.0.0%2F16",
|
||||
account_id="",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_network_encoded` but received ''"):
|
||||
client.zero_trust.networks.routes.networks.with_raw_response.create(
|
||||
ip_network_encoded="",
|
||||
account_id="699d98642c564d2e855e9661899b7252",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
)
|
||||
|
||||
@parametrize
|
||||
|
|
@ -191,6 +197,7 @@ class TestAsyncNetworks:
|
|||
network = await async_client.zero_trust.networks.routes.networks.create(
|
||||
ip_network_encoded="172.16.0.0%2F16",
|
||||
account_id="699d98642c564d2e855e9661899b7252",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
)
|
||||
assert_matches_type(Route, network, path=["response"])
|
||||
|
||||
|
|
@ -199,6 +206,7 @@ class TestAsyncNetworks:
|
|||
network = await async_client.zero_trust.networks.routes.networks.create(
|
||||
ip_network_encoded="172.16.0.0%2F16",
|
||||
account_id="699d98642c564d2e855e9661899b7252",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
comment="Example comment for this route.",
|
||||
virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
)
|
||||
|
|
@ -209,6 +217,7 @@ class TestAsyncNetworks:
|
|||
response = await async_client.zero_trust.networks.routes.networks.with_raw_response.create(
|
||||
ip_network_encoded="172.16.0.0%2F16",
|
||||
account_id="699d98642c564d2e855e9661899b7252",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
|
|
@ -221,6 +230,7 @@ class TestAsyncNetworks:
|
|||
async with async_client.zero_trust.networks.routes.networks.with_streaming_response.create(
|
||||
ip_network_encoded="172.16.0.0%2F16",
|
||||
account_id="699d98642c564d2e855e9661899b7252",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
|
@ -236,12 +246,14 @@ class TestAsyncNetworks:
|
|||
await async_client.zero_trust.networks.routes.networks.with_raw_response.create(
|
||||
ip_network_encoded="172.16.0.0%2F16",
|
||||
account_id="",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_network_encoded` but received ''"):
|
||||
await async_client.zero_trust.networks.routes.networks.with_raw_response.create(
|
||||
ip_network_encoded="",
|
||||
account_id="699d98642c564d2e855e9661899b7252",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
)
|
||||
|
||||
@parametrize
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ class TestRoutes:
|
|||
route = client.zero_trust.networks.routes.create(
|
||||
account_id="699d98642c564d2e855e9661899b7252",
|
||||
network="172.16.0.0/16",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
)
|
||||
assert_matches_type(Route, route, path=["response"])
|
||||
|
||||
|
|
@ -35,6 +36,7 @@ class TestRoutes:
|
|||
route = client.zero_trust.networks.routes.create(
|
||||
account_id="699d98642c564d2e855e9661899b7252",
|
||||
network="172.16.0.0/16",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
comment="Example comment for this route.",
|
||||
virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
)
|
||||
|
|
@ -45,6 +47,7 @@ class TestRoutes:
|
|||
response = client.zero_trust.networks.routes.with_raw_response.create(
|
||||
account_id="699d98642c564d2e855e9661899b7252",
|
||||
network="172.16.0.0/16",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
|
|
@ -57,6 +60,7 @@ class TestRoutes:
|
|||
with client.zero_trust.networks.routes.with_streaming_response.create(
|
||||
account_id="699d98642c564d2e855e9661899b7252",
|
||||
network="172.16.0.0/16",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
|
@ -72,6 +76,7 @@ class TestRoutes:
|
|||
client.zero_trust.networks.routes.with_raw_response.create(
|
||||
account_id="",
|
||||
network="172.16.0.0/16",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
)
|
||||
|
||||
@parametrize
|
||||
|
|
@ -193,6 +198,7 @@ class TestRoutes:
|
|||
account_id="699d98642c564d2e855e9661899b7252",
|
||||
comment="Example comment for this route.",
|
||||
network="172.16.0.0/16",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
)
|
||||
assert_matches_type(Route, route, path=["response"])
|
||||
|
|
@ -246,6 +252,7 @@ class TestAsyncRoutes:
|
|||
route = await async_client.zero_trust.networks.routes.create(
|
||||
account_id="699d98642c564d2e855e9661899b7252",
|
||||
network="172.16.0.0/16",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
)
|
||||
assert_matches_type(Route, route, path=["response"])
|
||||
|
||||
|
|
@ -254,6 +261,7 @@ class TestAsyncRoutes:
|
|||
route = await async_client.zero_trust.networks.routes.create(
|
||||
account_id="699d98642c564d2e855e9661899b7252",
|
||||
network="172.16.0.0/16",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
comment="Example comment for this route.",
|
||||
virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
)
|
||||
|
|
@ -264,6 +272,7 @@ class TestAsyncRoutes:
|
|||
response = await async_client.zero_trust.networks.routes.with_raw_response.create(
|
||||
account_id="699d98642c564d2e855e9661899b7252",
|
||||
network="172.16.0.0/16",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
|
|
@ -276,6 +285,7 @@ class TestAsyncRoutes:
|
|||
async with async_client.zero_trust.networks.routes.with_streaming_response.create(
|
||||
account_id="699d98642c564d2e855e9661899b7252",
|
||||
network="172.16.0.0/16",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
|
@ -291,6 +301,7 @@ class TestAsyncRoutes:
|
|||
await async_client.zero_trust.networks.routes.with_raw_response.create(
|
||||
account_id="",
|
||||
network="172.16.0.0/16",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
)
|
||||
|
||||
@parametrize
|
||||
|
|
@ -412,6 +423,7 @@ class TestAsyncRoutes:
|
|||
account_id="699d98642c564d2e855e9661899b7252",
|
||||
comment="Example comment for this route.",
|
||||
network="172.16.0.0/16",
|
||||
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
|
||||
)
|
||||
assert_matches_type(Route, route, path=["response"])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue