Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 22, 2024
1 parent 2c2219f commit 17adfbc
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 56 deletions.
10 changes: 5 additions & 5 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4178,16 +4178,16 @@ Methods:
Types:

```python
from cloudflare.types.rules import Hostname, Redirect, RuleList, ListDeleteResponse
from cloudflare.types.rules import Hostname, ListsList, Redirect, ListDeleteResponse
```

Methods:

- <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>
- <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>
- <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>
- <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/lists_list.py">Optional</a></code>
- <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/lists_list.py">Optional</a></code>
- <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/lists_list.py">SyncSinglePage[ListsList]</a></code>
- <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>
- <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>
- <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/lists_list.py">Optional</a></code>

### BulkOperations

Expand Down
38 changes: 19 additions & 19 deletions src/cloudflare/resources/rules/lists/lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
)
from ...._wrappers import ResultWrapper
from ....pagination import SyncSinglePage, AsyncSinglePage
from ....types.rules import RuleList, ListDeleteResponse, list_create_params, list_delete_params, list_update_params
from ....types.rules import ListsList, ListDeleteResponse, list_create_params, list_delete_params, list_update_params
from ...._base_client import (
AsyncPaginator,
make_request_options,
Expand Down Expand Up @@ -77,7 +77,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[RuleList]:
) -> Optional[ListsList]:
"""
Creates a new list of the specified type.
Expand Down Expand Up @@ -118,7 +118,7 @@ def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[RuleList]], ResultWrapper[RuleList]),
cast_to=cast(Type[Optional[ListsList]], ResultWrapper[ListsList]),
)

def update(
Expand All @@ -133,7 +133,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[RuleList]:
) -> Optional[ListsList]:
"""
Updates the description of a list.
Expand Down Expand Up @@ -166,7 +166,7 @@ def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[RuleList]], ResultWrapper[RuleList]),
cast_to=cast(Type[Optional[ListsList]], ResultWrapper[ListsList]),
)

def list(
Expand All @@ -179,7 +179,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncSinglePage[RuleList]:
) -> SyncSinglePage[ListsList]:
"""
Fetches all lists in the account.
Expand All @@ -198,11 +198,11 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
f"/accounts/{account_id}/rules/lists",
page=SyncSinglePage[RuleList],
page=SyncSinglePage[ListsList],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=RuleList,
model=ListsList,
)

def delete(
Expand Down Expand Up @@ -262,7 +262,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[RuleList]:
) -> Optional[ListsList]:
"""
Fetches the details of a list.
Expand Down Expand Up @@ -292,7 +292,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[RuleList]], ResultWrapper[RuleList]),
cast_to=cast(Type[Optional[ListsList]], ResultWrapper[ListsList]),
)


Expand Down Expand Up @@ -326,7 +326,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[RuleList]:
) -> Optional[ListsList]:
"""
Creates a new list of the specified type.
Expand Down Expand Up @@ -367,7 +367,7 @@ async def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[RuleList]], ResultWrapper[RuleList]),
cast_to=cast(Type[Optional[ListsList]], ResultWrapper[ListsList]),
)

async def update(
Expand All @@ -382,7 +382,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[RuleList]:
) -> Optional[ListsList]:
"""
Updates the description of a list.
Expand Down Expand Up @@ -415,7 +415,7 @@ async def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[RuleList]], ResultWrapper[RuleList]),
cast_to=cast(Type[Optional[ListsList]], ResultWrapper[ListsList]),
)

def list(
Expand All @@ -428,7 +428,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[RuleList, AsyncSinglePage[RuleList]]:
) -> AsyncPaginator[ListsList, AsyncSinglePage[ListsList]]:
"""
Fetches all lists in the account.
Expand All @@ -447,11 +447,11 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
f"/accounts/{account_id}/rules/lists",
page=AsyncSinglePage[RuleList],
page=AsyncSinglePage[ListsList],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=RuleList,
model=ListsList,
)

async def delete(
Expand Down Expand Up @@ -511,7 +511,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[RuleList]:
) -> Optional[ListsList]:
"""
Fetches the details of a list.
Expand Down Expand Up @@ -541,7 +541,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[RuleList]], ResultWrapper[RuleList]),
cast_to=cast(Type[Optional[ListsList]], ResultWrapper[ListsList]),
)


Expand Down
2 changes: 1 addition & 1 deletion src/cloudflare/types/rules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from .hostname import Hostname as Hostname
from .redirect import Redirect as Redirect
from .rule_list import RuleList as RuleList
from .lists_list import ListsList as ListsList
from .hostname_param import HostnameParam as HostnameParam
from .redirect_param import RedirectParam as RedirectParam
from .list_create_params import ListCreateParams as ListCreateParams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

from ..._models import BaseModel

__all__ = ["RuleList"]
__all__ = ["ListsList"]


class RuleList(BaseModel):
class ListsList(BaseModel):
id: Optional[str] = None
"""The unique ID of the list."""

Expand Down
Loading

0 comments on commit 17adfbc

Please sign in to comment.