1313 AsyncObjectsResourceWithStreamingResponse ,
1414)
1515from ...._types import NOT_GIVEN , Body , Query , Headers , NotGiven
16+ from ...._utils import maybe_transform
1617from ...._compat import cached_property
1718from ...._resource import SyncAPIResource , AsyncAPIResource
1819from ...._response import (
2122 async_to_raw_response_wrapper ,
2223 async_to_streamed_response_wrapper ,
2324)
24- from ....pagination import SyncSinglePage , AsyncSinglePage
25+ from ....pagination import SyncV4PagePaginationArray , AsyncV4PagePaginationArray
2526from ...._base_client import AsyncPaginator , make_request_options
27+ from ....types .durable_objects import namespace_list_params
2628from ....types .durable_objects .namespace import Namespace
2729
2830__all__ = ["NamespacesResource" , "AsyncNamespacesResource" ]
@@ -56,19 +58,25 @@ def list(
5658 self ,
5759 * ,
5860 account_id : str ,
61+ page : int | NotGiven = NOT_GIVEN ,
62+ per_page : int | NotGiven = NOT_GIVEN ,
5963 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6064 # The extra values given here take precedence over values defined on the client or passed to this method.
6165 extra_headers : Headers | None = None ,
6266 extra_query : Query | None = None ,
6367 extra_body : Body | None = None ,
6468 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
65- ) -> SyncSinglePage [Namespace ]:
69+ ) -> SyncV4PagePaginationArray [Namespace ]:
6670 """
6771 Returns the Durable Object namespaces owned by an account.
6872
6973 Args:
7074 account_id: Identifier.
7175
76+ page: Current page.
77+
78+ per_page: Items per-page.
79+
7280 extra_headers: Send extra headers
7381
7482 extra_query: Add additional query parameters to the request
@@ -81,9 +89,19 @@ def list(
8189 raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
8290 return self ._get_api_list (
8391 f"/accounts/{ account_id } /workers/durable_objects/namespaces" ,
84- page = SyncSinglePage [Namespace ],
92+ page = SyncV4PagePaginationArray [Namespace ],
8593 options = make_request_options (
86- extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
94+ extra_headers = extra_headers ,
95+ extra_query = extra_query ,
96+ extra_body = extra_body ,
97+ timeout = timeout ,
98+ query = maybe_transform (
99+ {
100+ "page" : page ,
101+ "per_page" : per_page ,
102+ },
103+ namespace_list_params .NamespaceListParams ,
104+ ),
87105 ),
88106 model = Namespace ,
89107 )
@@ -117,19 +135,25 @@ def list(
117135 self ,
118136 * ,
119137 account_id : str ,
138+ page : int | NotGiven = NOT_GIVEN ,
139+ per_page : int | NotGiven = NOT_GIVEN ,
120140 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
121141 # The extra values given here take precedence over values defined on the client or passed to this method.
122142 extra_headers : Headers | None = None ,
123143 extra_query : Query | None = None ,
124144 extra_body : Body | None = None ,
125145 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
126- ) -> AsyncPaginator [Namespace , AsyncSinglePage [Namespace ]]:
146+ ) -> AsyncPaginator [Namespace , AsyncV4PagePaginationArray [Namespace ]]:
127147 """
128148 Returns the Durable Object namespaces owned by an account.
129149
130150 Args:
131151 account_id: Identifier.
132152
153+ page: Current page.
154+
155+ per_page: Items per-page.
156+
133157 extra_headers: Send extra headers
134158
135159 extra_query: Add additional query parameters to the request
@@ -142,9 +166,19 @@ def list(
142166 raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
143167 return self ._get_api_list (
144168 f"/accounts/{ account_id } /workers/durable_objects/namespaces" ,
145- page = AsyncSinglePage [Namespace ],
169+ page = AsyncV4PagePaginationArray [Namespace ],
146170 options = make_request_options (
147- extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
171+ extra_headers = extra_headers ,
172+ extra_query = extra_query ,
173+ extra_body = extra_body ,
174+ timeout = timeout ,
175+ query = maybe_transform (
176+ {
177+ "page" : page ,
178+ "per_page" : per_page ,
179+ },
180+ namespace_list_params .NamespaceListParams ,
181+ ),
148182 ),
149183 model = Namespace ,
150184 )
0 commit comments