Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#248)
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 eee2f14 commit d17c894
Show file tree
Hide file tree
Showing 36 changed files with 334 additions and 337 deletions.
59 changes: 28 additions & 31 deletions api.md

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions src/cloudflare/resources/zero_trust/access/bookmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
make_request_options,
)
from ....types.zero_trust.access import (
Bookmark,
BookmarkDeleteResponse,
bookmarks,
bookmark_create_params,
bookmark_delete_params,
bookmark_update_params,
Expand Down Expand Up @@ -57,7 +57,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> bookmarks.Bookmarks:
) -> Bookmark:
"""
Create a new Bookmark application.
Expand Down Expand Up @@ -86,7 +86,7 @@ def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[bookmarks.Bookmarks], ResultWrapper[bookmarks.Bookmarks]),
cast_to=cast(Type[Bookmark], ResultWrapper[Bookmark]),
)

def update(
Expand All @@ -101,7 +101,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> bookmarks.Bookmarks:
) -> Bookmark:
"""
Updates a configured Bookmark application.
Expand Down Expand Up @@ -130,7 +130,7 @@ def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[bookmarks.Bookmarks], ResultWrapper[bookmarks.Bookmarks]),
cast_to=cast(Type[Bookmark], ResultWrapper[Bookmark]),
)

def list(
Expand All @@ -143,7 +143,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncSinglePage[bookmarks.Bookmarks]:
) -> SyncSinglePage[Bookmark]:
"""
Lists Bookmark applications.
Expand All @@ -160,11 +160,11 @@ def list(
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
return self._get_api_list(
f"/accounts/{identifier}/access/bookmarks",
page=SyncSinglePage[bookmarks.Bookmarks],
page=SyncSinglePage[Bookmark],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=bookmarks.Bookmarks,
model=Bookmark,
)

def delete(
Expand Down Expand Up @@ -222,7 +222,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> bookmarks.Bookmarks:
) -> Bookmark:
"""
Fetches a single Bookmark application.
Expand Down Expand Up @@ -250,7 +250,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[bookmarks.Bookmarks], ResultWrapper[bookmarks.Bookmarks]),
cast_to=cast(Type[Bookmark], ResultWrapper[Bookmark]),
)


Expand All @@ -275,7 +275,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> bookmarks.Bookmarks:
) -> Bookmark:
"""
Create a new Bookmark application.
Expand Down Expand Up @@ -304,7 +304,7 @@ async def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[bookmarks.Bookmarks], ResultWrapper[bookmarks.Bookmarks]),
cast_to=cast(Type[Bookmark], ResultWrapper[Bookmark]),
)

async def update(
Expand All @@ -319,7 +319,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> bookmarks.Bookmarks:
) -> Bookmark:
"""
Updates a configured Bookmark application.
Expand Down Expand Up @@ -348,7 +348,7 @@ async def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[bookmarks.Bookmarks], ResultWrapper[bookmarks.Bookmarks]),
cast_to=cast(Type[Bookmark], ResultWrapper[Bookmark]),
)

def list(
Expand All @@ -361,7 +361,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[bookmarks.Bookmarks, AsyncSinglePage[bookmarks.Bookmarks]]:
) -> AsyncPaginator[Bookmark, AsyncSinglePage[Bookmark]]:
"""
Lists Bookmark applications.
Expand All @@ -378,11 +378,11 @@ def list(
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
return self._get_api_list(
f"/accounts/{identifier}/access/bookmarks",
page=AsyncSinglePage[bookmarks.Bookmarks],
page=AsyncSinglePage[Bookmark],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=bookmarks.Bookmarks,
model=Bookmark,
)

async def delete(
Expand Down Expand Up @@ -440,7 +440,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> bookmarks.Bookmarks:
) -> Bookmark:
"""
Fetches a single Bookmark application.
Expand Down Expand Up @@ -468,7 +468,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[bookmarks.Bookmarks], ResultWrapper[bookmarks.Bookmarks]),
cast_to=cast(Type[Bookmark], ResultWrapper[Bookmark]),
)


