Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed May 7, 2024
1 parent 4c264e5 commit f47b44d
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 63 deletions.
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-4f0694869a2da3cbfcc749f0c718b6f45464c72e586046527d6e04c06210b0ca.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c4098fcb3861719a0115fe0bd93ede436f466e42ea623f1ed1feeb1f126d9c3d.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">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>
- <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>

# 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, cast, overload
from typing import Any, Optional, 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,
) -> BotManagementUpdateResponse:
) -> Optional[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,
) -> BotManagementUpdateResponse:
) -> Optional[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,
) -> BotManagementUpdateResponse:
) -> Optional[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,
) -> BotManagementUpdateResponse:
) -> Optional[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,
) -> BotManagementUpdateResponse:
) -> Optional[BotManagementUpdateResponse]:
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return cast(
BotManagementUpdateResponse,
Optional[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[BotManagementUpdateResponse]._unwrapper,
post_parser=ResultWrapper[Optional[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,
) -> BotManagementGetResponse:
) -> Optional[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(
BotManagementGetResponse,
Optional[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[BotManagementGetResponse]._unwrapper,
post_parser=ResultWrapper[Optional[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,
) -> BotManagementUpdateResponse:
) -> Optional[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,
) -> BotManagementUpdateResponse:
) -> Optional[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,
) -> BotManagementUpdateResponse:
) -> Optional[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,
) -> BotManagementUpdateResponse:
) -> Optional[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,
) -> BotManagementUpdateResponse:
) -> Optional[BotManagementUpdateResponse]:
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return cast(
BotManagementUpdateResponse,
Optional[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[BotManagementUpdateResponse]._unwrapper,
post_parser=ResultWrapper[Optional[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,
) -> BotManagementGetResponse:
) -> Optional[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(
BotManagementGetResponse,
Optional[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[BotManagementGetResponse]._unwrapper,
post_parser=ResultWrapper[Optional[BotManagementGetResponse]]._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[BotManagementGetResponse]
Expand Down
Loading

0 comments on commit f47b44d

Please sign in to comment.