Skip to content

Commit da40430

Browse files
chore(api): upload stainless config from cloudflare-config
1 parent cde1ea6 commit da40430

9 files changed

Lines changed: 46 additions & 106 deletions

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1783
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e408a7cdec2dae3d1a18842dcc59280c56050fb042569139aec3fe0f12e0d461.yml
33
openapi_spec_hash: 7e210c76f5dd4c79b3e67204ad279b81
4-
config_hash: 2d45ef3f487fb8c17ee578789175de57
4+
config_hash: 1d1f62e87686c0d8571be460876f347c

api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ from cloudflare.types.accounts.logs import AuditListResponse
131131

132132
Methods:
133133

134-
- <code title="get /accounts/{account_id}/logs/audit">client.accounts.logs.audit.<a href="./src/cloudflare/resources/accounts/logs/audit.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/accounts/logs/audit_list_params.py">params</a>) -> <a href="./src/cloudflare/types/accounts/logs/audit_list_response.py">SyncCursorPaginationAfter[AuditListResponse]</a></code>
134+
- <code title="get /accounts/{account_id}/logs/audit">client.accounts.logs.audit.<a href="./src/cloudflare/resources/accounts/logs/audit.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/accounts/logs/audit_list_params.py">params</a>) -> <a href="./src/cloudflare/types/accounts/logs/audit_list_response.py">SyncCursorLimitPagination[AuditListResponse]</a></code>
135135

136136
# OriginCACertificates
137137

