Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#219)
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 c1e3025 commit 23e38ea
Show file tree
Hide file tree
Showing 81 changed files with 770 additions and 608 deletions.
124 changes: 78 additions & 46 deletions api.md

Large diffs are not rendered by default.

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 UnnamedSchemaRef167
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[UnnamedSchemaRef167]:
) -> 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[UnnamedSchemaRef167],
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[UnnamedSchemaRef167]
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[UnnamedSchemaRef167]:
) -> 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[UnnamedSchemaRef167],
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[UnnamedSchemaRef167]
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[UnnamedSchemaRef167]:
) -> 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[UnnamedSchemaRef167],
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[UnnamedSchemaRef167]
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[UnnamedSchemaRef167]:
) -> 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[UnnamedSchemaRef167],
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[UnnamedSchemaRef167]
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 UnnamedSchemaRef167
from ....types.addressing import (
AddressingAddressMaps,
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[UnnamedSchemaRef167]:
) -> 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[UnnamedSchemaRef167],
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[UnnamedSchemaRef167]
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[UnnamedSchemaRef167]:
) -> 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[UnnamedSchemaRef167],
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[UnnamedSchemaRef167]
Any, ResultWrapper[AddressMapDeleteResponse]
), # Union types cannot be passed in as arguments in the type system
),
)
Expand Down
27 changes: 13 additions & 14 deletions src/cloudflare/resources/addressing/address_maps/ips.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
from ...._base_client import (
make_request_options,
)
from ....types.shared import UnnamedSchemaRef167
from ....types.addressing.address_maps import ip_delete_params, ip_update_params
from ....types.addressing.address_maps import IPDeleteResponse, IPUpdateResponse, ip_delete_params, ip_update_params

__all__ = ["IPs", "AsyncIPs"]

Expand All @@ -51,7 +50,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[UnnamedSchemaRef167]:
) -> Optional[IPUpdateResponse]:
"""
Add an IP from a prefix owned by the account to a particular address map.
Expand All @@ -77,7 +76,7 @@ def update(
if not ip_address:
raise ValueError(f"Expected a non-empty value for `ip_address` but received {ip_address!r}")
return cast(
Optional[UnnamedSchemaRef167],
Optional[IPUpdateResponse],
self._put(
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}",
body=maybe_transform(body, ip_update_params.IPUpdateParams),
Expand All @@ -89,7 +88,7 @@ def update(
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[UnnamedSchemaRef167]
Any, ResultWrapper[IPUpdateResponse]
), # Union types cannot be passed in as arguments in the type system
),
)
Expand All @@ -107,7 +106,7 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[UnnamedSchemaRef167]:
) -> Optional[IPDeleteResponse]:
"""
Remove an IP from a particular address map.
Expand All @@ -133,7 +132,7 @@ def delete(
if not ip_address:
raise ValueError(f"Expected a non-empty value for `ip_address` but received {ip_address!r}")
return cast(
Optional[UnnamedSchemaRef167],
Optional[IPDeleteResponse],
self._delete(
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}",
body=maybe_transform(body, ip_delete_params.IPDeleteParams),
Expand All @@ -145,7 +144,7 @@ def delete(
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[UnnamedSchemaRef167]
Any, ResultWrapper[IPDeleteResponse]
), # Union types cannot be passed in as arguments in the type system
),
)
Expand Down Expand Up @@ -173,7 +172,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[UnnamedSchemaRef167]:
) -> Optional[IPUpdateResponse]:
"""
Add an IP from a prefix owned by the account to a particular address map.
Expand All @@ -199,7 +198,7 @@ async def update(
if not ip_address:
raise ValueError(f"Expected a non-empty value for `ip_address` but received {ip_address!r}")
return cast(
Optional[UnnamedSchemaRef167],
Optional[IPUpdateResponse],
await self._put(
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}",
body=await async_maybe_transform(body, ip_update_params.IPUpdateParams),
Expand All @@ -211,7 +210,7 @@ async def update(
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[UnnamedSchemaRef167]
Any, ResultWrapper[IPUpdateResponse]
), # Union types cannot be passed in as arguments in the type system
),
)
Expand All @@ -229,7 +228,7 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[UnnamedSchemaRef167]:
) -> Optional[IPDeleteResponse]:
"""
Remove an IP from a particular address map.
Expand All @@ -255,7 +254,7 @@ async def delete(
if not ip_address:
raise ValueError(f"Expected a non-empty value for `ip_address` but received {ip_address!r}")
return cast(
Optional[UnnamedSchemaRef167],
Optional[IPDeleteResponse],
await self._delete(
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}",
body=await async_maybe_transform(body, ip_delete_params.IPDeleteParams),
Expand All @@ -267,7 +266,7 @@ async def delete(
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[UnnamedSchemaRef167]
Any, ResultWrapper[IPDeleteResponse]
), # Union types cannot be passed in as arguments in the type system
),
)
Expand Down
Loading

0 comments on commit 23e38ea

Please sign in to comment.