Skip to content

Commit 2de0fb0

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): manual updates (#2195)
1 parent 9949651 commit 2de0fb0

File tree

6 files changed

+23
-27
lines changed

6 files changed

+23
-27
lines changed

api.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -2653,7 +2653,7 @@ Methods:
26532653
Types:
26542654

26552655
```python
2656-
from cloudflare.types.api_gateway import DiscoveryGetResponse
2656+
from cloudflare.types.api_gateway import DiscoveryOperation, DiscoveryGetResponse
26572657
```
26582658

26592659
Methods:
@@ -2665,16 +2665,12 @@ Methods:
26652665
Types:
26662666

26672667
```python
2668-
from cloudflare.types.api_gateway.discovery import (
2669-
OperationListResponse,
2670-
OperationBulkEditResponse,
2671-
OperationEditResponse,
2672-
)
2668+
from cloudflare.types.api_gateway.discovery import OperationBulkEditResponse, OperationEditResponse
26732669
```
26742670

26752671
Methods:
26762672

2677-
- <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_list_response.py">SyncV4PagePaginationArray[OperationListResponse]</a></code>
2673+
- <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>
26782674
- <code title="patch /zones/{zone_id}/api_gateway/discovery/operations">client.api_gateway.discovery.operations.<a href="./src/cloudflare/resources/api_gateway/discovery/operations.py">bulk_edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/discovery/operation_bulk_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/discovery/operation_bulk_edit_response.py">OperationBulkEditResponse</a></code>
26792675
- <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>
26802676

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
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, operation_bulk_edit_params
27+
from ....types.api_gateway.discovery_operation import DiscoveryOperation
2728
from ....types.api_gateway.discovery.operation_edit_response import OperationEditResponse
28-
from ....types.api_gateway.discovery.operation_list_response import OperationListResponse
2929
from ....types.api_gateway.discovery.operation_bulk_edit_response import OperationBulkEditResponse
3030

3131
__all__ = ["OperationsResource", "AsyncOperationsResource"]
@@ -72,7 +72,7 @@ def list(
7272
extra_query: Query | None = None,
7373
extra_body: Body | None = None,
7474
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
75-
) -> SyncV4PagePaginationArray[OperationListResponse]:
75+
) -> SyncV4PagePaginationArray[DiscoveryOperation]:
7676
"""
7777
Retrieve the most up to date view of discovered operations
7878
@@ -124,7 +124,7 @@ def list(
124124
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
125125
return self._get_api_list(
126126
f"/zones/{zone_id}/api_gateway/discovery/operations",
127-
page=SyncV4PagePaginationArray[OperationListResponse],
127+
page=SyncV4PagePaginationArray[DiscoveryOperation],
128128
options=make_request_options(
129129
extra_headers=extra_headers,
130130
extra_query=extra_query,
@@ -146,7 +146,7 @@ def list(
146146
operation_list_params.OperationListParams,
147147
),
148148
),
149-
model=OperationListResponse,
149+
model=DiscoveryOperation,
150150
)
151151

152152
def bulk_edit(
@@ -283,7 +283,7 @@ def list(
283283
extra_query: Query | None = None,
284284
extra_body: Body | None = None,
285285
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
286-
) -> AsyncPaginator[OperationListResponse, AsyncV4PagePaginationArray[OperationListResponse]]:
286+
) -> AsyncPaginator[DiscoveryOperation, AsyncV4PagePaginationArray[DiscoveryOperation]]:
287287
"""
288288
Retrieve the most up to date view of discovered operations
289289
@@ -335,7 +335,7 @@ def list(
335335
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
336336
return self._get_api_list(
337337
f"/zones/{zone_id}/api_gateway/discovery/operations",
338-
page=AsyncV4PagePaginationArray[OperationListResponse],
338+
page=AsyncV4PagePaginationArray[DiscoveryOperation],
339339
options=make_request_options(
340340
extra_headers=extra_headers,
341341
extra_query=extra_query,
@@ -357,7 +357,7 @@ def list(
357357
operation_list_params.OperationListParams,
358358
),
359359
),
360-
model=OperationListResponse,
360+
model=DiscoveryOperation,
361361
)
362362

363363
async def bulk_edit(

src/cloudflare/types/api_gateway/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from .public_schema import PublicSchema as PublicSchema
1010
from .schema_upload import SchemaUpload as SchemaUpload
1111
from .schema_list_params import SchemaListParams as SchemaListParams
12+
from .discovery_operation import DiscoveryOperation as DiscoveryOperation
1213
from .operation_get_params import OperationGetParams as OperationGetParams
1314
from .schema_list_response import SchemaListResponse as SchemaListResponse
1415
from .operation_list_params import OperationListParams as OperationListParams

src/cloudflare/types/api_gateway/discovery/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@
55
from .operation_edit_params import OperationEditParams as OperationEditParams
66
from .operation_list_params import OperationListParams as OperationListParams
77
from .operation_edit_response import OperationEditResponse as OperationEditResponse
8-
from .operation_list_response import OperationListResponse as OperationListResponse
98
from .operation_bulk_edit_params import OperationBulkEditParams as OperationBulkEditParams
109
from .operation_bulk_edit_response import OperationBulkEditResponse as OperationBulkEditResponse

src/cloudflare/types/api_gateway/discovery/operation_list_response.py src/cloudflare/types/api_gateway/discovery_operation.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
from datetime import datetime
55
from typing_extensions import Literal
66

7-
from ...._models import BaseModel
7+
from ..._models import BaseModel
88

9-
__all__ = ["OperationListResponse", "Features", "FeaturesTrafficStats"]
9+
__all__ = ["DiscoveryOperation", "Features", "FeaturesTrafficStats"]
1010

1111

1212
class FeaturesTrafficStats(BaseModel):
@@ -23,7 +23,7 @@ class Features(BaseModel):
2323
traffic_stats: Optional[FeaturesTrafficStats] = None
2424

2525

26-
class OperationListResponse(BaseModel):
26+
class DiscoveryOperation(BaseModel):
2727
id: str
2828
"""UUID"""
2929

tests/api_resources/api_gateway/discovery/test_operations.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
from cloudflare import Cloudflare, AsyncCloudflare
1111
from tests.utils import assert_matches_type
1212
from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
13+
from cloudflare.types.api_gateway import DiscoveryOperation
1314
from cloudflare.types.api_gateway.discovery import (
1415
OperationEditResponse,
15-
OperationListResponse,
1616
OperationBulkEditResponse,
1717
)
1818

@@ -27,7 +27,7 @@ def test_method_list(self, client: Cloudflare) -> None:
2727
operation = client.api_gateway.discovery.operations.list(
2828
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
2929
)
30-
assert_matches_type(SyncV4PagePaginationArray[OperationListResponse], operation, path=["response"])
30+
assert_matches_type(SyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])
3131

3232
@parametrize
3333
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
@@ -44,7 +44,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
4444
per_page=5,
4545
state="review",
4646
)
47-
assert_matches_type(SyncV4PagePaginationArray[OperationListResponse], operation, path=["response"])
47+
assert_matches_type(SyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])
4848

