3
3
from __future__ import annotations
4
4
5
5
from typing import Type , Iterable , cast
6
- from typing_extensions import Literal
7
6
8
7
import httpx
9
8
32
31
from ...._base_client import (
33
32
make_request_options ,
34
33
)
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
36
37
from ....types .rulesets .phase_get_response import PhaseGetResponse
37
38
from ....types .rulesets .phase_update_response import PhaseUpdateResponse
38
39
@@ -54,64 +55,15 @@ def with_streaming_response(self) -> PhasesResourceWithStreamingResponse:
54
55
55
56
def update (
56
57
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 ,
82
59
* ,
83
60
rules : Iterable [phase_update_params .Rule ],
84
61
account_id : str | NotGiven = NOT_GIVEN ,
85
62
zone_id : str | NotGiven = NOT_GIVEN ,
86
63
description : str | NotGiven = NOT_GIVEN ,
87
- kind : Literal [ "managed" , "custom" , "root" , "zone" ] | NotGiven = NOT_GIVEN ,
64
+ kind : Kind | NotGiven = NOT_GIVEN ,
88
65
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 ,
115
67
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
116
68
# The extra values given here take precedence over values defined on the client or passed to this method.
117
69
extra_headers : Headers | None = None ,
@@ -185,31 +137,7 @@ def update(
185
137
186
138
def get (
187
139
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 ,
213
141
* ,
214
142
account_id : str | NotGiven = NOT_GIVEN ,
215
143
zone_id : str | NotGiven = NOT_GIVEN ,
@@ -281,64 +209,15 @@ def with_streaming_response(self) -> AsyncPhasesResourceWithStreamingResponse:
281
209
282
210
async def update (
283
211
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 ,
309
213
* ,
310
214
rules : Iterable [phase_update_params .Rule ],
311
215
account_id : str | NotGiven = NOT_GIVEN ,
312
216
zone_id : str | NotGiven = NOT_GIVEN ,
313
217
description : str | NotGiven = NOT_GIVEN ,
314
- kind : Literal [ "managed" , "custom" , "root" , "zone" ] | NotGiven = NOT_GIVEN ,
218
+ kind : Kind | NotGiven = NOT_GIVEN ,
315
219
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 ,
342
221
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
343
222
# The extra values given here take precedence over values defined on the client or passed to this method.
344
223
extra_headers : Headers | None = None ,
@@ -412,31 +291,7 @@ async def update(
412
291
413
292
async def get (
414
293
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 ,
440
295
* ,
441
296
account_id : str | NotGiven = NOT_GIVEN ,
442
297
zone_id : str | NotGiven = NOT_GIVEN ,
0 commit comments