Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#227)
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 dc229bd commit fba97f2
Show file tree
Hide file tree
Showing 42 changed files with 948 additions and 4,597 deletions.
17 changes: 11 additions & 6 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3107,9 +3107,14 @@ Types:

```python
from cloudflare.types import (
BlockRule,
ExecuteRule,
LogRule,
RequestRule,
Ruleset,
SkipRule,
RulesetCreateResponse,
RulesetUpdateResponse,
RulesetListResponse,
RulesetGetResponse,
)
```
Expand All @@ -3118,7 +3123,7 @@ Methods:

- <code title="post /{account_or_zone}/{account_or_zone_id}/rulesets">client.rulesets.<a href="./src/cloudflare/resources/rulesets/rulesets.py">create</a>(\*, account_id, zone_id, \*\*<a href="src/cloudflare/types/ruleset_create_params.py">params</a>) -> <a href="./src/cloudflare/types/ruleset_create_response.py">RulesetCreateResponse</a></code>
- <code title="put /{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}">client.rulesets.<a href="./src/cloudflare/resources/rulesets/rulesets.py">update</a>(ruleset_id, \*, account_id, zone_id, \*\*<a href="src/cloudflare/types/ruleset_update_params.py">params</a>) -> <a href="./src/cloudflare/types/ruleset_update_response.py">RulesetUpdateResponse</a></code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/rulesets">client.rulesets.<a href="./src/cloudflare/resources/rulesets/rulesets.py">list</a>(\*, account_id, zone_id) -> <a href="./src/cloudflare/types/ruleset_list_response.py">SyncSinglePage[RulesetListResponse]</a></code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/rulesets">client.rulesets.<a href="./src/cloudflare/resources/rulesets/rulesets.py">list</a>(\*, account_id, zone_id) -> <a href="./src/cloudflare/types/ruleset.py">SyncSinglePage[Ruleset]</a></code>
- <code title="delete /{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}">client.rulesets.<a href="./src/cloudflare/resources/rulesets/rulesets.py">delete</a>(ruleset_id, \*, account_id, zone_id) -> None</code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}">client.rulesets.<a href="./src/cloudflare/resources/rulesets/rulesets.py">get</a>(ruleset_id, \*, account_id, zone_id) -> <a href="./src/cloudflare/types/ruleset_get_response.py">RulesetGetResponse</a></code>

Expand All @@ -3140,12 +3145,12 @@ Methods:
Types:

```python
from cloudflare.types.rulesets.phases import VersionListResponse, VersionGetResponse
from cloudflare.types.rulesets.phases import VersionGetResponse
```

Methods:

- <code title="get /{account_or_zone}/{account_or_zone_id}/rulesets/phases/{ruleset_phase}/entrypoint/versions">client.rulesets.phases.versions.<a href="./src/cloudflare/resources/rulesets/phases/versions.py">list</a>(ruleset_phase, \*, account_id, zone_id) -> <a href="./src/cloudflare/types/rulesets/phases/version_list_response.py">SyncSinglePage[VersionListResponse]</a></code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/rulesets/phases/{ruleset_phase}/entrypoint/versions">client.rulesets.phases.versions.<a href="./src/cloudflare/resources/rulesets/phases/versions.py">list</a>(ruleset_phase, \*, account_id, zone_id) -> <a href="./src/cloudflare/types/ruleset.py">SyncSinglePage[Ruleset]</a></code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/rulesets/phases/{ruleset_phase}/entrypoint/versions/{ruleset_version}">client.rulesets.phases.versions.<a href="./src/cloudflare/resources/rulesets/phases/versions.py">get</a>(ruleset_version, \*, ruleset_phase, account_id, zone_id) -> <a href="./src/cloudflare/types/rulesets/phases/version_get_response.py">VersionGetResponse</a></code>

## Rules
Expand All @@ -3167,12 +3172,12 @@ Methods:
Types:

