From 3a5ff14d810fcacd185803277040f2bc14599664 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 12 Apr 2024 00:25:16 +0000 Subject: [PATCH] feat(api): update via SDK Studio (#299) --- api.md | 3 +- src/cloudflare/_client.py | 16 ++-- src/cloudflare/resources/__init__.py | 24 ++--- src/cloudflare/resources/warp_connector.py | 38 ++++---- src/cloudflare/types/__init__.py | 1 + src/cloudflare/types/warp_connector.py | 90 ++++++++++++++++++ .../types/warp_connector_create_response.py | 92 +------------------ .../types/warp_connector_delete_response.py | 92 +------------------ .../types/warp_connector_edit_response.py | 92 +------------------ .../types/warp_connector_get_response.py | 92 +------------------ .../types/warp_connector_list_response.py | 92 +------------------ .../types/zero_trust/tunnel_edit_response.py | 92 +------------------ .../types/zero_trust/tunnel_list_response.py | 92 +------------------ 13 files changed, 160 insertions(+), 656 deletions(-) create mode 100644 src/cloudflare/types/warp_connector.py diff --git a/api.md b/api.md index 229e19728c82..c6b33370fb6e 100644 --- a/api.md +++ b/api.md @@ -4595,12 +4595,13 @@ Methods: - client.r2.sippy.delete(bucket_name, \*, account_id) -> SippyDeleteResponse - client.r2.sippy.get(bucket_name, \*, account_id) -> Sippy -# WARPConnector +# WARPConnectorResource Types: ```python from cloudflare.types import ( + WARPConnector, WARPConnectorCreateResponse, WARPConnectorListResponse, WARPConnectorDeleteResponse, diff --git a/src/cloudflare/_client.py b/src/cloudflare/_client.py index 000dc7fe45a7..d85574035e04 100644 --- a/src/cloudflare/_client.py +++ b/src/cloudflare/_client.py @@ -110,7 +110,7 @@ class Cloudflare(SyncAPIClient): alerting: resources.Alerting d1: resources.D1Resource r2: resources.R2 - warp_connector: resources.WARPConnector + warp_connector: resources.WARPConnectorResource workers_for_platforms: resources.WorkersForPlatforms zero_trust: resources.ZeroTrust challenges: resources.Challenges @@ -265,7 +265,7 @@ def __init__( self.alerting = resources.Alerting(self) self.d1 = resources.D1Resource(self) self.r2 = resources.R2(self) - self.warp_connector = resources.WARPConnector(self) + self.warp_connector = resources.WARPConnectorResource(self) self.workers_for_platforms = resources.WorkersForPlatforms(self) self.zero_trust = resources.ZeroTrust(self) self.challenges = resources.Challenges(self) @@ -523,7 +523,7 @@ class AsyncCloudflare(AsyncAPIClient): alerting: resources.AsyncAlerting d1: resources.AsyncD1Resource r2: resources.AsyncR2 - warp_connector: resources.AsyncWARPConnector + warp_connector: resources.AsyncWARPConnectorResource workers_for_platforms: resources.AsyncWorkersForPlatforms zero_trust: resources.AsyncZeroTrust challenges: resources.AsyncChallenges @@ -678,7 +678,7 @@ def __init__( self.alerting = resources.AsyncAlerting(self) self.d1 = resources.AsyncD1Resource(self) self.r2 = resources.AsyncR2(self) - self.warp_connector = resources.AsyncWARPConnector(self) + self.warp_connector = resources.AsyncWARPConnectorResource(self) self.workers_for_platforms = resources.AsyncWorkersForPlatforms(self) self.zero_trust = resources.AsyncZeroTrust(self) self.challenges = resources.AsyncChallenges(self) @@ -937,7 +937,7 @@ def __init__(self, client: Cloudflare) -> None: self.alerting = resources.AlertingWithRawResponse(client.alerting) self.d1 = resources.D1ResourceWithRawResponse(client.d1) self.r2 = resources.R2WithRawResponse(client.r2) - self.warp_connector = resources.WARPConnectorWithRawResponse(client.warp_connector) + self.warp_connector = resources.WARPConnectorResourceWithRawResponse(client.warp_connector) self.workers_for_platforms = resources.WorkersForPlatformsWithRawResponse(client.workers_for_platforms) self.zero_trust = resources.ZeroTrustWithRawResponse(client.zero_trust) self.challenges = resources.ChallengesWithRawResponse(client.challenges) @@ -1027,7 +1027,7 @@ def __init__(self, client: AsyncCloudflare) -> None: self.alerting = resources.AsyncAlertingWithRawResponse(client.alerting) self.d1 = resources.AsyncD1ResourceWithRawResponse(client.d1) self.r2 = resources.AsyncR2WithRawResponse(client.r2) - self.warp_connector = resources.AsyncWARPConnectorWithRawResponse(client.warp_connector) + self.warp_connector = resources.AsyncWARPConnectorResourceWithRawResponse(client.warp_connector) self.workers_for_platforms = resources.AsyncWorkersForPlatformsWithRawResponse(client.workers_for_platforms) self.zero_trust = resources.AsyncZeroTrustWithRawResponse(client.zero_trust) self.challenges = resources.AsyncChallengesWithRawResponse(client.challenges) @@ -1117,7 +1117,7 @@ def __init__(self, client: Cloudflare) -> None: self.alerting = resources.AlertingWithStreamingResponse(client.alerting) self.d1 = resources.D1ResourceWithStreamingResponse(client.d1) self.r2 = resources.R2WithStreamingResponse(client.r2) - self.warp_connector = resources.WARPConnectorWithStreamingResponse(client.warp_connector) + self.warp_connector = resources.WARPConnectorResourceWithStreamingResponse(client.warp_connector) self.workers_for_platforms = resources.WorkersForPlatformsWithStreamingResponse(client.workers_for_platforms) self.zero_trust = resources.ZeroTrustWithStreamingResponse(client.zero_trust) self.challenges = resources.ChallengesWithStreamingResponse(client.challenges) @@ -1211,7 +1211,7 @@ def __init__(self, client: AsyncCloudflare) -> None: self.alerting = resources.AsyncAlertingWithStreamingResponse(client.alerting) self.d1 = resources.AsyncD1ResourceWithStreamingResponse(client.d1) self.r2 = resources.AsyncR2WithStreamingResponse(client.r2) - self.warp_connector = resources.AsyncWARPConnectorWithStreamingResponse(client.warp_connector) + self.warp_connector = resources.AsyncWARPConnectorResourceWithStreamingResponse(client.warp_connector) self.workers_for_platforms = resources.AsyncWorkersForPlatformsWithStreamingResponse( client.workers_for_platforms ) diff --git a/src/cloudflare/resources/__init__.py b/src/cloudflare/resources/__init__.py index 22875e389ef5..096d7cfd8ea4 100644 --- a/src/cloudflare/resources/__init__.py +++ b/src/cloudflare/resources/__init__.py @@ -497,12 +497,12 @@ AsyncLoadBalancersWithStreamingResponse, ) from .warp_connector import ( - WARPConnector, - AsyncWARPConnector, - WARPConnectorWithRawResponse, - AsyncWARPConnectorWithRawResponse, - WARPConnectorWithStreamingResponse, - AsyncWARPConnectorWithStreamingResponse, + WARPConnectorResource, + AsyncWARPConnectorResource, + WARPConnectorResourceWithRawResponse, + AsyncWARPConnectorResourceWithRawResponse, + WARPConnectorResourceWithStreamingResponse, + AsyncWARPConnectorResourceWithStreamingResponse, ) from .durable_objects import ( DurableObjects, @@ -1020,12 +1020,12 @@ "AsyncR2WithRawResponse", "R2WithStreamingResponse", "AsyncR2WithStreamingResponse", - "WARPConnector", - "AsyncWARPConnector", - "WARPConnectorWithRawResponse", - "AsyncWARPConnectorWithRawResponse", - "WARPConnectorWithStreamingResponse", - "AsyncWARPConnectorWithStreamingResponse", + "WARPConnectorResource", + "AsyncWARPConnectorResource", + "WARPConnectorResourceWithRawResponse", + "AsyncWARPConnectorResourceWithRawResponse", + "WARPConnectorResourceWithStreamingResponse", + "AsyncWARPConnectorResourceWithStreamingResponse", "WorkersForPlatforms", "AsyncWorkersForPlatforms", "WorkersForPlatformsWithRawResponse", diff --git a/src/cloudflare/resources/warp_connector.py b/src/cloudflare/resources/warp_connector.py index c25a010f0d31..e817d0728462 100644 --- a/src/cloudflare/resources/warp_connector.py +++ b/src/cloudflare/resources/warp_connector.py @@ -39,17 +39,17 @@ make_request_options, ) -__all__ = ["WARPConnector", "AsyncWARPConnector"] +__all__ = ["WARPConnectorResource", "AsyncWARPConnectorResource"] -class WARPConnector(SyncAPIResource): +class WARPConnectorResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> WARPConnectorWithRawResponse: - return WARPConnectorWithRawResponse(self) + def with_raw_response(self) -> WARPConnectorResourceWithRawResponse: + return WARPConnectorResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> WARPConnectorWithStreamingResponse: - return WARPConnectorWithStreamingResponse(self) + def with_streaming_response(self) -> WARPConnectorResourceWithStreamingResponse: + return WARPConnectorResourceWithStreamingResponse(self) def create( self, @@ -393,14 +393,14 @@ def token( ) -class AsyncWARPConnector(AsyncAPIResource): +class AsyncWARPConnectorResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncWARPConnectorWithRawResponse: - return AsyncWARPConnectorWithRawResponse(self) + def with_raw_response(self) -> AsyncWARPConnectorResourceWithRawResponse: + return AsyncWARPConnectorResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncWARPConnectorWithStreamingResponse: - return AsyncWARPConnectorWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncWARPConnectorResourceWithStreamingResponse: + return AsyncWARPConnectorResourceWithStreamingResponse(self) async def create( self, @@ -746,8 +746,8 @@ async def token( ) -class WARPConnectorWithRawResponse: - def __init__(self, warp_connector: WARPConnector) -> None: +class WARPConnectorResourceWithRawResponse: + def __init__(self, warp_connector: WARPConnectorResource) -> None: self._warp_connector = warp_connector self.create = to_raw_response_wrapper( @@ -770,8 +770,8 @@ def __init__(self, warp_connector: WARPConnector) -> None: ) -class AsyncWARPConnectorWithRawResponse: - def __init__(self, warp_connector: AsyncWARPConnector) -> None: +class AsyncWARPConnectorResourceWithRawResponse: + def __init__(self, warp_connector: AsyncWARPConnectorResource) -> None: self._warp_connector = warp_connector self.create = async_to_raw_response_wrapper( @@ -794,8 +794,8 @@ def __init__(self, warp_connector: AsyncWARPConnector) -> None: ) -class WARPConnectorWithStreamingResponse: - def __init__(self, warp_connector: WARPConnector) -> None: +class WARPConnectorResourceWithStreamingResponse: + def __init__(self, warp_connector: WARPConnectorResource) -> None: self._warp_connector = warp_connector self.create = to_streamed_response_wrapper( @@ -818,8 +818,8 @@ def __init__(self, warp_connector: WARPConnector) -> None: ) -class AsyncWARPConnectorWithStreamingResponse: - def __init__(self, warp_connector: AsyncWARPConnector) -> None: +class AsyncWARPConnectorResourceWithStreamingResponse: + def __init__(self, warp_connector: AsyncWARPConnectorResource) -> None: self._warp_connector = warp_connector self.create = async_to_streamed_response_wrapper( diff --git a/src/cloudflare/types/__init__.py b/src/cloudflare/types/__init__.py index 827978ab0d01..566b16253515 100644 --- a/src/cloudflare/types/__init__.py +++ b/src/cloudflare/types/__init__.py @@ -78,6 +78,7 @@ from .ip_list_params import IPListParams as IPListParams from .labeled_region import LabeledRegion as LabeledRegion from .migration_step import MigrationStep as MigrationStep +from .warp_connector import WARPConnector as WARPConnector from .allowed_origins import AllowedOrigins as AllowedOrigins from .firewall_filter import FirewallFilter as FirewallFilter from .origin_steering import OriginSteering as OriginSteering diff --git a/src/cloudflare/types/warp_connector.py b/src/cloudflare/types/warp_connector.py new file mode 100644 index 000000000000..b38246c800ab --- /dev/null +++ b/src/cloudflare/types/warp_connector.py @@ -0,0 +1,90 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["WARPConnector", "Connection"] + + +class Connection(BaseModel): + id: Optional[str] = None + """UUID of the Cloudflare Tunnel connection.""" + + client_id: Optional[object] = None + """UUID of the cloudflared instance.""" + + client_version: Optional[str] = None + """The cloudflared version used to establish this connection.""" + + colo_name: Optional[str] = None + """The Cloudflare data center used for this connection.""" + + is_pending_reconnect: Optional[bool] = None + """ + Cloudflare continues to track connections for several minutes after they + disconnect. This is an optimization to improve latency and reliability of + reconnecting. If `true`, the connection has disconnected but is still being + tracked. If `false`, the connection is actively serving traffic. + """ + + opened_at: Optional[datetime] = None + """Timestamp of when the connection was established.""" + + origin_ip: Optional[str] = None + """The public IP address of the host running cloudflared.""" + + uuid: Optional[str] = None + """UUID of the Cloudflare Tunnel connection.""" + + +class WARPConnector(BaseModel): + id: Optional[str] = None + """UUID of the tunnel.""" + + account_tag: Optional[str] = None + """Cloudflare account ID""" + + connections: Optional[List[Connection]] = None + """The Cloudflare Tunnel connections between your origin and Cloudflare's edge.""" + + conns_active_at: Optional[datetime] = None + """ + Timestamp of when the tunnel established at least one connection to Cloudflare's + edge. If `null`, the tunnel is inactive. + """ + + conns_inactive_at: Optional[datetime] = None + """ + Timestamp of when the tunnel became inactive (no connections to Cloudflare's + edge). If `null`, the tunnel is active. + """ + + created_at: Optional[datetime] = None + """Timestamp of when the tunnel was created.""" + + deleted_at: Optional[datetime] = None + """Timestamp of when the tunnel was deleted. + + If `null`, the tunnel has not been deleted. + """ + + metadata: Optional[object] = None + """Metadata associated with the tunnel.""" + + name: Optional[str] = None + """A user-friendly name for the tunnel.""" + + status: Optional[str] = None + """The status of the tunnel. + + Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is + active and able to serve traffic but in an unhealthy state), `healthy` (tunnel + is active and able to serve traffic), or `down` (tunnel can not serve traffic as + it has no connections to the Cloudflare Edge). + """ + + tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None + """The type of tunnel.""" diff --git a/src/cloudflare/types/warp_connector_create_response.py b/src/cloudflare/types/warp_connector_create_response.py index dd87278a2aa0..02aa7e8a64e0 100644 --- a/src/cloudflare/types/warp_connector_create_response.py +++ b/src/cloudflare/types/warp_connector_create_response.py @@ -1,94 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal +from typing import Union -from .._models import BaseModel from .zero_trust import Tunnel +from .warp_connector import WARPConnector -__all__ = ["WARPConnectorCreateResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] +__all__ = ["WARPConnectorCreateResponse"] - -class TunnelWARPConnectorTunnelConnection(BaseModel): - id: Optional[str] = None - """UUID of the Cloudflare Tunnel connection.""" - - client_id: Optional[object] = None - """UUID of the cloudflared instance.""" - - client_version: Optional[str] = None - """The cloudflared version used to establish this connection.""" - - colo_name: Optional[str] = None - """The Cloudflare data center used for this connection.""" - - is_pending_reconnect: Optional[bool] = None - """ - Cloudflare continues to track connections for several minutes after they - disconnect. This is an optimization to improve latency and reliability of - reconnecting. If `true`, the connection has disconnected but is still being - tracked. If `false`, the connection is actively serving traffic. - """ - - opened_at: Optional[datetime] = None - """Timestamp of when the connection was established.""" - - origin_ip: Optional[str] = None - """The public IP address of the host running cloudflared.""" - - uuid: Optional[str] = None - """UUID of the Cloudflare Tunnel connection.""" - - -class TunnelWARPConnectorTunnel(BaseModel): - id: Optional[str] = None - """UUID of the tunnel.""" - - account_tag: Optional[str] = None - """Cloudflare account ID""" - - connections: Optional[List[TunnelWARPConnectorTunnelConnection]] = None - """The Cloudflare Tunnel connections between your origin and Cloudflare's edge.""" - - conns_active_at: Optional[datetime] = None - """ - Timestamp of when the tunnel established at least one connection to Cloudflare's - edge. If `null`, the tunnel is inactive. - """ - - conns_inactive_at: Optional[datetime] = None - """ - Timestamp of when the tunnel became inactive (no connections to Cloudflare's - edge). If `null`, the tunnel is active. - """ - - created_at: Optional[datetime] = None - """Timestamp of when the tunnel was created.""" - - deleted_at: Optional[datetime] = None - """Timestamp of when the tunnel was deleted. - - If `null`, the tunnel has not been deleted. - """ - - metadata: Optional[object] = None - """Metadata associated with the tunnel.""" - - name: Optional[str] = None - """A user-friendly name for the tunnel.""" - - status: Optional[str] = None - """The status of the tunnel. - - Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is - active and able to serve traffic but in an unhealthy state), `healthy` (tunnel - is active and able to serve traffic), or `down` (tunnel can not serve traffic as - it has no connections to the Cloudflare Edge). - """ - - tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None - """The type of tunnel.""" - - -WARPConnectorCreateResponse = Union[Tunnel, TunnelWARPConnectorTunnel] +WARPConnectorCreateResponse = Union[Tunnel, WARPConnector] diff --git a/src/cloudflare/types/warp_connector_delete_response.py b/src/cloudflare/types/warp_connector_delete_response.py index e9343999295c..a5d9622b0770 100644 --- a/src/cloudflare/types/warp_connector_delete_response.py +++ b/src/cloudflare/types/warp_connector_delete_response.py @@ -1,94 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal +from typing import Union -from .._models import BaseModel from .zero_trust import Tunnel +from .warp_connector import WARPConnector -__all__ = ["WARPConnectorDeleteResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] +__all__ = ["WARPConnectorDeleteResponse"] - -class TunnelWARPConnectorTunnelConnection(BaseModel): - id: Optional[str] = None - """UUID of the Cloudflare Tunnel connection.""" - - client_id: Optional[object] = None - """UUID of the cloudflared instance.""" - - client_version: Optional[str] = None - """The cloudflared version used to establish this connection.""" - - colo_name: Optional[str] = None - """The Cloudflare data center used for this connection.""" - - is_pending_reconnect: Optional[bool] = None - """ - Cloudflare continues to track connections for several minutes after they - disconnect. This is an optimization to improve latency and reliability of - reconnecting. If `true`, the connection has disconnected but is still being - tracked. If `false`, the connection is actively serving traffic. - """ - - opened_at: Optional[datetime] = None - """Timestamp of when the connection was established.""" - - origin_ip: Optional[str] = None - """The public IP address of the host running cloudflared.""" - - uuid: Optional[str] = None - """UUID of the Cloudflare Tunnel connection.""" - - -class TunnelWARPConnectorTunnel(BaseModel): - id: Optional[str] = None - """UUID of the tunnel.""" - - account_tag: Optional[str] = None - """Cloudflare account ID""" - - connections: Optional[List[TunnelWARPConnectorTunnelConnection]] = None - """The Cloudflare Tunnel connections between your origin and Cloudflare's edge.""" - - conns_active_at: Optional[datetime] = None - """ - Timestamp of when the tunnel established at least one connection to Cloudflare's - edge. If `null`, the tunnel is inactive. - """ - - conns_inactive_at: Optional[datetime] = None - """ - Timestamp of when the tunnel became inactive (no connections to Cloudflare's - edge). If `null`, the tunnel is active. - """ - - created_at: Optional[datetime] = None - """Timestamp of when the tunnel was created.""" - - deleted_at: Optional[datetime] = None - """Timestamp of when the tunnel was deleted. - - If `null`, the tunnel has not been deleted. - """ - - metadata: Optional[object] = None - """Metadata associated with the tunnel.""" - - name: Optional[str] = None - """A user-friendly name for the tunnel.""" - - status: Optional[str] = None - """The status of the tunnel. - - Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is - active and able to serve traffic but in an unhealthy state), `healthy` (tunnel - is active and able to serve traffic), or `down` (tunnel can not serve traffic as - it has no connections to the Cloudflare Edge). - """ - - tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None - """The type of tunnel.""" - - -WARPConnectorDeleteResponse = Union[Tunnel, TunnelWARPConnectorTunnel] +WARPConnectorDeleteResponse = Union[Tunnel, WARPConnector] diff --git a/src/cloudflare/types/warp_connector_edit_response.py b/src/cloudflare/types/warp_connector_edit_response.py index 69103522d3bc..cecd76b58350 100644 --- a/src/cloudflare/types/warp_connector_edit_response.py +++ b/src/cloudflare/types/warp_connector_edit_response.py @@ -1,94 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal +from typing import Union -from .._models import BaseModel from .zero_trust import Tunnel +from .warp_connector import WARPConnector -__all__ = ["WARPConnectorEditResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] +__all__ = ["WARPConnectorEditResponse"] - -class TunnelWARPConnectorTunnelConnection(BaseModel): - id: Optional[str] = None - """UUID of the Cloudflare Tunnel connection.""" - - client_id: Optional[object] = None - """UUID of the cloudflared instance.""" - - client_version: Optional[str] = None - """The cloudflared version used to establish this connection.""" - - colo_name: Optional[str] = None - """The Cloudflare data center used for this connection.""" - - is_pending_reconnect: Optional[bool] = None - """ - Cloudflare continues to track connections for several minutes after they - disconnect. This is an optimization to improve latency and reliability of - reconnecting. If `true`, the connection has disconnected but is still being - tracked. If `false`, the connection is actively serving traffic. - """ - - opened_at: Optional[datetime] = None - """Timestamp of when the connection was established.""" - - origin_ip: Optional[str] = None - """The public IP address of the host running cloudflared.""" - - uuid: Optional[str] = None - """UUID of the Cloudflare Tunnel connection.""" - - -class TunnelWARPConnectorTunnel(BaseModel): - id: Optional[str] = None - """UUID of the tunnel.""" - - account_tag: Optional[str] = None - """Cloudflare account ID""" - - connections: Optional[List[TunnelWARPConnectorTunnelConnection]] = None - """The Cloudflare Tunnel connections between your origin and Cloudflare's edge.""" - - conns_active_at: Optional[datetime] = None - """ - Timestamp of when the tunnel established at least one connection to Cloudflare's - edge. If `null`, the tunnel is inactive. - """ - - conns_inactive_at: Optional[datetime] = None - """ - Timestamp of when the tunnel became inactive (no connections to Cloudflare's - edge). If `null`, the tunnel is active. - """ - - created_at: Optional[datetime] = None - """Timestamp of when the tunnel was created.""" - - deleted_at: Optional[datetime] = None - """Timestamp of when the tunnel was deleted. - - If `null`, the tunnel has not been deleted. - """ - - metadata: Optional[object] = None - """Metadata associated with the tunnel.""" - - name: Optional[str] = None - """A user-friendly name for the tunnel.""" - - status: Optional[str] = None - """The status of the tunnel. - - Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is - active and able to serve traffic but in an unhealthy state), `healthy` (tunnel - is active and able to serve traffic), or `down` (tunnel can not serve traffic as - it has no connections to the Cloudflare Edge). - """ - - tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None - """The type of tunnel.""" - - -WARPConnectorEditResponse = Union[Tunnel, TunnelWARPConnectorTunnel] +WARPConnectorEditResponse = Union[Tunnel, WARPConnector] diff --git a/src/cloudflare/types/warp_connector_get_response.py b/src/cloudflare/types/warp_connector_get_response.py index 4b211bb43e55..ac37eb7c2f11 100644 --- a/src/cloudflare/types/warp_connector_get_response.py +++ b/src/cloudflare/types/warp_connector_get_response.py @@ -1,94 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal +from typing import Union -from .._models import BaseModel from .zero_trust import Tunnel +from .warp_connector import WARPConnector -__all__ = ["WARPConnectorGetResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] +__all__ = ["WARPConnectorGetResponse"] - -class TunnelWARPConnectorTunnelConnection(BaseModel): - id: Optional[str] = None - """UUID of the Cloudflare Tunnel connection.""" - - client_id: Optional[object] = None - """UUID of the cloudflared instance.""" - - client_version: Optional[str] = None - """The cloudflared version used to establish this connection.""" - - colo_name: Optional[str] = None - """The Cloudflare data center used for this connection.""" - - is_pending_reconnect: Optional[bool] = None - """ - Cloudflare continues to track connections for several minutes after they - disconnect. This is an optimization to improve latency and reliability of - reconnecting. If `true`, the connection has disconnected but is still being - tracked. If `false`, the connection is actively serving traffic. - """ - - opened_at: Optional[datetime] = None - """Timestamp of when the connection was established.""" - - origin_ip: Optional[str] = None - """The public IP address of the host running cloudflared.""" - - uuid: Optional[str] = None - """UUID of the Cloudflare Tunnel connection.""" - - -class TunnelWARPConnectorTunnel(BaseModel): - id: Optional[str] = None - """UUID of the tunnel.""" - - account_tag: Optional[str] = None - """Cloudflare account ID""" - - connections: Optional[List[TunnelWARPConnectorTunnelConnection]] = None - """The Cloudflare Tunnel connections between your origin and Cloudflare's edge.""" - - conns_active_at: Optional[datetime] = None - """ - Timestamp of when the tunnel established at least one connection to Cloudflare's - edge. If `null`, the tunnel is inactive. - """ - - conns_inactive_at: Optional[datetime] = None - """ - Timestamp of when the tunnel became inactive (no connections to Cloudflare's - edge). If `null`, the tunnel is active. - """ - - created_at: Optional[datetime] = None - """Timestamp of when the tunnel was created.""" - - deleted_at: Optional[datetime] = None - """Timestamp of when the tunnel was deleted. - - If `null`, the tunnel has not been deleted. - """ - - metadata: Optional[object] = None - """Metadata associated with the tunnel.""" - - name: Optional[str] = None - """A user-friendly name for the tunnel.""" - - status: Optional[str] = None - """The status of the tunnel. - - Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is - active and able to serve traffic but in an unhealthy state), `healthy` (tunnel - is active and able to serve traffic), or `down` (tunnel can not serve traffic as - it has no connections to the Cloudflare Edge). - """ - - tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None - """The type of tunnel.""" - - -WARPConnectorGetResponse = Union[Tunnel, TunnelWARPConnectorTunnel] +WARPConnectorGetResponse = Union[Tunnel, WARPConnector] diff --git a/src/cloudflare/types/warp_connector_list_response.py b/src/cloudflare/types/warp_connector_list_response.py index 2c5e33542ca6..42be92ba52f5 100644 --- a/src/cloudflare/types/warp_connector_list_response.py +++ b/src/cloudflare/types/warp_connector_list_response.py @@ -1,94 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal +from typing import Union -from .._models import BaseModel from .zero_trust import Tunnel +from .warp_connector import WARPConnector -__all__ = ["WARPConnectorListResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] +__all__ = ["WARPConnectorListResponse"] - -class TunnelWARPConnectorTunnelConnection(BaseModel): - id: Optional[str] = None - """UUID of the Cloudflare Tunnel connection.""" - - client_id: Optional[object] = None - """UUID of the cloudflared instance.""" - - client_version: Optional[str] = None - """The cloudflared version used to establish this connection.""" - - colo_name: Optional[str] = None - """The Cloudflare data center used for this connection.""" - - is_pending_reconnect: Optional[bool] = None - """ - Cloudflare continues to track connections for several minutes after they - disconnect. This is an optimization to improve latency and reliability of - reconnecting. If `true`, the connection has disconnected but is still being - tracked. If `false`, the connection is actively serving traffic. - """ - - opened_at: Optional[datetime] = None - """Timestamp of when the connection was established.""" - - origin_ip: Optional[str] = None - """The public IP address of the host running cloudflared.""" - - uuid: Optional[str] = None - """UUID of the Cloudflare Tunnel connection.""" - - -class TunnelWARPConnectorTunnel(BaseModel): - id: Optional[str] = None - """UUID of the tunnel.""" - - account_tag: Optional[str] = None - """Cloudflare account ID""" - - connections: Optional[List[TunnelWARPConnectorTunnelConnection]] = None - """The Cloudflare Tunnel connections between your origin and Cloudflare's edge.""" - - conns_active_at: Optional[datetime] = None - """ - Timestamp of when the tunnel established at least one connection to Cloudflare's - edge. If `null`, the tunnel is inactive. - """ - - conns_inactive_at: Optional[datetime] = None - """ - Timestamp of when the tunnel became inactive (no connections to Cloudflare's - edge). If `null`, the tunnel is active. - """ - - created_at: Optional[datetime] = None - """Timestamp of when the tunnel was created.""" - - deleted_at: Optional[datetime] = None - """Timestamp of when the tunnel was deleted. - - If `null`, the tunnel has not been deleted. - """ - - metadata: Optional[object] = None - """Metadata associated with the tunnel.""" - - name: Optional[str] = None - """A user-friendly name for the tunnel.""" - - status: Optional[str] = None - """The status of the tunnel. - - Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is - active and able to serve traffic but in an unhealthy state), `healthy` (tunnel - is active and able to serve traffic), or `down` (tunnel can not serve traffic as - it has no connections to the Cloudflare Edge). - """ - - tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None - """The type of tunnel.""" - - -WARPConnectorListResponse = Union[Tunnel, TunnelWARPConnectorTunnel] +WARPConnectorListResponse = Union[Tunnel, WARPConnector] diff --git a/src/cloudflare/types/zero_trust/tunnel_edit_response.py b/src/cloudflare/types/zero_trust/tunnel_edit_response.py index 5e1b6878971e..109df4fcb8c6 100644 --- a/src/cloudflare/types/zero_trust/tunnel_edit_response.py +++ b/src/cloudflare/types/zero_trust/tunnel_edit_response.py @@ -1,94 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal +from typing import Union from .tunnel import Tunnel -from ..._models import BaseModel +from ..warp_connector import WARPConnector -__all__ = ["TunnelEditResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] +__all__ = ["TunnelEditResponse"] - -class TunnelWARPConnectorTunnelConnection(BaseModel): - id: Optional[str] = None - """UUID of the Cloudflare Tunnel connection.""" - - client_id: Optional[object] = None - """UUID of the cloudflared instance.""" - - client_version: Optional[str] = None - """The cloudflared version used to establish this connection.""" - - colo_name: Optional[str] = None - """The Cloudflare data center used for this connection.""" - - is_pending_reconnect: Optional[bool] = None - """ - Cloudflare continues to track connections for several minutes after they - disconnect. This is an optimization to improve latency and reliability of - reconnecting. If `true`, the connection has disconnected but is still being - tracked. If `false`, the connection is actively serving traffic. - """ - - opened_at: Optional[datetime] = None - """Timestamp of when the connection was established.""" - - origin_ip: Optional[str] = None - """The public IP address of the host running cloudflared.""" - - uuid: Optional[str] = None - """UUID of the Cloudflare Tunnel connection.""" - - -class TunnelWARPConnectorTunnel(BaseModel): - id: Optional[str] = None - """UUID of the tunnel.""" - - account_tag: Optional[str] = None - """Cloudflare account ID""" - - connections: Optional[List[TunnelWARPConnectorTunnelConnection]] = None - """The Cloudflare Tunnel connections between your origin and Cloudflare's edge.""" - - conns_active_at: Optional[datetime] = None - """ - Timestamp of when the tunnel established at least one connection to Cloudflare's - edge. If `null`, the tunnel is inactive. - """ - - conns_inactive_at: Optional[datetime] = None - """ - Timestamp of when the tunnel became inactive (no connections to Cloudflare's - edge). If `null`, the tunnel is active. - """ - - created_at: Optional[datetime] = None - """Timestamp of when the tunnel was created.""" - - deleted_at: Optional[datetime] = None - """Timestamp of when the tunnel was deleted. - - If `null`, the tunnel has not been deleted. - """ - - metadata: Optional[object] = None - """Metadata associated with the tunnel.""" - - name: Optional[str] = None - """A user-friendly name for the tunnel.""" - - status: Optional[str] = None - """The status of the tunnel. - - Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is - active and able to serve traffic but in an unhealthy state), `healthy` (tunnel - is active and able to serve traffic), or `down` (tunnel can not serve traffic as - it has no connections to the Cloudflare Edge). - """ - - tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None - """The type of tunnel.""" - - -TunnelEditResponse = Union[Tunnel, TunnelWARPConnectorTunnel] +TunnelEditResponse = Union[Tunnel, WARPConnector] diff --git a/src/cloudflare/types/zero_trust/tunnel_list_response.py b/src/cloudflare/types/zero_trust/tunnel_list_response.py index 97a4689566f5..612c9f139bfc 100644 --- a/src/cloudflare/types/zero_trust/tunnel_list_response.py +++ b/src/cloudflare/types/zero_trust/tunnel_list_response.py @@ -1,94 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal +from typing import Union from .tunnel import Tunnel -from ..._models import BaseModel +from ..warp_connector import WARPConnector -__all__ = ["TunnelListResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] +__all__ = ["TunnelListResponse"] - -class TunnelWARPConnectorTunnelConnection(BaseModel): - id: Optional[str] = None - """UUID of the Cloudflare Tunnel connection.""" - - client_id: Optional[object] = None - """UUID of the cloudflared instance.""" - - client_version: Optional[str] = None - """The cloudflared version used to establish this connection.""" - - colo_name: Optional[str] = None - """The Cloudflare data center used for this connection.""" - - is_pending_reconnect: Optional[bool] = None - """ - Cloudflare continues to track connections for several minutes after they - disconnect. This is an optimization to improve latency and reliability of - reconnecting. If `true`, the connection has disconnected but is still being - tracked. If `false`, the connection is actively serving traffic. - """ - - opened_at: Optional[datetime] = None - """Timestamp of when the connection was established.""" - - origin_ip: Optional[str] = None - """The public IP address of the host running cloudflared.""" - - uuid: Optional[str] = None - """UUID of the Cloudflare Tunnel connection.""" - - -class TunnelWARPConnectorTunnel(BaseModel): - id: Optional[str] = None - """UUID of the tunnel.""" - - account_tag: Optional[str] = None - """Cloudflare account ID""" - - connections: Optional[List[TunnelWARPConnectorTunnelConnection]] = None - """The Cloudflare Tunnel connections between your origin and Cloudflare's edge.""" - - conns_active_at: Optional[datetime] = None - """ - Timestamp of when the tunnel established at least one connection to Cloudflare's - edge. If `null`, the tunnel is inactive. - """ - - conns_inactive_at: Optional[datetime] = None - """ - Timestamp of when the tunnel became inactive (no connections to Cloudflare's - edge). If `null`, the tunnel is active. - """ - - created_at: Optional[datetime] = None - """Timestamp of when the tunnel was created.""" - - deleted_at: Optional[datetime] = None - """Timestamp of when the tunnel was deleted. - - If `null`, the tunnel has not been deleted. - """ - - metadata: Optional[object] = None - """Metadata associated with the tunnel.""" - - name: Optional[str] = None - """A user-friendly name for the tunnel.""" - - status: Optional[str] = None - """The status of the tunnel. - - Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is - active and able to serve traffic but in an unhealthy state), `healthy` (tunnel - is active and able to serve traffic), or `down` (tunnel can not serve traffic as - it has no connections to the Cloudflare Edge). - """ - - tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None - """The type of tunnel.""" - - -TunnelListResponse = Union[Tunnel, TunnelWARPConnectorTunnel] +TunnelListResponse = Union[Tunnel, WARPConnector]