@@ -2560,7 +2560,7 @@ from cloudflare.types.kv.namespaces import (
25602560

25612561
Methods:
25622562

2563-
- <code title="get /accounts/{account_id}/storage/kv/namespaces/{namespace_id}/keys">client.kv.namespaces.keys.<a href="./src/cloudflare/resources/kv/namespaces/keys.py">list</a>(namespace_id, \*, account_id, \*\*<a href="src/cloudflare/types/kv/namespaces/key_list_params.py">params</a>) -> <a href="./src/cloudflare/types/kv/namespaces/key.py">SyncCursorPaginationAfter[Key]</a></code>
2563+
- <code title="get /accounts/{account_id}/storage/kv/namespaces/{namespace_id}/keys">client.kv.namespaces.keys.<a href="./src/cloudflare/resources/kv/namespaces/keys.py">list</a>(namespace_id, \*, account_id, \*\*<a href="src/cloudflare/types/kv/namespaces/key_list_params.py">params</a>) -> <a href="./src/cloudflare/types/kv/namespaces/key.py">SyncCursorLimitPagination[Key]</a></code>
25642564
- <code title="post /accounts/{account_id}/storage/kv/namespaces/{namespace_id}/bulk/delete">client.kv.namespaces.keys.<a href="./src/cloudflare/resources/kv/namespaces/keys.py">bulk_delete</a>(namespace_id, \*, account_id, \*\*<a href="src/cloudflare/types/kv/namespaces/key_bulk_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/kv/namespaces/key_bulk_delete_response.py">Optional[KeyBulkDeleteResponse]</a></code>
25652565
- <code title="post /accounts/{account_id}/storage/kv/namespaces/{namespace_id}/bulk/get">client.kv.namespaces.keys.<a href="./src/cloudflare/resources/kv/namespaces/keys.py">bulk_get</a>(namespace_id, \*, account_id, \*\*<a href="src/cloudflare/types/kv/namespaces/key_bulk_get_params.py">params</a>) -> <a href="./src/cloudflare/types/kv/namespaces/key_bulk_get_response.py">Optional[KeyBulkGetResponse]</a></code>
25662566
- <code title="put /accounts/{account_id}/storage/kv/namespaces/{namespace_id}/bulk">client.kv.namespaces.keys.<a href="./src/cloudflare/resources/kv/namespaces/keys.py">bulk_update</a>(namespace_id, \*, account_id, \*\*<a href="src/cloudflare/types/kv/namespaces/key_bulk_update_params.py">params</a>) -> <a href="./src/cloudflare/types/kv/namespaces/key_bulk_update_response.py">Optional[KeyBulkUpdateResponse]</a></code>
@@ -2609,7 +2609,7 @@ from cloudflare.types.durable_objects.namespaces import DurableObject
26092609

26102610
Methods:
26112611

2612-
- <code title="get /accounts/{account_id}/workers/durable_objects/namespaces/{id}/objects">client.durable_objects.namespaces.objects.<a href="./src/cloudflare/resources/durable_objects/namespaces/objects.py">list</a>(id, \*, account_id, \*\*<a href="src/cloudflare/types/durable_objects/namespaces/object_list_params.py">params</a>) -> <a href="./src/cloudflare/types/durable_objects/namespaces/durable_object.py">SyncCursorPaginationAfter[DurableObject]</a></code>
2612+
- <code title="get /accounts/{account_id}/workers/durable_objects/namespaces/{id}/objects">client.durable_objects.namespaces.objects.<a href="./src/cloudflare/resources/durable_objects/namespaces/objects.py">list</a>(id, \*, account_id, \*\*<a href="src/cloudflare/types/durable_objects/namespaces/object_list_params.py">params</a>) -> <a href="./src/cloudflare/types/durable_objects/namespaces/durable_object.py">SyncCursorLimitPagination[DurableObject]</a></code>
26132613

26142614
# Queues
26152615

src/cloudflare/pagination.py

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
"CursorPaginationResultInfo",
1818
"SyncCursorPagination",
1919
"AsyncCursorPagination",
20-
"CursorPaginationAfterResultInfo",
21-
"CursorPaginationAfterCursors",
22-
"SyncCursorPaginationAfter",
23-
"AsyncCursorPaginationAfter",
2420
"CursorLimitPaginationResultInfo",
2521
"SyncCursorLimitPagination",
2622
"AsyncCursorLimitPagination",
@@ -179,62 +175,6 @@ def next_page_info(self) -> Optional[PageInfo]:
179175
return PageInfo(params={"cursor": cursor})
180176

181177

182-
class CursorPaginationAfterCursors(BaseModel):
183-
after: Optional[str] = None
184-
185-
186-
class CursorPaginationAfterResultInfo(BaseModel):
187-
cursors: Optional[CursorPaginationAfterCursors] = None
188-
189-
190-
class SyncCursorPaginationAfter(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
191-
result: List[_T]
192-
result_info: Optional[CursorPaginationAfterResultInfo] = None
193-
194-
@override
195-
def _get_page_items(self) -> List[_T]:
196-
result = self.result
197-
if not result:
198-
return []
199-
return result
200-
201-
@override
202-
def next_page_info(self) -> Optional[PageInfo]:
203-
after = None
204-
if self.result_info is not None:
205-
if self.result_info.cursors is not None:
206-
if self.result_info.cursors.after is not None:
207-
after = self.result_info.cursors.after
208-
if not after:
209-
return None
210-
211-
return PageInfo(params={"cursor": after})
212-
213-
214-
class AsyncCursorPaginationAfter(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
215-
result: List[_T]
216-
result_info: Optional[CursorPaginationAfterResultInfo] = None
217-
218-
@override
219-
def _get_page_items(self) -> List[_T]:
220-
result = self.result
221-
if not result:
222-
return []
223-
return result
224-
225-
@override
226-
def next_page_info(self) -> Optional[PageInfo]:
227-
after = None
228-
if self.result_info is not None:
229-
if self.result_info.cursors is not None:
230-
if self.result_info.cursors.after is not None:
231-
after = self.result_info.cursors.after
232-
if not after:
233-
return None
234-
235-
return PageInfo(params={"cursor": after})
236-
237-
238178
class CursorLimitPaginationResultInfo(BaseModel):
239179
count: Optional[int] = None
240180

src/cloudflare/resources/accounts/logs/audit.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
async_to_raw_response_wrapper,
1919
async_to_streamed_response_wrapper,
2020
)
21-
from ....pagination import SyncCursorPaginationAfter, AsyncCursorPaginationAfter
21+
from ....pagination import SyncCursorLimitPagination, AsyncCursorLimitPagination
2222
from ...._base_client import AsyncPaginator, make_request_options
2323
from ....types.accounts.logs import audit_list_params
2424
from ....types.accounts.logs.audit_list_response import AuditListResponse
@@ -82,7 +82,7 @@ def list(
8282
extra_query: Query | None = None,
8383
extra_body: Body | None = None,
8484
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
85-
) -> SyncCursorPaginationAfter[AuditListResponse]:
85+
) -> SyncCursorLimitPagination[AuditListResponse]:
8686
"""Gets a list of audit logs for an account.
8787
8888
<br /> <br /> This is the beta release
@@ -124,7 +124,7 @@ def list(
124124
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
125125
return self._get_api_list(
126126
f"/accounts/{account_id}/logs/audit",
127-
page=SyncCursorPaginationAfter[AuditListResponse],
127+
page=SyncCursorLimitPagination[AuditListResponse],
128128
options=make_request_options(
129129
extra_headers=extra_headers,
130130
extra_query=extra_query,
@@ -222,7 +222,7 @@ def list(
222222
extra_query: Query | None = None,
223223
extra_body: Body | None = None,
224224
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
225-
) -> AsyncPaginator[AuditListResponse, AsyncCursorPaginationAfter[AuditListResponse]]:
225+
) -> AsyncPaginator[AuditListResponse, AsyncCursorLimitPagination[AuditListResponse]]:
226226
"""Gets a list of audit logs for an account.
227227
228228
<br /> <br /> This is the beta release
@@ -264,7 +264,7 @@ def list(
264264
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
265265
return self._get_api_list(
266266
f"/accounts/{account_id}/logs/audit",
267-
page=AsyncCursorPaginationAfter[AuditListResponse],
267+
page=AsyncCursorLimitPagination[AuditListResponse],
268268
options=make_request_options(
269269
extra_headers=extra_headers,
270270
extra_query=extra_query,

src/cloudflare/resources/durable_objects/namespaces/objects.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
async_to_raw_response_wrapper,
1515
async_to_streamed_response_wrapper,
1616
)
17-
from ....pagination import SyncCursorPaginationAfter, AsyncCursorPaginationAfter
17+
from ....pagination import SyncCursorLimitPagination, AsyncCursorLimitPagination
1818
from ...._base_client import AsyncPaginator, make_request_options
1919
from ....types.durable_objects.namespaces import object_list_params
2020
from ....types.durable_objects.namespaces.durable_object import DurableObject
@@ -55,7 +55,7 @@ def list(
5555
extra_query: Query | None = None,
5656
extra_body: Body | None = None,
5757
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
58-
) -> SyncCursorPaginationAfter[DurableObject]:
58+
) -> SyncCursorLimitPagination[DurableObject]:
5959
"""
6060
Returns the Durable Objects in a given namespace.
6161
@@ -85,7 +85,7 @@ def list(
8585
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
8686
return self._get_api_list(
8787
f"/accounts/{account_id}/workers/durable_objects/namespaces/{id}/objects",
88-
page=SyncCursorPaginationAfter[DurableObject],
88+
page=SyncCursorLimitPagination[DurableObject],
8989
options=make_request_options(
9090
extra_headers=extra_headers,
9191
extra_query=extra_query,
@@ -136,7 +136,7 @@ def list(
136136
extra_query: Query | None = None,
137137
extra_body: Body | None = None,
138138
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
139-
) -> AsyncPaginator[DurableObject, AsyncCursorPaginationAfter[DurableObject]]:
139+
) -> AsyncPaginator[DurableObject, AsyncCursorLimitPagination[DurableObject]]:
140140
"""
141141
Returns the Durable Objects in a given namespace.
142142
@@ -166,7 +166,7 @@ def list(
166166
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
167167
return self._get_api_list(
168168
f"/accounts/{account_id}/workers/durable_objects/namespaces/{id}/objects",
169-
page=AsyncCursorPaginationAfter[DurableObject],
169+
page=AsyncCursorLimitPagination[DurableObject],
170170
options=make_request_options(
171171
extra_headers=extra_headers,
172172
extra_query=extra_query,

src/cloudflare/resources/kv/namespaces/keys.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
async_to_streamed_response_wrapper,
2020
)
2121
from ...._wrappers import ResultWrapper
22-
from ....pagination import SyncCursorPaginationAfter, AsyncCursorPaginationAfter
22+
from ....pagination import SyncCursorLimitPagination, AsyncCursorLimitPagination
2323
from ...._base_client import AsyncPaginator, make_request_options
2424
from ....types.kv.namespaces import key_list_params, key_bulk_get_params, key_bulk_update_params
2525
from ....types.kv.namespaces.key import Key
@@ -64,7 +64,7 @@ def list(
6464
extra_query: Query | None = None,
6565
extra_body: Body | None = None,
6666
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
67-
) -> SyncCursorPaginationAfter[Key]:
67+
) -> SyncCursorLimitPagination[Key]:
6868
"""
6969
Lists a namespace's keys.
7070
@@ -98,7 +98,7 @@ def list(
9898
raise ValueError(f"Expected a non-empty value for `namespace_id` but received {namespace_id!r}")
9999
return self._get_api_list(
100100
f"/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/keys",
101-
page=SyncCursorPaginationAfter[Key],
101+
page=SyncCursorLimitPagination[Key],
102102
options=make_request_options(
103103
extra_headers=extra_headers,
104104
extra_query=extra_query,
@@ -323,7 +323,7 @@ def list(
323323
extra_query: Query | None = None,
324324
extra_body: Body | None = None,
325325
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
326-
) -> AsyncPaginator[Key, AsyncCursorPaginationAfter[Key]]:
326+
) -> AsyncPaginator[Key, AsyncCursorLimitPagination[Key]]:
327327
"""
328328
Lists a namespace's keys.
329329
@@ -357,7 +357,7 @@ def list(
357357
raise ValueError(f"Expected a non-empty value for `namespace_id` but received {namespace_id!r}")
358358
return self._get_api_list(
359359
f"/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/keys",
360-
page=AsyncCursorPaginationAfter[Key],
360+
page=AsyncCursorLimitPagination[Key],
361361
options=make_request_options(
362362
extra_headers=extra_headers,
363363
extra_query=extra_query,

tests/api_resources/accounts/logs/test_audit.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from cloudflare import Cloudflare, AsyncCloudflare
1111
from tests.utils import assert_matches_type
1212
from cloudflare._utils import parse_date
13-
from cloudflare.pagination import SyncCursorPaginationAfter, AsyncCursorPaginationAfter
13+
from cloudflare.pagination import SyncCursorLimitPagination, AsyncCursorLimitPagination
1414
from cloudflare.types.accounts.logs import AuditListResponse
1515

1616
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -27,7 +27,7 @@ def test_method_list(self, client: Cloudflare) -> None:
2727
before=parse_date("2024-10-31"),
2828
since=parse_date("2024-10-30"),
2929
)
30-
assert_matches_type(SyncCursorPaginationAfter[AuditListResponse], audit, path=["response"])
30+
assert_matches_type(SyncCursorLimitPagination[AuditListResponse], audit, path=["response"])
3131

3232
@pytest.mark.skip(reason="TODO:investigate broken test")
3333
@parametrize
@@ -61,7 +61,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
6161
zone_id={"not": ["string"]},
6262
zone_name={"not": ["example.com"]},
6363
)
64-
assert_matches_type(SyncCursorPaginationAfter[AuditListResponse], audit, path=["response"])
64+
assert_matches_type(SyncCursorLimitPagination[AuditListResponse], audit, path=["response"])
6565

6666
@pytest.mark.skip(reason="TODO:investigate broken test")
6767
@parametrize
@@ -75,7 +75,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None:
7575
assert response.is_closed is True
7676
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
7777
audit = response.parse()
78-
assert_matches_type(SyncCursorPaginationAfter[AuditListResponse], audit, path=["response"])
78+
assert_matches_type(SyncCursorLimitPagination[AuditListResponse], audit, path=["response"])
7979

8080
@pytest.mark.skip(reason="TODO:investigate broken test")
8181
@parametrize
@@ -89,7 +89,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None:
8989
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
9090

9191
audit = response.parse()
92-
assert_matches_type(SyncCursorPaginationAfter[AuditListResponse], audit, path=["response"])
92+
assert_matches_type(SyncCursorLimitPagination[AuditListResponse], audit, path=["response"])
9393

9494
assert cast(Any, response.is_closed) is True
9595

@@ -117,7 +117,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
117117
before=parse_date("2024-10-31"),
118118
since=parse_date("2024-10-30"),
119119
)
120-
assert_matches_type(AsyncCursorPaginationAfter[AuditListResponse], audit, path=["response"])
120+
assert_matches_type(AsyncCursorLimitPagination[AuditListResponse], audit, path=["response"])
121121

122122
@pytest.mark.skip(reason="TODO:investigate broken test")
123123
@parametrize
@@ -151,7 +151,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare)
151151
zone_id={"not": ["string"]},
152152
zone_name={"not": ["example.com"]},
153153
)
154-
assert_matches_type(AsyncCursorPaginationAfter[AuditListResponse], audit, path=["response"])
154+
assert_matches_type(AsyncCursorLimitPagination[AuditListResponse], audit, path=["response"])
155155

156156
@pytest.mark.skip(reason="TODO:investigate broken test")
157157
@parametrize
@@ -165,7 +165,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
165165
assert response.is_closed is True
166166
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
167167
audit = await response.parse()
168-
assert_matches_type(AsyncCursorPaginationAfter[AuditListResponse], audit, path=["response"])
168+
assert_matches_type(AsyncCursorLimitPagination[AuditListResponse], audit, path=["response"])
169169

170170
@pytest.mark.skip(reason="TODO:investigate broken test")
171171
@parametrize
@@ -179,7 +179,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N
179179
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
180180

181181
audit = await response.parse()
182-
assert_matches_type(AsyncCursorPaginationAfter[AuditListResponse], audit, path=["response"])
182+
assert_matches_type(AsyncCursorLimitPagination[AuditListResponse], audit, path=["response"])
183183

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

0 commit comments

Comments
 (0)