Expand Down
38 changes: 19 additions & 19 deletions src/cloudflare/resources/zero_trust/access/service_tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
make_request_options,
)
from ....types.zero_trust.access import (
ErviceToken,
ServiceToken,
ServiceTokenCreateResponse,
ServiceTokenRotateResponse,
service_token_create_params,
Expand Down Expand Up @@ -132,7 +132,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ErviceToken:
) -> ServiceToken:
"""
Updates a configured service token.
Expand Down Expand Up @@ -190,7 +190,7 @@ def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[ErviceToken], ResultWrapper[ErviceToken]),
cast_to=cast(Type[ServiceToken], ResultWrapper[ServiceToken]),
)

def list(
Expand All @@ -204,7 +204,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncSinglePage[ErviceToken]:
) -> SyncSinglePage[ServiceToken]:
"""
Lists all service tokens.
Expand Down Expand Up @@ -238,11 +238,11 @@ def list(
account_or_zone_id = zone_id
return self._get_api_list(
f"/{account_or_zone}/{account_or_zone_id}/access/service_tokens",
page=SyncSinglePage[ErviceToken],
page=SyncSinglePage[ServiceToken],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=ErviceToken,
model=ServiceToken,
)

def delete(
Expand All @@ -257,7 +257,7 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ErviceToken:
) -> ServiceToken:
"""
Deletes a service token.
Expand Down Expand Up @@ -302,7 +302,7 @@ def delete(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[ErviceToken], ResultWrapper[ErviceToken]),
cast_to=cast(Type[ServiceToken], ResultWrapper[ServiceToken]),
)

def refresh(
Expand All @@ -316,7 +316,7 @@ def refresh(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ErviceToken:
) -> ServiceToken:
"""
Refreshes the expiration of a service token.
Expand Down Expand Up @@ -346,7 +346,7 @@ def refresh(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[ErviceToken], ResultWrapper[ErviceToken]),
cast_to=cast(Type[ServiceToken], ResultWrapper[ServiceToken]),
)

def rotate(
Expand Down Expand Up @@ -490,7 +490,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ErviceToken:
) -> ServiceToken:
"""
Updates a configured service token.
Expand Down Expand Up @@ -548,7 +548,7 @@ async def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[ErviceToken], ResultWrapper[ErviceToken]),
cast_to=cast(Type[ServiceToken], ResultWrapper[ServiceToken]),
)

def list(
Expand All @@ -562,7 +562,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[ErviceToken, AsyncSinglePage[ErviceToken]]:
) -> AsyncPaginator[ServiceToken, AsyncSinglePage[ServiceToken]]:
"""
Lists all service tokens.
Expand Down Expand Up @@ -596,11 +596,11 @@ def list(
account_or_zone_id = zone_id
return self._get_api_list(
f"/{account_or_zone}/{account_or_zone_id}/access/service_tokens",
page=AsyncSinglePage[ErviceToken],
page=AsyncSinglePage[ServiceToken],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=ErviceToken,
model=ServiceToken,
)

async def delete(
Expand All @@ -615,7 +615,7 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ErviceToken:
) -> ServiceToken:
"""
Deletes a service token.
Expand Down Expand Up @@ -660,7 +660,7 @@ async def delete(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[ErviceToken], ResultWrapper[ErviceToken]),
cast_to=cast(Type[ServiceToken], ResultWrapper[ServiceToken]),
)

async def refresh(
Expand All @@ -674,7 +674,7 @@ async def refresh(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ErviceToken:
) -> ServiceToken:
"""
Refreshes the expiration of a service token.
Expand Down Expand Up @@ -704,7 +704,7 @@ async def refresh(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[ErviceToken], ResultWrapper[ErviceToken]),
cast_to=cast(Type[ServiceToken], ResultWrapper[ServiceToken]),
)

async def rotate(
Expand Down
Loading

0 comments on commit d17c894

Please sign in to comment.