4949
@parametrize
5050
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -55,7 +55,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None:
5555
assert response.is_closed is True
5656
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
5757
operation = response.parse()
58-
assert_matches_type(SyncV4PagePaginationArray[OperationListResponse], operation, path=["response"])
58+
assert_matches_type(SyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])
5959

6060
@parametrize
6161
def test_streaming_response_list(self, client: Cloudflare) -> None:
@@ -66,7 +66,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None:
6666
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
6767

6868
operation = response.parse()
69-
assert_matches_type(SyncV4PagePaginationArray[OperationListResponse], operation, path=["response"])
69+
assert_matches_type(SyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])
7070

7171
assert cast(Any, response.is_closed) is True
7272

@@ -197,7 +197,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
197197
operation = await async_client.api_gateway.discovery.operations.list(
198198
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
199199
)
200-
assert_matches_type(AsyncV4PagePaginationArray[OperationListResponse], operation, path=["response"])
200+
assert_matches_type(AsyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])
201201

202202
@parametrize
203203
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
@@ -214,7 +214,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare)
214214
per_page=5,
215215
state="review",
216216
)
217-
assert_matches_type(AsyncV4PagePaginationArray[OperationListResponse], operation, path=["response"])
217+
assert_matches_type(AsyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])
218218

219219
@parametrize
220220
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -225,7 +225,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
225225
assert response.is_closed is True
226226
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
227227
operation = await response.parse()
228-
assert_matches_type(AsyncV4PagePaginationArray[OperationListResponse], operation, path=["response"])
228+
assert_matches_type(AsyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])
229229

230230
@parametrize
231231
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -236,7 +236,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N
236236
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
237237

238238
operation = await response.parse()
239-
assert_matches_type(AsyncV4PagePaginationArray[OperationListResponse], operation, path=["response"])
239+
assert_matches_type(AsyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])
240240

241241
assert cast(Any, response.is_closed) is True
242242

0 commit comments

Comments
 (0)