diff --git a/.stats.yml b/.stats.yml index 691540b5bcf..cfe7672b318 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 1353 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e79cc9a74089de5aec2c720b1e3023ea27869883f43c8b0167198f5967128636.yml +configured_endpoints: 1337 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8127f6c197e7f17e9eb9d99add7dff6ecbc8b5a90e298269e2070738ed4368e9.yml diff --git a/api.md b/api.md index 8f8c1cbf597..c3139edde1c 100644 --- a/api.md +++ b/api.md @@ -3988,40 +3988,25 @@ Methods: Types: ```python -from cloudflare.types.magic_transit import ( - CfInterconnectUpdateResponse, - CfInterconnectListResponse, - CfInterconnectGetResponse, -) +from cloudflare.types.magic_transit import CfInterconnectListResponse ``` Methods: -- client.magic_transit.cf_interconnects.update(tunnel_identifier, \*, account_id, \*\*params) -> CfInterconnectUpdateResponse - client.magic_transit.cf_interconnects.list(\*, account_id) -> CfInterconnectListResponse -- client.magic_transit.cf_interconnects.get(tunnel_identifier, \*, account_id) -> CfInterconnectGetResponse ## GRETunnels Types: ```python -from cloudflare.types.magic_transit import ( - GRETunnelCreateResponse, - GRETunnelUpdateResponse, - GRETunnelListResponse, - GRETunnelDeleteResponse, - GRETunnelGetResponse, -) +from cloudflare.types.magic_transit import GRETunnelCreateResponse, GRETunnelListResponse ``` Methods: - client.magic_transit.gre_tunnels.create(\*, account_id, \*\*params) -> GRETunnelCreateResponse -- client.magic_transit.gre_tunnels.update(tunnel_identifier, \*, account_id, \*\*params) -> GRETunnelUpdateResponse - client.magic_transit.gre_tunnels.list(\*, account_id) -> GRETunnelListResponse -- client.magic_transit.gre_tunnels.delete(tunnel_identifier, \*, account_id) -> GRETunnelDeleteResponse -- client.magic_transit.gre_tunnels.get(tunnel_identifier, \*, account_id) -> GRETunnelGetResponse ## IPSECTunnels @@ -4031,22 +4016,14 @@ Types: from cloudflare.types.magic_transit import ( PSKMetadata, IPSECTunnelCreateResponse, - IPSECTunnelUpdateResponse, IPSECTunnelListResponse, - IPSECTunnelDeleteResponse, - IPSECTunnelGetResponse, - IPSECTunnelPSKGenerateResponse, ) ``` Methods: - client.magic_transit.ipsec_tunnels.create(\*, account_id, \*\*params) -> IPSECTunnelCreateResponse -- client.magic_transit.ipsec_tunnels.update(tunnel_identifier, \*, account_id, \*\*params) -> IPSECTunnelUpdateResponse - client.magic_transit.ipsec_tunnels.list(\*, account_id) -> IPSECTunnelListResponse -- client.magic_transit.ipsec_tunnels.delete(tunnel_identifier, \*, account_id) -> IPSECTunnelDeleteResponse -- client.magic_transit.ipsec_tunnels.get(tunnel_identifier, \*, account_id) -> IPSECTunnelGetResponse -- client.magic_transit.ipsec_tunnels.psk_generate(tunnel_identifier, \*, account_id, \*\*params) -> IPSECTunnelPSKGenerateResponse ## Routes @@ -4056,22 +4033,16 @@ Types: from cloudflare.types.magic_transit import ( Scope, RouteCreateResponse, - RouteUpdateResponse, RouteListResponse, - RouteDeleteResponse, RouteEmptyResponse, - RouteGetResponse, ) ``` Methods: - client.magic_transit.routes.create(\*, account_id, \*\*params) -> RouteCreateResponse -- client.magic_transit.routes.update(route_identifier, \*, account_id, \*\*params) -> RouteUpdateResponse - client.magic_transit.routes.list(\*, account_id) -> RouteListResponse -- client.magic_transit.routes.delete(route_identifier, \*, account_id) -> RouteDeleteResponse - client.magic_transit.routes.empty(\*, account_id) -> RouteEmptyResponse -- client.magic_transit.routes.get(route_identifier, \*, account_id) -> RouteGetResponse ## Sites @@ -4101,11 +4072,7 @@ from cloudflare.types.magic_transit.sites import ACL, ACLConfiguration, AllowedP Methods: - client.magic_transit.sites.acls.create(site_id, \*, account_id, \*\*params) -> ACL -- client.magic_transit.sites.acls.update(acl_identifier, \*, account_id, site_id, \*\*params) -> ACL - client.magic_transit.sites.acls.list(site_id, \*, account_id) -> SyncSinglePage[ACL] -- client.magic_transit.sites.acls.delete(acl_identifier, \*, account_id, site_id) -> ACL -- client.magic_transit.sites.acls.edit(acl_identifier, \*, account_id, site_id, \*\*params) -> ACL -- client.magic_transit.sites.acls.get(acl_identifier, \*, account_id, site_id) -> ACL ### LANs diff --git a/src/cloudflare/resources/magic_transit/cf_interconnects.py b/src/cloudflare/resources/magic_transit/cf_interconnects.py index 753c1abf218..18f79e0181f 100644 --- a/src/cloudflare/resources/magic_transit/cf_interconnects.py +++ b/src/cloudflare/resources/magic_transit/cf_interconnects.py @@ -7,10 +7,6 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -23,10 +19,7 @@ from ..._base_client import ( make_request_options, ) -from ...types.magic_transit import cf_interconnect_update_params -from ...types.magic_transit.cf_interconnect_get_response import CfInterconnectGetResponse from ...types.magic_transit.cf_interconnect_list_response import CfInterconnectListResponse -from ...types.magic_transit.cf_interconnect_update_response import CfInterconnectUpdateResponse __all__ = ["CfInterconnectsResource", "AsyncCfInterconnectsResource"] @@ -40,79 +33,6 @@ def with_raw_response(self) -> CfInterconnectsResourceWithRawResponse: def with_streaming_response(self) -> CfInterconnectsResourceWithStreamingResponse: return CfInterconnectsResourceWithStreamingResponse(self) - def update( - self, - tunnel_identifier: str, - *, - account_id: str, - description: str | NotGiven = NOT_GIVEN, - gre: cf_interconnect_update_params.GRE | NotGiven = NOT_GIVEN, - health_check: cf_interconnect_update_params.HealthCheck | NotGiven = NOT_GIVEN, - interface_address: str | NotGiven = NOT_GIVEN, - mtu: int | 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CfInterconnectUpdateResponse: - """Updates a specific interconnect associated with an account. - - Use - `?validate_only=true` as an optional query parameter to only run validation - without persisting changes. - - Args: - account_id: Identifier - - tunnel_identifier: Identifier - - description: An optional description of the interconnect. - - gre: The configuration specific to GRE interconnects. - - interface_address: A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side - of the tunnel. Select the subnet from the following private IP space: - 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - - mtu: The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum - value is 576. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_identifier: - raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") - return self._put( - f"/accounts/{account_id}/magic/cf_interconnects/{tunnel_identifier}", - body=maybe_transform( - { - "description": description, - "gre": gre, - "health_check": health_check, - "interface_address": interface_address, - "mtu": mtu, - }, - cf_interconnect_update_params.CfInterconnectUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[CfInterconnectUpdateResponse]._unwrapper, - ), - cast_to=cast(Type[CfInterconnectUpdateResponse], ResultWrapper[CfInterconnectUpdateResponse]), - ) - def list( self, *, @@ -152,50 +72,6 @@ def list( cast_to=cast(Type[CfInterconnectListResponse], ResultWrapper[CfInterconnectListResponse]), ) - def get( - self, - tunnel_identifier: str, - *, - account_id: str, - # 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CfInterconnectGetResponse: - """ - Lists details for a specific interconnect. - - Args: - account_id: Identifier - - tunnel_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_identifier: - raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") - return self._get( - f"/accounts/{account_id}/magic/cf_interconnects/{tunnel_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[CfInterconnectGetResponse]._unwrapper, - ), - cast_to=cast(Type[CfInterconnectGetResponse], ResultWrapper[CfInterconnectGetResponse]), - ) - class AsyncCfInterconnectsResource(AsyncAPIResource): @cached_property @@ -206,79 +82,6 @@ def with_raw_response(self) -> AsyncCfInterconnectsResourceWithRawResponse: def with_streaming_response(self) -> AsyncCfInterconnectsResourceWithStreamingResponse: return AsyncCfInterconnectsResourceWithStreamingResponse(self) - async def update( - self, - tunnel_identifier: str, - *, - account_id: str, - description: str | NotGiven = NOT_GIVEN, - gre: cf_interconnect_update_params.GRE | NotGiven = NOT_GIVEN, - health_check: cf_interconnect_update_params.HealthCheck | NotGiven = NOT_GIVEN, - interface_address: str | NotGiven = NOT_GIVEN, - mtu: int | 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CfInterconnectUpdateResponse: - """Updates a specific interconnect associated with an account. - - Use - `?validate_only=true` as an optional query parameter to only run validation - without persisting changes. - - Args: - account_id: Identifier - - tunnel_identifier: Identifier - - description: An optional description of the interconnect. - - gre: The configuration specific to GRE interconnects. - - interface_address: A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side - of the tunnel. Select the subnet from the following private IP space: - 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - - mtu: The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum - value is 576. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_identifier: - raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") - return await self._put( - f"/accounts/{account_id}/magic/cf_interconnects/{tunnel_identifier}", - body=await async_maybe_transform( - { - "description": description, - "gre": gre, - "health_check": health_check, - "interface_address": interface_address, - "mtu": mtu, - }, - cf_interconnect_update_params.CfInterconnectUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[CfInterconnectUpdateResponse]._unwrapper, - ), - cast_to=cast(Type[CfInterconnectUpdateResponse], ResultWrapper[CfInterconnectUpdateResponse]), - ) - async def list( self, *, @@ -318,106 +121,38 @@ async def list( cast_to=cast(Type[CfInterconnectListResponse], ResultWrapper[CfInterconnectListResponse]), ) - async def get( - self, - tunnel_identifier: str, - *, - account_id: str, - # 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CfInterconnectGetResponse: - """ - Lists details for a specific interconnect. - - Args: - account_id: Identifier - - tunnel_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_identifier: - raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") - return await self._get( - f"/accounts/{account_id}/magic/cf_interconnects/{tunnel_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[CfInterconnectGetResponse]._unwrapper, - ), - cast_to=cast(Type[CfInterconnectGetResponse], ResultWrapper[CfInterconnectGetResponse]), - ) - class CfInterconnectsResourceWithRawResponse: def __init__(self, cf_interconnects: CfInterconnectsResource) -> None: self._cf_interconnects = cf_interconnects - self.update = to_raw_response_wrapper( - cf_interconnects.update, - ) self.list = to_raw_response_wrapper( cf_interconnects.list, ) - self.get = to_raw_response_wrapper( - cf_interconnects.get, - ) class AsyncCfInterconnectsResourceWithRawResponse: def __init__(self, cf_interconnects: AsyncCfInterconnectsResource) -> None: self._cf_interconnects = cf_interconnects - self.update = async_to_raw_response_wrapper( - cf_interconnects.update, - ) self.list = async_to_raw_response_wrapper( cf_interconnects.list, ) - self.get = async_to_raw_response_wrapper( - cf_interconnects.get, - ) class CfInterconnectsResourceWithStreamingResponse: def __init__(self, cf_interconnects: CfInterconnectsResource) -> None: self._cf_interconnects = cf_interconnects - self.update = to_streamed_response_wrapper( - cf_interconnects.update, - ) self.list = to_streamed_response_wrapper( cf_interconnects.list, ) - self.get = to_streamed_response_wrapper( - cf_interconnects.get, - ) class AsyncCfInterconnectsResourceWithStreamingResponse: def __init__(self, cf_interconnects: AsyncCfInterconnectsResource) -> None: self._cf_interconnects = cf_interconnects - self.update = async_to_streamed_response_wrapper( - cf_interconnects.update, - ) self.list = async_to_streamed_response_wrapper( cf_interconnects.list, ) - self.get = async_to_streamed_response_wrapper( - cf_interconnects.get, - ) diff --git a/src/cloudflare/resources/magic_transit/gre_tunnels.py b/src/cloudflare/resources/magic_transit/gre_tunnels.py index 7129aeb334e..fcb6f9c3a58 100644 --- a/src/cloudflare/resources/magic_transit/gre_tunnels.py +++ b/src/cloudflare/resources/magic_transit/gre_tunnels.py @@ -23,13 +23,9 @@ from ..._base_client import ( make_request_options, ) -from ...types.magic_transit import gre_tunnel_create_params, gre_tunnel_update_params -from ...types.magic_transit.health_check_param import HealthCheckParam -from ...types.magic_transit.gre_tunnel_get_response import GRETunnelGetResponse +from ...types.magic_transit import gre_tunnel_create_params from ...types.magic_transit.gre_tunnel_list_response import GRETunnelListResponse from ...types.magic_transit.gre_tunnel_create_response import GRETunnelCreateResponse -from ...types.magic_transit.gre_tunnel_delete_response import GRETunnelDeleteResponse -from ...types.magic_transit.gre_tunnel_update_response import GRETunnelUpdateResponse __all__ = ["GRETunnelsResource", "AsyncGRETunnelsResource"] @@ -86,91 +82,6 @@ def create( cast_to=cast(Type[GRETunnelCreateResponse], ResultWrapper[GRETunnelCreateResponse]), ) - def update( - self, - tunnel_identifier: str, - *, - account_id: str, - cloudflare_gre_endpoint: str, - customer_gre_endpoint: str, - interface_address: str, - name: str, - description: str | NotGiven = NOT_GIVEN, - health_check: HealthCheckParam | NotGiven = NOT_GIVEN, - mtu: int | NotGiven = NOT_GIVEN, - ttl: int | 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> GRETunnelUpdateResponse: - """Updates a specific GRE tunnel. - - Use `?validate_only=true` as an optional query - parameter to only run validation without persisting changes. - - Args: - account_id: Identifier - - tunnel_identifier: Identifier - - cloudflare_gre_endpoint: The IP address assigned to the Cloudflare side of the GRE tunnel. - - customer_gre_endpoint: The IP address assigned to the customer side of the GRE tunnel. - - interface_address: A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side - of the tunnel. Select the subnet from the following private IP space: - 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - - name: The name of the tunnel. The name cannot contain spaces or special characters, - must be 15 characters or less, and cannot share a name with another GRE tunnel. - - description: An optional description of the GRE tunnel. - - mtu: Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value - is 576. - - ttl: Time To Live (TTL) in number of hops of the GRE tunnel. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_identifier: - raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") - return self._put( - f"/accounts/{account_id}/magic/gre_tunnels/{tunnel_identifier}", - body=maybe_transform( - { - "cloudflare_gre_endpoint": cloudflare_gre_endpoint, - "customer_gre_endpoint": customer_gre_endpoint, - "interface_address": interface_address, - "name": name, - "description": description, - "health_check": health_check, - "mtu": mtu, - "ttl": ttl, - }, - gre_tunnel_update_params.GRETunnelUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[GRETunnelUpdateResponse]._unwrapper, - ), - cast_to=cast(Type[GRETunnelUpdateResponse], ResultWrapper[GRETunnelUpdateResponse]), - ) - def list( self, *, @@ -210,96 +121,6 @@ def list( cast_to=cast(Type[GRETunnelListResponse], ResultWrapper[GRETunnelListResponse]), ) - def delete( - self, - tunnel_identifier: str, - *, - account_id: str, - # 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> GRETunnelDeleteResponse: - """Disables and removes a specific static GRE tunnel. - - Use `?validate_only=true` as - an optional query parameter to only run validation without persisting changes. - - Args: - account_id: Identifier - - tunnel_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_identifier: - raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") - return self._delete( - f"/accounts/{account_id}/magic/gre_tunnels/{tunnel_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[GRETunnelDeleteResponse]._unwrapper, - ), - cast_to=cast(Type[GRETunnelDeleteResponse], ResultWrapper[GRETunnelDeleteResponse]), - ) - - def get( - self, - tunnel_identifier: str, - *, - account_id: str, - # 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> GRETunnelGetResponse: - """ - Lists informtion for a specific GRE tunnel. - - Args: - account_id: Identifier - - tunnel_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_identifier: - raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") - return self._get( - f"/accounts/{account_id}/magic/gre_tunnels/{tunnel_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[GRETunnelGetResponse]._unwrapper, - ), - cast_to=cast(Type[GRETunnelGetResponse], ResultWrapper[GRETunnelGetResponse]), - ) - class AsyncGRETunnelsResource(AsyncAPIResource): @cached_property @@ -353,91 +174,6 @@ async def create( cast_to=cast(Type[GRETunnelCreateResponse], ResultWrapper[GRETunnelCreateResponse]), ) - async def update( - self, - tunnel_identifier: str, - *, - account_id: str, - cloudflare_gre_endpoint: str, - customer_gre_endpoint: str, - interface_address: str, - name: str, - description: str | NotGiven = NOT_GIVEN, - health_check: HealthCheckParam | NotGiven = NOT_GIVEN, - mtu: int | NotGiven = NOT_GIVEN, - ttl: int | 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> GRETunnelUpdateResponse: - """Updates a specific GRE tunnel. - - Use `?validate_only=true` as an optional query - parameter to only run validation without persisting changes. - - Args: - account_id: Identifier - - tunnel_identifier: Identifier - - cloudflare_gre_endpoint: The IP address assigned to the Cloudflare side of the GRE tunnel. - - customer_gre_endpoint: The IP address assigned to the customer side of the GRE tunnel. - - interface_address: A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side - of the tunnel. Select the subnet from the following private IP space: - 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - - name: The name of the tunnel. The name cannot contain spaces or special characters, - must be 15 characters or less, and cannot share a name with another GRE tunnel. - - description: An optional description of the GRE tunnel. - - mtu: Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value - is 576. - - ttl: Time To Live (TTL) in number of hops of the GRE tunnel. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_identifier: - raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") - return await self._put( - f"/accounts/{account_id}/magic/gre_tunnels/{tunnel_identifier}", - body=await async_maybe_transform( - { - "cloudflare_gre_endpoint": cloudflare_gre_endpoint, - "customer_gre_endpoint": customer_gre_endpoint, - "interface_address": interface_address, - "name": name, - "description": description, - "health_check": health_check, - "mtu": mtu, - "ttl": ttl, - }, - gre_tunnel_update_params.GRETunnelUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[GRETunnelUpdateResponse]._unwrapper, - ), - cast_to=cast(Type[GRETunnelUpdateResponse], ResultWrapper[GRETunnelUpdateResponse]), - ) - async def list( self, *, @@ -477,96 +213,6 @@ async def list( cast_to=cast(Type[GRETunnelListResponse], ResultWrapper[GRETunnelListResponse]), ) - async def delete( - self, - tunnel_identifier: str, - *, - account_id: str, - # 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> GRETunnelDeleteResponse: - """Disables and removes a specific static GRE tunnel. - - Use `?validate_only=true` as - an optional query parameter to only run validation without persisting changes. - - Args: - account_id: Identifier - - tunnel_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_identifier: - raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") - return await self._delete( - f"/accounts/{account_id}/magic/gre_tunnels/{tunnel_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[GRETunnelDeleteResponse]._unwrapper, - ), - cast_to=cast(Type[GRETunnelDeleteResponse], ResultWrapper[GRETunnelDeleteResponse]), - ) - - async def get( - self, - tunnel_identifier: str, - *, - account_id: str, - # 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> GRETunnelGetResponse: - """ - Lists informtion for a specific GRE tunnel. - - Args: - account_id: Identifier - - tunnel_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_identifier: - raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") - return await self._get( - f"/accounts/{account_id}/magic/gre_tunnels/{tunnel_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[GRETunnelGetResponse]._unwrapper, - ), - cast_to=cast(Type[GRETunnelGetResponse], ResultWrapper[GRETunnelGetResponse]), - ) - class GRETunnelsResourceWithRawResponse: def __init__(self, gre_tunnels: GRETunnelsResource) -> None: @@ -575,18 +221,9 @@ def __init__(self, gre_tunnels: GRETunnelsResource) -> None: self.create = to_raw_response_wrapper( gre_tunnels.create, ) - self.update = to_raw_response_wrapper( - gre_tunnels.update, - ) self.list = to_raw_response_wrapper( gre_tunnels.list, ) - self.delete = to_raw_response_wrapper( - gre_tunnels.delete, - ) - self.get = to_raw_response_wrapper( - gre_tunnels.get, - ) class AsyncGRETunnelsResourceWithRawResponse: @@ -596,18 +233,9 @@ def __init__(self, gre_tunnels: AsyncGRETunnelsResource) -> None: self.create = async_to_raw_response_wrapper( gre_tunnels.create, ) - self.update = async_to_raw_response_wrapper( - gre_tunnels.update, - ) self.list = async_to_raw_response_wrapper( gre_tunnels.list, ) - self.delete = async_to_raw_response_wrapper( - gre_tunnels.delete, - ) - self.get = async_to_raw_response_wrapper( - gre_tunnels.get, - ) class GRETunnelsResourceWithStreamingResponse: @@ -617,18 +245,9 @@ def __init__(self, gre_tunnels: GRETunnelsResource) -> None: self.create = to_streamed_response_wrapper( gre_tunnels.create, ) - self.update = to_streamed_response_wrapper( - gre_tunnels.update, - ) self.list = to_streamed_response_wrapper( gre_tunnels.list, ) - self.delete = to_streamed_response_wrapper( - gre_tunnels.delete, - ) - self.get = to_streamed_response_wrapper( - gre_tunnels.get, - ) class AsyncGRETunnelsResourceWithStreamingResponse: @@ -638,15 +257,6 @@ def __init__(self, gre_tunnels: AsyncGRETunnelsResource) -> None: self.create = async_to_streamed_response_wrapper( gre_tunnels.create, ) - self.update = async_to_streamed_response_wrapper( - gre_tunnels.update, - ) self.list = async_to_streamed_response_wrapper( gre_tunnels.list, ) - self.delete = async_to_streamed_response_wrapper( - gre_tunnels.delete, - ) - self.get = async_to_streamed_response_wrapper( - gre_tunnels.get, - ) diff --git a/src/cloudflare/resources/magic_transit/ipsec_tunnels.py b/src/cloudflare/resources/magic_transit/ipsec_tunnels.py index 02240b292b4..847d54acb25 100644 --- a/src/cloudflare/resources/magic_transit/ipsec_tunnels.py +++ b/src/cloudflare/resources/magic_transit/ipsec_tunnels.py @@ -23,18 +23,10 @@ from ..._base_client import ( make_request_options, ) -from ...types.magic_transit import ( - ipsec_tunnel_create_params, - ipsec_tunnel_update_params, - ipsec_tunnel_psk_generate_params, -) +from ...types.magic_transit import ipsec_tunnel_create_params from ...types.magic_transit.health_check_param import HealthCheckParam -from ...types.magic_transit.ipsec_tunnel_get_response import IPSECTunnelGetResponse from ...types.magic_transit.ipsec_tunnel_list_response import IPSECTunnelListResponse from ...types.magic_transit.ipsec_tunnel_create_response import IPSECTunnelCreateResponse -from ...types.magic_transit.ipsec_tunnel_delete_response import IPSECTunnelDeleteResponse -from ...types.magic_transit.ipsec_tunnel_update_response import IPSECTunnelUpdateResponse -from ...types.magic_transit.ipsec_tunnel_psk_generate_response import IPSECTunnelPSKGenerateResponse __all__ = ["IPSECTunnelsResource", "AsyncIPSECTunnelsResource"] @@ -129,92 +121,6 @@ def create( cast_to=cast(Type[IPSECTunnelCreateResponse], ResultWrapper[IPSECTunnelCreateResponse]), ) - def update( - self, - tunnel_identifier: str, - *, - account_id: str, - cloudflare_endpoint: str, - interface_address: str, - name: str, - customer_endpoint: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - health_check: HealthCheckParam | NotGiven = NOT_GIVEN, - psk: str | NotGiven = NOT_GIVEN, - replay_protection: bool | 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IPSECTunnelUpdateResponse: - """Updates a specific IPsec tunnel associated with an account. - - Use - `?validate_only=true` as an optional query parameter to only run validation - without persisting changes. - - Args: - account_id: Identifier - - tunnel_identifier: Identifier - - cloudflare_endpoint: The IP address assigned to the Cloudflare side of the IPsec tunnel. - - interface_address: A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side - of the tunnel. Select the subnet from the following private IP space: - 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - - name: The name of the IPsec tunnel. The name cannot share a name with other tunnels. - - customer_endpoint: The IP address assigned to the customer side of the IPsec tunnel. Not required, - but must be set for proactive traceroutes to work. - - description: An optional description forthe IPsec tunnel. - - psk: A randomly generated or provided string for use in the IPsec tunnel. - - replay_protection: If `true`, then IPsec replay protection will be supported in the - Cloudflare-to-customer direction. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_identifier: - raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") - return self._put( - f"/accounts/{account_id}/magic/ipsec_tunnels/{tunnel_identifier}", - body=maybe_transform( - { - "cloudflare_endpoint": cloudflare_endpoint, - "interface_address": interface_address, - "name": name, - "customer_endpoint": customer_endpoint, - "description": description, - "health_check": health_check, - "psk": psk, - "replay_protection": replay_protection, - }, - ipsec_tunnel_update_params.IPSECTunnelUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[IPSECTunnelUpdateResponse]._unwrapper, - ), - cast_to=cast(Type[IPSECTunnelUpdateResponse], ResultWrapper[IPSECTunnelUpdateResponse]), - ) - def list( self, *, @@ -254,146 +160,6 @@ def list( cast_to=cast(Type[IPSECTunnelListResponse], ResultWrapper[IPSECTunnelListResponse]), ) - def delete( - self, - tunnel_identifier: str, - *, - account_id: str, - # 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IPSECTunnelDeleteResponse: - """ - Disables and removes a specific static IPsec Tunnel associated with an account. - Use `?validate_only=true` as an optional query parameter to only run validation - without persisting changes. - - Args: - account_id: Identifier - - tunnel_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_identifier: - raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") - return self._delete( - f"/accounts/{account_id}/magic/ipsec_tunnels/{tunnel_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[IPSECTunnelDeleteResponse]._unwrapper, - ), - cast_to=cast(Type[IPSECTunnelDeleteResponse], ResultWrapper[IPSECTunnelDeleteResponse]), - ) - - def get( - self, - tunnel_identifier: str, - *, - account_id: str, - # 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IPSECTunnelGetResponse: - """ - Lists details for a specific IPsec tunnel. - - Args: - account_id: Identifier - - tunnel_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_identifier: - raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") - return self._get( - f"/accounts/{account_id}/magic/ipsec_tunnels/{tunnel_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[IPSECTunnelGetResponse]._unwrapper, - ), - cast_to=cast(Type[IPSECTunnelGetResponse], ResultWrapper[IPSECTunnelGetResponse]), - ) - - def psk_generate( - self, - tunnel_identifier: str, - *, - account_id: str, - body: object, - # 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IPSECTunnelPSKGenerateResponse: - """ - Generates a Pre Shared Key for a specific IPsec tunnel used in the IKE session. - Use `?validate_only=true` as an optional query parameter to only run validation - without persisting changes. After a PSK is generated, the PSK is immediately - persisted to Cloudflare's edge and cannot be retrieved later. Note the PSK in a - safe place. - - Args: - account_id: Identifier - - tunnel_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_identifier: - raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") - return self._post( - f"/accounts/{account_id}/magic/ipsec_tunnels/{tunnel_identifier}/psk_generate", - body=maybe_transform(body, ipsec_tunnel_psk_generate_params.IPSECTunnelPSKGenerateParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[IPSECTunnelPSKGenerateResponse]._unwrapper, - ), - cast_to=cast(Type[IPSECTunnelPSKGenerateResponse], ResultWrapper[IPSECTunnelPSKGenerateResponse]), - ) - class AsyncIPSECTunnelsResource(AsyncAPIResource): @cached_property @@ -485,92 +251,6 @@ async def create( cast_to=cast(Type[IPSECTunnelCreateResponse], ResultWrapper[IPSECTunnelCreateResponse]), ) - async def update( - self, - tunnel_identifier: str, - *, - account_id: str, - cloudflare_endpoint: str, - interface_address: str, - name: str, - customer_endpoint: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - health_check: HealthCheckParam | NotGiven = NOT_GIVEN, - psk: str | NotGiven = NOT_GIVEN, - replay_protection: bool | 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IPSECTunnelUpdateResponse: - """Updates a specific IPsec tunnel associated with an account. - - Use - `?validate_only=true` as an optional query parameter to only run validation - without persisting changes. - - Args: - account_id: Identifier - - tunnel_identifier: Identifier - - cloudflare_endpoint: The IP address assigned to the Cloudflare side of the IPsec tunnel. - - interface_address: A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side - of the tunnel. Select the subnet from the following private IP space: - 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - - name: The name of the IPsec tunnel. The name cannot share a name with other tunnels. - - customer_endpoint: The IP address assigned to the customer side of the IPsec tunnel. Not required, - but must be set for proactive traceroutes to work. - - description: An optional description forthe IPsec tunnel. - - psk: A randomly generated or provided string for use in the IPsec tunnel. - - replay_protection: If `true`, then IPsec replay protection will be supported in the - Cloudflare-to-customer direction. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_identifier: - raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") - return await self._put( - f"/accounts/{account_id}/magic/ipsec_tunnels/{tunnel_identifier}", - body=await async_maybe_transform( - { - "cloudflare_endpoint": cloudflare_endpoint, - "interface_address": interface_address, - "name": name, - "customer_endpoint": customer_endpoint, - "description": description, - "health_check": health_check, - "psk": psk, - "replay_protection": replay_protection, - }, - ipsec_tunnel_update_params.IPSECTunnelUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[IPSECTunnelUpdateResponse]._unwrapper, - ), - cast_to=cast(Type[IPSECTunnelUpdateResponse], ResultWrapper[IPSECTunnelUpdateResponse]), - ) - async def list( self, *, @@ -610,146 +290,6 @@ async def list( cast_to=cast(Type[IPSECTunnelListResponse], ResultWrapper[IPSECTunnelListResponse]), ) - async def delete( - self, - tunnel_identifier: str, - *, - account_id: str, - # 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IPSECTunnelDeleteResponse: - """ - Disables and removes a specific static IPsec Tunnel associated with an account. - Use `?validate_only=true` as an optional query parameter to only run validation - without persisting changes. - - Args: - account_id: Identifier - - tunnel_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_identifier: - raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") - return await self._delete( - f"/accounts/{account_id}/magic/ipsec_tunnels/{tunnel_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[IPSECTunnelDeleteResponse]._unwrapper, - ), - cast_to=cast(Type[IPSECTunnelDeleteResponse], ResultWrapper[IPSECTunnelDeleteResponse]), - ) - - async def get( - self, - tunnel_identifier: str, - *, - account_id: str, - # 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IPSECTunnelGetResponse: - """ - Lists details for a specific IPsec tunnel. - - Args: - account_id: Identifier - - tunnel_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_identifier: - raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") - return await self._get( - f"/accounts/{account_id}/magic/ipsec_tunnels/{tunnel_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[IPSECTunnelGetResponse]._unwrapper, - ), - cast_to=cast(Type[IPSECTunnelGetResponse], ResultWrapper[IPSECTunnelGetResponse]), - ) - - async def psk_generate( - self, - tunnel_identifier: str, - *, - account_id: str, - body: object, - # 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IPSECTunnelPSKGenerateResponse: - """ - Generates a Pre Shared Key for a specific IPsec tunnel used in the IKE session. - Use `?validate_only=true` as an optional query parameter to only run validation - without persisting changes. After a PSK is generated, the PSK is immediately - persisted to Cloudflare's edge and cannot be retrieved later. Note the PSK in a - safe place. - - Args: - account_id: Identifier - - tunnel_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_identifier: - raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") - return await self._post( - f"/accounts/{account_id}/magic/ipsec_tunnels/{tunnel_identifier}/psk_generate", - body=await async_maybe_transform(body, ipsec_tunnel_psk_generate_params.IPSECTunnelPSKGenerateParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[IPSECTunnelPSKGenerateResponse]._unwrapper, - ), - cast_to=cast(Type[IPSECTunnelPSKGenerateResponse], ResultWrapper[IPSECTunnelPSKGenerateResponse]), - ) - class IPSECTunnelsResourceWithRawResponse: def __init__(self, ipsec_tunnels: IPSECTunnelsResource) -> None: @@ -758,21 +298,9 @@ def __init__(self, ipsec_tunnels: IPSECTunnelsResource) -> None: self.create = to_raw_response_wrapper( ipsec_tunnels.create, ) - self.update = to_raw_response_wrapper( - ipsec_tunnels.update, - ) self.list = to_raw_response_wrapper( ipsec_tunnels.list, ) - self.delete = to_raw_response_wrapper( - ipsec_tunnels.delete, - ) - self.get = to_raw_response_wrapper( - ipsec_tunnels.get, - ) - self.psk_generate = to_raw_response_wrapper( - ipsec_tunnels.psk_generate, - ) class AsyncIPSECTunnelsResourceWithRawResponse: @@ -782,21 +310,9 @@ def __init__(self, ipsec_tunnels: AsyncIPSECTunnelsResource) -> None: self.create = async_to_raw_response_wrapper( ipsec_tunnels.create, ) - self.update = async_to_raw_response_wrapper( - ipsec_tunnels.update, - ) self.list = async_to_raw_response_wrapper( ipsec_tunnels.list, ) - self.delete = async_to_raw_response_wrapper( - ipsec_tunnels.delete, - ) - self.get = async_to_raw_response_wrapper( - ipsec_tunnels.get, - ) - self.psk_generate = async_to_raw_response_wrapper( - ipsec_tunnels.psk_generate, - ) class IPSECTunnelsResourceWithStreamingResponse: @@ -806,21 +322,9 @@ def __init__(self, ipsec_tunnels: IPSECTunnelsResource) -> None: self.create = to_streamed_response_wrapper( ipsec_tunnels.create, ) - self.update = to_streamed_response_wrapper( - ipsec_tunnels.update, - ) self.list = to_streamed_response_wrapper( ipsec_tunnels.list, ) - self.delete = to_streamed_response_wrapper( - ipsec_tunnels.delete, - ) - self.get = to_streamed_response_wrapper( - ipsec_tunnels.get, - ) - self.psk_generate = to_streamed_response_wrapper( - ipsec_tunnels.psk_generate, - ) class AsyncIPSECTunnelsResourceWithStreamingResponse: @@ -830,18 +334,6 @@ def __init__(self, ipsec_tunnels: AsyncIPSECTunnelsResource) -> None: self.create = async_to_streamed_response_wrapper( ipsec_tunnels.create, ) - self.update = async_to_streamed_response_wrapper( - ipsec_tunnels.update, - ) self.list = async_to_streamed_response_wrapper( ipsec_tunnels.list, ) - self.delete = async_to_streamed_response_wrapper( - ipsec_tunnels.delete, - ) - self.get = async_to_streamed_response_wrapper( - ipsec_tunnels.get, - ) - self.psk_generate = async_to_streamed_response_wrapper( - ipsec_tunnels.psk_generate, - ) diff --git a/src/cloudflare/resources/magic_transit/routes.py b/src/cloudflare/resources/magic_transit/routes.py index d8eef542fc5..f8c1f1bb62a 100644 --- a/src/cloudflare/resources/magic_transit/routes.py +++ b/src/cloudflare/resources/magic_transit/routes.py @@ -23,14 +23,10 @@ from ..._base_client import ( make_request_options, ) -from ...types.magic_transit import route_create_params, route_update_params -from ...types.magic_transit.scope_param import ScopeParam -from ...types.magic_transit.route_get_response import RouteGetResponse +from ...types.magic_transit import route_create_params from ...types.magic_transit.route_list_response import RouteListResponse from ...types.magic_transit.route_empty_response import RouteEmptyResponse from ...types.magic_transit.route_create_response import RouteCreateResponse -from ...types.magic_transit.route_delete_response import RouteDeleteResponse -from ...types.magic_transit.route_update_response import RouteUpdateResponse __all__ = ["RoutesResource", "AsyncRoutesResource"] @@ -87,81 +83,6 @@ def create( cast_to=cast(Type[RouteCreateResponse], ResultWrapper[RouteCreateResponse]), ) - def update( - self, - route_identifier: str, - *, - account_id: str, - nexthop: str, - prefix: str, - priority: int, - description: str | NotGiven = NOT_GIVEN, - scope: ScopeParam | NotGiven = NOT_GIVEN, - weight: int | 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RouteUpdateResponse: - """Update a specific Magic static route. - - Use `?validate_only=true` as an optional - query parameter to run validation only without persisting changes. - - Args: - account_id: Identifier - - route_identifier: Identifier - - nexthop: The next-hop IP Address for the static route. - - prefix: IP Prefix in Classless Inter-Domain Routing format. - - priority: Priority of the static route. - - description: An optional human provided description of the static route. - - scope: Used only for ECMP routes. - - weight: Optional weight of the ECMP scope - if provided. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not route_identifier: - raise ValueError(f"Expected a non-empty value for `route_identifier` but received {route_identifier!r}") - return self._put( - f"/accounts/{account_id}/magic/routes/{route_identifier}", - body=maybe_transform( - { - "nexthop": nexthop, - "prefix": prefix, - "priority": priority, - "description": description, - "scope": scope, - "weight": weight, - }, - route_update_params.RouteUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[RouteUpdateResponse]._unwrapper, - ), - cast_to=cast(Type[RouteUpdateResponse], ResultWrapper[RouteUpdateResponse]), - ) - def list( self, *, @@ -201,50 +122,6 @@ def list( cast_to=cast(Type[RouteListResponse], ResultWrapper[RouteListResponse]), ) - def delete( - self, - route_identifier: str, - *, - account_id: str, - # 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RouteDeleteResponse: - """ - Disable and remove a specific Magic static route. - - Args: - account_id: Identifier - - route_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not route_identifier: - raise ValueError(f"Expected a non-empty value for `route_identifier` but received {route_identifier!r}") - return self._delete( - f"/accounts/{account_id}/magic/routes/{route_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[RouteDeleteResponse]._unwrapper, - ), - cast_to=cast(Type[RouteDeleteResponse], ResultWrapper[RouteDeleteResponse]), - ) - def empty( self, *, @@ -284,50 +161,6 @@ def empty( cast_to=cast(Type[RouteEmptyResponse], ResultWrapper[RouteEmptyResponse]), ) - def get( - self, - route_identifier: str, - *, - account_id: str, - # 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RouteGetResponse: - """ - Get a specific Magic static route. - - Args: - account_id: Identifier - - route_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not route_identifier: - raise ValueError(f"Expected a non-empty value for `route_identifier` but received {route_identifier!r}") - return self._get( - f"/accounts/{account_id}/magic/routes/{route_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[RouteGetResponse]._unwrapper, - ), - cast_to=cast(Type[RouteGetResponse], ResultWrapper[RouteGetResponse]), - ) - class AsyncRoutesResource(AsyncAPIResource): @cached_property @@ -381,81 +214,6 @@ async def create( cast_to=cast(Type[RouteCreateResponse], ResultWrapper[RouteCreateResponse]), ) - async def update( - self, - route_identifier: str, - *, - account_id: str, - nexthop: str, - prefix: str, - priority: int, - description: str | NotGiven = NOT_GIVEN, - scope: ScopeParam | NotGiven = NOT_GIVEN, - weight: int | 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RouteUpdateResponse: - """Update a specific Magic static route. - - Use `?validate_only=true` as an optional - query parameter to run validation only without persisting changes. - - Args: - account_id: Identifier - - route_identifier: Identifier - - nexthop: The next-hop IP Address for the static route. - - prefix: IP Prefix in Classless Inter-Domain Routing format. - - priority: Priority of the static route. - - description: An optional human provided description of the static route. - - scope: Used only for ECMP routes. - - weight: Optional weight of the ECMP scope - if provided. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not route_identifier: - raise ValueError(f"Expected a non-empty value for `route_identifier` but received {route_identifier!r}") - return await self._put( - f"/accounts/{account_id}/magic/routes/{route_identifier}", - body=await async_maybe_transform( - { - "nexthop": nexthop, - "prefix": prefix, - "priority": priority, - "description": description, - "scope": scope, - "weight": weight, - }, - route_update_params.RouteUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[RouteUpdateResponse]._unwrapper, - ), - cast_to=cast(Type[RouteUpdateResponse], ResultWrapper[RouteUpdateResponse]), - ) - async def list( self, *, @@ -495,50 +253,6 @@ async def list( cast_to=cast(Type[RouteListResponse], ResultWrapper[RouteListResponse]), ) - async def delete( - self, - route_identifier: str, - *, - account_id: str, - # 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RouteDeleteResponse: - """ - Disable and remove a specific Magic static route. - - Args: - account_id: Identifier - - route_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not route_identifier: - raise ValueError(f"Expected a non-empty value for `route_identifier` but received {route_identifier!r}") - return await self._delete( - f"/accounts/{account_id}/magic/routes/{route_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[RouteDeleteResponse]._unwrapper, - ), - cast_to=cast(Type[RouteDeleteResponse], ResultWrapper[RouteDeleteResponse]), - ) - async def empty( self, *, @@ -578,50 +292,6 @@ async def empty( cast_to=cast(Type[RouteEmptyResponse], ResultWrapper[RouteEmptyResponse]), ) - async def get( - self, - route_identifier: str, - *, - account_id: str, - # 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RouteGetResponse: - """ - Get a specific Magic static route. - - Args: - account_id: Identifier - - route_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not route_identifier: - raise ValueError(f"Expected a non-empty value for `route_identifier` but received {route_identifier!r}") - return await self._get( - f"/accounts/{account_id}/magic/routes/{route_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[RouteGetResponse]._unwrapper, - ), - cast_to=cast(Type[RouteGetResponse], ResultWrapper[RouteGetResponse]), - ) - class RoutesResourceWithRawResponse: def __init__(self, routes: RoutesResource) -> None: @@ -630,21 +300,12 @@ def __init__(self, routes: RoutesResource) -> None: self.create = to_raw_response_wrapper( routes.create, ) - self.update = to_raw_response_wrapper( - routes.update, - ) self.list = to_raw_response_wrapper( routes.list, ) - self.delete = to_raw_response_wrapper( - routes.delete, - ) self.empty = to_raw_response_wrapper( routes.empty, ) - self.get = to_raw_response_wrapper( - routes.get, - ) class AsyncRoutesResourceWithRawResponse: @@ -654,21 +315,12 @@ def __init__(self, routes: AsyncRoutesResource) -> None: self.create = async_to_raw_response_wrapper( routes.create, ) - self.update = async_to_raw_response_wrapper( - routes.update, - ) self.list = async_to_raw_response_wrapper( routes.list, ) - self.delete = async_to_raw_response_wrapper( - routes.delete, - ) self.empty = async_to_raw_response_wrapper( routes.empty, ) - self.get = async_to_raw_response_wrapper( - routes.get, - ) class RoutesResourceWithStreamingResponse: @@ -678,21 +330,12 @@ def __init__(self, routes: RoutesResource) -> None: self.create = to_streamed_response_wrapper( routes.create, ) - self.update = to_streamed_response_wrapper( - routes.update, - ) self.list = to_streamed_response_wrapper( routes.list, ) - self.delete = to_streamed_response_wrapper( - routes.delete, - ) self.empty = to_streamed_response_wrapper( routes.empty, ) - self.get = to_streamed_response_wrapper( - routes.get, - ) class AsyncRoutesResourceWithStreamingResponse: @@ -702,18 +345,9 @@ def __init__(self, routes: AsyncRoutesResource) -> None: self.create = async_to_streamed_response_wrapper( routes.create, ) - self.update = async_to_streamed_response_wrapper( - routes.update, - ) self.list = async_to_streamed_response_wrapper( routes.list, ) - self.delete = async_to_streamed_response_wrapper( - routes.delete, - ) self.empty = async_to_streamed_response_wrapper( routes.empty, ) - self.get = async_to_streamed_response_wrapper( - routes.get, - ) diff --git a/src/cloudflare/resources/magic_transit/sites/acls.py b/src/cloudflare/resources/magic_transit/sites/acls.py index 8c6e537f60b..c5ac6f1d672 100644 --- a/src/cloudflare/resources/magic_transit/sites/acls.py +++ b/src/cloudflare/resources/magic_transit/sites/acls.py @@ -25,7 +25,7 @@ AsyncPaginator, make_request_options, ) -from ....types.magic_transit.sites import acl_edit_params, acl_create_params, acl_update_params +from ....types.magic_transit.sites import acl_create_params from ....types.magic_transit.sites.acl import ACL from ....types.magic_transit.sites.allowed_protocol import AllowedProtocol from ....types.magic_transit.sites.acl_configuration_param import ACLConfigurationParam @@ -112,81 +112,6 @@ def create( cast_to=cast(Type[ACL], ResultWrapper[ACL]), ) - def update( - self, - acl_identifier: str, - *, - account_id: str, - site_id: str, - description: str | NotGiven = NOT_GIVEN, - forward_locally: bool | NotGiven = NOT_GIVEN, - lan_1: ACLConfigurationParam | NotGiven = NOT_GIVEN, - lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - protocols: List[AllowedProtocol] | 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ACL: - """ - Update a specific Site ACL. - - Args: - account_id: Identifier - - site_id: Identifier - - acl_identifier: Identifier - - description: Description for the ACL. - - forward_locally: The desired forwarding action for this ACL policy. If set to "false", the policy - will forward traffic to Cloudflare. If set to "true", the policy will forward - traffic locally on the Magic Connector. If not included in request, will default - to false. - - name: The name of the ACL. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not site_id: - raise ValueError(f"Expected a non-empty value for `site_id` but received {site_id!r}") - if not acl_identifier: - raise ValueError(f"Expected a non-empty value for `acl_identifier` but received {acl_identifier!r}") - return self._put( - f"/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_identifier}", - body=maybe_transform( - { - "description": description, - "forward_locally": forward_locally, - "lan_1": lan_1, - "lan_2": lan_2, - "name": name, - "protocols": protocols, - }, - acl_update_params.ACLUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ACL]._unwrapper, - ), - cast_to=cast(Type[ACL], ResultWrapper[ACL]), - ) - def list( self, site_id: str, @@ -228,179 +153,6 @@ def list( model=ACL, ) - def delete( - self, - acl_identifier: str, - *, - account_id: str, - site_id: str, - # 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ACL: - """ - Remove a specific Site ACL. - - Args: - account_id: Identifier - - site_id: Identifier - - acl_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not site_id: - raise ValueError(f"Expected a non-empty value for `site_id` but received {site_id!r}") - if not acl_identifier: - raise ValueError(f"Expected a non-empty value for `acl_identifier` but received {acl_identifier!r}") - return self._delete( - f"/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ACL]._unwrapper, - ), - cast_to=cast(Type[ACL], ResultWrapper[ACL]), - ) - - def edit( - self, - acl_identifier: str, - *, - account_id: str, - site_id: str, - description: str | NotGiven = NOT_GIVEN, - forward_locally: bool | NotGiven = NOT_GIVEN, - lan_1: ACLConfigurationParam | NotGiven = NOT_GIVEN, - lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - protocols: List[AllowedProtocol] | 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ACL: - """ - Patch a specific Site ACL. - - Args: - account_id: Identifier - - site_id: Identifier - - acl_identifier: Identifier - - description: Description for the ACL. - - forward_locally: The desired forwarding action for this ACL policy. If set to "false", the policy - will forward traffic to Cloudflare. If set to "true", the policy will forward - traffic locally on the Magic Connector. If not included in request, will default - to false. - - name: The name of the ACL. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not site_id: - raise ValueError(f"Expected a non-empty value for `site_id` but received {site_id!r}") - if not acl_identifier: - raise ValueError(f"Expected a non-empty value for `acl_identifier` but received {acl_identifier!r}") - return self._patch( - f"/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_identifier}", - body=maybe_transform( - { - "description": description, - "forward_locally": forward_locally, - "lan_1": lan_1, - "lan_2": lan_2, - "name": name, - "protocols": protocols, - }, - acl_edit_params.ACLEditParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ACL]._unwrapper, - ), - cast_to=cast(Type[ACL], ResultWrapper[ACL]), - ) - - def get( - self, - acl_identifier: str, - *, - account_id: str, - site_id: str, - # 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ACL: - """ - Get a specific Site ACL. - - Args: - account_id: Identifier - - site_id: Identifier - - acl_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not site_id: - raise ValueError(f"Expected a non-empty value for `site_id` but received {site_id!r}") - if not acl_identifier: - raise ValueError(f"Expected a non-empty value for `acl_identifier` but received {acl_identifier!r}") - return self._get( - f"/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ACL]._unwrapper, - ), - cast_to=cast(Type[ACL], ResultWrapper[ACL]), - ) - class AsyncACLsResource(AsyncAPIResource): @cached_property @@ -481,81 +233,6 @@ async def create( cast_to=cast(Type[ACL], ResultWrapper[ACL]), ) - async def update( - self, - acl_identifier: str, - *, - account_id: str, - site_id: str, - description: str | NotGiven = NOT_GIVEN, - forward_locally: bool | NotGiven = NOT_GIVEN, - lan_1: ACLConfigurationParam | NotGiven = NOT_GIVEN, - lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - protocols: List[AllowedProtocol] | 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ACL: - """ - Update a specific Site ACL. - - Args: - account_id: Identifier - - site_id: Identifier - - acl_identifier: Identifier - - description: Description for the ACL. - - forward_locally: The desired forwarding action for this ACL policy. If set to "false", the policy - will forward traffic to Cloudflare. If set to "true", the policy will forward - traffic locally on the Magic Connector. If not included in request, will default - to false. - - name: The name of the ACL. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not site_id: - raise ValueError(f"Expected a non-empty value for `site_id` but received {site_id!r}") - if not acl_identifier: - raise ValueError(f"Expected a non-empty value for `acl_identifier` but received {acl_identifier!r}") - return await self._put( - f"/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_identifier}", - body=await async_maybe_transform( - { - "description": description, - "forward_locally": forward_locally, - "lan_1": lan_1, - "lan_2": lan_2, - "name": name, - "protocols": protocols, - }, - acl_update_params.ACLUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ACL]._unwrapper, - ), - cast_to=cast(Type[ACL], ResultWrapper[ACL]), - ) - def list( self, site_id: str, @@ -597,179 +274,6 @@ def list( model=ACL, ) - async def delete( - self, - acl_identifier: str, - *, - account_id: str, - site_id: str, - # 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ACL: - """ - Remove a specific Site ACL. - - Args: - account_id: Identifier - - site_id: Identifier - - acl_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not site_id: - raise ValueError(f"Expected a non-empty value for `site_id` but received {site_id!r}") - if not acl_identifier: - raise ValueError(f"Expected a non-empty value for `acl_identifier` but received {acl_identifier!r}") - return await self._delete( - f"/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ACL]._unwrapper, - ), - cast_to=cast(Type[ACL], ResultWrapper[ACL]), - ) - - async def edit( - self, - acl_identifier: str, - *, - account_id: str, - site_id: str, - description: str | NotGiven = NOT_GIVEN, - forward_locally: bool | NotGiven = NOT_GIVEN, - lan_1: ACLConfigurationParam | NotGiven = NOT_GIVEN, - lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - protocols: List[AllowedProtocol] | 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ACL: - """ - Patch a specific Site ACL. - - Args: - account_id: Identifier - - site_id: Identifier - - acl_identifier: Identifier - - description: Description for the ACL. - - forward_locally: The desired forwarding action for this ACL policy. If set to "false", the policy - will forward traffic to Cloudflare. If set to "true", the policy will forward - traffic locally on the Magic Connector. If not included in request, will default - to false. - - name: The name of the ACL. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not site_id: - raise ValueError(f"Expected a non-empty value for `site_id` but received {site_id!r}") - if not acl_identifier: - raise ValueError(f"Expected a non-empty value for `acl_identifier` but received {acl_identifier!r}") - return await self._patch( - f"/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_identifier}", - body=await async_maybe_transform( - { - "description": description, - "forward_locally": forward_locally, - "lan_1": lan_1, - "lan_2": lan_2, - "name": name, - "protocols": protocols, - }, - acl_edit_params.ACLEditParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ACL]._unwrapper, - ), - cast_to=cast(Type[ACL], ResultWrapper[ACL]), - ) - - async def get( - self, - acl_identifier: str, - *, - account_id: str, - site_id: str, - # 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ACL: - """ - Get a specific Site ACL. - - Args: - account_id: Identifier - - site_id: Identifier - - acl_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not site_id: - raise ValueError(f"Expected a non-empty value for `site_id` but received {site_id!r}") - if not acl_identifier: - raise ValueError(f"Expected a non-empty value for `acl_identifier` but received {acl_identifier!r}") - return await self._get( - f"/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ACL]._unwrapper, - ), - cast_to=cast(Type[ACL], ResultWrapper[ACL]), - ) - class ACLsResourceWithRawResponse: def __init__(self, acls: ACLsResource) -> None: @@ -778,21 +282,9 @@ def __init__(self, acls: ACLsResource) -> None: self.create = to_raw_response_wrapper( acls.create, ) - self.update = to_raw_response_wrapper( - acls.update, - ) self.list = to_raw_response_wrapper( acls.list, ) - self.delete = to_raw_response_wrapper( - acls.delete, - ) - self.edit = to_raw_response_wrapper( - acls.edit, - ) - self.get = to_raw_response_wrapper( - acls.get, - ) class AsyncACLsResourceWithRawResponse: @@ -802,21 +294,9 @@ def __init__(self, acls: AsyncACLsResource) -> None: self.create = async_to_raw_response_wrapper( acls.create, ) - self.update = async_to_raw_response_wrapper( - acls.update, - ) self.list = async_to_raw_response_wrapper( acls.list, ) - self.delete = async_to_raw_response_wrapper( - acls.delete, - ) - self.edit = async_to_raw_response_wrapper( - acls.edit, - ) - self.get = async_to_raw_response_wrapper( - acls.get, - ) class ACLsResourceWithStreamingResponse: @@ -826,21 +306,9 @@ def __init__(self, acls: ACLsResource) -> None: self.create = to_streamed_response_wrapper( acls.create, ) - self.update = to_streamed_response_wrapper( - acls.update, - ) self.list = to_streamed_response_wrapper( acls.list, ) - self.delete = to_streamed_response_wrapper( - acls.delete, - ) - self.edit = to_streamed_response_wrapper( - acls.edit, - ) - self.get = to_streamed_response_wrapper( - acls.get, - ) class AsyncACLsResourceWithStreamingResponse: @@ -850,18 +318,6 @@ def __init__(self, acls: AsyncACLsResource) -> None: self.create = async_to_streamed_response_wrapper( acls.create, ) - self.update = async_to_streamed_response_wrapper( - acls.update, - ) self.list = async_to_streamed_response_wrapper( acls.list, ) - self.delete = async_to_streamed_response_wrapper( - acls.delete, - ) - self.edit = async_to_streamed_response_wrapper( - acls.edit, - ) - self.get = async_to_streamed_response_wrapper( - acls.get, - ) diff --git a/src/cloudflare/types/magic_transit/__init__.py b/src/cloudflare/types/magic_transit/__init__.py index ad2327c5724..446a433bc84 100644 --- a/src/cloudflare/types/magic_transit/__init__.py +++ b/src/cloudflare/types/magic_transit/__init__.py @@ -4,7 +4,6 @@ from .site import Site as Site from .scope import Scope as Scope -from .scope_param import ScopeParam as ScopeParam from .health_check import HealthCheck as HealthCheck from .psk_metadata import PSKMetadata as PSKMetadata from .site_location import SiteLocation as SiteLocation @@ -16,7 +15,6 @@ from .health_check_rate import HealthCheckRate as HealthCheckRate from .health_check_type import HealthCheckType as HealthCheckType from .health_check_param import HealthCheckParam as HealthCheckParam -from .route_get_response import RouteGetResponse as RouteGetResponse from .site_create_params import SiteCreateParams as SiteCreateParams from .site_update_params import SiteUpdateParams as SiteUpdateParams from .app_create_response import AppCreateResponse as AppCreateResponse @@ -24,35 +22,19 @@ from .app_update_response import AppUpdateResponse as AppUpdateResponse from .route_create_params import RouteCreateParams as RouteCreateParams from .route_list_response import RouteListResponse as RouteListResponse -from .route_update_params import RouteUpdateParams as RouteUpdateParams from .site_location_param import SiteLocationParam as SiteLocationParam from .route_empty_response import RouteEmptyResponse as RouteEmptyResponse from .connector_edit_params import ConnectorEditParams as ConnectorEditParams from .route_create_response import RouteCreateResponse as RouteCreateResponse -from .route_delete_response import RouteDeleteResponse as RouteDeleteResponse -from .route_update_response import RouteUpdateResponse as RouteUpdateResponse from .connector_get_response import ConnectorGetResponse as ConnectorGetResponse from .connector_edit_response import ConnectorEditResponse as ConnectorEditResponse from .connector_list_response import ConnectorListResponse as ConnectorListResponse from .connector_update_params import ConnectorUpdateParams as ConnectorUpdateParams -from .gre_tunnel_get_response import GRETunnelGetResponse as GRETunnelGetResponse from .gre_tunnel_create_params import GRETunnelCreateParams as GRETunnelCreateParams from .gre_tunnel_list_response import GRETunnelListResponse as GRETunnelListResponse -from .gre_tunnel_update_params import GRETunnelUpdateParams as GRETunnelUpdateParams from .connector_update_response import ConnectorUpdateResponse as ConnectorUpdateResponse -from .ipsec_tunnel_get_response import IPSECTunnelGetResponse as IPSECTunnelGetResponse from .gre_tunnel_create_response import GRETunnelCreateResponse as GRETunnelCreateResponse -from .gre_tunnel_delete_response import GRETunnelDeleteResponse as GRETunnelDeleteResponse -from .gre_tunnel_update_response import GRETunnelUpdateResponse as GRETunnelUpdateResponse from .ipsec_tunnel_create_params import IPSECTunnelCreateParams as IPSECTunnelCreateParams from .ipsec_tunnel_list_response import IPSECTunnelListResponse as IPSECTunnelListResponse -from .ipsec_tunnel_update_params import IPSECTunnelUpdateParams as IPSECTunnelUpdateParams -from .cf_interconnect_get_response import CfInterconnectGetResponse as CfInterconnectGetResponse from .ipsec_tunnel_create_response import IPSECTunnelCreateResponse as IPSECTunnelCreateResponse -from .ipsec_tunnel_delete_response import IPSECTunnelDeleteResponse as IPSECTunnelDeleteResponse -from .ipsec_tunnel_update_response import IPSECTunnelUpdateResponse as IPSECTunnelUpdateResponse from .cf_interconnect_list_response import CfInterconnectListResponse as CfInterconnectListResponse -from .cf_interconnect_update_params import CfInterconnectUpdateParams as CfInterconnectUpdateParams -from .cf_interconnect_update_response import CfInterconnectUpdateResponse as CfInterconnectUpdateResponse -from .ipsec_tunnel_psk_generate_params import IPSECTunnelPSKGenerateParams as IPSECTunnelPSKGenerateParams -from .ipsec_tunnel_psk_generate_response import IPSECTunnelPSKGenerateResponse as IPSECTunnelPSKGenerateResponse diff --git a/src/cloudflare/types/magic_transit/cf_interconnect_get_response.py b/src/cloudflare/types/magic_transit/cf_interconnect_get_response.py deleted file mode 100644 index 1693571a82a..00000000000 --- a/src/cloudflare/types/magic_transit/cf_interconnect_get_response.py +++ /dev/null @@ -1,11 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["CfInterconnectGetResponse"] - - -class CfInterconnectGetResponse(BaseModel): - interconnect: Optional[object] = None diff --git a/src/cloudflare/types/magic_transit/cf_interconnect_update_params.py b/src/cloudflare/types/magic_transit/cf_interconnect_update_params.py deleted file mode 100644 index 00fca27a8f2..00000000000 --- a/src/cloudflare/types/magic_transit/cf_interconnect_update_params.py +++ /dev/null @@ -1,63 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .health_check_rate import HealthCheckRate -from .health_check_type import HealthCheckType - -__all__ = ["CfInterconnectUpdateParams", "GRE", "HealthCheck"] - - -class CfInterconnectUpdateParams(TypedDict, total=False): - account_id: Required[str] - """Identifier""" - - description: str - """An optional description of the interconnect.""" - - gre: GRE - """The configuration specific to GRE interconnects.""" - - health_check: HealthCheck - - interface_address: str - """ - A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side - of the tunnel. Select the subnet from the following private IP space: - 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - """ - - mtu: int - """The Maximum Transmission Unit (MTU) in bytes for the interconnect. - - The minimum value is 576. - """ - - -class GRE(TypedDict, total=False): - cloudflare_endpoint: str - """ - The IP address assigned to the Cloudflare side of the GRE tunnel created as part - of the Interconnect. - """ - - -class HealthCheck(TypedDict, total=False): - enabled: bool - """Determines whether to run healthchecks for a tunnel.""" - - rate: HealthCheckRate - """How frequent the health check is run. The default value is `mid`.""" - - target: str - """The destination address in a request type health check. - - After the healthcheck is decapsulated at the customer end of the tunnel, the - ICMP echo will be forwarded to this address. This field defaults to - `customer_gre_endpoint address`. - """ - - type: HealthCheckType - """The type of healthcheck to run, reply or request. The default value is `reply`.""" diff --git a/src/cloudflare/types/magic_transit/cf_interconnect_update_response.py b/src/cloudflare/types/magic_transit/cf_interconnect_update_response.py deleted file mode 100644 index e21d22dbd40..00000000000 --- a/src/cloudflare/types/magic_transit/cf_interconnect_update_response.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["CfInterconnectUpdateResponse"] - - -class CfInterconnectUpdateResponse(BaseModel): - modified: Optional[bool] = None - - modified_interconnect: Optional[object] = None diff --git a/src/cloudflare/types/magic_transit/gre_tunnel_delete_response.py b/src/cloudflare/types/magic_transit/gre_tunnel_delete_response.py deleted file mode 100644 index 5165f2dcc3b..00000000000 --- a/src/cloudflare/types/magic_transit/gre_tunnel_delete_response.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["GRETunnelDeleteResponse"] - - -class GRETunnelDeleteResponse(BaseModel): - deleted: Optional[bool] = None - - deleted_gre_tunnel: Optional[object] = None diff --git a/src/cloudflare/types/magic_transit/gre_tunnel_get_response.py b/src/cloudflare/types/magic_transit/gre_tunnel_get_response.py deleted file mode 100644 index 141c70992f1..00000000000 --- a/src/cloudflare/types/magic_transit/gre_tunnel_get_response.py +++ /dev/null @@ -1,11 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["GRETunnelGetResponse"] - - -class GRETunnelGetResponse(BaseModel): - gre_tunnel: Optional[object] = None diff --git a/src/cloudflare/types/magic_transit/gre_tunnel_update_params.py b/src/cloudflare/types/magic_transit/gre_tunnel_update_params.py deleted file mode 100644 index 6d891bbe546..00000000000 --- a/src/cloudflare/types/magic_transit/gre_tunnel_update_params.py +++ /dev/null @@ -1,48 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .health_check_param import HealthCheckParam - -__all__ = ["GRETunnelUpdateParams"] - - -class GRETunnelUpdateParams(TypedDict, total=False): - account_id: Required[str] - """Identifier""" - - cloudflare_gre_endpoint: Required[str] - """The IP address assigned to the Cloudflare side of the GRE tunnel.""" - - customer_gre_endpoint: Required[str] - """The IP address assigned to the customer side of the GRE tunnel.""" - - interface_address: Required[str] - """ - A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side - of the tunnel. Select the subnet from the following private IP space: - 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - """ - - name: Required[str] - """The name of the tunnel. - - The name cannot contain spaces or special characters, must be 15 characters or - less, and cannot share a name with another GRE tunnel. - """ - - description: str - """An optional description of the GRE tunnel.""" - - health_check: HealthCheckParam - - mtu: int - """Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. - - The minimum value is 576. - """ - - ttl: int - """Time To Live (TTL) in number of hops of the GRE tunnel.""" diff --git a/src/cloudflare/types/magic_transit/gre_tunnel_update_response.py b/src/cloudflare/types/magic_transit/gre_tunnel_update_response.py deleted file mode 100644 index c84ba582d7e..00000000000 --- a/src/cloudflare/types/magic_transit/gre_tunnel_update_response.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["GRETunnelUpdateResponse"] - - -class GRETunnelUpdateResponse(BaseModel): - modified: Optional[bool] = None - - modified_gre_tunnel: Optional[object] = None diff --git a/src/cloudflare/types/magic_transit/ipsec_tunnel_delete_response.py b/src/cloudflare/types/magic_transit/ipsec_tunnel_delete_response.py deleted file mode 100644 index b39ba183f72..00000000000 --- a/src/cloudflare/types/magic_transit/ipsec_tunnel_delete_response.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["IPSECTunnelDeleteResponse"] - - -class IPSECTunnelDeleteResponse(BaseModel): - deleted: Optional[bool] = None - - deleted_ipsec_tunnel: Optional[object] = None diff --git a/src/cloudflare/types/magic_transit/ipsec_tunnel_get_response.py b/src/cloudflare/types/magic_transit/ipsec_tunnel_get_response.py deleted file mode 100644 index 816098c9ead..00000000000 --- a/src/cloudflare/types/magic_transit/ipsec_tunnel_get_response.py +++ /dev/null @@ -1,11 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["IPSECTunnelGetResponse"] - - -class IPSECTunnelGetResponse(BaseModel): - ipsec_tunnel: Optional[object] = None diff --git a/src/cloudflare/types/magic_transit/ipsec_tunnel_psk_generate_params.py b/src/cloudflare/types/magic_transit/ipsec_tunnel_psk_generate_params.py deleted file mode 100644 index 1066fa603d1..00000000000 --- a/src/cloudflare/types/magic_transit/ipsec_tunnel_psk_generate_params.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["IPSECTunnelPSKGenerateParams"] - - -class IPSECTunnelPSKGenerateParams(TypedDict, total=False): - account_id: Required[str] - """Identifier""" - - body: Required[object] diff --git a/src/cloudflare/types/magic_transit/ipsec_tunnel_psk_generate_response.py b/src/cloudflare/types/magic_transit/ipsec_tunnel_psk_generate_response.py deleted file mode 100644 index 9c4438b1456..00000000000 --- a/src/cloudflare/types/magic_transit/ipsec_tunnel_psk_generate_response.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .psk_metadata import PSKMetadata - -__all__ = ["IPSECTunnelPSKGenerateResponse"] - - -class IPSECTunnelPSKGenerateResponse(BaseModel): - ipsec_tunnel_id: Optional[str] = None - """Identifier""" - - psk: Optional[str] = None - """A randomly generated or provided string for use in the IPsec tunnel.""" - - psk_metadata: Optional[PSKMetadata] = None - """The PSK metadata that includes when the PSK was generated.""" diff --git a/src/cloudflare/types/magic_transit/ipsec_tunnel_update_params.py b/src/cloudflare/types/magic_transit/ipsec_tunnel_update_params.py deleted file mode 100644 index 8a0170e0345..00000000000 --- a/src/cloudflare/types/magic_transit/ipsec_tunnel_update_params.py +++ /dev/null @@ -1,47 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .health_check_param import HealthCheckParam - -__all__ = ["IPSECTunnelUpdateParams"] - - -class IPSECTunnelUpdateParams(TypedDict, total=False): - account_id: Required[str] - """Identifier""" - - cloudflare_endpoint: Required[str] - """The IP address assigned to the Cloudflare side of the IPsec tunnel.""" - - interface_address: Required[str] - """ - A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side - of the tunnel. Select the subnet from the following private IP space: - 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - """ - - name: Required[str] - """The name of the IPsec tunnel. The name cannot share a name with other tunnels.""" - - customer_endpoint: str - """The IP address assigned to the customer side of the IPsec tunnel. - - Not required, but must be set for proactive traceroutes to work. - """ - - description: str - """An optional description forthe IPsec tunnel.""" - - health_check: HealthCheckParam - - psk: str - """A randomly generated or provided string for use in the IPsec tunnel.""" - - replay_protection: bool - """ - If `true`, then IPsec replay protection will be supported in the - Cloudflare-to-customer direction. - """ diff --git a/src/cloudflare/types/magic_transit/ipsec_tunnel_update_response.py b/src/cloudflare/types/magic_transit/ipsec_tunnel_update_response.py deleted file mode 100644 index 8a7b92e2b11..00000000000 --- a/src/cloudflare/types/magic_transit/ipsec_tunnel_update_response.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["IPSECTunnelUpdateResponse"] - - -class IPSECTunnelUpdateResponse(BaseModel): - modified: Optional[bool] = None - - modified_ipsec_tunnel: Optional[object] = None diff --git a/src/cloudflare/types/magic_transit/route_delete_response.py b/src/cloudflare/types/magic_transit/route_delete_response.py deleted file mode 100644 index 096e4ece8f1..00000000000 --- a/src/cloudflare/types/magic_transit/route_delete_response.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["RouteDeleteResponse"] - - -class RouteDeleteResponse(BaseModel): - deleted: Optional[bool] = None - - deleted_route: Optional[object] = None diff --git a/src/cloudflare/types/magic_transit/route_get_response.py b/src/cloudflare/types/magic_transit/route_get_response.py deleted file mode 100644 index f23ba2c2ec4..00000000000 --- a/src/cloudflare/types/magic_transit/route_get_response.py +++ /dev/null @@ -1,11 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["RouteGetResponse"] - - -class RouteGetResponse(BaseModel): - route: Optional[object] = None diff --git a/src/cloudflare/types/magic_transit/route_update_params.py b/src/cloudflare/types/magic_transit/route_update_params.py deleted file mode 100644 index 14d10ad42c0..00000000000 --- a/src/cloudflare/types/magic_transit/route_update_params.py +++ /dev/null @@ -1,32 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .scope_param import ScopeParam - -__all__ = ["RouteUpdateParams"] - - -class RouteUpdateParams(TypedDict, total=False): - account_id: Required[str] - """Identifier""" - - nexthop: Required[str] - """The next-hop IP Address for the static route.""" - - prefix: Required[str] - """IP Prefix in Classless Inter-Domain Routing format.""" - - priority: Required[int] - """Priority of the static route.""" - - description: str - """An optional human provided description of the static route.""" - - scope: ScopeParam - """Used only for ECMP routes.""" - - weight: int - """Optional weight of the ECMP scope - if provided.""" diff --git a/src/cloudflare/types/magic_transit/route_update_response.py b/src/cloudflare/types/magic_transit/route_update_response.py deleted file mode 100644 index 33b497d969f..00000000000 --- a/src/cloudflare/types/magic_transit/route_update_response.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["RouteUpdateResponse"] - - -class RouteUpdateResponse(BaseModel): - modified: Optional[bool] = None - - modified_route: Optional[object] = None diff --git a/src/cloudflare/types/magic_transit/scope_param.py b/src/cloudflare/types/magic_transit/scope_param.py deleted file mode 100644 index 95df559e364..00000000000 --- a/src/cloudflare/types/magic_transit/scope_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List -from typing_extensions import TypedDict - -__all__ = ["ScopeParam"] - - -class ScopeParam(TypedDict, total=False): - colo_names: List[str] - """List of colo names for the ECMP scope.""" - - colo_regions: List[str] - """List of colo regions for the ECMP scope.""" diff --git a/src/cloudflare/types/magic_transit/sites/__init__.py b/src/cloudflare/types/magic_transit/sites/__init__.py index 38f592bb4e6..14816eed960 100644 --- a/src/cloudflare/types/magic_transit/sites/__init__.py +++ b/src/cloudflare/types/magic_transit/sites/__init__.py @@ -12,14 +12,12 @@ from .dhcp_server import DHCPServer as DHCPServer from .subnet_param import SubnetParam as SubnetParam from .routed_subnet import RoutedSubnet as RoutedSubnet -from .acl_edit_params import ACLEditParams as ACLEditParams from .lan_edit_params import LANEditParams as LANEditParams from .wan_edit_params import WANEditParams as WANEditParams from .allowed_protocol import AllowedProtocol as AllowedProtocol from .dhcp_relay_param import DHCPRelayParam as DHCPRelayParam from .acl_configuration import ACLConfiguration as ACLConfiguration from .acl_create_params import ACLCreateParams as ACLCreateParams -from .acl_update_params import ACLUpdateParams as ACLUpdateParams from .dhcp_server_param import DHCPServerParam as DHCPServerParam from .lan_create_params import LANCreateParams as LANCreateParams from .lan_update_params import LANUpdateParams as LANUpdateParams diff --git a/src/cloudflare/types/magic_transit/sites/acl_edit_params.py b/src/cloudflare/types/magic_transit/sites/acl_edit_params.py deleted file mode 100644 index 8a6c7b0f5c6..00000000000 --- a/src/cloudflare/types/magic_transit/sites/acl_edit_params.py +++ /dev/null @@ -1,39 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List -from typing_extensions import Required, TypedDict - -from .allowed_protocol import AllowedProtocol -from .acl_configuration_param import ACLConfigurationParam - -__all__ = ["ACLEditParams"] - - -class ACLEditParams(TypedDict, total=False): - account_id: Required[str] - """Identifier""" - - site_id: Required[str] - """Identifier""" - - description: str - """Description for the ACL.""" - - forward_locally: bool - """The desired forwarding action for this ACL policy. - - If set to "false", the policy will forward traffic to Cloudflare. If set to - "true", the policy will forward traffic locally on the Magic Connector. If not - included in request, will default to false. - """ - - lan_1: ACLConfigurationParam - - lan_2: ACLConfigurationParam - - name: str - """The name of the ACL.""" - - protocols: List[AllowedProtocol] diff --git a/src/cloudflare/types/magic_transit/sites/acl_update_params.py b/src/cloudflare/types/magic_transit/sites/acl_update_params.py deleted file mode 100644 index 5abc70c2329..00000000000 --- a/src/cloudflare/types/magic_transit/sites/acl_update_params.py +++ /dev/null @@ -1,39 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List -from typing_extensions import Required, TypedDict - -from .allowed_protocol import AllowedProtocol -from .acl_configuration_param import ACLConfigurationParam - -__all__ = ["ACLUpdateParams"] - - -class ACLUpdateParams(TypedDict, total=False): - account_id: Required[str] - """Identifier""" - - site_id: Required[str] - """Identifier""" - - description: str - """Description for the ACL.""" - - forward_locally: bool - """The desired forwarding action for this ACL policy. - - If set to "false", the policy will forward traffic to Cloudflare. If set to - "true", the policy will forward traffic locally on the Magic Connector. If not - included in request, will default to false. - """ - - lan_1: ACLConfigurationParam - - lan_2: ACLConfigurationParam - - name: str - """The name of the ACL.""" - - protocols: List[AllowedProtocol] diff --git a/tests/api_resources/magic_transit/sites/test_acls.py b/tests/api_resources/magic_transit/sites/test_acls.py index 4bcac3f4126..10ffc357c63 100644 --- a/tests/api_resources/magic_transit/sites/test_acls.py +++ b/tests/api_resources/magic_transit/sites/test_acls.py @@ -10,9 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.magic_transit.sites import ( - ACL, -) +from cloudflare.types.magic_transit.sites import ACL base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -107,91 +105,6 @@ def test_path_params_create(self, client: Cloudflare) -> None: name="PIN Pad - Cash Register", ) - @parametrize - def test_method_update(self, client: Cloudflare) -> None: - acl = client.magic_transit.sites.acls.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(ACL, acl, path=["response"]) - - @parametrize - def test_method_update_with_all_params(self, client: Cloudflare) -> None: - acl = client.magic_transit.sites.acls.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - description="Allows local traffic between PIN pads and cash register.", - forward_locally=True, - lan_1={ - "lan_id": "string", - "lan_name": "string", - "ports": [1, 1, 1], - "subnets": ["192.0.2.1", "192.0.2.1", "192.0.2.1"], - }, - lan_2={ - "lan_id": "string", - "lan_name": "string", - "ports": [1, 1, 1], - "subnets": ["192.0.2.1", "192.0.2.1", "192.0.2.1"], - }, - name="PIN Pad - Cash Register", - protocols=["tcp", "udp", "icmp"], - ) - assert_matches_type(ACL, acl, path=["response"]) - - @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.magic_transit.sites.acls.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - acl = response.parse() - assert_matches_type(ACL, acl, path=["response"]) - - @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.magic_transit.sites.acls.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - acl = response.parse() - assert_matches_type(ACL, acl, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.magic_transit.sites.acls.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_id` but received ''"): - client.magic_transit.sites.acls.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `acl_identifier` but received ''"): - client.magic_transit.sites.acls.with_raw_response.update( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - @parametrize def test_method_list(self, client: Cloudflare) -> None: acl = client.magic_transit.sites.acls.list( @@ -240,211 +153,6 @@ def test_path_params_list(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - acl = client.magic_transit.sites.acls.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(ACL, acl, path=["response"]) - - @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.magic_transit.sites.acls.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - acl = response.parse() - assert_matches_type(ACL, acl, path=["response"]) - - @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.magic_transit.sites.acls.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - acl = response.parse() - assert_matches_type(ACL, acl, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.magic_transit.sites.acls.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_id` but received ''"): - client.magic_transit.sites.acls.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `acl_identifier` but received ''"): - client.magic_transit.sites.acls.with_raw_response.delete( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - def test_method_edit(self, client: Cloudflare) -> None: - acl = client.magic_transit.sites.acls.edit( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(ACL, acl, path=["response"]) - - @parametrize - def test_method_edit_with_all_params(self, client: Cloudflare) -> None: - acl = client.magic_transit.sites.acls.edit( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - description="Allows local traffic between PIN pads and cash register.", - forward_locally=True, - lan_1={ - "lan_id": "string", - "lan_name": "string", - "ports": [1, 1, 1], - "subnets": ["192.0.2.1", "192.0.2.1", "192.0.2.1"], - }, - lan_2={ - "lan_id": "string", - "lan_name": "string", - "ports": [1, 1, 1], - "subnets": ["192.0.2.1", "192.0.2.1", "192.0.2.1"], - }, - name="PIN Pad - Cash Register", - protocols=["tcp", "udp", "icmp"], - ) - assert_matches_type(ACL, acl, path=["response"]) - - @parametrize - def test_raw_response_edit(self, client: Cloudflare) -> None: - response = client.magic_transit.sites.acls.with_raw_response.edit( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - acl = response.parse() - assert_matches_type(ACL, acl, path=["response"]) - - @parametrize - def test_streaming_response_edit(self, client: Cloudflare) -> None: - with client.magic_transit.sites.acls.with_streaming_response.edit( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - acl = response.parse() - assert_matches_type(ACL, acl, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_edit(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.magic_transit.sites.acls.with_raw_response.edit( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_id` but received ''"): - client.magic_transit.sites.acls.with_raw_response.edit( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `acl_identifier` but received ''"): - client.magic_transit.sites.acls.with_raw_response.edit( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - acl = client.magic_transit.sites.acls.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(ACL, acl, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.magic_transit.sites.acls.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - acl = response.parse() - assert_matches_type(ACL, acl, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.magic_transit.sites.acls.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - acl = response.parse() - assert_matches_type(ACL, acl, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.magic_transit.sites.acls.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_id` but received ''"): - client.magic_transit.sites.acls.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `acl_identifier` but received ''"): - client.magic_transit.sites.acls.with_raw_response.get( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - class TestAsyncACLs: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -536,91 +244,6 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: name="PIN Pad - Cash Register", ) - @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: - acl = await async_client.magic_transit.sites.acls.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(ACL, acl, path=["response"]) - - @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: - acl = await async_client.magic_transit.sites.acls.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - description="Allows local traffic between PIN pads and cash register.", - forward_locally=True, - lan_1={ - "lan_id": "string", - "lan_name": "string", - "ports": [1, 1, 1], - "subnets": ["192.0.2.1", "192.0.2.1", "192.0.2.1"], - }, - lan_2={ - "lan_id": "string", - "lan_name": "string", - "ports": [1, 1, 1], - "subnets": ["192.0.2.1", "192.0.2.1", "192.0.2.1"], - }, - name="PIN Pad - Cash Register", - protocols=["tcp", "udp", "icmp"], - ) - assert_matches_type(ACL, acl, path=["response"]) - - @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.sites.acls.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - acl = await response.parse() - assert_matches_type(ACL, acl, path=["response"]) - - @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.sites.acls.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - acl = await response.parse() - assert_matches_type(ACL, acl, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.magic_transit.sites.acls.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_id` but received ''"): - await async_client.magic_transit.sites.acls.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `acl_identifier` but received ''"): - await async_client.magic_transit.sites.acls.with_raw_response.update( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: acl = await async_client.magic_transit.sites.acls.list( @@ -668,208 +291,3 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - - @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - acl = await async_client.magic_transit.sites.acls.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(ACL, acl, path=["response"]) - - @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.sites.acls.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - acl = await response.parse() - assert_matches_type(ACL, acl, path=["response"]) - - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.sites.acls.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - acl = await response.parse() - assert_matches_type(ACL, acl, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.magic_transit.sites.acls.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_id` but received ''"): - await async_client.magic_transit.sites.acls.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `acl_identifier` but received ''"): - await async_client.magic_transit.sites.acls.with_raw_response.delete( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - async def test_method_edit(self, async_client: AsyncCloudflare) -> None: - acl = await async_client.magic_transit.sites.acls.edit( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(ACL, acl, path=["response"]) - - @parametrize - async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: - acl = await async_client.magic_transit.sites.acls.edit( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - description="Allows local traffic between PIN pads and cash register.", - forward_locally=True, - lan_1={ - "lan_id": "string", - "lan_name": "string", - "ports": [1, 1, 1], - "subnets": ["192.0.2.1", "192.0.2.1", "192.0.2.1"], - }, - lan_2={ - "lan_id": "string", - "lan_name": "string", - "ports": [1, 1, 1], - "subnets": ["192.0.2.1", "192.0.2.1", "192.0.2.1"], - }, - name="PIN Pad - Cash Register", - protocols=["tcp", "udp", "icmp"], - ) - assert_matches_type(ACL, acl, path=["response"]) - - @parametrize - async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.sites.acls.with_raw_response.edit( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - acl = await response.parse() - assert_matches_type(ACL, acl, path=["response"]) - - @parametrize - async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.sites.acls.with_streaming_response.edit( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - acl = await response.parse() - assert_matches_type(ACL, acl, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.magic_transit.sites.acls.with_raw_response.edit( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_id` but received ''"): - await async_client.magic_transit.sites.acls.with_raw_response.edit( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `acl_identifier` but received ''"): - await async_client.magic_transit.sites.acls.with_raw_response.edit( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - acl = await async_client.magic_transit.sites.acls.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(ACL, acl, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.sites.acls.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - acl = await response.parse() - assert_matches_type(ACL, acl, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.sites.acls.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - acl = await response.parse() - assert_matches_type(ACL, acl, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.magic_transit.sites.acls.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_id` but received ''"): - await async_client.magic_transit.sites.acls.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `acl_identifier` but received ''"): - await async_client.magic_transit.sites.acls.with_raw_response.get( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - site_id="023e105f4ecef8ad9ca31a8372d0c353", - ) diff --git a/tests/api_resources/magic_transit/test_cf_interconnects.py b/tests/api_resources/magic_transit/test_cf_interconnects.py index 8869b789a89..836520620fb 100644 --- a/tests/api_resources/magic_transit/test_cf_interconnects.py +++ b/tests/api_resources/magic_transit/test_cf_interconnects.py @@ -9,11 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.magic_transit import ( - CfInterconnectGetResponse, - CfInterconnectListResponse, - CfInterconnectUpdateResponse, -) +from cloudflare.types.magic_transit import CfInterconnectListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -21,72 +17,6 @@ class TestCfInterconnects: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @parametrize - def test_method_update(self, client: Cloudflare) -> None: - cf_interconnect = client.magic_transit.cf_interconnects.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(CfInterconnectUpdateResponse, cf_interconnect, path=["response"]) - - @parametrize - def test_method_update_with_all_params(self, client: Cloudflare) -> None: - cf_interconnect = client.magic_transit.cf_interconnects.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - description="Tunnel for Interconnect to ORD", - gre={"cloudflare_endpoint": "203.0.113.1"}, - health_check={ - "enabled": True, - "rate": "low", - "target": "203.0.113.1", - "type": "request", - }, - interface_address="192.0.2.0/31", - mtu=0, - ) - assert_matches_type(CfInterconnectUpdateResponse, cf_interconnect, path=["response"]) - - @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.magic_transit.cf_interconnects.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - cf_interconnect = response.parse() - assert_matches_type(CfInterconnectUpdateResponse, cf_interconnect, path=["response"]) - - @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.magic_transit.cf_interconnects.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - cf_interconnect = response.parse() - assert_matches_type(CfInterconnectUpdateResponse, cf_interconnect, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.magic_transit.cf_interconnects.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): - client.magic_transit.cf_interconnects.with_raw_response.update( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - @parametrize def test_method_list(self, client: Cloudflare) -> None: cf_interconnect = client.magic_transit.cf_interconnects.list( @@ -125,124 +55,10 @@ def test_path_params_list(self, client: Cloudflare) -> None: account_id="", ) - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - cf_interconnect = client.magic_transit.cf_interconnects.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(CfInterconnectGetResponse, cf_interconnect, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.magic_transit.cf_interconnects.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - cf_interconnect = response.parse() - assert_matches_type(CfInterconnectGetResponse, cf_interconnect, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.magic_transit.cf_interconnects.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - cf_interconnect = response.parse() - assert_matches_type(CfInterconnectGetResponse, cf_interconnect, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.magic_transit.cf_interconnects.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): - client.magic_transit.cf_interconnects.with_raw_response.get( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - class TestAsyncCfInterconnects: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: - cf_interconnect = await async_client.magic_transit.cf_interconnects.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(CfInterconnectUpdateResponse, cf_interconnect, path=["response"]) - - @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: - cf_interconnect = await async_client.magic_transit.cf_interconnects.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - description="Tunnel for Interconnect to ORD", - gre={"cloudflare_endpoint": "203.0.113.1"}, - health_check={ - "enabled": True, - "rate": "low", - "target": "203.0.113.1", - "type": "request", - }, - interface_address="192.0.2.0/31", - mtu=0, - ) - assert_matches_type(CfInterconnectUpdateResponse, cf_interconnect, path=["response"]) - - @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.cf_interconnects.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - cf_interconnect = await response.parse() - assert_matches_type(CfInterconnectUpdateResponse, cf_interconnect, path=["response"]) - - @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.cf_interconnects.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - cf_interconnect = await response.parse() - assert_matches_type(CfInterconnectUpdateResponse, cf_interconnect, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.magic_transit.cf_interconnects.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): - await async_client.magic_transit.cf_interconnects.with_raw_response.update( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: cf_interconnect = await async_client.magic_transit.cf_interconnects.list( @@ -280,51 +96,3 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: await async_client.magic_transit.cf_interconnects.with_raw_response.list( account_id="", ) - - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - cf_interconnect = await async_client.magic_transit.cf_interconnects.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(CfInterconnectGetResponse, cf_interconnect, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.cf_interconnects.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - cf_interconnect = await response.parse() - assert_matches_type(CfInterconnectGetResponse, cf_interconnect, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.cf_interconnects.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - cf_interconnect = await response.parse() - assert_matches_type(CfInterconnectGetResponse, cf_interconnect, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.magic_transit.cf_interconnects.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): - await async_client.magic_transit.cf_interconnects.with_raw_response.get( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) diff --git a/tests/api_resources/magic_transit/test_gre_tunnels.py b/tests/api_resources/magic_transit/test_gre_tunnels.py index 4b34df6809b..7cbc640a0f5 100644 --- a/tests/api_resources/magic_transit/test_gre_tunnels.py +++ b/tests/api_resources/magic_transit/test_gre_tunnels.py @@ -9,13 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.magic_transit import ( - GRETunnelGetResponse, - GRETunnelListResponse, - GRETunnelCreateResponse, - GRETunnelDeleteResponse, - GRETunnelUpdateResponse, -) +from cloudflare.types.magic_transit import GRETunnelListResponse, GRETunnelCreateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -69,96 +63,6 @@ def test_path_params_create(self, client: Cloudflare) -> None: body={}, ) - @parametrize - def test_method_update(self, client: Cloudflare) -> None: - gre_tunnel = client.magic_transit.gre_tunnels.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cloudflare_gre_endpoint="203.0.113.1", - customer_gre_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="GRE_1", - ) - assert_matches_type(GRETunnelUpdateResponse, gre_tunnel, path=["response"]) - - @parametrize - def test_method_update_with_all_params(self, client: Cloudflare) -> None: - gre_tunnel = client.magic_transit.gre_tunnels.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cloudflare_gre_endpoint="203.0.113.1", - customer_gre_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="GRE_1", - description="Tunnel for ISP X", - health_check={ - "direction": "bidirectional", - "enabled": True, - "rate": "low", - "target": "203.0.113.1", - "type": "request", - }, - mtu=0, - ttl=0, - ) - assert_matches_type(GRETunnelUpdateResponse, gre_tunnel, path=["response"]) - - @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.magic_transit.gre_tunnels.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cloudflare_gre_endpoint="203.0.113.1", - customer_gre_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="GRE_1", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - gre_tunnel = response.parse() - assert_matches_type(GRETunnelUpdateResponse, gre_tunnel, path=["response"]) - - @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.magic_transit.gre_tunnels.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cloudflare_gre_endpoint="203.0.113.1", - customer_gre_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="GRE_1", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - gre_tunnel = response.parse() - assert_matches_type(GRETunnelUpdateResponse, gre_tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.magic_transit.gre_tunnels.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - cloudflare_gre_endpoint="203.0.113.1", - customer_gre_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="GRE_1", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): - client.magic_transit.gre_tunnels.with_raw_response.update( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cloudflare_gre_endpoint="203.0.113.1", - customer_gre_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="GRE_1", - ) - @parametrize def test_method_list(self, client: Cloudflare) -> None: gre_tunnel = client.magic_transit.gre_tunnels.list( @@ -197,102 +101,6 @@ def test_path_params_list(self, client: Cloudflare) -> None: account_id="", ) - @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - gre_tunnel = client.magic_transit.gre_tunnels.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(GRETunnelDeleteResponse, gre_tunnel, path=["response"]) - - @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.magic_transit.gre_tunnels.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - gre_tunnel = response.parse() - assert_matches_type(GRETunnelDeleteResponse, gre_tunnel, path=["response"]) - - @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.magic_transit.gre_tunnels.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - gre_tunnel = response.parse() - assert_matches_type(GRETunnelDeleteResponse, gre_tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.magic_transit.gre_tunnels.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): - client.magic_transit.gre_tunnels.with_raw_response.delete( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - gre_tunnel = client.magic_transit.gre_tunnels.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(GRETunnelGetResponse, gre_tunnel, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.magic_transit.gre_tunnels.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - gre_tunnel = response.parse() - assert_matches_type(GRETunnelGetResponse, gre_tunnel, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.magic_transit.gre_tunnels.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - gre_tunnel = response.parse() - assert_matches_type(GRETunnelGetResponse, gre_tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.magic_transit.gre_tunnels.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): - client.magic_transit.gre_tunnels.with_raw_response.get( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - class TestAsyncGRETunnels: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -343,96 +151,6 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: body={}, ) - @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: - gre_tunnel = await async_client.magic_transit.gre_tunnels.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cloudflare_gre_endpoint="203.0.113.1", - customer_gre_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="GRE_1", - ) - assert_matches_type(GRETunnelUpdateResponse, gre_tunnel, path=["response"]) - - @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: - gre_tunnel = await async_client.magic_transit.gre_tunnels.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cloudflare_gre_endpoint="203.0.113.1", - customer_gre_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="GRE_1", - description="Tunnel for ISP X", - health_check={ - "direction": "bidirectional", - "enabled": True, - "rate": "low", - "target": "203.0.113.1", - "type": "request", - }, - mtu=0, - ttl=0, - ) - assert_matches_type(GRETunnelUpdateResponse, gre_tunnel, path=["response"]) - - @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.gre_tunnels.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cloudflare_gre_endpoint="203.0.113.1", - customer_gre_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="GRE_1", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - gre_tunnel = await response.parse() - assert_matches_type(GRETunnelUpdateResponse, gre_tunnel, path=["response"]) - - @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.gre_tunnels.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cloudflare_gre_endpoint="203.0.113.1", - customer_gre_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="GRE_1", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - gre_tunnel = await response.parse() - assert_matches_type(GRETunnelUpdateResponse, gre_tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.magic_transit.gre_tunnels.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - cloudflare_gre_endpoint="203.0.113.1", - customer_gre_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="GRE_1", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): - await async_client.magic_transit.gre_tunnels.with_raw_response.update( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cloudflare_gre_endpoint="203.0.113.1", - customer_gre_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="GRE_1", - ) - @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: gre_tunnel = await async_client.magic_transit.gre_tunnels.list( @@ -470,99 +188,3 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: await async_client.magic_transit.gre_tunnels.with_raw_response.list( account_id="", ) - - @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - gre_tunnel = await async_client.magic_transit.gre_tunnels.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(GRETunnelDeleteResponse, gre_tunnel, path=["response"]) - - @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.gre_tunnels.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - gre_tunnel = await response.parse() - assert_matches_type(GRETunnelDeleteResponse, gre_tunnel, path=["response"]) - - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.gre_tunnels.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - gre_tunnel = await response.parse() - assert_matches_type(GRETunnelDeleteResponse, gre_tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.magic_transit.gre_tunnels.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): - await async_client.magic_transit.gre_tunnels.with_raw_response.delete( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - gre_tunnel = await async_client.magic_transit.gre_tunnels.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(GRETunnelGetResponse, gre_tunnel, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.gre_tunnels.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - gre_tunnel = await response.parse() - assert_matches_type(GRETunnelGetResponse, gre_tunnel, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.gre_tunnels.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - gre_tunnel = await response.parse() - assert_matches_type(GRETunnelGetResponse, gre_tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.magic_transit.gre_tunnels.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): - await async_client.magic_transit.gre_tunnels.with_raw_response.get( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) diff --git a/tests/api_resources/magic_transit/test_ipsec_tunnels.py b/tests/api_resources/magic_transit/test_ipsec_tunnels.py index e4ea142af03..9f0d27fcfa5 100644 --- a/tests/api_resources/magic_transit/test_ipsec_tunnels.py +++ b/tests/api_resources/magic_transit/test_ipsec_tunnels.py @@ -10,12 +10,8 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.magic_transit import ( - IPSECTunnelGetResponse, IPSECTunnelListResponse, IPSECTunnelCreateResponse, - IPSECTunnelDeleteResponse, - IPSECTunnelUpdateResponse, - IPSECTunnelPSKGenerateResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -95,91 +91,6 @@ def test_path_params_create(self, client: Cloudflare) -> None: name="IPsec_1", ) - @parametrize - def test_method_update(self, client: Cloudflare) -> None: - ipsec_tunnel = client.magic_transit.ipsec_tunnels.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cloudflare_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="IPsec_1", - ) - assert_matches_type(IPSECTunnelUpdateResponse, ipsec_tunnel, path=["response"]) - - @parametrize - def test_method_update_with_all_params(self, client: Cloudflare) -> None: - ipsec_tunnel = client.magic_transit.ipsec_tunnels.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cloudflare_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="IPsec_1", - customer_endpoint="203.0.113.1", - description="Tunnel for ISP X", - health_check={ - "direction": "bidirectional", - "enabled": True, - "rate": "low", - "target": "203.0.113.1", - "type": "request", - }, - psk="O3bwKSjnaoCxDoUxjcq4Rk8ZKkezQUiy", - replay_protection=False, - ) - assert_matches_type(IPSECTunnelUpdateResponse, ipsec_tunnel, path=["response"]) - - @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.magic_transit.ipsec_tunnels.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cloudflare_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="IPsec_1", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - ipsec_tunnel = response.parse() - assert_matches_type(IPSECTunnelUpdateResponse, ipsec_tunnel, path=["response"]) - - @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.magic_transit.ipsec_tunnels.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cloudflare_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="IPsec_1", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - ipsec_tunnel = response.parse() - assert_matches_type(IPSECTunnelUpdateResponse, ipsec_tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.magic_transit.ipsec_tunnels.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - cloudflare_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="IPsec_1", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): - client.magic_transit.ipsec_tunnels.with_raw_response.update( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cloudflare_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="IPsec_1", - ) - @parametrize def test_method_list(self, client: Cloudflare) -> None: ipsec_tunnel = client.magic_transit.ipsec_tunnels.list( @@ -218,155 +129,6 @@ def test_path_params_list(self, client: Cloudflare) -> None: account_id="", ) - @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - ipsec_tunnel = client.magic_transit.ipsec_tunnels.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(IPSECTunnelDeleteResponse, ipsec_tunnel, path=["response"]) - - @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.magic_transit.ipsec_tunnels.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - ipsec_tunnel = response.parse() - assert_matches_type(IPSECTunnelDeleteResponse, ipsec_tunnel, path=["response"]) - - @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.magic_transit.ipsec_tunnels.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - ipsec_tunnel = response.parse() - assert_matches_type(IPSECTunnelDeleteResponse, ipsec_tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.magic_transit.ipsec_tunnels.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): - client.magic_transit.ipsec_tunnels.with_raw_response.delete( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - ipsec_tunnel = client.magic_transit.ipsec_tunnels.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(IPSECTunnelGetResponse, ipsec_tunnel, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.magic_transit.ipsec_tunnels.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - ipsec_tunnel = response.parse() - assert_matches_type(IPSECTunnelGetResponse, ipsec_tunnel, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.magic_transit.ipsec_tunnels.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - ipsec_tunnel = response.parse() - assert_matches_type(IPSECTunnelGetResponse, ipsec_tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.magic_transit.ipsec_tunnels.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): - client.magic_transit.ipsec_tunnels.with_raw_response.get( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - def test_method_psk_generate(self, client: Cloudflare) -> None: - ipsec_tunnel = client.magic_transit.ipsec_tunnels.psk_generate( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) - assert_matches_type(IPSECTunnelPSKGenerateResponse, ipsec_tunnel, path=["response"]) - - @parametrize - def test_raw_response_psk_generate(self, client: Cloudflare) -> None: - response = client.magic_transit.ipsec_tunnels.with_raw_response.psk_generate( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - ipsec_tunnel = response.parse() - assert_matches_type(IPSECTunnelPSKGenerateResponse, ipsec_tunnel, path=["response"]) - - @parametrize - def test_streaming_response_psk_generate(self, client: Cloudflare) -> None: - with client.magic_transit.ipsec_tunnels.with_streaming_response.psk_generate( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - ipsec_tunnel = response.parse() - assert_matches_type(IPSECTunnelPSKGenerateResponse, ipsec_tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_psk_generate(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.magic_transit.ipsec_tunnels.with_raw_response.psk_generate( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - body={}, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): - client.magic_transit.ipsec_tunnels.with_raw_response.psk_generate( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) - class TestAsyncIPSECTunnels: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -442,91 +204,6 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: name="IPsec_1", ) - @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: - ipsec_tunnel = await async_client.magic_transit.ipsec_tunnels.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cloudflare_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="IPsec_1", - ) - assert_matches_type(IPSECTunnelUpdateResponse, ipsec_tunnel, path=["response"]) - - @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: - ipsec_tunnel = await async_client.magic_transit.ipsec_tunnels.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cloudflare_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="IPsec_1", - customer_endpoint="203.0.113.1", - description="Tunnel for ISP X", - health_check={ - "direction": "bidirectional", - "enabled": True, - "rate": "low", - "target": "203.0.113.1", - "type": "request", - }, - psk="O3bwKSjnaoCxDoUxjcq4Rk8ZKkezQUiy", - replay_protection=False, - ) - assert_matches_type(IPSECTunnelUpdateResponse, ipsec_tunnel, path=["response"]) - - @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.ipsec_tunnels.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cloudflare_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="IPsec_1", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - ipsec_tunnel = await response.parse() - assert_matches_type(IPSECTunnelUpdateResponse, ipsec_tunnel, path=["response"]) - - @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.ipsec_tunnels.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cloudflare_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="IPsec_1", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - ipsec_tunnel = await response.parse() - assert_matches_type(IPSECTunnelUpdateResponse, ipsec_tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.magic_transit.ipsec_tunnels.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - cloudflare_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="IPsec_1", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): - await async_client.magic_transit.ipsec_tunnels.with_raw_response.update( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cloudflare_endpoint="203.0.113.1", - interface_address="192.0.2.0/31", - name="IPsec_1", - ) - @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: ipsec_tunnel = await async_client.magic_transit.ipsec_tunnels.list( @@ -564,152 +241,3 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: await async_client.magic_transit.ipsec_tunnels.with_raw_response.list( account_id="", ) - - @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - ipsec_tunnel = await async_client.magic_transit.ipsec_tunnels.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(IPSECTunnelDeleteResponse, ipsec_tunnel, path=["response"]) - - @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.ipsec_tunnels.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - ipsec_tunnel = await response.parse() - assert_matches_type(IPSECTunnelDeleteResponse, ipsec_tunnel, path=["response"]) - - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.ipsec_tunnels.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - ipsec_tunnel = await response.parse() - assert_matches_type(IPSECTunnelDeleteResponse, ipsec_tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.magic_transit.ipsec_tunnels.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): - await async_client.magic_transit.ipsec_tunnels.with_raw_response.delete( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - ipsec_tunnel = await async_client.magic_transit.ipsec_tunnels.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(IPSECTunnelGetResponse, ipsec_tunnel, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.ipsec_tunnels.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - ipsec_tunnel = await response.parse() - assert_matches_type(IPSECTunnelGetResponse, ipsec_tunnel, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.ipsec_tunnels.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - ipsec_tunnel = await response.parse() - assert_matches_type(IPSECTunnelGetResponse, ipsec_tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.magic_transit.ipsec_tunnels.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): - await async_client.magic_transit.ipsec_tunnels.with_raw_response.get( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - async def test_method_psk_generate(self, async_client: AsyncCloudflare) -> None: - ipsec_tunnel = await async_client.magic_transit.ipsec_tunnels.psk_generate( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) - assert_matches_type(IPSECTunnelPSKGenerateResponse, ipsec_tunnel, path=["response"]) - - @parametrize - async def test_raw_response_psk_generate(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.ipsec_tunnels.with_raw_response.psk_generate( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - ipsec_tunnel = await response.parse() - assert_matches_type(IPSECTunnelPSKGenerateResponse, ipsec_tunnel, path=["response"]) - - @parametrize - async def test_streaming_response_psk_generate(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.ipsec_tunnels.with_streaming_response.psk_generate( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - ipsec_tunnel = await response.parse() - assert_matches_type(IPSECTunnelPSKGenerateResponse, ipsec_tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_psk_generate(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.magic_transit.ipsec_tunnels.with_raw_response.psk_generate( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - body={}, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): - await async_client.magic_transit.ipsec_tunnels.with_raw_response.psk_generate( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) diff --git a/tests/api_resources/magic_transit/test_routes.py b/tests/api_resources/magic_transit/test_routes.py index 20866b7a330..78985a57c3d 100644 --- a/tests/api_resources/magic_transit/test_routes.py +++ b/tests/api_resources/magic_transit/test_routes.py @@ -10,12 +10,9 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.magic_transit import ( - RouteGetResponse, RouteListResponse, RouteEmptyResponse, RouteCreateResponse, - RouteDeleteResponse, - RouteUpdateResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -70,86 +67,6 @@ def test_path_params_create(self, client: Cloudflare) -> None: body={}, ) - @parametrize - def test_method_update(self, client: Cloudflare) -> None: - route = client.magic_transit.routes.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - nexthop="203.0.113.1", - prefix="192.0.2.0/24", - priority=0, - ) - assert_matches_type(RouteUpdateResponse, route, path=["response"]) - - @parametrize - def test_method_update_with_all_params(self, client: Cloudflare) -> None: - route = client.magic_transit.routes.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - nexthop="203.0.113.1", - prefix="192.0.2.0/24", - priority=0, - description="New route for new prefix 203.0.113.1", - scope={ - "colo_names": ["den01", "den01", "den01"], - "colo_regions": ["APAC", "APAC", "APAC"], - }, - weight=0, - ) - assert_matches_type(RouteUpdateResponse, route, path=["response"]) - - @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.magic_transit.routes.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - nexthop="203.0.113.1", - prefix="192.0.2.0/24", - priority=0, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - route = response.parse() - assert_matches_type(RouteUpdateResponse, route, path=["response"]) - - @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.magic_transit.routes.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - nexthop="203.0.113.1", - prefix="192.0.2.0/24", - priority=0, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - route = response.parse() - assert_matches_type(RouteUpdateResponse, route, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.magic_transit.routes.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - nexthop="203.0.113.1", - prefix="192.0.2.0/24", - priority=0, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_identifier` but received ''"): - client.magic_transit.routes.with_raw_response.update( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - nexthop="203.0.113.1", - prefix="192.0.2.0/24", - priority=0, - ) - @parametrize def test_method_list(self, client: Cloudflare) -> None: route = client.magic_transit.routes.list( @@ -188,54 +105,6 @@ def test_path_params_list(self, client: Cloudflare) -> None: account_id="", ) - @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - route = client.magic_transit.routes.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(RouteDeleteResponse, route, path=["response"]) - - @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.magic_transit.routes.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - route = response.parse() - assert_matches_type(RouteDeleteResponse, route, path=["response"]) - - @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.magic_transit.routes.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - route = response.parse() - assert_matches_type(RouteDeleteResponse, route, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.magic_transit.routes.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_identifier` but received ''"): - client.magic_transit.routes.with_raw_response.delete( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - @parametrize def test_method_empty(self, client: Cloudflare) -> None: route = client.magic_transit.routes.empty( @@ -274,54 +143,6 @@ def test_path_params_empty(self, client: Cloudflare) -> None: account_id="", ) - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - route = client.magic_transit.routes.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(RouteGetResponse, route, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.magic_transit.routes.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - route = response.parse() - assert_matches_type(RouteGetResponse, route, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.magic_transit.routes.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - route = response.parse() - assert_matches_type(RouteGetResponse, route, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.magic_transit.routes.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_identifier` but received ''"): - client.magic_transit.routes.with_raw_response.get( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - class TestAsyncRoutes: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -372,86 +193,6 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: body={}, ) - @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: - route = await async_client.magic_transit.routes.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - nexthop="203.0.113.1", - prefix="192.0.2.0/24", - priority=0, - ) - assert_matches_type(RouteUpdateResponse, route, path=["response"]) - - @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: - route = await async_client.magic_transit.routes.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - nexthop="203.0.113.1", - prefix="192.0.2.0/24", - priority=0, - description="New route for new prefix 203.0.113.1", - scope={ - "colo_names": ["den01", "den01", "den01"], - "colo_regions": ["APAC", "APAC", "APAC"], - }, - weight=0, - ) - assert_matches_type(RouteUpdateResponse, route, path=["response"]) - - @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.routes.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - nexthop="203.0.113.1", - prefix="192.0.2.0/24", - priority=0, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - route = await response.parse() - assert_matches_type(RouteUpdateResponse, route, path=["response"]) - - @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.routes.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - nexthop="203.0.113.1", - prefix="192.0.2.0/24", - priority=0, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - route = await response.parse() - assert_matches_type(RouteUpdateResponse, route, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.magic_transit.routes.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - nexthop="203.0.113.1", - prefix="192.0.2.0/24", - priority=0, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_identifier` but received ''"): - await async_client.magic_transit.routes.with_raw_response.update( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - nexthop="203.0.113.1", - prefix="192.0.2.0/24", - priority=0, - ) - @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: route = await async_client.magic_transit.routes.list( @@ -490,54 +231,6 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: account_id="", ) - @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - route = await async_client.magic_transit.routes.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(RouteDeleteResponse, route, path=["response"]) - - @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.routes.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - route = await response.parse() - assert_matches_type(RouteDeleteResponse, route, path=["response"]) - - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.routes.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - route = await response.parse() - assert_matches_type(RouteDeleteResponse, route, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.magic_transit.routes.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_identifier` but received ''"): - await async_client.magic_transit.routes.with_raw_response.delete( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - @parametrize async def test_method_empty(self, async_client: AsyncCloudflare) -> None: route = await async_client.magic_transit.routes.empty( @@ -575,51 +268,3 @@ async def test_path_params_empty(self, async_client: AsyncCloudflare) -> None: await async_client.magic_transit.routes.with_raw_response.empty( account_id="", ) - - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - route = await async_client.magic_transit.routes.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(RouteGetResponse, route, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.routes.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - route = await response.parse() - assert_matches_type(RouteGetResponse, route, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.routes.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - route = await response.parse() - assert_matches_type(RouteGetResponse, route, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.magic_transit.routes.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_identifier` but received ''"): - await async_client.magic_transit.routes.with_raw_response.get( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - )