Skip to content

Commit 2fc1388

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): update via SDK Studio (#280)
1 parent e2478c5 commit 2fc1388

File tree

5 files changed

+61
-58
lines changed

5 files changed

+61
-58
lines changed

api.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -4178,16 +4178,16 @@ Methods:
41784178
Types:
41794179

41804180
```python
4181-
from cloudflare.types.rules import Hostname, List, Redirect, ListDeleteResponse
4181+
from cloudflare.types.rules import Hostname, Redirect, RuleList, ListDeleteResponse
41824182
```
41834183

41844184
Methods:
41854185

4186-
- <code title="post /accounts/{account_id}/rules/lists">client.rules.lists.<a href="./src/cloudflare/resources/rules/lists/lists.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/rules/list_create_params.py">params</a>) -> <a href="./src/cloudflare/types/rules/list.py">Optional</a></code>
4187-
- <code title="put /accounts/{account_id}/rules/lists/{list_id}">client.rules.lists.<a href="./src/cloudflare/resources/rules/lists/lists.py">update</a>(list_id, \*, account_id, \*\*<a href="src/cloudflare/types/rules/list_update_params.py">params</a>) -> <a href="./src/cloudflare/types/rules/list.py">Optional</a></code>
4188-
- <code title="get /accounts/{account_id}/rules/lists">client.rules.lists.<a href="./src/cloudflare/resources/rules/lists/lists.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/rules/list.py">SyncSinglePage[List]</a></code>
4186+
- <code title="post /accounts/{account_id}/rules/lists">client.rules.lists.<a href="./src/cloudflare/resources/rules/lists/lists.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/rules/list_create_params.py">params</a>) -> <a href="./src/cloudflare/types/rules/rule_list.py">Optional</a></code>
4187+
- <code title="put /accounts/{account_id}/rules/lists/{list_id}">client.rules.lists.<a href="./src/cloudflare/resources/rules/lists/lists.py">update</a>(list_id, \*, account_id, \*\*<a href="src/cloudflare/types/rules/list_update_params.py">params</a>) -> <a href="./src/cloudflare/types/rules/rule_list.py">Optional</a></code>
4188+
- <code title="get /accounts/{account_id}/rules/lists">client.rules.lists.<a href="./src/cloudflare/resources/rules/lists/lists.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/rules/rule_list.py">SyncSinglePage[RuleList]</a></code>
41894189
- <code title="delete /accounts/{account_id}/rules/lists/{list_id}">client.rules.lists.<a href="./src/cloudflare/resources/rules/lists/lists.py">delete</a>(list_id, \*, account_id, \*\*<a href="src/cloudflare/types/rules/list_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/rules/list_delete_response.py">Optional</a></code>
4190-
- <code title="get /accounts/{account_id}/rules/lists/{list_id}">client.rules.lists.<a href="./src/cloudflare/resources/rules/lists/lists.py">get</a>(list_id, \*, account_id) -> <a href="./src/cloudflare/types/rules/list.py">Optional</a></code>
4190+
- <code title="get /accounts/{account_id}/rules/lists/{list_id}">client.rules.lists.<a href="./src/cloudflare/resources/rules/lists/lists.py">get</a>(list_id, \*, account_id) -> <a href="./src/cloudflare/types/rules/rule_list.py">Optional</a></code>
41914191

41924192
### BulkOperations
41934193

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

+20-20
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Type, Optional, cast
5+
from typing import Type, Optional, cast
66
from typing_extensions import Literal
77

88
import httpx
@@ -30,7 +30,7 @@
3030
)
3131
from ...._wrappers import ResultWrapper
3232
from ....pagination import SyncSinglePage, AsyncSinglePage
33-
from ....types.rules import List, ListDeleteResponse, list_create_params, list_delete_params, list_update_params
33+
from ....types.rules import RuleList, ListDeleteResponse, list_create_params, list_delete_params, list_update_params
3434
from ...._base_client import (
3535
AsyncPaginator,
3636
make_request_options,
@@ -77,7 +77,7 @@ def create(
7777
extra_query: Query | None = None,
7878
extra_body: Body | None = None,
7979
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
80-
) -> Optional[List]:
80+
) -> Optional[RuleList]:
8181
"""
8282
Creates a new list of the specified type.
8383
@@ -118,7 +118,7 @@ def create(
118118
timeout=timeout,
119119
post_parser=ResultWrapper._unwrapper,
120120
),
121-
cast_to=cast(Type[Optional[List]], ResultWrapper[List]),
121+
cast_to=cast(Type[Optional[RuleList]], ResultWrapper[RuleList]),
122122
)
123123

124124
def update(
@@ -133,7 +133,7 @@ def update(
133133
extra_query: Query | None = None,
134134
extra_body: Body | None = None,
135135
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
136-
) -> Optional[List]:
136+
) -> Optional[RuleList]:
137137
"""
138138
Updates the description of a list.
139139
@@ -166,7 +166,7 @@ def update(
166166
timeout=timeout,
167167
post_parser=ResultWrapper._unwrapper,
168168
),
169-
cast_to=cast(Type[Optional[List]], ResultWrapper[List]),
169+
cast_to=cast(Type[Optional[RuleList]], ResultWrapper[RuleList]),
170170
)
171171

