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): OpenAPI spec update via Stainless API #376

Merged
merged 1 commit into from
Apr 29, 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
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1266
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c4098fcb3861719a0115fe0bd93ede436f466e42ea623f1ed1feeb1f126d9c3d.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4f0694869a2da3cbfcc749f0c718b6f45464c72e586046527d6e04c06210b0ca.yml
4 changes: 2 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7152,8 +7152,8 @@ from cloudflare.types.bot_management import (

Methods:

- <code title="put /zones/{zone_id}/bot_management">client.bot_management.<a href="./src/cloudflare/resources/bot_management.py">update</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/bot_management/bot_management_update_params.py">params</a>) -> <a href="./src/cloudflare/types/bot_management/bot_management_update_response.py">Optional</a></code>
- <code title="get /zones/{zone_id}/bot_management">client.bot_management.<a href="./src/cloudflare/resources/bot_management.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/bot_management/bot_management_get_response.py">Optional</a></code>
- <code title="put /zones/{zone_id}/bot_management">client.bot_management.<a href="./src/cloudflare/resources/bot_management.py">update</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/bot_management/bot_management_update_params.py">params</a>) -> <a href="./src/cloudflare/types/bot_management/bot_management_update_response.py">BotManagementUpdateResponse</a></code>
- <code title="get /zones/{zone_id}/bot_management">client.bot_management.<a href="./src/cloudflare/resources/bot_management.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/bot_management/bot_management_get_response.py">BotManagementGetResponse</a></code>

# OriginPostQuantumEncryption

Expand Down
42 changes: 21 additions & 21 deletions src/cloudflare/resources/bot_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Any, Optional, cast, overload
from typing import Any, cast, overload
from typing_extensions import Literal

import httpx
Expand Down Expand Up @@ -54,7 +54,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[BotManagementUpdateResponse]:
) -> BotManagementUpdateResponse:
"""
Updates the Bot Management configuration for a zone.
Expand Down Expand Up @@ -101,7 +101,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[BotManagementUpdateResponse]:
) -> BotManagementUpdateResponse:
"""
Updates the Bot Management configuration for a zone.
Expand Down Expand Up @@ -157,7 +157,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[BotManagementUpdateResponse]:
) -> BotManagementUpdateResponse:
"""
Updates the Bot Management configuration for a zone.
Expand Down Expand Up @@ -212,7 +212,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[BotManagementUpdateResponse]:
) -> BotManagementUpdateResponse:
"""
Updates the Bot Management configuration for a zone.
Expand Down Expand Up @@ -268,11 +268,11 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[BotManagementUpdateResponse]:
) -> BotManagementUpdateResponse:
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return cast(
Optional[BotManagementUpdateResponse],
BotManagementUpdateResponse,
self._put(
f"/zones/{zone_id}/bot_management",
body=maybe_transform(
Expand All @@ -294,7 +294,7 @@ def update(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[BotManagementUpdateResponse]]._unwrapper,
post_parser=ResultWrapper[BotManagementUpdateResponse]._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[BotManagementUpdateResponse]
Expand All @@ -312,7 +312,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[BotManagementGetResponse]:
) -> BotManagementGetResponse:
"""
Retrieve a zone's Bot Management Config
Expand All @@ -330,15 +330,15 @@ def get(
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return cast(
Optional[BotManagementGetResponse],
BotManagementGetResponse,
self._get(
f"/zones/{zone_id}/bot_management",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[BotManagementGetResponse]]._unwrapper,
post_parser=ResultWrapper[BotManagementGetResponse]._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[BotManagementGetResponse]
Expand Down Expand Up @@ -369,7 +369,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[BotManagementUpdateResponse]:
) -> BotManagementUpdateResponse:
"""
Updates the Bot Management configuration for a zone.
Expand Down Expand Up @@ -416,7 +416,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[BotManagementUpdateResponse]:
) -> BotManagementUpdateResponse:
"""
Updates the Bot Management configuration for a zone.
Expand Down Expand Up @@ -472,7 +472,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[BotManagementUpdateResponse]:
) -> BotManagementUpdateResponse:
"""
Updates the Bot Management configuration for a zone.
Expand Down Expand Up @@ -527,7 +527,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[BotManagementUpdateResponse]:
) -> BotManagementUpdateResponse:
"""
Updates the Bot Management configuration for a zone.
Expand Down Expand Up @@ -583,11 +583,11 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[BotManagementUpdateResponse]:
) -> BotManagementUpdateResponse:
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return cast(
Optional[BotManagementUpdateResponse],
BotManagementUpdateResponse,
await self._put(
f"/zones/{zone_id}/bot_management",
body=await async_maybe_transform(
Expand All @@ -609,7 +609,7 @@ async def update(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[BotManagementUpdateResponse]]._unwrapper,
post_parser=ResultWrapper[BotManagementUpdateResponse]._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[BotManagementUpdateResponse]
Expand All @@ -627,7 +627,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[BotManagementGetResponse]:
) -> BotManagementGetResponse:
"""
Retrieve a zone's Bot Management Config
Expand All @@ -645,15 +645,15 @@ async def get(
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return cast(
Optional[BotManagementGetResponse],
BotManagementGetResponse,
await self._get(
f"/zones/{zone_id}/bot_management",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[BotManagementGetResponse]]._unwrapper,
post_parser=ResultWrapper[BotManagementGetResponse]._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[BotManagementGetResponse]
Expand Down
Loading