Skip to content

Commit ff93fa7

Browse files
feat(api): api update
1 parent 3c1137d commit ff93fa7

13 files changed

Lines changed: 87 additions & 184 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1782
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b5b0c8e83f279b4776ef5ca44c6fb345ff64c19a44be35eda76dbb91d97985d3.yml
3-
openapi_spec_hash: 4ee1b788eb519ff993c064b0b69dd131
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2166aa56e7272ad216c6228d41fc306578dc0e5f0ad0dbce7626ae6c8dad4cdd.yml
3+
openapi_spec_hash: 30f44d6784a0b7386c5edd38c4076f78
44
config_hash: eda5b3d9487ce675d1fadf88153b457d

api.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4542,19 +4542,17 @@ from cloudflare.types.rules.lists import (
45424542
ListItem,
45434543
ItemCreateResponse,
45444544
ItemUpdateResponse,
4545-
ItemListResponse,
45464545
ItemDeleteResponse,
4547-
ItemGetResponse,
45484546
)
45494547
```
45504548

45514549
Methods:
45524550

45534551
- <code title="post /accounts/{account_id}/rules/lists/{list_id}/items">client.rules.lists.items.<a href="./src/cloudflare/resources/rules/lists/items.py">create</a>(list_id, \*, account_id, \*\*<a href="src/cloudflare/types/rules/lists/item_create_params.py">params</a>) -> <a href="./src/cloudflare/types/rules/lists/item_create_response.py">ItemCreateResponse</a></code>
45544552
- <code title="put /accounts/{account_id}/rules/lists/{list_id}/items">client.rules.lists.items.<a href="./src/cloudflare/resources/rules/lists/items.py">update</a>(list_id, \*, account_id, \*\*<a href="src/cloudflare/types/rules/lists/item_update_params.py">params</a>) -> <a href="./src/cloudflare/types/rules/lists/item_update_response.py">ItemUpdateResponse</a></code>
4555-
- <code title="get /accounts/{account_id}/rules/lists/{list_id}/items">client.rules.lists.items.<a href="./src/cloudflare/resources/rules/lists/items.py">list</a>(list_id, \*, account_id, \*\*<a href="src/cloudflare/types/rules/lists/item_list_params.py">params</a>) -> <a href="./src/cloudflare/types/rules/lists/item_list_response.py">SyncCursorPagination[ItemListResponse]</a></code>
4553+
- <code title="get /accounts/{account_id}/rules/lists/{list_id}/items">client.rules.lists.items.<a href="./src/cloudflare/resources/rules/lists/items.py">list</a>(list_id, \*, account_id, \*\*<a href="src/cloudflare/types/rules/lists/item_list_params.py">params</a>) -> SyncCursorPagination[object]</code>
45564554
- <code title="delete /accounts/{account_id}/rules/lists/{list_id}/items">client.rules.lists.items.<a href="./src/cloudflare/resources/rules/lists/items.py">delete</a>(list_id, \*, account_id, \*\*<a href="src/cloudflare/types/rules/lists/item_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/rules/lists/item_delete_response.py">ItemDeleteResponse</a></code>
4557-
- <code title="get /accounts/{account_id}/rules/lists/{list_id}/items/{item_id}">client.rules.lists.items.<a href="./src/cloudflare/resources/rules/lists/items.py">get</a>(item_id, \*, account_id, list_id) -> <a href="./src/cloudflare/types/rules/lists/item_get_response.py">ItemGetResponse</a></code>
4555+
- <code title="get /accounts/{account_id}/rules/lists/{list_id}/items/{item_id}">client.rules.lists.items.<a href="./src/cloudflare/resources/rules/lists/items.py">get</a>(item_id, \*, account_id, list_id) -> object</code>
45584556

45594557
# Stream
45604558

src/cloudflare/resources/rules/lists/items.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
from ....pagination import SyncCursorPagination, AsyncCursorPagination
2121
from ...._base_client import AsyncPaginator, make_request_options
2222
from ....types.rules.lists import item_list_params, item_create_params, item_delete_params, item_update_params
23-
from ....types.rules.lists.item_get_response import ItemGetResponse
24-
from ....types.rules.lists.item_list_response import ItemListResponse
2523
from ....types.rules.lists.item_create_response import ItemCreateResponse
2624
from ....types.rules.lists.item_delete_response import ItemDeleteResponse
2725
from ....types.rules.lists.item_update_response import ItemUpdateResponse
@@ -163,7 +161,7 @@ def list(
163161
extra_query: Query | None = None,
164162
extra_body: Body | None = None,
165163
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
166-
) -> SyncCursorPagination[ItemListResponse]:
164+
) -> SyncCursorPagination[object]:
167165
"""
168166
Fetches all the items in the list.
169167
@@ -199,7 +197,7 @@ def list(
199197
raise ValueError(f"Expected a non-empty value for `list_id` but received {list_id!r}")
200198
return self._get_api_list(
201199
f"/accounts/{account_id}/rules/lists/{list_id}/items",
202-
page=SyncCursorPagination[ItemListResponse],
200+
page=SyncCursorPagination[object],
203201
options=make_request_options(
204202
extra_headers=extra_headers,
205203
extra_query=extra_query,
@@ -214,7 +212,7 @@ def list(
214212
item_list_params.ItemListParams,
215213
),
216214
),
217-
model=ItemListResponse,
215+
model=object,
218216
)
219217

220218
def delete(
@@ -279,7 +277,7 @@ def get(
279277
extra_query: Query | None = None,
280278
extra_body: Body | None = None,
281279
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
282-
) -> ItemGetResponse:
280+
) -> object:
283281
"""
284282
Fetches a list item in the list.
285283
@@ -311,9 +309,9 @@ def get(
311309
extra_query=extra_query,
312310
extra_body=extra_body,
313311
timeout=timeout,
314-
post_parser=ResultWrapper[ItemGetResponse]._unwrapper,
312+
post_parser=ResultWrapper[object]._unwrapper,
315313
),
316-
cast_to=cast(Type[ItemGetResponse], ResultWrapper[ItemGetResponse]),
314+
cast_to=cast(Type[object], ResultWrapper[object]),
317315
)
318316

319317

@@ -451,7 +449,7 @@ def list(
451449
extra_query: Query | None = None,
452450
extra_body: Body | None = None,
453451
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
454-
) -> AsyncPaginator[ItemListResponse, AsyncCursorPagination[ItemListResponse]]:
452+
) -> AsyncPaginator[object, AsyncCursorPagination[object]]:
455453
"""
456454
Fetches all the items in the list.
457455
@@ -487,7 +485,7 @@ def list(
487485
raise ValueError(f"Expected a non-empty value for `list_id` but received {list_id!r}")
488486
return self._get_api_list(
489487
f"/accounts/{account_id}/rules/lists/{list_id}/items",
490-
page=AsyncCursorPagination[ItemListResponse],
488+
page=AsyncCursorPagination[object],
491489
options=make_request_options(
492490
extra_headers=extra_headers,
493491
extra_query=extra_query,
@@ -502,7 +500,7 @@ def list(
502500
item_list_params.ItemListParams,
503501
),
504502
),
505-
model=ItemListResponse,
503+
model=object,
506504
)
507505

508506
async def delete(
@@ -567,7 +565,7 @@ async def get(
567565
extra_query: Query | None = None,
568566
extra_body: Body | None = None,
569567
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
570-
) -> ItemGetResponse:
568+
) -> object:
571569
"""
572570
Fetches a list item in the list.
573571
@@ -599,9 +597,9 @@ async def get(
599597
extra_query=extra_query,
600598
extra_body=extra_body,
601599
timeout=timeout,
602-
post_parser=ResultWrapper[ItemGetResponse]._unwrapper,
600+
post_parser=ResultWrapper[object]._unwrapper,
603601
),
604-
cast_to=cast(Type[ItemGetResponse], ResultWrapper[ItemGetResponse]),
602+
cast_to=cast(Type[object], ResultWrapper[object]),
605603
)
606604

607605

src/cloudflare/types/rules/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
from __future__ import annotations
44

5-
from .hostname import Hostname as Hostname
6-
from .redirect import Redirect as Redirect
75
from .lists_list import ListsList as ListsList
86
from .hostname_param import HostnameParam as HostnameParam
97
from .redirect_param import RedirectParam as RedirectParam

src/cloudflare/types/rules/hostname.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/cloudflare/types/rules/lists/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44

55
from .list_cursor import ListCursor as ListCursor
66
from .item_list_params import ItemListParams as ItemListParams
7-
from .item_get_response import ItemGetResponse as ItemGetResponse
87
from .item_create_params import ItemCreateParams as ItemCreateParams
98
from .item_delete_params import ItemDeleteParams as ItemDeleteParams
10-
from .item_list_response import ItemListResponse as ItemListResponse
119
from .item_update_params import ItemUpdateParams as ItemUpdateParams
1210
from .item_create_response import ItemCreateResponse as ItemCreateResponse
1311
from .item_delete_response import ItemDeleteResponse as ItemDeleteResponse

src/cloudflare/types/rules/lists/bulk_operation_get_response.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,47 @@
55

66
from ...._models import BaseModel
77

8-
__all__ = ["BulkOperationGetResponse", "UnionMember0", "UnionMember1", "UnionMember2"]
8+
__all__ = [
9+
"BulkOperationGetResponse",
10+
"ListsPendingOrRunningBulkOperation",
11+
"ListsCompletedBulkOperation",
12+
"ListsFailedBulkOperation",
13+
]
914

1015

11-
class UnionMember0(BaseModel):
16+
class ListsPendingOrRunningBulkOperation(BaseModel):
1217
id: str
1318
"""The unique operation ID of the asynchronous action."""
1419

15-
completed: str
16-
"""The RFC 3339 timestamp of when the operation was completed."""
17-
18-
error: str
19-
"""A message describing the error when the status is `failed`."""
20-
21-
status: Literal["failed"]
20+
status: Literal["pending", "running"]
2221
"""The current status of the asynchronous operation."""
2322

2423

25-
class UnionMember1(BaseModel):
24+
class ListsCompletedBulkOperation(BaseModel):
2625
id: str
2726
"""The unique operation ID of the asynchronous action."""
2827

29-
status: Literal["pending", "running"]
28+
completed: str
29+
"""The RFC 3339 timestamp of when the operation was completed."""
30+
31+
status: Literal["completed"]
3032
"""The current status of the asynchronous operation."""
3133

3234

33-
class UnionMember2(BaseModel):
35+
class ListsFailedBulkOperation(BaseModel):
3436
id: str
3537
"""The unique operation ID of the asynchronous action."""
3638

3739
completed: str
3840
"""The RFC 3339 timestamp of when the operation was completed."""
3941

40-
status: Literal["completed"]
42+
error: str
43+
"""A message describing the error when the status is `failed`."""
44+
45+
status: Literal["failed"]
4146
"""The current status of the asynchronous operation."""
4247

4348

44-
BulkOperationGetResponse: TypeAlias = Union[UnionMember0, UnionMember1, UnionMember2]
49+
BulkOperationGetResponse: TypeAlias = Union[
50+
ListsPendingOrRunningBulkOperation, ListsCompletedBulkOperation, ListsFailedBulkOperation
51+
]

src/cloudflare/types/rules/lists/item_create_params.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@
88
from ..hostname_param import HostnameParam
99
from ..redirect_param import RedirectParam
1010

11-
__all__ = ["ItemCreateParams", "Body", "BodyUnionMember0", "BodyUnionMember1", "BodyUnionMember2", "BodyUnionMember3"]
11+
__all__ = [
12+
"ItemCreateParams",
13+
"Body",
14+
"BodyListsListItemIPComment",
15+
"BodyListsListItemRedirectComment",
16+
"BodyListsListItemHostnameComment",
17+
"BodyListsListItemASNComment",
18+
]
1219

1320

1421
class ItemCreateParams(TypedDict, total=False):
@@ -18,23 +25,23 @@ class ItemCreateParams(TypedDict, total=False):
1825
body: Required[Iterable[Body]]
1926

2027

21-
class BodyUnionMember0(TypedDict, total=False):
28+
class BodyListsListItemIPComment(TypedDict, total=False):
2229
ip: Required[str]
2330
"""An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR."""
2431

2532
comment: str
2633
"""Defines an informative summary of the list item."""
2734

2835

29-
class BodyUnionMember1(TypedDict, total=False):
36+
class BodyListsListItemRedirectComment(TypedDict, total=False):
3037
redirect: Required[RedirectParam]
3138
"""The definition of the redirect."""
3239

3340
comment: str
3441
"""Defines an informative summary of the list item."""
3542

3643

37-
class BodyUnionMember2(TypedDict, total=False):
44+
class BodyListsListItemHostnameComment(TypedDict, total=False):
3845
hostname: Required[HostnameParam]
3946
"""
4047
Valid characters for hostnames are ASCII(7) letters from a to z, the digits from
@@ -45,12 +52,17 @@ class BodyUnionMember2(TypedDict, total=False):
4552
"""Defines an informative summary of the list item."""
4653

4754

48-
class BodyUnionMember3(TypedDict, total=False):
55+
class BodyListsListItemASNComment(TypedDict, total=False):
4956
asn: Required[int]
5057
"""Defines a non-negative 32 bit integer."""
5158

5259
comment: str
5360
"""Defines an informative summary of the list item."""
5461

5562

56-
Body: TypeAlias = Union[BodyUnionMember0, BodyUnionMember1, BodyUnionMember2, BodyUnionMember3]
63+
Body: TypeAlias = Union[
64+
BodyListsListItemIPComment,
65+
BodyListsListItemRedirectComment,
66+
BodyListsListItemHostnameComment,
67+
BodyListsListItemASNComment,
68+
]

src/cloudflare/types/rules/lists/item_get_response.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/cloudflare/types/rules/lists/item_list_response.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)