172172
def list(
@@ -179,7 +179,7 @@ def list(
179179
extra_query: Query | None = None,
180180
extra_body: Body | None = None,
181181
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
182-
) -> SyncSinglePage[List]:
182+
) -> SyncSinglePage[RuleList]:
183183
"""
184184
Fetches all lists in the account.
185185
@@ -198,11 +198,11 @@ def list(
198198
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
199199
return self._get_api_list(
200200
f"/accounts/{account_id}/rules/lists",
201-
page=SyncSinglePage[List],
201+
page=SyncSinglePage[RuleList],
202202
options=make_request_options(
203203
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
204204
),
205-
model=List,
205+
model=RuleList,
206206
)
207207

208208
def delete(
@@ -262,7 +262,7 @@ def get(
262262
extra_query: Query | None = None,
263263
extra_body: Body | None = None,
264264
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
265-
) -> Optional[List]:
265+
) -> Optional[RuleList]:
266266
"""
267267
Fetches the details of a list.
268268
@@ -292,7 +292,7 @@ def get(
292292
timeout=timeout,
293293
post_parser=ResultWrapper._unwrapper,
294294
),
295-
cast_to=cast(Type[Optional[List]], ResultWrapper[List]),
295+
cast_to=cast(Type[Optional[RuleList]], ResultWrapper[RuleList]),
296296
)
297297

298298

@@ -326,7 +326,7 @@ async def create(
326326
extra_query: Query | None = None,
327327
extra_body: Body | None = None,
328328
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
329-
) -> Optional[List]:
329+
) -> Optional[RuleList]:
330330
"""
331331
Creates a new list of the specified type.
332332
@@ -367,7 +367,7 @@ async def create(
367367
timeout=timeout,
368368
post_parser=ResultWrapper._unwrapper,
369369
),
370-
cast_to=cast(Type[Optional[List]], ResultWrapper[List]),
370+
cast_to=cast(Type[Optional[RuleList]], ResultWrapper[RuleList]),
371371
)
372372

373373
async def update(
@@ -382,7 +382,7 @@ async def update(
382382
extra_query: Query | None = None,
383383
extra_body: Body | None = None,
384384
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
385-
) -> Optional[List]:
385+
) -> Optional[RuleList]:
386386
"""
387387
Updates the description of a list.
388388
@@ -415,7 +415,7 @@ async def update(
415415
timeout=timeout,
416416
post_parser=ResultWrapper._unwrapper,
417417
),
418-
cast_to=cast(Type[Optional[List]], ResultWrapper[List]),
418+
cast_to=cast(Type[Optional[RuleList]], ResultWrapper[RuleList]),
419419
)
420420

421421
def list(
@@ -428,7 +428,7 @@ def list(
428428
extra_query: Query | None = None,
429429
extra_body: Body | None = None,
430430
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
431-
) -> AsyncPaginator[List, AsyncSinglePage[List]]:
431+
) -> AsyncPaginator[RuleList, AsyncSinglePage[RuleList]]:
432432
"""
433433
Fetches all lists in the account.
434434
@@ -447,11 +447,11 @@ def list(
447447
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
448448
return self._get_api_list(
449449
f"/accounts/{account_id}/rules/lists",
450-
page=AsyncSinglePage[List],
450+
page=AsyncSinglePage[RuleList],
451451
options=make_request_options(
452452
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
453453
),
454-
model=List,
454+
model=RuleList,
455455
)
456456

457457
async def delete(
@@ -511,7 +511,7 @@ async def get(
511511
extra_query: Query | None = None,
512512
extra_body: Body | None = None,
513513
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
514-
) -> Optional[List]:
514+
) -> Optional[RuleList]:
515515
"""
516516
Fetches the details of a list.
517517
@@ -541,7 +541,7 @@ async def get(
541541
timeout=timeout,
542542
post_parser=ResultWrapper._unwrapper,
543543
),
544-
cast_to=cast(Type[Optional[List]], ResultWrapper[List]),
544+
cast_to=cast(Type[Optional[RuleList]], ResultWrapper[RuleList]),
545545
)
546546

547547

src/cloudflare/types/rules/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
from __future__ import annotations
44

5-
from .list import List as List
65
from .hostname import Hostname as Hostname
76
from .redirect import Redirect as Redirect
7+
from .rule_list import RuleList as RuleList
88
from .hostname_param import HostnameParam as HostnameParam
99
from .redirect_param import RedirectParam as RedirectParam
1010
from .list_create_params import ListCreateParams as ListCreateParams

src/cloudflare/types/rules/list.py src/cloudflare/types/rules/rule_list.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import List, Optional
3+
from typing import Optional
44
from typing_extensions import Literal
55

66
from ..._models import BaseModel
77

8-
__all__ = ["List"]
8+
__all__ = ["RuleList"]
99

1010

11-
class List(BaseModel):
11+
class RuleList(BaseModel):
1212
id: Optional[str] = None
1313
"""The unique ID of the list."""
1414

0 commit comments

Comments
 (0)