From 96236a2dc34933de8b2c33cb0d2e6c5c49561d08 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 19:37:57 +0000 Subject: [PATCH] feat(api): OpenAPI spec update via Stainless API (#857) --- .stats.yml | 2 +- src/cloudflare/resources/warp_connector.py | 15 +++++++++++++++ .../resources/zero_trust/tunnels/tunnels.py | 15 +++++++++++++++ src/cloudflare/types/shared/cloudflare_tunnel.py | 2 +- .../warp_connector_create_response.py | 2 +- .../warp_connector_delete_response.py | 2 +- .../warp_connector_edit_response.py | 2 +- .../warp_connector/warp_connector_get_response.py | 2 +- .../warp_connector/warp_connector_list_params.py | 11 ++++++++++- .../warp_connector_list_response.py | 2 +- .../types/zero_trust/tunnel_edit_response.py | 2 +- .../types/zero_trust/tunnel_list_params.py | 11 ++++++++++- .../types/zero_trust/tunnel_list_response.py | 2 +- tests/api_resources/test_warp_connector.py | 2 ++ tests/api_resources/zero_trust/test_tunnels.py | 2 ++ 15 files changed, 63 insertions(+), 11 deletions(-) diff --git a/.stats.yml b/.stats.yml index f5f614db49b..1635b8c85ae 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1336 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f2571965a066e5ec176e3f8cb83d9cbf8889e42380a250bad505db2d18a4a772.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6a077023d5a748c646073f33bc20264fc7235f7fe9ce157d1f50f9914a3927e1.yml diff --git a/src/cloudflare/resources/warp_connector.py b/src/cloudflare/resources/warp_connector.py index e614da171ef..b2df61979db 100644 --- a/src/cloudflare/resources/warp_connector.py +++ b/src/cloudflare/resources/warp_connector.py @@ -4,6 +4,7 @@ from typing import Any, Union, cast from datetime import datetime +from typing_extensions import Literal import httpx @@ -105,6 +106,7 @@ def list( name: str | NotGiven = NOT_GIVEN, page: float | NotGiven = NOT_GIVEN, per_page: float | NotGiven = NOT_GIVEN, + status: Literal["inactive", "degraded", "healthy", "down"] | NotGiven = NOT_GIVEN, uuid: str | NotGiven = NOT_GIVEN, was_active_at: Union[str, datetime] | NotGiven = NOT_GIVEN, was_inactive_at: Union[str, datetime] | NotGiven = NOT_GIVEN, @@ -133,6 +135,11 @@ def list( per_page: Number of results to display. + status: 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). + uuid: UUID of the tunnel. extra_headers: Send extra headers @@ -162,6 +169,7 @@ def list( "name": name, "page": page, "per_page": per_page, + "status": status, "uuid": uuid, "was_active_at": was_active_at, "was_inactive_at": was_inactive_at, @@ -456,6 +464,7 @@ def list( name: str | NotGiven = NOT_GIVEN, page: float | NotGiven = NOT_GIVEN, per_page: float | NotGiven = NOT_GIVEN, + status: Literal["inactive", "degraded", "healthy", "down"] | NotGiven = NOT_GIVEN, uuid: str | NotGiven = NOT_GIVEN, was_active_at: Union[str, datetime] | NotGiven = NOT_GIVEN, was_inactive_at: Union[str, datetime] | NotGiven = NOT_GIVEN, @@ -484,6 +493,11 @@ def list( per_page: Number of results to display. + status: 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). + uuid: UUID of the tunnel. extra_headers: Send extra headers @@ -513,6 +527,7 @@ def list( "name": name, "page": page, "per_page": per_page, + "status": status, "uuid": uuid, "was_active_at": was_active_at, "was_inactive_at": was_inactive_at, diff --git a/src/cloudflare/resources/zero_trust/tunnels/tunnels.py b/src/cloudflare/resources/zero_trust/tunnels/tunnels.py index 228c4044763..4133b87dcf2 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/tunnels.py +++ b/src/cloudflare/resources/zero_trust/tunnels/tunnels.py @@ -4,6 +4,7 @@ from typing import Any, Type, Union, cast from datetime import datetime +from typing_extensions import Literal import httpx @@ -169,6 +170,7 @@ def list( name: str | NotGiven = NOT_GIVEN, page: float | NotGiven = NOT_GIVEN, per_page: float | NotGiven = NOT_GIVEN, + status: Literal["inactive", "degraded", "healthy", "down"] | NotGiven = NOT_GIVEN, tun_types: str | NotGiven = NOT_GIVEN, uuid: str | NotGiven = NOT_GIVEN, was_active_at: Union[str, datetime] | NotGiven = NOT_GIVEN, @@ -198,6 +200,11 @@ def list( per_page: Number of results to display. + status: 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_types: The types of tunnels to filter separated by a comma. uuid: UUID of the tunnel. @@ -229,6 +236,7 @@ def list( "name": name, "page": page, "per_page": per_page, + "status": status, "tun_types": tun_types, "uuid": uuid, "was_active_at": was_active_at, @@ -485,6 +493,7 @@ def list( name: str | NotGiven = NOT_GIVEN, page: float | NotGiven = NOT_GIVEN, per_page: float | NotGiven = NOT_GIVEN, + status: Literal["inactive", "degraded", "healthy", "down"] | NotGiven = NOT_GIVEN, tun_types: str | NotGiven = NOT_GIVEN, uuid: str | NotGiven = NOT_GIVEN, was_active_at: Union[str, datetime] | NotGiven = NOT_GIVEN, @@ -514,6 +523,11 @@ def list( per_page: Number of results to display. + status: 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_types: The types of tunnels to filter separated by a comma. uuid: UUID of the tunnel. @@ -545,6 +559,7 @@ def list( "name": name, "page": page, "per_page": per_page, + "status": status, "tun_types": tun_types, "uuid": uuid, "was_active_at": was_active_at, diff --git a/src/cloudflare/types/shared/cloudflare_tunnel.py b/src/cloudflare/types/shared/cloudflare_tunnel.py index 63f80cc424a..9fbc6e6c16a 100644 --- a/src/cloudflare/types/shared/cloudflare_tunnel.py +++ b/src/cloudflare/types/shared/cloudflare_tunnel.py @@ -83,7 +83,7 @@ class CloudflareTunnel(BaseModel): If `false`, the tunnel must be configured locally on the origin machine. """ - status: Optional[str] = None + status: Optional[Literal["inactive", "degraded", "healthy", "down"]] = None """The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is diff --git a/src/cloudflare/types/warp_connector/warp_connector_create_response.py b/src/cloudflare/types/warp_connector/warp_connector_create_response.py index f76eda94d7c..20c981ffbba 100644 --- a/src/cloudflare/types/warp_connector/warp_connector_create_response.py +++ b/src/cloudflare/types/warp_connector/warp_connector_create_response.py @@ -78,7 +78,7 @@ class TunnelWARPConnectorTunnel(BaseModel): name: Optional[str] = None """A user-friendly name for a tunnel.""" - status: Optional[str] = None + status: Optional[Literal["inactive", "degraded", "healthy", "down"]] = None """The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is diff --git a/src/cloudflare/types/warp_connector/warp_connector_delete_response.py b/src/cloudflare/types/warp_connector/warp_connector_delete_response.py index 22c9fd73ca3..6cbd9848ac0 100644 --- a/src/cloudflare/types/warp_connector/warp_connector_delete_response.py +++ b/src/cloudflare/types/warp_connector/warp_connector_delete_response.py @@ -78,7 +78,7 @@ class TunnelWARPConnectorTunnel(BaseModel): name: Optional[str] = None """A user-friendly name for a tunnel.""" - status: Optional[str] = None + status: Optional[Literal["inactive", "degraded", "healthy", "down"]] = None """The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is diff --git a/src/cloudflare/types/warp_connector/warp_connector_edit_response.py b/src/cloudflare/types/warp_connector/warp_connector_edit_response.py index 19ac4305497..1efce6cc9ab 100644 --- a/src/cloudflare/types/warp_connector/warp_connector_edit_response.py +++ b/src/cloudflare/types/warp_connector/warp_connector_edit_response.py @@ -78,7 +78,7 @@ class TunnelWARPConnectorTunnel(BaseModel): name: Optional[str] = None """A user-friendly name for a tunnel.""" - status: Optional[str] = None + status: Optional[Literal["inactive", "degraded", "healthy", "down"]] = None """The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is diff --git a/src/cloudflare/types/warp_connector/warp_connector_get_response.py b/src/cloudflare/types/warp_connector/warp_connector_get_response.py index aab7e8cfb2c..af11fb6dfbb 100644 --- a/src/cloudflare/types/warp_connector/warp_connector_get_response.py +++ b/src/cloudflare/types/warp_connector/warp_connector_get_response.py @@ -78,7 +78,7 @@ class TunnelWARPConnectorTunnel(BaseModel): name: Optional[str] = None """A user-friendly name for a tunnel.""" - status: Optional[str] = None + status: Optional[Literal["inactive", "degraded", "healthy", "down"]] = None """The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is diff --git a/src/cloudflare/types/warp_connector/warp_connector_list_params.py b/src/cloudflare/types/warp_connector/warp_connector_list_params.py index e58a6e75cc1..e02da6d9bed 100644 --- a/src/cloudflare/types/warp_connector/warp_connector_list_params.py +++ b/src/cloudflare/types/warp_connector/warp_connector_list_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Required, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -40,6 +40,15 @@ class WARPConnectorListParams(TypedDict, total=False): per_page: float """Number of results to display.""" + status: Literal["inactive", "degraded", "healthy", "down"] + """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). + """ + uuid: str """UUID of the tunnel.""" diff --git a/src/cloudflare/types/warp_connector/warp_connector_list_response.py b/src/cloudflare/types/warp_connector/warp_connector_list_response.py index a5b67df48c4..1412e8639ee 100644 --- a/src/cloudflare/types/warp_connector/warp_connector_list_response.py +++ b/src/cloudflare/types/warp_connector/warp_connector_list_response.py @@ -78,7 +78,7 @@ class TunnelWARPConnectorTunnel(BaseModel): name: Optional[str] = None """A user-friendly name for a tunnel.""" - status: Optional[str] = None + status: Optional[Literal["inactive", "degraded", "healthy", "down"]] = None """The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is diff --git a/src/cloudflare/types/zero_trust/tunnel_edit_response.py b/src/cloudflare/types/zero_trust/tunnel_edit_response.py index b1871e21042..6e910203a04 100644 --- a/src/cloudflare/types/zero_trust/tunnel_edit_response.py +++ b/src/cloudflare/types/zero_trust/tunnel_edit_response.py @@ -78,7 +78,7 @@ class TunnelWARPConnectorTunnel(BaseModel): name: Optional[str] = None """A user-friendly name for a tunnel.""" - status: Optional[str] = None + status: Optional[Literal["inactive", "degraded", "healthy", "down"]] = None """The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is diff --git a/src/cloudflare/types/zero_trust/tunnel_list_params.py b/src/cloudflare/types/zero_trust/tunnel_list_params.py index e5f6d43dd32..82934968056 100644 --- a/src/cloudflare/types/zero_trust/tunnel_list_params.py +++ b/src/cloudflare/types/zero_trust/tunnel_list_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Required, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -40,6 +40,15 @@ class TunnelListParams(TypedDict, total=False): per_page: float """Number of results to display.""" + status: Literal["inactive", "degraded", "healthy", "down"] + """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_types: str """The types of tunnels to filter separated by a comma.""" diff --git a/src/cloudflare/types/zero_trust/tunnel_list_response.py b/src/cloudflare/types/zero_trust/tunnel_list_response.py index ab94c69f9b7..60b42e47af8 100644 --- a/src/cloudflare/types/zero_trust/tunnel_list_response.py +++ b/src/cloudflare/types/zero_trust/tunnel_list_response.py @@ -78,7 +78,7 @@ class TunnelWARPConnectorTunnel(BaseModel): name: Optional[str] = None """A user-friendly name for a tunnel.""" - status: Optional[str] = None + status: Optional[Literal["inactive", "degraded", "healthy", "down"]] = None """The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is diff --git a/tests/api_resources/test_warp_connector.py b/tests/api_resources/test_warp_connector.py index d94380162cd..7db50a0d321 100644 --- a/tests/api_resources/test_warp_connector.py +++ b/tests/api_resources/test_warp_connector.py @@ -86,6 +86,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: name="blog", page=1, per_page=1, + status="healthy", uuid="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", was_active_at=parse_datetime("2009-11-10T23:00:00Z"), was_inactive_at=parse_datetime("2009-11-10T23:00:00Z"), @@ -389,6 +390,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) name="blog", page=1, per_page=1, + status="healthy", uuid="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", was_active_at=parse_datetime("2009-11-10T23:00:00Z"), was_inactive_at=parse_datetime("2009-11-10T23:00:00Z"), diff --git a/tests/api_resources/zero_trust/test_tunnels.py b/tests/api_resources/zero_trust/test_tunnels.py index ee77b47c681..c00bfff850e 100644 --- a/tests/api_resources/zero_trust/test_tunnels.py +++ b/tests/api_resources/zero_trust/test_tunnels.py @@ -89,6 +89,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: name="blog", page=1, per_page=1, + status="healthy", tun_types="cfd_tunnel,warp_connector", uuid="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", was_active_at=parse_datetime("2009-11-10T23:00:00Z"), @@ -349,6 +350,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) name="blog", page=1, per_page=1, + status="healthy", tun_types="cfd_tunnel,warp_connector", uuid="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", was_active_at=parse_datetime("2009-11-10T23:00:00Z"),