Skip to content

Commit 06eb2a6

Browse files
chore(api): update composite API spec
1 parent bda625c commit 06eb2a6

7 files changed

Lines changed: 31 additions & 89 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1822
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4c953d01ba0d29acde0a9aad85619356c3b6287c8144c17929504f7125bda785.yml
3-
openapi_spec_hash: fcd36105bdcfc881e47185b5ea04bd68
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-01cf0b8416cacc095e16fcc4f6924d525fbad59cb74cc073e9e04221310f2713.yml
3+
openapi_spec_hash: a010543a98c2cb9cca203fe0c5c4ed13
44
config_hash: 0ce5789fc4b59ae352e68d00847570c2

api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2760,13 +2760,13 @@ Methods:
27602760
Types:
27612761

27622762
```python
2763-
from cloudflare.types.api_gateway import Configuration, ConfigurationUpdateResponse
2763+
from cloudflare.types.api_gateway import Configuration
27642764
```
27652765

27662766
Methods:
27672767

2768-
- <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_update_response.py">ConfigurationUpdateResponse</a></code>
2769-
- <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>
2768+
- <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>
2769+
- <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>
27702770

27712771
## Discovery
27722772

src/cloudflare/resources/api_gateway/configurations.py

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Type, Iterable, cast
6-
from typing_extensions import Literal
5+
from typing import Type, Iterable, cast
76

87
import httpx
98

10-
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
9+
from ..._types import Body, Query, Headers, NotGiven, not_given
1110
from ..._utils import maybe_transform, async_maybe_transform
1211
from ..._compat import cached_property
1312
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -19,9 +18,8 @@
1918
)
2019
from ..._wrappers import ResultWrapper
2120
from ..._base_client import make_request_options
22-
from ...types.api_gateway import configuration_get_params, configuration_update_params
21+
from ...types.api_gateway import configuration_update_params
2322
from ...types.api_gateway.configuration import Configuration
24-
from ...types.api_gateway.configuration_update_response import ConfigurationUpdateResponse
2523

2624
__all__ = ["ConfigurationsResource", "AsyncConfigurationsResource"]
2725

@@ -57,9 +55,9 @@ def update(
5755
extra_query: Query | None = None,
5856
extra_body: Body | None = None,
5957
timeout: float | httpx.Timeout | None | NotGiven = not_given,
60-
) -> ConfigurationUpdateResponse:
58+
) -> Configuration:
6159
"""
62-
Set configuration properties
60+
Update configuration properties
6361
6462
Args:
6563
zone_id: Identifier.
@@ -81,16 +79,19 @@ def update(
8179
configuration_update_params.ConfigurationUpdateParams,
8280
),
8381
options=make_request_options(
84-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
82+
extra_headers=extra_headers,
83+
extra_query=extra_query,
84+
extra_body=extra_body,
85+
timeout=timeout,
86+
post_parser=ResultWrapper[Configuration]._unwrapper,
8587
),
86-
cast_to=ConfigurationUpdateResponse,
88+
cast_to=cast(Type[Configuration], ResultWrapper[Configuration]),
8789
)
8890

8991
def get(
9092
self,
9193
*,
9294
zone_id: str,
93-
properties: List[Literal["auth_id_characteristics"]] | Omit = omit,
9495
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
9596
# The extra values given here take precedence over values defined on the client or passed to this method.
9697
extra_headers: Headers | None = None,
@@ -104,8 +105,6 @@ def get(
104105
Args:
105106
zone_id: Identifier.
106107
107-
properties: Requests information about certain properties.
108-
109108
extra_headers: Send extra headers
110109
111110
extra_query: Add additional query parameters to the request
@@ -123,7 +122,6 @@ def get(
123122
extra_query=extra_query,
124123
extra_body=extra_body,
125124
timeout=timeout,
126-
query=maybe_transform({"properties": properties}, configuration_get_params.ConfigurationGetParams),
127125
post_parser=ResultWrapper[Configuration]._unwrapper,
128126
),
129127
cast_to=cast(Type[Configuration], ResultWrapper[Configuration]),
@@ -161,9 +159,9 @@ async def update(
161159
extra_query: Query | None = None,
162160
extra_body: Body | None = None,
163161
timeout: float | httpx.Timeout | None | NotGiven = not_given,
164-
) -> ConfigurationUpdateResponse:
162+
) -> Configuration:
165163
"""
166-
Set configuration properties
164+
Update configuration properties
167165
168166
Args:
169167
zone_id: Identifier.
@@ -185,16 +183,19 @@ async def update(
185183
configuration_update_params.ConfigurationUpdateParams,
186184
),
187185
options=make_request_options(
188-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
186+
extra_headers=extra_headers,
187+
extra_query=extra_query,
188+
extra_body=extra_body,
189+
timeout=timeout,
190+
post_parser=ResultWrapper[Configuration]._unwrapper,
189191
),
190-
cast_to=ConfigurationUpdateResponse,
192+
cast_to=cast(Type[Configuration], ResultWrapper[Configuration]),
191193
)
192194

