Skip to content

Commit 622f384

Browse files
chore(api): update composite API spec
1 parent 64bc54f commit 622f384

File tree

7 files changed

+88
-5
lines changed

7 files changed

+88
-5
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1891
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7e4d0f06a14e00e1fded122c6e363b955753c19f529887d691584630b9625544.yml
3-
openapi_spec_hash: f04905b36443a3e136496c9dc28ea51d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6d83cb5b55796ad6fb90e4941b68bf0814dee7735ce3a458dd249f5c5bcea2cb.yml
3+
openapi_spec_hash: 1c6947fbdbd925e0acbe688861673092
44
config_hash: f8ad41a1e87119e46c6452f8f1ea0440

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2799,7 +2799,7 @@ from cloudflare.types.api_gateway import Configuration
27992799
Methods:
28002800

28012801
- <code title="put /zones/{zone_id}/api_gateway/configuration">client.api_gateway.configurations.<a href="./src/cloudflare/resources/api_gateway/configurations.py">update</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/configuration_update_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/configuration.py">Configuration</a></code>
2802-
- <code title="get /zones/{zone_id}/api_gateway/configuration">client.api_gateway.configurations.<a href="./src/cloudflare/resources/api_gateway/configurations.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/api_gateway/configuration.py">Configuration</a></code>
2802+
- <code title="get /zones/{zone_id}/api_gateway/configuration">client.api_gateway.configurations.<a href="./src/cloudflare/resources/api_gateway/configurations.py">get</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/configuration_get_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/configuration.py">Configuration</a></code>
28032803

28042804
## Discovery
28052805

src/cloudflare/resources/api_gateway/configurations.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import httpx
88

9-
from ..._types import Body, Query, Headers, NotGiven, not_given
9+
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
1010
from ..._utils import maybe_transform, async_maybe_transform
1111
from ..._compat import cached_property
1212
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -18,7 +18,7 @@
1818
)
1919
from ..._wrappers import ResultWrapper
2020
from ..._base_client import make_request_options
21-
from ...types.api_gateway import configuration_update_params
21+
from ...types.api_gateway import configuration_get_params, configuration_update_params
2222
from ...types.api_gateway.configuration import Configuration
2323