```python
from cloudflare.types.rulesets import VersionListResponse, VersionGetResponse
from cloudflare.types.rulesets import VersionGetResponse
```

Methods:

- <code title="get /{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/versions">client.rulesets.versions.<a href="./src/cloudflare/resources/rulesets/versions/versions.py">list</a>(ruleset_id, \*, account_id, zone_id) -> <a href="./src/cloudflare/types/rulesets/version_list_response.py">SyncSinglePage[VersionListResponse]</a></code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/versions">client.rulesets.versions.<a href="./src/cloudflare/resources/rulesets/versions/versions.py">list</a>(ruleset_id, \*, account_id, zone_id) -> <a href="./src/cloudflare/types/ruleset.py">SyncSinglePage[Ruleset]</a></code>
- <code title="delete /{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/versions/{ruleset_version}">client.rulesets.versions.<a href="./src/cloudflare/resources/rulesets/versions/versions.py">delete</a>(ruleset_version, \*, ruleset_id, account_id, zone_id) -> None</code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/versions/{ruleset_version}">client.rulesets.versions.<a href="./src/cloudflare/resources/rulesets/versions/versions.py">get</a>(ruleset_version, \*, ruleset_id, account_id, zone_id) -> <a href="./src/cloudflare/types/rulesets/version_get_response.py">VersionGetResponse</a></code>

Expand Down
5 changes: 3 additions & 2 deletions src/cloudflare/resources/rulesets/phases/phases.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import httpx

from ....types import RequestRuleParam
from .versions import (
Versions,
AsyncVersions,
Expand Down Expand Up @@ -78,7 +79,7 @@ def update(
"magic_transit_managed",
],
*,
rules: Iterable[phase_update_params.Rule],
rules: Iterable[RequestRuleParam],
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -311,7 +312,7 @@ async def update(
"magic_transit_managed",
],
*,
rules: Iterable[phase_update_params.Rule],
rules: Iterable[RequestRuleParam],
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
Expand Down
15 changes: 8 additions & 7 deletions src/cloudflare/resources/rulesets/phases/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import httpx

from ....types import Ruleset
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
Expand All @@ -22,7 +23,7 @@
AsyncPaginator,
make_request_options,
)
from ....types.rulesets.phases import VersionGetResponse, VersionListResponse
from ....types.rulesets.phases import VersionGetResponse

__all__ = ["Versions", "AsyncVersions"]

