Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): update via SDK Studio #299

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4595,12 +4595,13 @@ Methods:
- <code title="delete /accounts/{account_id}/r2/buckets/{bucket_name}/sippy">client.r2.sippy.<a href="./src/cloudflare/resources/r2/sippy.py">delete</a>(bucket_name, \*, account_id) -> <a href="./src/cloudflare/types/r2/sippy_delete_response.py">SippyDeleteResponse</a></code>
- <code title="get /accounts/{account_id}/r2/buckets/{bucket_name}/sippy">client.r2.sippy.<a href="./src/cloudflare/resources/r2/sippy.py">get</a>(bucket_name, \*, account_id) -> <a href="./src/cloudflare/types/r2/sippy.py">Sippy</a></code>

# WARPConnector
# WARPConnectorResource

Types:

```python
from cloudflare.types import (
WARPConnector,
WARPConnectorCreateResponse,
WARPConnectorListResponse,
WARPConnectorDeleteResponse,
Expand Down
16 changes: 8 additions & 8 deletions src/cloudflare/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
)
Expand Down
24 changes: 12 additions & 12 deletions src/cloudflare/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1020,12 +1020,12 @@
"AsyncR2WithRawResponse",
"R2WithStreamingResponse",
"AsyncR2WithStreamingResponse",
"WARPConnector",
"AsyncWARPConnector",
"WARPConnectorWithRawResponse",
"AsyncWARPConnectorWithRawResponse",
"WARPConnectorWithStreamingResponse",
"AsyncWARPConnectorWithStreamingResponse",
"WARPConnectorResource",
"AsyncWARPConnectorResource",
"WARPConnectorResourceWithRawResponse",
"AsyncWARPConnectorResourceWithRawResponse",
"WARPConnectorResourceWithStreamingResponse",
"AsyncWARPConnectorResourceWithStreamingResponse",
"WorkersForPlatforms",
"AsyncWorkersForPlatforms",
"WorkersForPlatformsWithRawResponse",
Expand Down
38 changes: 19 additions & 19 deletions src/cloudflare/resources/warp_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand Down
1 change: 1 addition & 0 deletions src/cloudflare/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
90 changes: 90 additions & 0 deletions src/cloudflare/types/warp_connector.py
Original file line number Diff line number Diff line change
@@ -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."""
Loading