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

Merged
merged 1 commit into from
May 7, 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
8 changes: 6 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ from cloudflare.types import (
ResponseInfo,
Result,
Role,
SortDirection,
)
```

Expand Down Expand Up @@ -278,7 +279,7 @@ Methods:
Types:

```python
from cloudflare.types.zones import Zone, ZoneDeleteResponse
from cloudflare.types.zones import Type, Zone, ZoneDeleteResponse
```

Methods:
Expand Down Expand Up @@ -1159,7 +1160,7 @@ Methods:
Types:

```python
from cloudflare.types.load_balancers import RegionListResponse, RegionGetResponse
from cloudflare.types.load_balancers import RegionID, RegionListResponse, RegionGetResponse
```

Methods:
Expand Down Expand Up @@ -1199,6 +1200,7 @@ Types:
from cloudflare.types.cache import (
CacheReserve,
CacheReserveClear,
State,
CacheReserveClearResponse,
CacheReserveEditResponse,
CacheReserveGetResponse,
Expand Down Expand Up @@ -3021,6 +3023,8 @@ Types:

```python
from cloudflare.types.rulesets import (
Kind,
Phase,
Ruleset,
RulesetCreateResponse,
RulesetUpdateResponse,
Expand Down
5 changes: 3 additions & 2 deletions src/cloudflare/resources/dns/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from ...types.dns.record import Record
from ...types.dns.ttl_param import TTLParam
from ...types.dns.record_tags import RecordTags
from ...types.shared.sort_direction import SortDirection
from ...types.dns.record_scan_response import RecordScanResponse
from ...types.dns.record_delete_response import RecordDeleteResponse
from ...types.dns.record_import_response import RecordImportResponse
Expand Down Expand Up @@ -2597,7 +2598,7 @@ def list(
zone_id: str,
comment: record_list_params.Comment | NotGiven = NOT_GIVEN,
content: str | NotGiven = NOT_GIVEN,
direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
direction: SortDirection | NotGiven = NOT_GIVEN,
match: Literal["any", "all"] | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
order: Literal["type", "name", "content", "ttl", "proxied"] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -6801,7 +6802,7 @@ def list(
zone_id: str,
comment: record_list_params.Comment | NotGiven = NOT_GIVEN,
content: str | NotGiven = NOT_GIVEN,
direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
direction: SortDirection | NotGiven = NOT_GIVEN,
match: Literal["any", "all"] | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
order: Literal["type", "name", "content", "ttl", "proxied"] | NotGiven = NOT_GIVEN,
Expand Down
12 changes: 6 additions & 6 deletions src/cloudflare/resources/load_balancers/pools/pools.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, Iterable, Optional, cast
from typing import Type, Iterable, Optional, cast

import httpx

Expand Down Expand Up @@ -48,8 +48,8 @@
pool_update_params,
)
from ....types.load_balancers.pool import Pool
from ....types.load_balancers.check_region import CheckRegion
from ....types.load_balancers.origin_param import OriginParam
from ....types.load_balancers.region_id_param import RegionIDParam
from ....types.load_balancers.load_shedding_param import LoadSheddingParam
from ....types.load_balancers.pool_delete_response import PoolDeleteResponse
from ....types.load_balancers.origin_steering_param import OriginSteeringParam
Expand Down Expand Up @@ -189,7 +189,7 @@ def update(
account_id: str,
name: str,
origins: Iterable[OriginParam],
check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN,
check_regions: Optional[RegionIDParam] | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
latitude: float | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -388,7 +388,7 @@ def edit(
pool_id: str,
*,
account_id: str,
check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN,
check_regions: Optional[RegionIDParam] | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
latitude: float | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -672,7 +672,7 @@ async def update(
account_id: str,
name: str,
origins: Iterable[OriginParam],
check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN,
check_regions: Optional[RegionIDParam] | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
latitude: float | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -871,7 +871,7 @@ async def edit(
pool_id: str,
*,
account_id: str,
check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN,
check_regions: Optional[RegionIDParam] | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
latitude: float | NotGiven = NOT_GIVEN,
Expand Down
167 changes: 11 additions & 156 deletions src/cloudflare/resources/rulesets/phases/phases.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from __future__ import annotations

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

import httpx

Expand Down Expand Up @@ -32,7 +31,9 @@
from ...._base_client import (
make_request_options,
)
from ....types.rulesets import phase_update_params
from ....types.rulesets import Kind, Phase, phase_update_params
from ....types.rulesets.kind import Kind
from ....types.rulesets.phase import Phase
from ....types.rulesets.phase_get_response import PhaseGetResponse
from ....types.rulesets.phase_update_response import PhaseUpdateResponse

Expand All @@ -54,64 +55,15 @@ def with_streaming_response(self) -> PhasesResourceWithStreamingResponse:

def update(
self,
ruleset_phase: Literal[
"ddos_l4",
"ddos_l7",
"http_config_settings",
"http_custom_errors",
"http_log_custom_fields",
"http_ratelimit",
"http_request_cache_settings",
"http_request_dynamic_redirect",
"http_request_firewall_custom",
"http_request_firewall_managed",
"http_request_late_transform",
"http_request_origin",
"http_request_redirect",
"http_request_sanitize",
"http_request_sbfm",
"http_request_select_configuration",
"http_request_transform",
"http_response_compression",
"http_response_firewall_managed",
"http_response_headers_transform",
"magic_transit",
"magic_transit_ids_managed",
"magic_transit_managed",
],
ruleset_phase: Phase,
*,
rules: Iterable[phase_update_params.Rule],
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
kind: Literal["managed", "custom", "root", "zone"] | NotGiven = NOT_GIVEN,
kind: Kind | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
phase: Literal[
"ddos_l4",
"ddos_l7",
"http_config_settings",
"http_custom_errors",
"http_log_custom_fields",
"http_ratelimit",
"http_request_cache_settings",
"http_request_dynamic_redirect",
"http_request_firewall_custom",
"http_request_firewall_managed",
"http_request_late_transform",
"http_request_origin",
"http_request_redirect",
"http_request_sanitize",
"http_request_sbfm",
"http_request_select_configuration",
"http_request_transform",
"http_response_compression",
"http_response_firewall_managed",
"http_response_headers_transform",
"magic_transit",
"magic_transit_ids_managed",
"magic_transit_managed",
]
| NotGiven = NOT_GIVEN,
phase: Phase | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -185,31 +137,7 @@ def update(

def get(
self,
ruleset_phase: Literal[
"ddos_l4",
"ddos_l7",
"http_config_settings",
"http_custom_errors",
"http_log_custom_fields",
"http_ratelimit",
"http_request_cache_settings",
"http_request_dynamic_redirect",
"http_request_firewall_custom",
"http_request_firewall_managed",
"http_request_late_transform",
"http_request_origin",
"http_request_redirect",
"http_request_sanitize",
"http_request_sbfm",
"http_request_select_configuration",
"http_request_transform",
"http_response_compression",
"http_response_firewall_managed",
"http_response_headers_transform",
"magic_transit",
"magic_transit_ids_managed",
"magic_transit_managed",
],
ruleset_phase: Phase,
*,
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -281,64 +209,15 @@ def with_streaming_response(self) -> AsyncPhasesResourceWithStreamingResponse:

async def update(
self,
ruleset_phase: Literal[
"ddos_l4",
"ddos_l7",
"http_config_settings",
"http_custom_errors",
"http_log_custom_fields",
"http_ratelimit",
"http_request_cache_settings",
"http_request_dynamic_redirect",
"http_request_firewall_custom",
"http_request_firewall_managed",
"http_request_late_transform",
"http_request_origin",
"http_request_redirect",
"http_request_sanitize",
"http_request_sbfm",
"http_request_select_configuration",
"http_request_transform",
"http_response_compression",
"http_response_firewall_managed",
"http_response_headers_transform",
"magic_transit",
"magic_transit_ids_managed",
"magic_transit_managed",
],
ruleset_phase: Phase,
*,
rules: Iterable[phase_update_params.Rule],
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
kind: Literal["managed", "custom", "root", "zone"] | NotGiven = NOT_GIVEN,
kind: Kind | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
phase: Literal[
"ddos_l4",
"ddos_l7",
"http_config_settings",
"http_custom_errors",
"http_log_custom_fields",
"http_ratelimit",
"http_request_cache_settings",
"http_request_dynamic_redirect",
"http_request_firewall_custom",
"http_request_firewall_managed",
"http_request_late_transform",
"http_request_origin",
"http_request_redirect",
"http_request_sanitize",
"http_request_sbfm",
"http_request_select_configuration",
"http_request_transform",
"http_response_compression",
"http_response_firewall_managed",
"http_response_headers_transform",
"magic_transit",
"magic_transit_ids_managed",
"magic_transit_managed",
]
| NotGiven = NOT_GIVEN,
phase: Phase | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -412,31 +291,7 @@ async def update(

async def get(
self,
ruleset_phase: Literal[
"ddos_l4",
"ddos_l7",
"http_config_settings",
"http_custom_errors",
"http_log_custom_fields",
"http_ratelimit",
"http_request_cache_settings",
"http_request_dynamic_redirect",
"http_request_firewall_custom",
"http_request_firewall_managed",
"http_request_late_transform",
"http_request_origin",
"http_request_redirect",
"http_request_sanitize",
"http_request_sbfm",
"http_request_select_configuration",
"http_request_transform",
"http_response_compression",
"http_response_firewall_managed",
"http_response_headers_transform",
"magic_transit",
"magic_transit_ids_managed",
"magic_transit_managed",
],
ruleset_phase: Phase,
*,
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
Expand Down
Loading