Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): update via SDK Studio #280

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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