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 #293

Merged
merged 1 commit into from
Apr 11, 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
2 changes: 0 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2995,8 +2995,6 @@ Types:

```python
from cloudflare.types import (
RequestRule,
ResponseRule,
Ruleset,
RulesetCreateResponse,
RulesetUpdateResponse,
Expand Down
7 changes: 3 additions & 4 deletions src/cloudflare/resources/rulesets/phases/phases.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

from __future__ import annotations

from typing import Type, cast
from typing import Type, Iterable, cast
from typing_extensions import Literal

import httpx

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

from __future__ import annotations

from typing import Type, cast
from typing import Type, Iterable, cast
from typing_extensions import Literal

import httpx
Expand All @@ -25,7 +25,6 @@
)
from ...types import (
Ruleset,
RequestRuleParam,
RulesetGetResponse,
RulesetCreateResponse,
RulesetUpdateResponse,
Expand Down Expand Up @@ -116,7 +115,7 @@ def create(
"magic_transit_ids_managed",
"magic_transit_managed",
],
rules: RequestRuleParam,
rules: Iterable[ruleset_create_params.Rule],
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -194,7 +193,7 @@ def update(
self,
ruleset_id: str,
*,
rules: RequestRuleParam,
rules: Iterable[ruleset_update_params.Rule],
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -521,7 +520,7 @@ async def create(
"magic_transit_ids_managed",
"magic_transit_managed",
],
rules: RequestRuleParam,
rules: Iterable[ruleset_create_params.Rule],
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -599,7 +598,7 @@ async def update(
self,
ruleset_id: str,
*,
rules: RequestRuleParam,
rules: Iterable[ruleset_update_params.Rule],
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
Expand Down
2 changes: 0 additions & 2 deletions src/cloudflare/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
from .queue_created import QueueCreated as QueueCreated
from .queue_updated import QueueUpdated as QueueUpdated
from .request_model import RequestModel as RequestModel
from .response_rule import ResponseRule as ResponseRule
from .edge_ips_param import EdgeIPsParam as EdgeIPsParam
from .filter_options import FilterOptions as FilterOptions
from .hostname_param import HostnameParam as HostnameParam
Expand Down Expand Up @@ -117,7 +116,6 @@
from .http_configuration import HTTPConfiguration as HTTPConfiguration
from .pcap_create_params import PCAPCreateParams as PCAPCreateParams
from .pcap_list_response import PCAPListResponse as PCAPListResponse
from .request_rule_param import RequestRuleParam as RequestRuleParam
from .stream_list_params import StreamListParams as StreamListParams
from .user_edit_response import UserEditResponse as UserEditResponse
from .zone_create_params import ZoneCreateParams as ZoneCreateParams
Expand Down
13 changes: 0 additions & 13 deletions src/cloudflare/types/request_rule_param.py

This file was deleted.

11 changes: 0 additions & 11 deletions src/cloudflare/types/response_rule.py

This file was deleted.

10 changes: 7 additions & 3 deletions src/cloudflare/types/ruleset_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

from __future__ import annotations

from typing import Union, Iterable
from typing_extensions import Literal, Required, TypedDict

from .request_rule_param import RequestRuleParam
from .rulesets import LogRuleParam, SkipRuleParam, BlockRuleParam, ExecuteRuleParam

__all__ = ["RulesetCreateParams"]
__all__ = ["RulesetCreateParams", "Rule"]


class RulesetCreateParams(TypedDict, total=False):
Expand Down Expand Up @@ -45,7 +46,7 @@ class RulesetCreateParams(TypedDict, total=False):
]
"""The phase of the ruleset."""

rules: Required[RequestRuleParam]
rules: Required[Iterable[Rule]]
"""The list of rules in the ruleset."""

account_id: str
Expand All @@ -56,3 +57,6 @@ class RulesetCreateParams(TypedDict, total=False):

description: str
"""An informative description of the ruleset."""


Rule = Union[BlockRuleParam, ExecuteRuleParam, LogRuleParam, SkipRuleParam]
10 changes: 6 additions & 4 deletions src/cloudflare/types/ruleset_create_response.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

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

from .._models import BaseModel
from .response_rule import ResponseRule
from .rulesets import LogRule, SkipRule, BlockRule, ExecuteRule

__all__ = ["RulesetCreateResponse"]
__all__ = ["RulesetCreateResponse", "Rule"]

Rule = Union[BlockRule, ExecuteRule, LogRule, SkipRule]


class RulesetCreateResponse(BaseModel):
Expand Down Expand Up @@ -50,7 +52,7 @@ class RulesetCreateResponse(BaseModel):
]
"""The phase of the ruleset."""

rules: ResponseRule
rules: List[Rule]
"""The list of rules in the ruleset."""

version: str
Expand Down
10 changes: 6 additions & 4 deletions src/cloudflare/types/ruleset_get_response.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

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

from .._models import BaseModel
from .response_rule import ResponseRule
from .rulesets import LogRule, SkipRule, BlockRule, ExecuteRule

__all__ = ["RulesetGetResponse"]
__all__ = ["RulesetGetResponse", "Rule"]

Rule = Union[BlockRule, ExecuteRule, LogRule, SkipRule]


class RulesetGetResponse(BaseModel):
Expand Down Expand Up @@ -50,7 +52,7 @@ class RulesetGetResponse(BaseModel):
]
"""The phase of the ruleset."""

rules: ResponseRule
rules: List[Rule]
"""The list of rules in the ruleset."""

version: str
Expand Down
10 changes: 7 additions & 3 deletions src/cloudflare/types/ruleset_update_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

from __future__ import annotations

from typing import Union, Iterable
from typing_extensions import Literal, Required, TypedDict

from .request_rule_param import RequestRuleParam
from .rulesets import LogRuleParam, SkipRuleParam, BlockRuleParam, ExecuteRuleParam

__all__ = ["RulesetUpdateParams"]
__all__ = ["RulesetUpdateParams", "Rule"]


class RulesetUpdateParams(TypedDict, total=False):
rules: Required[RequestRuleParam]
rules: Required[Iterable[Rule]]
"""The list of rules in the ruleset."""

account_id: str
Expand Down Expand Up @@ -54,3 +55,6 @@ class RulesetUpdateParams(TypedDict, total=False):
"magic_transit_managed",
]
"""The phase of the ruleset."""


Rule = Union[BlockRuleParam, ExecuteRuleParam, LogRuleParam, SkipRuleParam]
10 changes: 6 additions & 4 deletions src/cloudflare/types/ruleset_update_response.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

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

from .._models import BaseModel
from .response_rule import ResponseRule
from .rulesets import LogRule, SkipRule, BlockRule, ExecuteRule

__all__ = ["RulesetUpdateResponse"]
__all__ = ["RulesetUpdateResponse", "Rule"]

Rule = Union[BlockRule, ExecuteRule, LogRule, SkipRule]


class RulesetUpdateResponse(BaseModel):
Expand Down Expand Up @@ -50,7 +52,7 @@ class RulesetUpdateResponse(BaseModel):
]
"""The phase of the ruleset."""

rules: ResponseRule
rules: List[Rule]
"""The list of rules in the ruleset."""

version: str
Expand Down
13 changes: 9 additions & 4 deletions src/cloudflare/types/rulesets/phase_get_response.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

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

from .log_rule import LogRule
from ..._models import BaseModel
from ..response_rule import ResponseRule
from .skip_rule import SkipRule
from .block_rule import BlockRule
from .execute_rule import ExecuteRule

__all__ = ["PhaseGetResponse"]
__all__ = ["PhaseGetResponse", "Rule"]

Rule = Union[BlockRule, ExecuteRule, LogRule, SkipRule]


class PhaseGetResponse(BaseModel):
Expand Down Expand Up @@ -50,7 +55,7 @@ class PhaseGetResponse(BaseModel):
]
"""The phase of the ruleset."""

rules: ResponseRule
rules: List[Rule]
"""The list of rules in the ruleset."""

version: str
Expand Down
13 changes: 10 additions & 3 deletions src/cloudflare/types/rulesets/phase_update_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

from __future__ import annotations

from typing import Union, Iterable
from typing_extensions import Literal, Required, TypedDict

from ..request_rule_param import RequestRuleParam
from .log_rule_param import LogRuleParam
from .skip_rule_param import SkipRuleParam
from .block_rule_param import BlockRuleParam
from .execute_rule_param import ExecuteRuleParam

__all__ = ["PhaseUpdateParams"]
__all__ = ["PhaseUpdateParams", "Rule"]


class PhaseUpdateParams(TypedDict, total=False):
rules: Required[RequestRuleParam]
rules: Required[Iterable[Rule]]
"""The list of rules in the ruleset."""

account_id: str
Expand Down Expand Up @@ -54,3 +58,6 @@ class PhaseUpdateParams(TypedDict, total=False):
"magic_transit_managed",
]
"""The phase of the ruleset."""


Rule = Union[BlockRuleParam, ExecuteRuleParam, LogRuleParam, SkipRuleParam]
13 changes: 9 additions & 4 deletions src/cloudflare/types/rulesets/phase_update_response.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

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

from .log_rule import LogRule
from ..._models import BaseModel
from ..response_rule import ResponseRule
from .skip_rule import SkipRule
from .block_rule import BlockRule
from .execute_rule import ExecuteRule

__all__ = ["PhaseUpdateResponse"]
__all__ = ["PhaseUpdateResponse", "Rule"]

Rule = Union[BlockRule, ExecuteRule, LogRule, SkipRule]


class PhaseUpdateResponse(BaseModel):
Expand Down Expand Up @@ -50,7 +55,7 @@ class PhaseUpdateResponse(BaseModel):
]
"""The phase of the ruleset."""

rules: ResponseRule
rules: List[Rule]
"""The list of rules in the ruleset."""

version: str
Expand Down
Loading