193195
async def get(
194196
self,
195197
*,
196198
zone_id: str,
197-
properties: List[Literal["auth_id_characteristics"]] | Omit = omit,
198199
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
199200
# The extra values given here take precedence over values defined on the client or passed to this method.
200201
extra_headers: Headers | None = None,
@@ -208,8 +209,6 @@ async def get(
208209
Args:
209210
zone_id: Identifier.
210211
211-
properties: Requests information about certain properties.
212-
213212
extra_headers: Send extra headers
214213
215214
extra_query: Add additional query parameters to the request
@@ -227,9 +226,6 @@ async def get(
227226
extra_query=extra_query,
228227
extra_body=extra_body,
229228
timeout=timeout,
230-
query=await async_maybe_transform(
231-
{"properties": properties}, configuration_get_params.ConfigurationGetParams
232-
),
233229
post_parser=ResultWrapper[Configuration]._unwrapper,
234230
),
235231
cast_to=cast(Type[Configuration], ResultWrapper[Configuration]),

src/cloudflare/types/api_gateway/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@
1919
from .operation_list_response import OperationListResponse as OperationListResponse
2020
from .user_schema_edit_params import UserSchemaEditParams as UserSchemaEditParams
2121
from .user_schema_list_params import UserSchemaListParams as UserSchemaListParams
22-
from .configuration_get_params import ConfigurationGetParams as ConfigurationGetParams
2322
from .operation_create_response import OperationCreateResponse as OperationCreateResponse
2423
from .operation_delete_response import OperationDeleteResponse as OperationDeleteResponse
2524
from .user_schema_create_params import UserSchemaCreateParams as UserSchemaCreateParams
2625
from .configuration_update_params import ConfigurationUpdateParams as ConfigurationUpdateParams
2726
from .user_schema_delete_response import UserSchemaDeleteResponse as UserSchemaDeleteResponse
2827
from .operation_bulk_create_params import OperationBulkCreateParams as OperationBulkCreateParams
29-
from .configuration_update_response import ConfigurationUpdateResponse as ConfigurationUpdateResponse
3028
from .operation_bulk_create_response import OperationBulkCreateResponse as OperationBulkCreateResponse
3129
from .operation_bulk_delete_response import OperationBulkDeleteResponse as OperationBulkDeleteResponse

src/cloudflare/types/api_gateway/configuration_get_params.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/cloudflare/types/api_gateway/configuration_update_response.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/api_resources/api_gateway/test_configurations.py

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99

1010
from cloudflare import Cloudflare, AsyncCloudflare
1111
from tests.utils import assert_matches_type
12-
from cloudflare.types.api_gateway import (
13-
Configuration,
14-
ConfigurationUpdateResponse,
15-
)
12+
from cloudflare.types.api_gateway import Configuration
1613

1714
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
1815

@@ -31,7 +28,7 @@ def test_method_update(self, client: Cloudflare) -> None:
3128
}
3229
],
3330
)
34-
assert_matches_type(ConfigurationUpdateResponse, configuration, path=["response"])
31+
assert_matches_type(Configuration, configuration, path=["response"])
3532

3633
@parametrize
3734
def test_raw_response_update(self, client: Cloudflare) -> None:
@@ -48,7 +45,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None:
4845
assert response.is_closed is True
4946
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
5047
configuration = response.parse()
51-
assert_matches_type(ConfigurationUpdateResponse, configuration, path=["response"])
48+
assert_matches_type(Configuration, configuration, path=["response"])
5249

5350
@parametrize
5451
def test_streaming_response_update(self, client: Cloudflare) -> None:
@@ -65,7 +62,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None:
6562
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
6663

6764
configuration = response.parse()
68-
assert_matches_type(ConfigurationUpdateResponse, configuration, path=["response"])
65+
assert_matches_type(Configuration, configuration, path=["response"])
6966

7067
assert cast(Any, response.is_closed) is True
7168

@@ -89,14 +86,6 @@ def test_method_get(self, client: Cloudflare) -> None:
8986
)
9087
assert_matches_type(Configuration, configuration, path=["response"])
9188

92-
@parametrize
93-
def test_method_get_with_all_params(self, client: Cloudflare) -> None:
94-
configuration = client.api_gateway.configurations.get(
95-
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
96-
properties=["auth_id_characteristics"],
97-
)
98-
assert_matches_type(Configuration, configuration, path=["response"])
99-
10089
@parametrize
10190
def test_raw_response_get(self, client: Cloudflare) -> None:
10291
response = client.api_gateway.configurations.with_raw_response.get(
@@ -145,7 +134,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None:
145134
}
146135
],
147136
)
148-
assert_matches_type(ConfigurationUpdateResponse, configuration, path=["response"])
137+
assert_matches_type(Configuration, configuration, path=["response"])
149138

150139
@parametrize
151140
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
@@ -162,7 +151,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
162151
assert response.is_closed is True
163152
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
164153
configuration = await response.parse()
165-
assert_matches_type(ConfigurationUpdateResponse, configuration, path=["response"])
154+
assert_matches_type(Configuration, configuration, path=["response"])
166155

167156
@parametrize
168157
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
@@ -179,7 +168,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) ->
179168
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
180169

181170
configuration = await response.parse()
182-
assert_matches_type(ConfigurationUpdateResponse, configuration, path=["response"])
171+
assert_matches_type(Configuration, configuration, path=["response"])
183172

184173
assert cast(Any, response.is_closed) is True
185174

@@ -203,14 +192,6 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
203192
)
204193
assert_matches_type(Configuration, configuration, path=["response"])
205194

206-
@parametrize
207-
async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None:
208-
configuration = await async_client.api_gateway.configurations.get(
209-
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
210-
properties=["auth_id_characteristics"],
211-
)
212-
assert_matches_type(Configuration, configuration, path=["response"])
213-
214195
@parametrize
215196
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
216197
response = await async_client.api_gateway.configurations.with_raw_response.get(

0 commit comments

Comments
 (0)