Expand Down Expand Up @@ -72,7 +73,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncSinglePage[VersionListResponse]:
) -> SyncSinglePage[Ruleset]:
"""
Fetches the versions of an account or zone entry point ruleset.
Expand Down Expand Up @@ -110,11 +111,11 @@ def list(
account_or_zone_id = zone_id
return self._get_api_list(
f"/{account_or_zone}/{account_or_zone_id}/rulesets/phases/{ruleset_phase}/entrypoint/versions",
page=SyncSinglePage[VersionListResponse],
page=SyncSinglePage[Ruleset],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=VersionListResponse,
model=Ruleset,
)

def get(
Expand Down Expand Up @@ -252,7 +253,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[VersionListResponse, AsyncSinglePage[VersionListResponse]]:
) -> AsyncPaginator[Ruleset, AsyncSinglePage[Ruleset]]:
"""
Fetches the versions of an account or zone entry point ruleset.
Expand Down Expand Up @@ -290,11 +291,11 @@ def list(
account_or_zone_id = zone_id
return self._get_api_list(
f"/{account_or_zone}/{account_or_zone_id}/rulesets/phases/{ruleset_phase}/entrypoint/versions",
page=AsyncSinglePage[VersionListResponse],
page=AsyncSinglePage[Ruleset],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=VersionListResponse,
model=Ruleset,
)

async def get(
Expand Down
48 changes: 24 additions & 24 deletions src/cloudflare/resources/rulesets/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def create(
zone_id: str | NotGiven = NOT_GIVEN,
id: str | NotGiven = NOT_GIVEN,
action: Literal["block"] | NotGiven = NOT_GIVEN,
action_parameters: rule_create_params.RulesetsBlockRuleActionParameters | NotGiven = NOT_GIVEN,
action_parameters: rule_create_params.BlockRuleActionParameters | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
expression: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -115,7 +115,7 @@ def create(
zone_id: str | NotGiven = NOT_GIVEN,
id: str | NotGiven = NOT_GIVEN,
action: Literal["execute"] | NotGiven = NOT_GIVEN,
action_parameters: rule_create_params.RulesetsExecuteRuleActionParameters | NotGiven = NOT_GIVEN,
action_parameters: rule_create_params.ExecuteRuleActionParameters | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
expression: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -235,7 +235,7 @@ def create(
zone_id: str | NotGiven = NOT_GIVEN,
id: str | NotGiven = NOT_GIVEN,
action: Literal["skip"] | NotGiven = NOT_GIVEN,
action_parameters: rule_create_params.RulesetsSkipRuleActionParameters | NotGiven = NOT_GIVEN,
action_parameters: rule_create_params.SkipRuleActionParameters | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
expression: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -294,10 +294,10 @@ def create(
zone_id: str | NotGiven = NOT_GIVEN,
id: str | NotGiven = NOT_GIVEN,
action: Literal["block"] | Literal["execute"] | Literal["log"] | Literal["skip"] | NotGiven = NOT_GIVEN,
action_parameters: rule_create_params.RulesetsBlockRuleActionParameters
| rule_create_params.RulesetsExecuteRuleActionParameters
action_parameters: rule_create_params.BlockRuleActionParameters
| rule_create_params.ExecuteRuleActionParameters
| object
| rule_create_params.RulesetsSkipRuleActionParameters
| rule_create_params.SkipRuleActionParameters
| NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -428,7 +428,7 @@ def edit(
zone_id: str | NotGiven = NOT_GIVEN,
id: str | NotGiven = NOT_GIVEN,
action: Literal["block"] | NotGiven = NOT_GIVEN,
action_parameters: rule_edit_params.RulesetsBlockRuleActionParameters | NotGiven = NOT_GIVEN,
action_parameters: rule_edit_params.BlockRuleActionParameters | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
expression: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -489,7 +489,7 @@ def edit(
zone_id: str | NotGiven = NOT_GIVEN,
id: str | NotGiven = NOT_GIVEN,
action: Literal["execute"] | NotGiven = NOT_GIVEN,
action_parameters: rule_edit_params.RulesetsExecuteRuleActionParameters | NotGiven = NOT_GIVEN,
action_parameters: rule_edit_params.ExecuteRuleActionParameters | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
expression: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -611,7 +611,7 @@ def edit(
zone_id: str | NotGiven = NOT_GIVEN,
id: str | NotGiven = NOT_GIVEN,
action: Literal["skip"] | NotGiven = NOT_GIVEN,
action_parameters: rule_edit_params.RulesetsSkipRuleActionParameters | NotGiven = NOT_GIVEN,
action_parameters: rule_edit_params.SkipRuleActionParameters | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
expression: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -672,10 +672,10 @@ def edit(
zone_id: str | NotGiven = NOT_GIVEN,
id: str | NotGiven = NOT_GIVEN,
action: Literal["block"] | Literal["execute"] | Literal["log"] | Literal["skip"] | NotGiven = NOT_GIVEN,
action_parameters: rule_edit_params.RulesetsBlockRuleActionParameters
| rule_edit_params.RulesetsExecuteRuleActionParameters
action_parameters: rule_edit_params.BlockRuleActionParameters
| rule_edit_params.ExecuteRuleActionParameters
| object
| rule_edit_params.RulesetsSkipRuleActionParameters
| rule_edit_params.SkipRuleActionParameters
| NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -752,7 +752,7 @@ async def create(
zone_id: str | NotGiven = NOT_GIVEN,
id: str | NotGiven = NOT_GIVEN,
action: Literal["block"] | NotGiven = NOT_GIVEN,
action_parameters: rule_create_params.RulesetsBlockRuleActionParameters | NotGiven = NOT_GIVEN,
action_parameters: rule_create_params.BlockRuleActionParameters | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
expression: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -812,7 +812,7 @@ async def create(
zone_id: str | NotGiven = NOT_GIVEN,
id: str | NotGiven = NOT_GIVEN,
action: Literal["execute"] | NotGiven = NOT_GIVEN,
action_parameters: rule_create_params.RulesetsExecuteRuleActionParameters | NotGiven = NOT_GIVEN,
action_parameters: rule_create_params.ExecuteRuleActionParameters | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
expression: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -932,7 +932,7 @@ async def create(
zone_id: str | NotGiven = NOT_GIVEN,
id: str | NotGiven = NOT_GIVEN,
action: Literal["skip"] | NotGiven = NOT_GIVEN,
action_parameters: rule_create_params.RulesetsSkipRuleActionParameters | NotGiven = NOT_GIVEN,
action_parameters: rule_create_params.SkipRuleActionParameters | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
expression: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -991,10 +991,10 @@ async def create(
zone_id: str | NotGiven = NOT_GIVEN,
id: str | NotGiven = NOT_GIVEN,
action: Literal["block"] | Literal["execute"] | Literal["log"] | Literal["skip"] | NotGiven = NOT_GIVEN,
action_parameters: rule_create_params.RulesetsBlockRuleActionParameters
| rule_create_params.RulesetsExecuteRuleActionParameters
action_parameters: rule_create_params.BlockRuleActionParameters
| rule_create_params.ExecuteRuleActionParameters
| object
| rule_create_params.RulesetsSkipRuleActionParameters
| rule_create_params.SkipRuleActionParameters
| NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -1125,7 +1125,7 @@ async def edit(
zone_id: str | NotGiven = NOT_GIVEN,
id: str | NotGiven = NOT_GIVEN,
action: Literal["block"] | NotGiven = NOT_GIVEN,
action_parameters: rule_edit_params.RulesetsBlockRuleActionParameters | NotGiven = NOT_GIVEN,
action_parameters: rule_edit_params.BlockRuleActionParameters | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
expression: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -1186,7 +1186,7 @@ async def edit(
zone_id: str | NotGiven = NOT_GIVEN,
id: str | NotGiven = NOT_GIVEN,
action: Literal["execute"] | NotGiven = NOT_GIVEN,
action_parameters: rule_edit_params.RulesetsExecuteRuleActionParameters | NotGiven = NOT_GIVEN,
action_parameters: rule_edit_params.ExecuteRuleActionParameters | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
expression: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -1308,7 +1308,7 @@ async def edit(
zone_id: str | NotGiven = NOT_GIVEN,
id: str | NotGiven = NOT_GIVEN,
action: Literal["skip"] | NotGiven = NOT_GIVEN,
action_parameters: rule_edit_params.RulesetsSkipRuleActionParameters | NotGiven = NOT_GIVEN,
action_parameters: rule_edit_params.SkipRuleActionParameters | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
expression: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -1369,10 +1369,10 @@ async def edit(
zone_id: str | NotGiven = NOT_GIVEN,
id: str | NotGiven = NOT_GIVEN,
action: Literal["block"] | Literal["execute"] | Literal["log"] | Literal["skip"] | NotGiven = NOT_GIVEN,
action_parameters: rule_edit_params.RulesetsBlockRuleActionParameters
| rule_edit_params.RulesetsExecuteRuleActionParameters
action_parameters: rule_edit_params.BlockRuleActionParameters
| rule_edit_params.ExecuteRuleActionParameters
| object
| rule_edit_params.RulesetsSkipRuleActionParameters
| rule_edit_params.SkipRuleActionParameters
| NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
Expand Down
Loading

0 comments on commit fba97f2

Please sign in to comment.