2424
__all__ = ["ConfigurationsResource", "AsyncConfigurationsResource"]
@@ -49,6 +49,7 @@ def update(
4949
*,
5050
zone_id: str,
5151
auth_id_characteristics: Iterable[configuration_update_params.AuthIDCharacteristic],
52+
normalize: bool | Omit = omit,
5253
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5354
# The extra values given here take precedence over values defined on the client or passed to this method.
5455
extra_headers: Headers | None = None,
@@ -62,6 +63,8 @@ def update(
6263
Args:
6364
zone_id: Identifier.
6465
66+
normalize: Ensures that the configuration is written or retrieved in normalized fashion
67+
6568
extra_headers: Send extra headers
6669
6770
extra_query: Add additional query parameters to the request
@@ -83,6 +86,7 @@ def update(
8386
extra_query=extra_query,
8487
extra_body=extra_body,
8588
timeout=timeout,
89+
query=maybe_transform({"normalize": normalize}, configuration_update_params.ConfigurationUpdateParams),
8690
post_parser=ResultWrapper[Configuration]._unwrapper,
8791
),
8892
cast_to=cast(Type[Configuration], ResultWrapper[Configuration]),
@@ -92,6 +96,7 @@ def get(
9296
self,
9397
*,
9498
zone_id: str,
99+
normalize: bool | Omit = omit,
95100
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
96101
# The extra values given here take precedence over values defined on the client or passed to this method.
97102
extra_headers: Headers | None = None,
@@ -105,6 +110,8 @@ def get(
105110
Args:
106111
zone_id: Identifier.
107112
113+
normalize: Ensures that the configuration is written or retrieved in normalized fashion
114+
108115
extra_headers: Send extra headers
109116
110117
extra_query: Add additional query parameters to the request
@@ -122,6 +129,7 @@ def get(
122129
extra_query=extra_query,
123130
extra_body=extra_body,
124131
timeout=timeout,
132+
query=maybe_transform({"normalize": normalize}, configuration_get_params.ConfigurationGetParams),
125133
post_parser=ResultWrapper[Configuration]._unwrapper,
126134
),
127135
cast_to=cast(Type[Configuration], ResultWrapper[Configuration]),
@@ -153,6 +161,7 @@ async def update(
153161
*,
154162
zone_id: str,
155163
auth_id_characteristics: Iterable[configuration_update_params.AuthIDCharacteristic],
164+
normalize: bool | Omit = omit,
156165
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
157166
# The extra values given here take precedence over values defined on the client or passed to this method.
158167
extra_headers: Headers | None = None,
@@ -166,6 +175,8 @@ async def update(
166175
Args:
167176
zone_id: Identifier.
168177
178+
normalize: Ensures that the configuration is written or retrieved in normalized fashion
179+
169180
extra_headers: Send extra headers
170181
171182
extra_query: Add additional query parameters to the request
@@ -187,6 +198,9 @@ async def update(
187198
extra_query=extra_query,
188199
extra_body=extra_body,
189200
timeout=timeout,
201+
query=await async_maybe_transform(
202+
{"normalize": normalize}, configuration_update_params.ConfigurationUpdateParams
203+
),
190204
post_parser=ResultWrapper[Configuration]._unwrapper,
191205
),
192206
cast_to=cast(Type[Configuration], ResultWrapper[Configuration]),
@@ -196,6 +210,7 @@ async def get(
196210
self,
197211
*,
198212
zone_id: str,
213+
normalize: bool | Omit = omit,
199214
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
200215
# The extra values given here take precedence over values defined on the client or passed to this method.
201216
extra_headers: Headers | None = None,
@@ -209,6 +224,8 @@ async def get(
209224
Args:
210225
zone_id: Identifier.
211226
227+
normalize: Ensures that the configuration is written or retrieved in normalized fashion
228+
212229
extra_headers: Send extra headers
213230
214231
extra_query: Add additional query parameters to the request
@@ -226,6 +243,9 @@ async def get(
226243
extra_query=extra_query,
227244
extra_body=extra_body,
228245
timeout=timeout,
246+
query=await async_maybe_transform(
247+
{"normalize": normalize}, configuration_get_params.ConfigurationGetParams
248+
),
229249
post_parser=ResultWrapper[Configuration]._unwrapper,
230250
),
231251
cast_to=cast(Type[Configuration], ResultWrapper[Configuration]),

src/cloudflare/types/api_gateway/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from .operation_list_response import OperationListResponse as OperationListResponse
1818
from .user_schema_edit_params import UserSchemaEditParams as UserSchemaEditParams
1919
from .user_schema_list_params import UserSchemaListParams as UserSchemaListParams
20+
from .configuration_get_params import ConfigurationGetParams as ConfigurationGetParams
2021
from .operation_create_response import OperationCreateResponse as OperationCreateResponse
2122
from .operation_delete_response import OperationDeleteResponse as OperationDeleteResponse
2223
from .user_schema_create_params import UserSchemaCreateParams as UserSchemaCreateParams
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Required, TypedDict
6+
7+
__all__ = ["ConfigurationGetParams"]
8+
9+
10+
class ConfigurationGetParams(TypedDict, total=False):
11+
zone_id: Required[str]
12+
"""Identifier."""
13+
14+
normalize: bool
15+
"""Ensures that the configuration is written or retrieved in normalized fashion"""

src/cloudflare/types/api_gateway/configuration_update_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ class ConfigurationUpdateParams(TypedDict, total=False):
1919

2020
auth_id_characteristics: Required[Iterable[AuthIDCharacteristic]]
2121

22+
normalize: bool
23+
"""Ensures that the configuration is written or retrieved in normalized fashion"""
24+
2225

2326
class AuthIDCharacteristicAPIShieldAuthIDCharacteristic(TypedDict, total=False):
2427
name: Required[str]

tests/api_resources/api_gateway/test_configurations.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,20 @@ def test_method_update(self, client: Cloudflare) -> None:
3030
)
3131
assert_matches_type(Configuration, configuration, path=["response"])
3232

33+
@parametrize
34+
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
35+
configuration = client.api_gateway.configurations.update(
36+
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
37+
auth_id_characteristics=[
38+
{
39+
"name": "authorization",
40+
"type": "header",
41+
}
42+
],
43+
normalize=True,
44+
)
45+
assert_matches_type(Configuration, configuration, path=["response"])
46+
3347
@parametrize
3448
def test_raw_response_update(self, client: Cloudflare) -> None:
3549
response = client.api_gateway.configurations.with_raw_response.update(
@@ -86,6 +100,14 @@ def test_method_get(self, client: Cloudflare) -> None:
86100
)
87101
assert_matches_type(Configuration, configuration, path=["response"])
88102

103+
@parametrize
104+
def test_method_get_with_all_params(self, client: Cloudflare) -> None:
105+
configuration = client.api_gateway.configurations.get(
106+
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
107+
normalize=True,
108+
)
109+
assert_matches_type(Configuration, configuration, path=["response"])
110+
89111
@parametrize
90112
def test_raw_response_get(self, client: Cloudflare) -> None:
91113
response = client.api_gateway.configurations.with_raw_response.get(
@@ -136,6 +158,20 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None:
136158
)
137159
assert_matches_type(Configuration, configuration, path=["response"])
138160

161+
@parametrize
162+
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
163+
configuration = await async_client.api_gateway.configurations.update(
164+
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
165+
auth_id_characteristics=[
166+
{
167+
"name": "authorization",
168+
"type": "header",
169+
}
170+
],
171+
normalize=True,
172+
)
173+
assert_matches_type(Configuration, configuration, path=["response"])
174+
139175
@parametrize
140176
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
141177
response = await async_client.api_gateway.configurations.with_raw_response.update(
@@ -192,6 +228,14 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
192228
)
193229
assert_matches_type(Configuration, configuration, path=["response"])
194230

231+
@parametrize
232+
async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None:
233+
configuration = await async_client.api_gateway.configurations.get(
234+
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
235+
normalize=True,
236+
)
237+
assert_matches_type(Configuration, configuration, path=["response"])
238+
195239
@parametrize
196240
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
197241
response = await async_client.api_gateway.configurations.with_raw_response.get(

0 commit comments

Comments
 (0)