Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1449
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-829ade7062fed63a30accc2a5e1a14c6c26fd4dc003d300d1b25a5416b8b8727.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-47eb882cbdc1acad6371a1827ff0a63b642a7b9a7a61049445cc4c2c4e7b9397.yml
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8273,7 +8273,7 @@ from cloudflare.types.workflows import VersionListResponse, VersionGetResponse

Methods:

- <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>
- <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>
- <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>

# ResourceSharing
Expand Down
10 changes: 5 additions & 5 deletions src/cloudflare/resources/workflows/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
async_to_streamed_response_wrapper,
)
from ..._wrappers import ResultWrapper
from ...pagination import SyncV4PagePagination, AsyncV4PagePagination
from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
from ..._base_client import AsyncPaginator, make_request_options
from ...types.workflows import version_list_params
from ...types.workflows.version_get_response import VersionGetResponse
Expand Down Expand Up @@ -59,7 +59,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncV4PagePagination[VersionListResponse]:
) -> SyncV4PagePaginationArray[VersionListResponse]:
"""
List deployed Workflow versions

Expand All @@ -78,7 +78,7 @@ def list(
raise ValueError(f"Expected a non-empty value for `workflow_name` but received {workflow_name!r}")
return self._get_api_list(
f"/accounts/{account_id}/workflows/{workflow_name}/versions",
page=SyncV4PagePagination[VersionListResponse],
page=SyncV4PagePaginationArray[VersionListResponse],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand Down Expand Up @@ -172,7 +172,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[VersionListResponse, AsyncV4PagePagination[VersionListResponse]]:
) -> AsyncPaginator[VersionListResponse, AsyncV4PagePaginationArray[VersionListResponse]]:
"""
List deployed Workflow versions

Expand All @@ -191,7 +191,7 @@ def list(
raise ValueError(f"Expected a non-empty value for `workflow_name` but received {workflow_name!r}")
return self._get_api_list(
f"/accounts/{account_id}/workflows/{workflow_name}/versions",
page=AsyncV4PagePagination[VersionListResponse],
page=AsyncV4PagePaginationArray[VersionListResponse],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand Down
40 changes: 2 additions & 38 deletions src/cloudflare/types/workflows/version_list_response.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,13 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Optional
from datetime import datetime
from typing_extensions import Literal

from ..._models import BaseModel

__all__ = ["VersionListResponse", "Error", "Message", "Result", "ResultInfo"]
__all__ = ["VersionListResponse"]


class Error(BaseModel):
code: float

message: str


class Message(BaseModel):
code: float

message: str


class Result(BaseModel):
class VersionListResponse(BaseModel):
id: str

class_name: str
Expand All @@ -31,25 +17,3 @@ class Result(BaseModel):
modified_on: datetime

workflow_id: str


class ResultInfo(BaseModel):
count: float

page: float

per_page: float

total_count: float


class VersionListResponse(BaseModel):
errors: List[Error]

messages: List[Message]

result: Result

success: Literal[True]

result_info: Optional[ResultInfo] = None
18 changes: 9 additions & 9 deletions tests/api_resources/workflows/test_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from cloudflare import Cloudflare, AsyncCloudflare
from tests.utils import assert_matches_type
from cloudflare.pagination import SyncV4PagePagination, AsyncV4PagePagination
from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
from cloudflare.types.workflows import VersionGetResponse, VersionListResponse

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

@parametrize
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
Expand All @@ -34,7 +34,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
page=1,
per_page=1,
)
assert_matches_type(SyncV4PagePagination[VersionListResponse], version, path=["response"])
assert_matches_type(SyncV4PagePaginationArray[VersionListResponse], version, path=["response"])

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

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

version = response.parse()
assert_matches_type(SyncV4PagePagination[VersionListResponse], version, path=["response"])
assert_matches_type(SyncV4PagePaginationArray[VersionListResponse], version, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down Expand Up @@ -146,7 +146,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
workflow_name="x",
account_id="account_id",
)
assert_matches_type(AsyncV4PagePagination[VersionListResponse], version, path=["response"])
assert_matches_type(AsyncV4PagePaginationArray[VersionListResponse], version, path=["response"])

@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
Expand All @@ -156,7 +156,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare)
page=1,
per_page=1,
)
assert_matches_type(AsyncV4PagePagination[VersionListResponse], version, path=["response"])
assert_matches_type(AsyncV4PagePaginationArray[VersionListResponse], version, path=["response"])

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

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

version = await response.parse()
assert_matches_type(AsyncV4PagePagination[VersionListResponse], version, path=["response"])
assert_matches_type(AsyncV4PagePaginationArray[VersionListResponse], version, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down