diff --git a/api.md b/api.md index f9f5281fff1..af6282d5e79 100644 --- a/api.md +++ b/api.md @@ -3,13 +3,13 @@ ```python from cloudflare.types import ( AuditLog, + CloudflareTunnel, ErrorData, Identifier, LoadBalancerPreview, PaginationInfo, ResponseInfo, Result, - Tunnel, ) ``` diff --git a/src/cloudflare/types/__init__.py b/src/cloudflare/types/__init__.py index c234a3d462c..618578f0dc5 100644 --- a/src/cloudflare/types/__init__.py +++ b/src/cloudflare/types/__init__.py @@ -20,12 +20,12 @@ from .origin import Origin as Origin from .shared import ( Result as Result, - Tunnel as Tunnel, AuditLog as AuditLog, ErrorData as ErrorData, Identifier as Identifier, ResponseInfo as ResponseInfo, PaginationInfo as PaginationInfo, + CloudflareTunnel as CloudflareTunnel, LoadBalancerPreview as LoadBalancerPreview, ) from .submit import Submit as Submit diff --git a/src/cloudflare/types/shared/__init__.py b/src/cloudflare/types/shared/__init__.py index 62e8826930b..aed721f25f7 100644 --- a/src/cloudflare/types/shared/__init__.py +++ b/src/cloudflare/types/shared/__init__.py @@ -1,10 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .result import Result as Result -from .tunnel import Tunnel as Tunnel from .audit_log import AuditLog as AuditLog from .error_data import ErrorData as ErrorData from .identifier import Identifier as Identifier from .response_info import ResponseInfo as ResponseInfo from .pagination_info import PaginationInfo as PaginationInfo +from .cloudflare_tunnel import CloudflareTunnel as CloudflareTunnel from .load_balancer_preview import LoadBalancerPreview as LoadBalancerPreview diff --git a/src/cloudflare/types/shared/tunnel.py b/src/cloudflare/types/shared/cloudflare_tunnel.py similarity index 97% rename from src/cloudflare/types/shared/tunnel.py rename to src/cloudflare/types/shared/cloudflare_tunnel.py index a7c3ca49648..4e42ab3182d 100644 --- a/src/cloudflare/types/shared/tunnel.py +++ b/src/cloudflare/types/shared/cloudflare_tunnel.py @@ -6,7 +6,7 @@ from ..._models import BaseModel -__all__ = ["Tunnel", "Connection"] +__all__ = ["CloudflareTunnel", "Connection"] class Connection(BaseModel): @@ -40,7 +40,7 @@ class Connection(BaseModel): """UUID of the Cloudflare Tunnel connection.""" -class Tunnel(BaseModel): +class CloudflareTunnel(BaseModel): id: Optional[str] = None """UUID of the tunnel.""" diff --git a/src/cloudflare/types/shared_params/__init__.py b/src/cloudflare/types/shared_params/__init__.py deleted file mode 100644 index 479125d38fc..00000000000 --- a/src/cloudflare/types/shared_params/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .tunnel import Tunnel as Tunnel diff --git a/src/cloudflare/types/shared_params/tunnel.py b/src/cloudflare/types/shared_params/tunnel.py deleted file mode 100644 index 268364366bc..00000000000 --- a/src/cloudflare/types/shared_params/tunnel.py +++ /dev/null @@ -1,89 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict - -from ..._utils import PropertyInfo - -__all__ = ["Tunnel", "Connection"] - - -class Connection(TypedDict, total=False): - client_id: object - """UUID of the cloudflared instance.""" - - client_version: str - """The cloudflared version used to establish this connection.""" - - colo_name: str - """The Cloudflare data center used for this connection.""" - - is_pending_reconnect: bool - """ - 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: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] - """Timestamp of when the connection was established.""" - - origin_ip: str - """The public IP address of the host running cloudflared.""" - - -class Tunnel(TypedDict, total=False): - account_tag: str - """Cloudflare account ID""" - - connections: Iterable[Connection] - """The Cloudflare Tunnel connections between your origin and Cloudflare's edge.""" - - conns_active_at: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """ - Timestamp of when the tunnel established at least one connection to Cloudflare's - edge. If `null`, the tunnel is inactive. - """ - - conns_inactive_at: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """ - Timestamp of when the tunnel became inactive (no connections to Cloudflare's - edge). If `null`, the tunnel is active. - """ - - created_at: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] - """Timestamp of when the tunnel was created.""" - - deleted_at: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """Timestamp of when the tunnel was deleted. - - If `null`, the tunnel has not been deleted. - """ - - metadata: object - """Metadata associated with the tunnel.""" - - name: str - """A user-friendly name for the tunnel.""" - - remote_config: bool - """If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. - - If `false`, the tunnel must be configured locally on the origin machine. - """ - - status: str - """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: Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"] - """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 2b145cac371..ac7ea82fcc6 100644 --- a/src/cloudflare/types/warp_connector_create_response.py +++ b/src/cloudflare/types/warp_connector_create_response.py @@ -4,7 +4,7 @@ from datetime import datetime from typing_extensions import Literal -from .shared import Tunnel +from .shared import CloudflareTunnel from .._models import BaseModel __all__ = ["WARPConnectorCreateResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] @@ -91,4 +91,4 @@ class TunnelWARPConnectorTunnel(BaseModel): """The type of tunnel.""" -WARPConnectorCreateResponse = Union[Tunnel, TunnelWARPConnectorTunnel] +WARPConnectorCreateResponse = Union[CloudflareTunnel, TunnelWARPConnectorTunnel] diff --git a/src/cloudflare/types/warp_connector_delete_response.py b/src/cloudflare/types/warp_connector_delete_response.py index a9d3d09d139..2c2498143b1 100644 --- a/src/cloudflare/types/warp_connector_delete_response.py +++ b/src/cloudflare/types/warp_connector_delete_response.py @@ -4,7 +4,7 @@ from datetime import datetime from typing_extensions import Literal -from .shared import Tunnel +from .shared import CloudflareTunnel from .._models import BaseModel __all__ = ["WARPConnectorDeleteResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] @@ -91,4 +91,4 @@ class TunnelWARPConnectorTunnel(BaseModel): """The type of tunnel.""" -WARPConnectorDeleteResponse = Union[Tunnel, TunnelWARPConnectorTunnel] +WARPConnectorDeleteResponse = Union[CloudflareTunnel, TunnelWARPConnectorTunnel] diff --git a/src/cloudflare/types/warp_connector_edit_response.py b/src/cloudflare/types/warp_connector_edit_response.py index d371096bafb..048c254ea94 100644 --- a/src/cloudflare/types/warp_connector_edit_response.py +++ b/src/cloudflare/types/warp_connector_edit_response.py @@ -4,7 +4,7 @@ from datetime import datetime from typing_extensions import Literal -from .shared import Tunnel +from .shared import CloudflareTunnel from .._models import BaseModel __all__ = ["WARPConnectorEditResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] @@ -91,4 +91,4 @@ class TunnelWARPConnectorTunnel(BaseModel): """The type of tunnel.""" -WARPConnectorEditResponse = Union[Tunnel, TunnelWARPConnectorTunnel] +WARPConnectorEditResponse = Union[CloudflareTunnel, TunnelWARPConnectorTunnel] diff --git a/src/cloudflare/types/warp_connector_get_response.py b/src/cloudflare/types/warp_connector_get_response.py index 22c1046365a..087bbbbf160 100644 --- a/src/cloudflare/types/warp_connector_get_response.py +++ b/src/cloudflare/types/warp_connector_get_response.py @@ -4,7 +4,7 @@ from datetime import datetime from typing_extensions import Literal -from .shared import Tunnel +from .shared import CloudflareTunnel from .._models import BaseModel __all__ = ["WARPConnectorGetResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] @@ -91,4 +91,4 @@ class TunnelWARPConnectorTunnel(BaseModel): """The type of tunnel.""" -WARPConnectorGetResponse = Union[Tunnel, TunnelWARPConnectorTunnel] +WARPConnectorGetResponse = Union[CloudflareTunnel, TunnelWARPConnectorTunnel] diff --git a/src/cloudflare/types/warp_connector_list_response.py b/src/cloudflare/types/warp_connector_list_response.py index 9a7a7514c51..0da244e276d 100644 --- a/src/cloudflare/types/warp_connector_list_response.py +++ b/src/cloudflare/types/warp_connector_list_response.py @@ -4,7 +4,7 @@ from datetime import datetime from typing_extensions import Literal -from .shared import Tunnel +from .shared import CloudflareTunnel from .._models import BaseModel __all__ = ["WARPConnectorListResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] @@ -91,4 +91,4 @@ class TunnelWARPConnectorTunnel(BaseModel): """The type of tunnel.""" -WARPConnectorListResponse = Union[Tunnel, TunnelWARPConnectorTunnel] +WARPConnectorListResponse = Union[CloudflareTunnel, TunnelWARPConnectorTunnel] diff --git a/src/cloudflare/types/zero_trust/tunnel_edit_response.py b/src/cloudflare/types/zero_trust/tunnel_edit_response.py index a06b6680aac..9b0f909d402 100644 --- a/src/cloudflare/types/zero_trust/tunnel_edit_response.py +++ b/src/cloudflare/types/zero_trust/tunnel_edit_response.py @@ -4,7 +4,7 @@ from datetime import datetime from typing_extensions import Literal -from ..shared import Tunnel +from ..shared import CloudflareTunnel from ..._models import BaseModel __all__ = ["TunnelEditResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] @@ -91,4 +91,4 @@ class TunnelWARPConnectorTunnel(BaseModel): """The type of tunnel.""" -TunnelEditResponse = Union[Tunnel, TunnelWARPConnectorTunnel] +TunnelEditResponse = Union[CloudflareTunnel, TunnelWARPConnectorTunnel] diff --git a/src/cloudflare/types/zero_trust/tunnel_list_response.py b/src/cloudflare/types/zero_trust/tunnel_list_response.py index 1d05b47b7e8..da85f0ca4b7 100644 --- a/src/cloudflare/types/zero_trust/tunnel_list_response.py +++ b/src/cloudflare/types/zero_trust/tunnel_list_response.py @@ -4,7 +4,7 @@ from datetime import datetime from typing_extensions import Literal -from ..shared import Tunnel +from ..shared import CloudflareTunnel from ..._models import BaseModel __all__ = ["TunnelListResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] @@ -91,4 +91,4 @@ class TunnelWARPConnectorTunnel(BaseModel): """The type of tunnel.""" -TunnelListResponse = Union[Tunnel, TunnelWARPConnectorTunnel] +TunnelListResponse = Union[CloudflareTunnel, TunnelWARPConnectorTunnel]