Skip to content

Commit d3e0648

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#1191)
1 parent 28c06a7 commit d3e0648

29 files changed

+747
-261
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1256
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-74d68374448e03b29a39bb6cdf6c39cdeaaaa691dd9c38f46a26a1d562c8ee37.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b116e60da4a69a05bc8823c2397e4a33d111c82a6b458ea4f480d0ba52ea8de0.yml

api.md

+14-8
Original file line numberDiff line numberDiff line change
@@ -2392,23 +2392,29 @@ from cloudflare.types.api_gateway.discovery import OperationEditResponse
23922392

23932393
Methods:
23942394

2395-
- <code title="get /zones/{zone_id}/api_gateway/discovery/operations">client.api_gateway.discovery.operations.<a href="./src/cloudflare/resources/api_gateway/discovery/operations.py">list</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/discovery/operation_list_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/discovery_operation.py">SyncSinglePage[DiscoveryOperation]</a></code>
2395+
- <code title="get /zones/{zone_id}/api_gateway/discovery/operations">client.api_gateway.discovery.operations.<a href="./src/cloudflare/resources/api_gateway/discovery/operations.py">list</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/discovery/operation_list_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/discovery_operation.py">SyncV4PagePaginationArray[DiscoveryOperation]</a></code>
23962396
- <code title="patch /zones/{zone_id}/api_gateway/discovery/operations/{operation_id}">client.api_gateway.discovery.operations.<a href="./src/cloudflare/resources/api_gateway/discovery/operations.py">edit</a>(operation_id, \*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/discovery/operation_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/discovery/operation_edit_response.py">OperationEditResponse</a></code>
23972397

23982398
## Operations
23992399

24002400
Types:
24012401

24022402
```python
2403-
from cloudflare.types.api_gateway import APIShield, OperationCreateResponse, OperationDeleteResponse
2403+
from cloudflare.types.api_gateway import (
2404+
APIShield,
2405+
OperationCreateResponse,
2406+
OperationListResponse,
2407+
OperationDeleteResponse,
2408+
OperationGetResponse,
2409+
)
24042410
```
24052411

24062412
Methods:
24072413

2408-
- <code title="post /zones/{zone_id}/api_gateway/operations">client.api_gateway.operations.<a href="./src/cloudflare/resources/api_gateway/operations/operations.py">create</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/operation_create_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/operation_create_response.py">Optional</a></code>
2409-
- <code title="get /zones/{zone_id}/api_gateway/operations">client.api_gateway.operations.<a href="./src/cloudflare/resources/api_gateway/operations/operations.py">list</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/operation_list_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/api_shield.py">SyncSinglePage[APIShield]</a></code>
2414+
- <code title="post /zones/{zone_id}/api_gateway/operations">client.api_gateway.operations.<a href="./src/cloudflare/resources/api_gateway/operations/operations.py">create</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/operation_create_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/operation_create_response.py">OperationCreateResponse</a></code>
2415+
- <code title="get /zones/{zone_id}/api_gateway/operations">client.api_gateway.operations.<a href="./src/cloudflare/resources/api_gateway/operations/operations.py">list</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/operation_list_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/operation_list_response.py">SyncV4PagePaginationArray[OperationListResponse]</a></code>
24102416
- <code title="delete /zones/{zone_id}/api_gateway/operations/{operation_id}">client.api_gateway.operations.<a href="./src/cloudflare/resources/api_gateway/operations/operations.py">delete</a>(operation_id, \*, zone_id) -> <a href="./src/cloudflare/types/api_gateway/operation_delete_response.py">OperationDeleteResponse</a></code>
2411-
- <code title="get /zones/{zone_id}/api_gateway/operations/{operation_id}">client.api_gateway.operations.<a href="./src/cloudflare/resources/api_gateway/operations/operations.py">get</a>(operation_id, \*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/operation_get_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/api_shield.py">APIShield</a></code>
2417+
- <code title="get /zones/{zone_id}/api_gateway/operations/{operation_id}">client.api_gateway.operations.<a href="./src/cloudflare/resources/api_gateway/operations/operations.py">get</a>(operation_id, \*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/operation_get_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/operation_get_response.py">OperationGetResponse</a></code>
24122418

24132419
### SchemaValidation
24142420

@@ -2472,8 +2478,8 @@ from cloudflare.types.api_gateway import (
24722478
Methods:
24732479

24742480
- <code title="post /zones/{zone_id}/api_gateway/user_schemas">client.api_gateway.user_schemas.<a href="./src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py">create</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/user_schema_create_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/schema_upload.py">SchemaUpload</a></code>
2475-
- <code title="get /zones/{zone_id}/api_gateway/user_schemas">client.api_gateway.user_schemas.<a href="./src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py">list</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/user_schema_list_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/public_schema.py">SyncSinglePage[PublicSchema]</a></code>
2476-
- <code title="delete /zones/{zone_id}/api_gateway/user_schemas/{schema_id}">client.api_gateway.user_schemas.<a href="./src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py">delete</a>(schema_id, \*, zone_id) -> <a href="./src/cloudflare/types/api_gateway/user_schema_delete_response.py">UserSchemaDeleteResponse</a></code>
2481+
- <code title="get /zones/{zone_id}/api_gateway/user_schemas">client.api_gateway.user_schemas.<a href="./src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py">list</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/user_schema_list_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/public_schema.py">SyncV4PagePaginationArray[PublicSchema]</a></code>
2482+
- <code title="delete /zones/{zone_id}/api_gateway/user_schemas/{schema_id}">client.api_gateway.user_schemas.<a href="./src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py">delete</a>(schema_id, \*, zone_id) -> <a href="./src/cloudflare/types/api_gateway/user_schema_delete_response.py">Optional</a></code>
24772483
- <code title="patch /zones/{zone_id}/api_gateway/user_schemas/{schema_id}">client.api_gateway.user_schemas.<a href="./src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py">edit</a>(schema_id, \*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/user_schema_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/public_schema.py">PublicSchema</a></code>
24782484
- <code title="get /zones/{zone_id}/api_gateway/user_schemas/{schema_id}">client.api_gateway.user_schemas.<a href="./src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py">get</a>(schema_id, \*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/user_schema_get_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/public_schema.py">PublicSchema</a></code>
24792485

@@ -2487,7 +2493,7 @@ from cloudflare.types.api_gateway.user_schemas import OperationListResponse
24872493

24882494
Methods:
24892495

2490-
- <code title="get /zones/{zone_id}/api_gateway/user_schemas/{schema_id}/operations">client.api_gateway.user_schemas.operations.<a href="./src/cloudflare/resources/api_gateway/user_schemas/operations.py">list</a>(schema_id, \*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/user_schemas/operation_list_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py">SyncSinglePage[OperationListResponse]</a></code>
2496+
- <code title="get /zones/{zone_id}/api_gateway/user_schemas/{schema_id}/operations">client.api_gateway.user_schemas.operations.<a href="./src/cloudflare/resources/api_gateway/user_schemas/operations.py">list</a>(schema_id, \*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/user_schemas/operation_list_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py">SyncV4PagePaginationArray[OperationListResponse]</a></code>
24912497

24922498
# ManagedHeaders
24932499

src/cloudflare/resources/api_gateway/configurations.py

+21-39
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Any, List, Type, Iterable, cast
5+
from typing import List, Type, Iterable, cast
66
from typing_extensions import Literal
77

88
import httpx
@@ -42,7 +42,7 @@ def update(
4242
self,
4343
*,
4444
zone_id: str,
45-
auth_id_characteristics: Iterable[configuration_update_params.AuthIDCharacteristic] | NotGiven = NOT_GIVEN,
45+
auth_id_characteristics: Iterable[configuration_update_params.AuthIDCharacteristic],
4646
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
4747
# The extra values given here take precedence over values defined on the client or passed to this method.
4848
extra_headers: Headers | None = None,
@@ -66,25 +66,16 @@ def update(
6666
"""
6767
if not zone_id:
6868
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
69-
return cast(
70-
ConfigurationUpdateResponse,
71-
self._put(
72-
f"/zones/{zone_id}/api_gateway/configuration",
73-
body=maybe_transform(
74-
{"auth_id_characteristics": auth_id_characteristics},
75-
configuration_update_params.ConfigurationUpdateParams,
76-
),
77-
options=make_request_options(
78-
extra_headers=extra_headers,
79-
extra_query=extra_query,
80-
extra_body=extra_body,
81-
timeout=timeout,
82-
post_parser=ResultWrapper[ConfigurationUpdateResponse]._unwrapper,
83-
),
84-
cast_to=cast(
85-
Any, ResultWrapper[ConfigurationUpdateResponse]
86-
), # Union types cannot be passed in as arguments in the type system
69+
return self._put(
70+
f"/zones/{zone_id}/api_gateway/configuration",
71+
body=maybe_transform(
72+
{"auth_id_characteristics": auth_id_characteristics},
73+
configuration_update_params.ConfigurationUpdateParams,
74+
),
75+
options=make_request_options(
76+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
8777
),
78+
cast_to=ConfigurationUpdateResponse,
8879
)
8980

9081
def get(
@@ -144,7 +135,7 @@ async def update(
144135
self,
145136
*,
146137
zone_id: str,
147-
auth_id_characteristics: Iterable[configuration_update_params.AuthIDCharacteristic] | NotGiven = NOT_GIVEN,
138+
auth_id_characteristics: Iterable[configuration_update_params.AuthIDCharacteristic],
148139
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
149140
# The extra values given here take precedence over values defined on the client or passed to this method.
150141
extra_headers: Headers | None = None,
@@ -168,25 +159,16 @@ async def update(
168159
"""
169160
if not zone_id:
170161
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
171-
return cast(
172-
ConfigurationUpdateResponse,
173-
await self._put(
174-
f"/zones/{zone_id}/api_gateway/configuration",
175-
body=await async_maybe_transform(
176-
{"auth_id_characteristics": auth_id_characteristics},
177-
configuration_update_params.ConfigurationUpdateParams,
178-
),
179-
options=make_request_options(
180-
extra_headers=extra_headers,
181-
extra_query=extra_query,
182-
extra_body=extra_body,
183-
timeout=timeout,
184-
post_parser=ResultWrapper[ConfigurationUpdateResponse]._unwrapper,
185-
),
186-
cast_to=cast(
187-
Any, ResultWrapper[ConfigurationUpdateResponse]
188-
), # Union types cannot be passed in as arguments in the type system
162+
return await self._put(
163+
f"/zones/{zone_id}/api_gateway/configuration",
164+
body=await async_maybe_transform(
165+
{"auth_id_characteristics": auth_id_characteristics},
166+
configuration_update_params.ConfigurationUpdateParams,
167+
),
168+
options=make_request_options(
169+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
189170
),
171+
cast_to=ConfigurationUpdateResponse,
190172
)
191173

192174
async def get(

src/cloudflare/resources/api_gateway/discovery/operations.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
async_to_streamed_response_wrapper,
2222
)
2323
from ...._wrappers import ResultWrapper
24-
from ....pagination import SyncSinglePage, AsyncSinglePage
24+
from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
2525
from ...._base_client import AsyncPaginator, make_request_options
2626
from ....types.api_gateway.discovery import operation_edit_params, operation_list_params
2727
from ....types.api_gateway.discovery_operation import DiscoveryOperation
@@ -51,16 +51,16 @@ def list(
5151
order: Literal["host", "method", "endpoint", "traffic_stats.requests", "traffic_stats.last_updated"]
5252
| NotGiven = NOT_GIVEN,
5353
origin: Literal["ML", "SessionIdentifier"] | NotGiven = NOT_GIVEN,
54-
page: object | NotGiven = NOT_GIVEN,
55-
per_page: object | NotGiven = NOT_GIVEN,
54+
page: int | NotGiven = NOT_GIVEN,
55+
per_page: int | NotGiven = NOT_GIVEN,
5656
state: Literal["review", "saved", "ignored"] | NotGiven = NOT_GIVEN,
5757
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5858
# The extra values given here take precedence over values defined on the client or passed to this method.
5959
extra_headers: Headers | None = None,
6060
extra_query: Query | None = None,
6161
extra_body: Body | None = None,
6262
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
63-
) -> SyncSinglePage[DiscoveryOperation]:
63+
) -> SyncV4PagePaginationArray[DiscoveryOperation]:
6464
"""
6565
Retrieve the most up to date view of discovered operations
6666
@@ -112,7 +112,7 @@ def list(
112112
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
113113
return self._get_api_list(
114114
f"/zones/{zone_id}/api_gateway/discovery/operations",
115-
page=SyncSinglePage[DiscoveryOperation],
115+
page=SyncV4PagePaginationArray[DiscoveryOperation],
116116
options=make_request_options(
117117
extra_headers=extra_headers,
118118
extra_query=extra_query,
@@ -156,7 +156,7 @@ def edit(
156156
Args:
157157
zone_id: Identifier
158158
159-
operation_id: UUID identifier
159+
operation_id: UUID
160160
161161
state: Mark state of operation in API Discovery
162162
@@ -210,16 +210,16 @@ def list(
210210
order: Literal["host", "method", "endpoint", "traffic_stats.requests", "traffic_stats.last_updated"]
211211
| NotGiven = NOT_GIVEN,
212212
origin: Literal["ML", "SessionIdentifier"] | NotGiven = NOT_GIVEN,
213-
page: object | NotGiven = NOT_GIVEN,
214-
per_page: object | NotGiven = NOT_GIVEN,
213+
page: int | NotGiven = NOT_GIVEN,
214+
per_page: int | NotGiven = NOT_GIVEN,
215215
state: Literal["review", "saved", "ignored"] | NotGiven = NOT_GIVEN,
216216
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
217217
# The extra values given here take precedence over values defined on the client or passed to this method.
218218
extra_headers: Headers | None = None,
219219
extra_query: Query | None = None,
220220
extra_body: Body | None = None,
221221
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
222-
) -> AsyncPaginator[DiscoveryOperation, AsyncSinglePage[DiscoveryOperation]]:
222+
) -> AsyncPaginator[DiscoveryOperation, AsyncV4PagePaginationArray[DiscoveryOperation]]:
223223
"""
224224
Retrieve the most up to date view of discovered operations
225225
@@ -271,7 +271,7 @@ def list(
271271
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
272272
return self._get_api_list(
273273
f"/zones/{zone_id}/api_gateway/discovery/operations",
274-
page=AsyncSinglePage[DiscoveryOperation],
274+
page=AsyncV4PagePaginationArray[DiscoveryOperation],
275275
options=make_request_options(
276276
extra_headers=extra_headers,
277277
extra_query=extra_query,
@@ -315,7 +315,7 @@ async def edit(
315315
Args:
316316
zone_id: Identifier
317317
318-
operation_id: UUID identifier
318+
operation_id: UUID
319319
320320
state: Mark state of operation in API Discovery
321321

0 commit comments

Comments
 (0)