Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#290)
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 b6008f2 commit c6c81d4
Show file tree
Hide file tree
Showing 66 changed files with 516 additions and 1,774 deletions.
97 changes: 32 additions & 65 deletions api.md

Large diffs are not rendered by default.

41 changes: 19 additions & 22 deletions src/cloudflare/resources/addressing/prefixes/prefixes.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@
make_request_options,
)
from ....types.addressing import (
PrefixGetResponse,
PrefixEditResponse,
PrefixListResponse,
PrefixCreateResponse,
Prefix,
PrefixDeleteResponse,
prefix_edit_params,
prefix_create_params,
Expand Down Expand Up @@ -86,7 +83,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> PrefixCreateResponse:
) -> Prefix:
"""
Add a new prefix under the account.
Expand Down Expand Up @@ -126,7 +123,7 @@ def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[PrefixCreateResponse], ResultWrapper[PrefixCreateResponse]),
cast_to=cast(Type[Prefix], ResultWrapper[Prefix]),
)

def list(
Expand All @@ -139,7 +136,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncSinglePage[PrefixListResponse]:
) -> SyncSinglePage[Prefix]:
"""
List all prefixes owned by the account.
Expand All @@ -158,11 +155,11 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
f"/accounts/{account_id}/addressing/prefixes",
page=SyncSinglePage[PrefixListResponse],
page=SyncSinglePage[Prefix],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=PrefixListResponse,
model=Prefix,
)

def delete(
Expand Down Expand Up @@ -228,7 +225,7 @@ def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> PrefixEditResponse:
) -> Prefix:
"""
Modify the description for a prefix owned by the account.
Expand Down Expand Up @@ -261,7 +258,7 @@ def edit(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[PrefixEditResponse], ResultWrapper[PrefixEditResponse]),
cast_to=cast(Type[Prefix], ResultWrapper[Prefix]),
)

def get(
Expand All @@ -275,7 +272,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> PrefixGetResponse:
) -> Prefix:
"""
List a particular prefix owned by the account.
Expand Down Expand Up @@ -305,7 +302,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[PrefixGetResponse], ResultWrapper[PrefixGetResponse]),
cast_to=cast(Type[Prefix], ResultWrapper[Prefix]),
)


Expand Down Expand Up @@ -339,7 +336,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> PrefixCreateResponse:
) -> Prefix:
"""
Add a new prefix under the account.
Expand Down Expand Up @@ -379,7 +376,7 @@ async def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[PrefixCreateResponse], ResultWrapper[PrefixCreateResponse]),
cast_to=cast(Type[Prefix], ResultWrapper[Prefix]),
)

def list(
Expand All @@ -392,7 +389,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[PrefixListResponse, AsyncSinglePage[PrefixListResponse]]:
) -> AsyncPaginator[Prefix, AsyncSinglePage[Prefix]]:
"""
List all prefixes owned by the account.
Expand All @@ -411,11 +408,11 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
f"/accounts/{account_id}/addressing/prefixes",
page=AsyncSinglePage[PrefixListResponse],
page=AsyncSinglePage[Prefix],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=PrefixListResponse,
model=Prefix,
)

async def delete(
Expand Down Expand Up @@ -481,7 +478,7 @@ async def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> PrefixEditResponse:
) -> Prefix:
"""
Modify the description for a prefix owned by the account.
Expand Down Expand Up @@ -514,7 +511,7 @@ async def edit(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[PrefixEditResponse], ResultWrapper[PrefixEditResponse]),
cast_to=cast(Type[Prefix], ResultWrapper[Prefix]),
)

async def get(
Expand All @@ -528,7 +525,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> PrefixGetResponse:
) -> Prefix:
"""
List a particular prefix owned by the account.
Expand Down Expand Up @@ -558,7 +555,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[PrefixGetResponse], ResultWrapper[PrefixGetResponse]),
cast_to=cast(Type[Prefix], ResultWrapper[Prefix]),
)


Expand Down
25 changes: 12 additions & 13 deletions src/cloudflare/resources/keyless_certificates.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import httpx

from ..types import (
Hostname,
TunnelParam,
BundleMethod,
KeylessCertificate,
Expand Down Expand Up @@ -64,7 +63,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Hostname:
) -> KeylessCertificate:
"""
Create Keyless SSL Configuration
Expand Down Expand Up @@ -117,7 +116,7 @@ def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Hostname], ResultWrapper[Hostname]),
cast_to=cast(Type[KeylessCertificate], ResultWrapper[KeylessCertificate]),
)

def list(
Expand Down Expand Up @@ -220,7 +219,7 @@ def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Hostname:
) -> KeylessCertificate:
"""This will update attributes of a Keyless SSL.
Consists of one or more of the
Expand Down Expand Up @@ -275,7 +274,7 @@ def edit(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Hostname], ResultWrapper[Hostname]),
cast_to=cast(Type[KeylessCertificate], ResultWrapper[KeylessCertificate]),
)

def get(
Expand All @@ -289,7 +288,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Hostname:
) -> KeylessCertificate:
"""
Get details for one Keyless SSL configuration.
Expand Down Expand Up @@ -321,7 +320,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Hostname], ResultWrapper[Hostname]),
cast_to=cast(Type[KeylessCertificate], ResultWrapper[KeylessCertificate]),
)


Expand Down Expand Up @@ -350,7 +349,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Hostname:
) -> KeylessCertificate:
"""
Create Keyless SSL Configuration
Expand Down Expand Up @@ -403,7 +402,7 @@ async def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Hostname], ResultWrapper[Hostname]),
cast_to=cast(Type[KeylessCertificate], ResultWrapper[KeylessCertificate]),
)

def list(
Expand Down Expand Up @@ -506,7 +505,7 @@ async def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Hostname:
) -> KeylessCertificate:
"""This will update attributes of a Keyless SSL.
Consists of one or more of the
Expand Down Expand Up @@ -561,7 +560,7 @@ async def edit(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Hostname], ResultWrapper[Hostname]),
cast_to=cast(Type[KeylessCertificate], ResultWrapper[KeylessCertificate]),
)

async def get(
Expand All @@ -575,7 +574,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Hostname:
) -> KeylessCertificate:
"""
Get details for one Keyless SSL configuration.
Expand Down Expand Up @@ -607,7 +606,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Hostname], ResultWrapper[Hostname]),
cast_to=cast(Type[KeylessCertificate], ResultWrapper[KeylessCertificate]),
)


Expand Down
Loading

0 comments on commit c6c81d4

Please sign in to comment.