Skip to content

Commit d39c7b5

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): api update (#2179)
1 parent bd94126 commit d39c7b5

File tree

5 files changed

+18
-54
lines changed

5 files changed

+18
-54
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1449
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-829ade7062fed63a30accc2a5e1a14c6c26fd4dc003d300d1b25a5416b8b8727.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-47eb882cbdc1acad6371a1827ff0a63b642a7b9a7a61049445cc4c2c4e7b9397.yml

api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8273,7 +8273,7 @@ from cloudflare.types.workflows import VersionListResponse, VersionGetResponse
82738273

82748274
Methods:
82758275

8276-
- <code title="get /accounts/{account_id}/workflows/{workflow_name}/versions">client.workflows.versions.<a href="./src/cloudflare/resources/workflows/versions.py">list</a>(workflow_name, \*, account_id, \*\*<a href="src/cloudflare/types/workflows/version_list_params.py">params</a>) -> <a href="./src/cloudflare/types/workflows/version_list_response.py">SyncV4PagePagination[VersionListResponse]</a></code>
8276+
- <code title="get /accounts/{account_id}/workflows/{workflow_name}/versions">client.workflows.versions.<a href="./src/cloudflare/resources/workflows/versions.py">list</a>(workflow_name, \*, account_id, \*\*<a href="src/cloudflare/types/workflows/version_list_params.py">params</a>) -> <a href="./src/cloudflare/types/workflows/version_list_response.py">SyncV4PagePaginationArray[VersionListResponse]</a></code>
82778277
- <code title="get /accounts/{account_id}/workflows/{workflow_name}/versions/{version_id}">client.workflows.versions.<a href="./src/cloudflare/resources/workflows/versions.py">get</a>(version_id, \*, account_id, workflow_name) -> <a href="./src/cloudflare/types/workflows/version_get_response.py">VersionGetResponse</a></code>
82788278

82798279
# ResourceSharing

src/cloudflare/resources/workflows/versions.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
async_to_streamed_response_wrapper,
1818
)
1919
from ..._wrappers import ResultWrapper
20-
from ...pagination import SyncV4PagePagination, AsyncV4PagePagination
20+
from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
2121
from ..._base_client import AsyncPaginator, make_request_options
2222
from ...types.workflows import version_list_params
2323
from ...types.workflows.version_get_response import VersionGetResponse
@@ -59,7 +59,7 @@ def list(
5959
extra_query: Query | None = None,
6060
extra_body: Body | None = None,
6161
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
62-
) -> SyncV4PagePagination[VersionListResponse]:
62+
) -> SyncV4PagePaginationArray[VersionListResponse]:
6363
"""
6464
List deployed Workflow versions
6565
@@ -78,7 +78,7 @@ def list(
7878
raise ValueError(f"Expected a non-empty value for `workflow_name` but received {workflow_name!r}")
7979
return self._get_api_list(
8080
f"/accounts/{account_id}/workflows/{workflow_name}/versions",
81-
page=SyncV4PagePagination[VersionListResponse],
81+
page=SyncV4PagePaginationArray[VersionListResponse],
8282
options=make_request_options(
8383
extra_headers=extra_headers,
8484
extra_query=extra_query,
@@ -172,7 +172,7 @@ def list(
172172
extra_query: Query | None = None,
173173
extra_body: Body | None = None,
174174
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
175-
) -> AsyncPaginator[VersionListResponse, AsyncV4PagePagination[VersionListResponse]]:
175+
) -> AsyncPaginator[VersionListResponse, AsyncV4PagePaginationArray[VersionListResponse]]:
176176
"""
177177
List deployed Workflow versions
178178
@@ -191,7 +191,7 @@ def list(
191191
raise ValueError(f"Expected a non-empty value for `workflow_name` but received {workflow_name!r}")
192192
return self._get_api_list(
193193
f"/accounts/{account_id}/workflows/{workflow_name}/versions",
194-
page=AsyncV4PagePagination[VersionListResponse],
194+
page=AsyncV4PagePaginationArray[VersionListResponse],
195195
options=make_request_options(
196196
extra_headers=extra_headers,
197197
extra_query=extra_query,
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,13 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import List, Optional
43
from datetime import datetime
5-
from typing_extensions import Literal
64

75
from ..._models import BaseModel
86

9-
__all__ = ["VersionListResponse", "Error", "Message", "Result", "ResultInfo"]
7+
__all__ = ["VersionListResponse"]
108

119

12-
class Error(BaseModel):
13-
code: float
14-
15-
message: str
16-
17-
18-
class Message(BaseModel):
19-
code: float
20-
21-
message: str
22-
23-
24-
class Result(BaseModel):
10+
class VersionListResponse(BaseModel):
2511
id: str
2612

2713
class_name: str
@@ -31,25 +17,3 @@ class Result(BaseModel):
3117
modified_on: datetime
3218

3319
workflow_id: str
34-
35-
36-
class ResultInfo(BaseModel):
37-
count: float
38-
39-
page: float
40-
41-
per_page: float
42-
43-
total_count: float
44-
45-
46-
class VersionListResponse(BaseModel):
47-
errors: List[Error]
48-
49-
messages: List[Message]
50-
51-
result: Result
52-
53-
success: Literal[True]
54-
55-
result_info: Optional[ResultInfo] = None

tests/api_resources/workflows/test_versions.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from cloudflare import Cloudflare, AsyncCloudflare
1111
from tests.utils import assert_matches_type
12-
from cloudflare.pagination import SyncV4PagePagination, AsyncV4PagePagination
12+
from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
1313
from cloudflare.types.workflows import VersionGetResponse, VersionListResponse
1414

1515
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -24,7 +24,7 @@ def test_method_list(self, client: Cloudflare) -> None:
2424
workflow_name="x",
2525
account_id="account_id",
2626
)
27-
assert_matches_type(SyncV4PagePagination[VersionListResponse], version, path=["response"])
27+
assert_matches_type(SyncV4PagePaginationArray[VersionListResponse], version, path=["response"])
2828

2929
@parametrize
3030
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
@@ -34,7 +34,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
3434
page=1,
3535
per_page=1,
3636
)
37-
assert_matches_type(SyncV4PagePagination[VersionListResponse], version, path=["response"])
37+
assert_matches_type(SyncV4PagePaginationArray[VersionListResponse], version, path=["response"])
3838

3939
@parametrize
4040
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -46,7 +46,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None:
4646
assert response.is_closed is True
4747
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
4848
version = response.parse()
49-
assert_matches_type(SyncV4PagePagination[VersionListResponse], version, path=["response"])
49+
assert_matches_type(SyncV4PagePaginationArray[VersionListResponse], version, path=["response"])
5050

5151
@parametrize
5252
def test_streaming_response_list(self, client: Cloudflare) -> None:
@@ -58,7 +58,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None:
5858
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
5959

6060
version = response.parse()
61-
assert_matches_type(SyncV4PagePagination[VersionListResponse], version, path=["response"])
61+
assert_matches_type(SyncV4PagePaginationArray[VersionListResponse], version, path=["response"])
6262

6363
assert cast(Any, response.is_closed) is True
6464

@@ -146,7 +146,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
146146
workflow_name="x",
147147
account_id="account_id",
148148
)
149-
assert_matches_type(AsyncV4PagePagination[VersionListResponse], version, path=["response"])
149+
assert_matches_type(AsyncV4PagePaginationArray[VersionListResponse], version, path=["response"])
150150

151151
@parametrize
152152
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
@@ -156,7 +156,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare)
156156
page=1,
157157
per_page=1,
158158
)
159-
assert_matches_type(AsyncV4PagePagination[VersionListResponse], version, path=["response"])
159+
assert_matches_type(AsyncV4PagePaginationArray[VersionListResponse], version, path=["response"])
160160

161161
@parametrize
162162
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -168,7 +168,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
168168
assert response.is_closed is True
169169
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
170170
version = await response.parse()
171-
assert_matches_type(AsyncV4PagePagination[VersionListResponse], version, path=["response"])
171+
assert_matches_type(AsyncV4PagePaginationArray[VersionListResponse], version, path=["response"])
172172

173173
@parametrize
174174
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -180,7 +180,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N
180180
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
181181

182182
version = await response.parse()
183-
assert_matches_type(AsyncV4PagePagination[VersionListResponse], version, path=["response"])
183+
assert_matches_type(AsyncV4PagePaginationArray[VersionListResponse], version, path=["response"])
184184

185185
assert cast(Any, response.is_closed) is True
186186

0 commit comments

Comments
 (0)