Skip to content

Commit b8e303b

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): update via SDK Studio (#472)
1 parent 7fc60d8 commit b8e303b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+249
-921
lines changed

api.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ from cloudflare.types import (
1717
ResponseInfo,
1818
Result,
1919
Role,
20+
SortDirection,
2021
)
2122
```
2223

@@ -278,7 +279,7 @@ Methods:
278279
Types:
279280

280281
```python
281-
from cloudflare.types.zones import Zone, ZoneDeleteResponse
282+
from cloudflare.types.zones import Type, Zone, ZoneDeleteResponse
282283
```
283284

284285
Methods:
@@ -1159,7 +1160,7 @@ Methods:
11591160
Types:
11601161

11611162
```python
1162-
from cloudflare.types.load_balancers import RegionListResponse, RegionGetResponse
1163+
from cloudflare.types.load_balancers import RegionID, RegionListResponse, RegionGetResponse
11631164
```
11641165

11651166
Methods:
@@ -1199,6 +1200,7 @@ Types:
11991200
from cloudflare.types.cache import (
12001201
CacheReserve,
12011202
CacheReserveClear,
1203+
State,
12021204
CacheReserveClearResponse,
12031205
CacheReserveEditResponse,
12041206
CacheReserveGetResponse,
@@ -3021,6 +3023,8 @@ Types:
30213023

30223024
```python
30233025
from cloudflare.types.rulesets import (
3026+
Kind,
3027+
Phase,
30243028
Ruleset,
30253029
RulesetCreateResponse,
30263030
RulesetUpdateResponse,

src/cloudflare/resources/dns/records.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
from ...types.dns.record import Record
3939
from ...types.dns.ttl_param import TTLParam
4040
from ...types.dns.record_tags import RecordTags
41+
from ...types.shared.sort_direction import SortDirection
4142
from ...types.dns.record_scan_response import RecordScanResponse
4243
from ...types.dns.record_delete_response import RecordDeleteResponse
4344
from ...types.dns.record_import_response import RecordImportResponse
@@ -2597,7 +2598,7 @@ def list(
25972598
zone_id: str,
25982599
comment: record_list_params.Comment | NotGiven = NOT_GIVEN,
25992600
content: str | NotGiven = NOT_GIVEN,
2600-
direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
2601+
direction: SortDirection | NotGiven = NOT_GIVEN,
26012602
match: Literal["any", "all"] | NotGiven = NOT_GIVEN,
26022603
name: str | NotGiven = NOT_GIVEN,
26032604
order: Literal["type", "name", "content", "ttl", "proxied"] | NotGiven = NOT_GIVEN,
@@ -6801,7 +6802,7 @@ def list(
68016802
zone_id: str,
68026803
comment: record_list_params.Comment | NotGiven = NOT_GIVEN,
68036804
content: str | NotGiven = NOT_GIVEN,
6804-
direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
6805+
direction: SortDirection | NotGiven = NOT_GIVEN,
68056806
match: Literal["any", "all"] | NotGiven = NOT_GIVEN,
68066807
name: str | NotGiven = NOT_GIVEN,
68076808
order: Literal["type", "name", "content", "ttl", "proxied"] | NotGiven = NOT_GIVEN,

src/cloudflare/resources/load_balancers/pools/pools.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Type, Iterable, Optional, cast
5+
from typing import Type, Iterable, Optional, cast
66

77
import httpx
88

@@ -48,8 +48,8 @@
4848
pool_update_params,
4949
)
5050
from ....types.load_balancers.pool import Pool
51-
from ....types.load_balancers.check_region import CheckRegion
5251
from ....types.load_balancers.origin_param import OriginParam
52+
from ....types.load_balancers.region_id_param import RegionIDParam
5353
from ....types.load_balancers.load_shedding_param import LoadSheddingParam
5454
from ....types.load_balancers.pool_delete_response import PoolDeleteResponse
5555
from ....types.load_balancers.origin_steering_param import OriginSteeringParam
@@ -189,7 +189,7 @@ def update(
189189
account_id: str,
190190
name: str,
191191
origins: Iterable[OriginParam],
192-
check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN,
192+
check_regions: Optional[RegionIDParam] | NotGiven = NOT_GIVEN,
193193
description: str | NotGiven = NOT_GIVEN,
194194
enabled: bool | NotGiven = NOT_GIVEN,
195195
latitude: float | NotGiven = NOT_GIVEN,
@@ -388,7 +388,7 @@ def edit(
388388
pool_id: str,
389389
*,
390390
account_id: str,
391-
check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN,
391+
check_regions: Optional[RegionIDParam] | NotGiven = NOT_GIVEN,
392392
description: str | NotGiven = NOT_GIVEN,
393393
enabled: bool | NotGiven = NOT_GIVEN,
394394
latitude: float | NotGiven = NOT_GIVEN,
@@ -672,7 +672,7 @@ async def update(
672672
account_id: str,
673673
name: str,
674674
origins: Iterable[OriginParam],
675-
check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN,
675+
check_regions: Optional[RegionIDParam] | NotGiven = NOT_GIVEN,
676676
description: str | NotGiven = NOT_GIVEN,
677677
enabled: bool | NotGiven = NOT_GIVEN,
678678
latitude: float | NotGiven = NOT_GIVEN,
@@ -871,7 +871,7 @@ async def edit(
871871
pool_id: str,
872872
*,
873873
account_id: str,
874-
check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN,
874+
check_regions: Optional[RegionIDParam] | NotGiven = NOT_GIVEN,
875875
description: str | NotGiven = NOT_GIVEN,
876876
enabled: bool | NotGiven = NOT_GIVEN,
877877
latitude: float | NotGiven = NOT_GIVEN,

src/cloudflare/resources/rulesets/phases/phases.py

+11-156
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from __future__ import annotations
44

55
from typing import Type, Iterable, cast
6-
from typing_extensions import Literal
76

87
import httpx
98

@@ -32,7 +31,9 @@
3231
from ...._base_client import (
3332
make_request_options,
3433
)
35-
from ....types.rulesets import phase_update_params
34+
from ....types.rulesets import Kind, Phase, phase_update_params
35+
from ....types.rulesets.kind import Kind
36+
from ....types.rulesets.phase import Phase
3637
from ....types.rulesets.phase_get_response import PhaseGetResponse
3738
from ....types.rulesets.phase_update_response import PhaseUpdateResponse
3839

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

5556
def update(
5657
self,
57-
ruleset_phase: Literal[
58-
"ddos_l4",
59-
"ddos_l7",
60-
"http_config_settings",
61-
"http_custom_errors",
62-
"http_log_custom_fields",
63-
"http_ratelimit",
64-
"http_request_cache_settings",
65-
"http_request_dynamic_redirect",
66-
"http_request_firewall_custom",
67-
"http_request_firewall_managed",
68-
"http_request_late_transform",
69-
"http_request_origin",
70-
"http_request_redirect",
71-
"http_request_sanitize",
72-
"http_request_sbfm",
73-
"http_request_select_configuration",
74-
"http_request_transform",
75-
"http_response_compression",
76-
"http_response_firewall_managed",
77-
"http_response_headers_transform",
78-
"magic_transit",
79-
"magic_transit_ids_managed",
80-
"magic_transit_managed",
81-
],
58+
ruleset_phase: Phase,
8259
*,
8360
rules: Iterable[phase_update_params.Rule],
8461
account_id: str | NotGiven = NOT_GIVEN,
8562
zone_id: str | NotGiven = NOT_GIVEN,
8663
description: str | NotGiven = NOT_GIVEN,
87-
kind: Literal["managed", "custom", "root", "zone"] | NotGiven = NOT_GIVEN,
64+
kind: Kind | NotGiven = NOT_GIVEN,
8865
name: str | NotGiven = NOT_GIVEN,
89-
phase: Literal[
90-
"ddos_l4",
91-
"ddos_l7",
92-
"http_config_settings",
93-
"http_custom_errors",
94-
"http_log_custom_fields",
95-
"http_ratelimit",
96-
"http_request_cache_settings",
97-
"http_request_dynamic_redirect",
98-
"http_request_firewall_custom",
99-
"http_request_firewall_managed",
100-
"http_request_late_transform",
101-
"http_request_origin",
102-
"http_request_redirect",
103-
"http_request_sanitize",
104-
"http_request_sbfm",
105-
"http_request_select_configuration",
106-
"http_request_transform",
107-
"http_response_compression",
108-
"http_response_firewall_managed",
109-
"http_response_headers_transform",
110-
"magic_transit",
111-
"magic_transit_ids_managed",
112-
"magic_transit_managed",
113-
]
114-
| NotGiven = NOT_GIVEN,
66+
phase: Phase | NotGiven = NOT_GIVEN,
11567
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
11668
# The extra values given here take precedence over values defined on the client or passed to this method.
11769
extra_headers: Headers | None = None,
@@ -185,31 +137,7 @@ def update(
185137

186138
def get(
187139
self,
188-
ruleset_phase: Literal[
189-
"ddos_l4",
190-
"ddos_l7",
191-
"http_config_settings",
192-
"http_custom_errors",
193-
"http_log_custom_fields",
194-
"http_ratelimit",
195-
"http_request_cache_settings",
196-
"http_request_dynamic_redirect",
197-
"http_request_firewall_custom",
198-
"http_request_firewall_managed",
199-
"http_request_late_transform",
200-
"http_request_origin",
201-
"http_request_redirect",
202-
"http_request_sanitize",
203-
"http_request_sbfm",
204-
"http_request_select_configuration",
205-
"http_request_transform",
206-
"http_response_compression",
207-
"http_response_firewall_managed",
208-
"http_response_headers_transform",
209-
"magic_transit",
210-
"magic_transit_ids_managed",
211-
"magic_transit_managed",
212-
],
140+
ruleset_phase: Phase,
213141
*,
214142
account_id: str | NotGiven = NOT_GIVEN,
215143
zone_id: str | NotGiven = NOT_GIVEN,
@@ -281,64 +209,15 @@ def with_streaming_response(self) -> AsyncPhasesResourceWithStreamingResponse:
281209

282210
async def update(
283211
self,
284-
ruleset_phase: Literal[
285-
"ddos_l4",
286-
"ddos_l7",
287-
"http_config_settings",
288-
"http_custom_errors",
289-
"http_log_custom_fields",
290-
"http_ratelimit",
291-
"http_request_cache_settings",
292-
"http_request_dynamic_redirect",
293-
"http_request_firewall_custom",
294-
"http_request_firewall_managed",
295-
"http_request_late_transform",
296-
"http_request_origin",
297-
"http_request_redirect",
298-
"http_request_sanitize",
299-
"http_request_sbfm",
300-
"http_request_select_configuration",
301-
"http_request_transform",
302-
"http_response_compression",
303-
"http_response_firewall_managed",
304-
"http_response_headers_transform",
305-
"magic_transit",
306-
"magic_transit_ids_managed",
307-
"magic_transit_managed",
308-
],
212+
ruleset_phase: Phase,
309213
*,
310214
rules: Iterable[phase_update_params.Rule],
311215
account_id: str | NotGiven = NOT_GIVEN,
312216
zone_id: str | NotGiven = NOT_GIVEN,
313217
description: str | NotGiven = NOT_GIVEN,
314-
kind: Literal["managed", "custom", "root", "zone"] | NotGiven = NOT_GIVEN,
218+
kind: Kind | NotGiven = NOT_GIVEN,
315219
name: str | NotGiven = NOT_GIVEN,
316-
phase: Literal[
317-
"ddos_l4",
318-
"ddos_l7",
319-
"http_config_settings",
320-
"http_custom_errors",
321-
"http_log_custom_fields",
322-
"http_ratelimit",
323-
"http_request_cache_settings",
324-
"http_request_dynamic_redirect",
325-
"http_request_firewall_custom",
326-
"http_request_firewall_managed",
327-
"http_request_late_transform",
328-
"http_request_origin",
329-
"http_request_redirect",
330-
"http_request_sanitize",
331-
"http_request_sbfm",
332-
"http_request_select_configuration",
333-
"http_request_transform",
334-
"http_response_compression",
335-
"http_response_firewall_managed",
336-
"http_response_headers_transform",
337-
"magic_transit",
338-
"magic_transit_ids_managed",
339-
"magic_transit_managed",
340-
]
341-
| NotGiven = NOT_GIVEN,
220+
phase: Phase | NotGiven = NOT_GIVEN,
342221
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
343222
# The extra values given here take precedence over values defined on the client or passed to this method.
344223
extra_headers: Headers | None = None,
@@ -412,31 +291,7 @@ async def update(
412291

413292
async def get(
414293
self,
415-
ruleset_phase: Literal[
416-
"ddos_l4",
417-
"ddos_l7",
418-
"http_config_settings",
419-
"http_custom_errors",
420-
"http_log_custom_fields",
421-
"http_ratelimit",
422-
"http_request_cache_settings",
423-
"http_request_dynamic_redirect",
424-
"http_request_firewall_custom",
425-
"http_request_firewall_managed",
426-
"http_request_late_transform",
427-
"http_request_origin",
428-
"http_request_redirect",
429-
"http_request_sanitize",
430-
"http_request_sbfm",
431-
"http_request_select_configuration",
432-
"http_request_transform",
433-
"http_response_compression",
434-
"http_response_firewall_managed",
435-
"http_response_headers_transform",
436-
"magic_transit",
437-
"magic_transit_ids_managed",
438-
"magic_transit_managed",
439-
],
294+
ruleset_phase: Phase,
440295
*,
441296
account_id: str | NotGiven = NOT_GIVEN,
442297
zone_id: str | NotGiven = NOT_GIVEN,

0 commit comments

Comments
 (0)