From 41a8d2246f92dcafba6a7f728ed21bdf354cd508 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 04:54:53 +0000 Subject: [PATCH] feat(api): update via SDK Studio (#1182) --- .stats.yml | 2 +- .../zero_trust/networks/routes/networks.py | 8 ++++++++ .../zero_trust/networks/routes/routes.py | 16 ++++++++++++++++ .../prioritize_update_params.py | 3 +++ .../zero_trust/networks/route_create_params.py | 3 +++ .../zero_trust/networks/route_edit_params.py | 3 +++ .../networks/routes/network_create_params.py | 3 +++ .../zero_trust/networks/routes/test_networks.py | 12 ++++++++++++ .../zero_trust/networks/test_routes.py | 12 ++++++++++++ 9 files changed, 61 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 53103a816fb..b9d92cc7a0f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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 diff --git a/src/cloudflare/resources/zero_trust/networks/routes/networks.py b/src/cloudflare/resources/zero_trust/networks/routes/networks.py index c5defa8b985..6363a91a951 100644 --- a/src/cloudflare/resources/zero_trust/networks/routes/networks.py +++ b/src/cloudflare/resources/zero_trust/networks/routes/networks.py @@ -42,6 +42,7 @@ def create( 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 @@ def create( 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 @@ def create( 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 @@ async def create( 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 @@ async def create( 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 @@ async def create( 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, }, diff --git a/src/cloudflare/resources/zero_trust/networks/routes/routes.py b/src/cloudflare/resources/zero_trust/networks/routes/routes.py index 102a782dfa7..d4d7cb45e53 100644 --- a/src/cloudflare/resources/zero_trust/networks/routes/routes.py +++ b/src/cloudflare/resources/zero_trust/networks/routes/routes.py @@ -68,6 +68,7 @@ def create( *, 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 @@ def create( 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 @@ def create( body=maybe_transform( { "network": network, + "tunnel_id": tunnel_id, "comment": comment, "virtual_network_id": virtual_network_id, }, @@ -260,6 +264,7 @@ def edit( 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 @@ def edit( 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 @@ def edit( { "comment": comment, "network": network, + "tunnel_id": tunnel_id, "virtual_network_id": virtual_network_id, }, route_edit_params.RouteEditParams, @@ -339,6 +347,7 @@ async def create( *, 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 @@ async def create( 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 @@ async def create( body=await async_maybe_transform( { "network": network, + "tunnel_id": tunnel_id, "comment": comment, "virtual_network_id": virtual_network_id, }, @@ -531,6 +543,7 @@ async def edit( 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 @@ async def edit( 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 @@ async def edit( { "comment": comment, "network": network, + "tunnel_id": tunnel_id, "virtual_network_id": virtual_network_id, }, route_edit_params.RouteEditParams, diff --git a/src/cloudflare/types/custom_certificates/prioritize_update_params.py b/src/cloudflare/types/custom_certificates/prioritize_update_params.py index 5924e7533a0..8e290afb630 100644 --- a/src/cloudflare/types/custom_certificates/prioritize_update_params.py +++ b/src/cloudflare/types/custom_certificates/prioritize_update_params.py @@ -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. diff --git a/src/cloudflare/types/zero_trust/networks/route_create_params.py b/src/cloudflare/types/zero_trust/networks/route_create_params.py index 1d2fe28479d..635da63698f 100644 --- a/src/cloudflare/types/zero_trust/networks/route_create_params.py +++ b/src/cloudflare/types/zero_trust/networks/route_create_params.py @@ -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.""" diff --git a/src/cloudflare/types/zero_trust/networks/route_edit_params.py b/src/cloudflare/types/zero_trust/networks/route_edit_params.py index 1640ce2c28b..5d0a383e5f0 100644 --- a/src/cloudflare/types/zero_trust/networks/route_edit_params.py +++ b/src/cloudflare/types/zero_trust/networks/route_edit_params.py @@ -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.""" diff --git a/src/cloudflare/types/zero_trust/networks/routes/network_create_params.py b/src/cloudflare/types/zero_trust/networks/routes/network_create_params.py index 5f145557ca0..f33811b5e5e 100644 --- a/src/cloudflare/types/zero_trust/networks/routes/network_create_params.py +++ b/src/cloudflare/types/zero_trust/networks/routes/network_create_params.py @@ -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.""" diff --git a/tests/api_resources/zero_trust/networks/routes/test_networks.py b/tests/api_resources/zero_trust/networks/routes/test_networks.py index 484c99fdd33..5f9fb16ca2d 100644 --- a/tests/api_resources/zero_trust/networks/routes/test_networks.py +++ b/tests/api_resources/zero_trust/networks/routes/test_networks.py @@ -22,6 +22,7 @@ def test_method_create(self, client: Cloudflare) -> None: 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 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: 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 @@ def test_raw_response_create(self, client: Cloudflare) -> None: 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 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: 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 @@ def test_path_params_create(self, client: Cloudflare) -> None: 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 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: 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 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare 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 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: 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 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> 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 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: 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 diff --git a/tests/api_resources/zero_trust/networks/test_routes.py b/tests/api_resources/zero_trust/networks/test_routes.py index be4aa81b146..c1bc1d16c66 100644 --- a/tests/api_resources/zero_trust/networks/test_routes.py +++ b/tests/api_resources/zero_trust/networks/test_routes.py @@ -27,6 +27,7 @@ def test_method_create(self, client: Cloudflare) -> None: 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 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: 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 @@ def test_raw_response_create(self, client: Cloudflare) -> None: 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 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: 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 @@ def test_path_params_create(self, client: Cloudflare) -> None: 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 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: 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 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: 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 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare 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 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: 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 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> 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 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: 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 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) 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"])