Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#280)
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 e2478c5 commit 2fc1388
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 58 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, List, Redirect, ListDeleteResponse
from cloudflare.types.rules import Hostname, Redirect, RuleList, 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/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/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/list.py">SyncSinglePage[List]</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/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="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/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/rule_list.py">Optional</a></code>

### BulkOperations

Expand Down
40 changes: 20 additions & 20 deletions src/cloudflare/resources/rules/lists/lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import List, Type, Optional, cast
from typing import Type, Optional, cast
from typing_extensions import Literal

import httpx
Expand Down Expand Up @@ -30,7 +30,7 @@
)
from ...._wrappers import ResultWrapper
from ....pagination import SyncSinglePage, AsyncSinglePage
from ....types.rules import List, ListDeleteResponse, list_create_params, list_delete_params, list_update_params
from ....types.rules import RuleList, 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[List]:
) -> Optional[RuleList]:
"""
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[List]], ResultWrapper[List]),
cast_to=cast(Type[Optional[RuleList]], ResultWrapper[RuleList]),
)

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[List]:
) -> Optional[RuleList]:
"""
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[List]], ResultWrapper[List]),
cast_to=cast(Type[Optional[RuleList]], ResultWrapper[RuleList]),
)

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[List]:
) -> SyncSinglePage[RuleList]:
"""
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[List],
page=SyncSinglePage[RuleList],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=List,
model=RuleList,
)

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[List]:
) -> Optional[RuleList]:
"""
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[List]], ResultWrapper[List]),
cast_to=cast(Type[Optional[RuleList]], ResultWrapper[RuleList]),
)


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[List]:
) -> Optional[RuleList]:
"""
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[List]], ResultWrapper[List]),
cast_to=cast(Type[Optional[RuleList]], ResultWrapper[RuleList]),
)

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[List]:
) -> Optional[RuleList]:
"""
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[List]], ResultWrapper[List]),
cast_to=cast(Type[Optional[RuleList]], ResultWrapper[RuleList]),
)

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[List, AsyncSinglePage[List]]:
) -> AsyncPaginator[RuleList, AsyncSinglePage[RuleList]]:
"""
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[List],
page=AsyncSinglePage[RuleList],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=List,
model=RuleList,
)

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[List]:
) -> Optional[RuleList]:
"""
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[List]], ResultWrapper[List]),
cast_to=cast(Type[Optional[RuleList]], ResultWrapper[RuleList]),
)


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 @@ -2,9 +2,9 @@

from __future__ import annotations

from .list import List as List
from .hostname import Hostname as Hostname
from .redirect import Redirect as Redirect
from .rule_list import RuleList as RuleList
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
@@ -1,14 +1,14 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Optional
from typing import Optional
from typing_extensions import Literal

from ..._models import BaseModel

__all__ = ["List"]
__all__ = ["RuleList"]


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

Expand Down
Loading

0 comments on commit 2fc1388

Please sign in to comment.