Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 22, 2024
1 parent 8ba08ef commit a333132
Show file tree
Hide file tree
Showing 304 changed files with 2,776 additions and 2,462 deletions.
425 changes: 284 additions & 141 deletions api.md

Large diffs are not rendered by default.

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
5 changes: 2 additions & 3 deletions src/cloudflare/resources/accounts/members.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
)
from ...types.accounts import (
Member,
MemberRoleParam,
MemberListResponse,
MemberDeleteResponse,
MemberWithInviteCode,
Expand Down Expand Up @@ -105,7 +104,7 @@ def update(
member_id: str,
*,
account_id: object,
roles: Iterable[MemberRoleParam],
roles: Iterable[member_update_params.Role],
# 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,
Expand Down Expand Up @@ -351,7 +350,7 @@ async def update(
member_id: str,
*,
account_id: object,
roles: Iterable[MemberRoleParam],
roles: Iterable[member_update_params.Role],
# 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,
Expand Down
32 changes: 18 additions & 14 deletions src/cloudflare/resources/addressing/address_maps/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@
from ...._base_client import (
make_request_options,
)
from ....types.shared import UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151
from ....types.addressing.address_maps import account_delete_params, account_update_params
from ....types.addressing.address_maps import (
AccountDeleteResponse,
AccountUpdateResponse,
account_delete_params,
account_update_params,
)

__all__ = ["Accounts", "AsyncAccounts"]

Expand All @@ -50,7 +54,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151]:
) -> Optional[AccountUpdateResponse]:
"""
Add an account as a member of a particular address map.
Expand All @@ -72,7 +76,7 @@ def update(
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
return cast(
Optional[UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151],
Optional[AccountUpdateResponse],
self._put(
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
body=maybe_transform(body, account_update_params.AccountUpdateParams),
Expand All @@ -84,7 +88,7 @@ def update(
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151]
Any, ResultWrapper[AccountUpdateResponse]
), # Union types cannot be passed in as arguments in the type system
),
)
Expand All @@ -101,7 +105,7 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151]:
) -> Optional[AccountDeleteResponse]:
"""
Remove an account as a member of a particular address map.
Expand All @@ -123,7 +127,7 @@ def delete(
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
return cast(
Optional[UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151],
Optional[AccountDeleteResponse],
self._delete(
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
body=maybe_transform(body, account_delete_params.AccountDeleteParams),
Expand All @@ -135,7 +139,7 @@ def delete(
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151]
Any, ResultWrapper[AccountDeleteResponse]
), # Union types cannot be passed in as arguments in the type system
),
)
Expand All @@ -162,7 +166,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151]:
) -> Optional[AccountUpdateResponse]:
"""
Add an account as a member of a particular address map.
Expand All @@ -184,7 +188,7 @@ async def update(
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
return cast(
Optional[UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151],
Optional[AccountUpdateResponse],
await self._put(
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
body=await async_maybe_transform(body, account_update_params.AccountUpdateParams),
Expand All @@ -196,7 +200,7 @@ async def update(
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151]
Any, ResultWrapper[AccountUpdateResponse]
), # Union types cannot be passed in as arguments in the type system
),
)
Expand All @@ -213,7 +217,7 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151]:
) -> Optional[AccountDeleteResponse]:
"""
Remove an account as a member of a particular address map.
Expand All @@ -235,7 +239,7 @@ async def delete(
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
return cast(
Optional[UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151],
Optional[AccountDeleteResponse],
await self._delete(
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
body=await async_maybe_transform(body, account_delete_params.AccountDeleteParams),
Expand All @@ -247,7 +251,7 @@ async def delete(
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151]
Any, ResultWrapper[AccountDeleteResponse]
), # Union types cannot be passed in as arguments in the type system
),
)
Expand Down
14 changes: 7 additions & 7 deletions src/cloudflare/resources/addressing/address_maps/address_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@
AsyncPaginator,
make_request_options,
)
from ....types.shared import UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151
from ....types.addressing import (
AddressMap,
AddressMapGetResponse,
AddressMapCreateResponse,
AddressMapDeleteResponse,
address_map_edit_params,
address_map_create_params,
address_map_delete_params,
Expand Down Expand Up @@ -185,7 +185,7 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151]:
) -> Optional[AddressMapDeleteResponse]:
"""Delete a particular address map owned by the account.
An Address Map must be
Expand All @@ -209,7 +209,7 @@ def delete(
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
return cast(
Optional[UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151],
Optional[AddressMapDeleteResponse],
self._delete(
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}",
body=maybe_transform(body, address_map_delete_params.AddressMapDeleteParams),
Expand All @@ -221,7 +221,7 @@ def delete(
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151]
Any, ResultWrapper[AddressMapDeleteResponse]
), # Union types cannot be passed in as arguments in the type system
),
)
Expand Down Expand Up @@ -461,7 +461,7 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151]:
) -> Optional[AddressMapDeleteResponse]:
"""Delete a particular address map owned by the account.
An Address Map must be
Expand All @@ -485,7 +485,7 @@ async def delete(
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
return cast(
Optional[UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151],
Optional[AddressMapDeleteResponse],
await self._delete(
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}",
body=await async_maybe_transform(body, address_map_delete_params.AddressMapDeleteParams),
Expand All @@ -497,7 +497,7 @@ async def delete(
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151]
Any, ResultWrapper[AddressMapDeleteResponse]
), # Union types cannot be passed in as arguments in the type system
),
)
Expand Down
Loading

0 comments on commit a333132

Please sign in to comment.