2
2
3
3
from __future__ import annotations
4
4
5
- from typing import Any , cast , overload
5
+ from typing import Any , Optional , cast , overload
6
6
from typing_extensions import Literal
7
7
8
8
import httpx
@@ -54,7 +54,7 @@ def update(
54
54
extra_query : Query | None = None ,
55
55
extra_body : Body | None = None ,
56
56
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
57
- ) -> BotManagementUpdateResponse :
57
+ ) -> Optional [ BotManagementUpdateResponse ] :
58
58
"""
59
59
Updates the Bot Management configuration for a zone.
60
60
@@ -101,7 +101,7 @@ def update(
101
101
extra_query : Query | None = None ,
102
102
extra_body : Body | None = None ,
103
103
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
104
- ) -> BotManagementUpdateResponse :
104
+ ) -> Optional [ BotManagementUpdateResponse ] :
105
105
"""
106
106
Updates the Bot Management configuration for a zone.
107
107
@@ -157,7 +157,7 @@ def update(
157
157
extra_query : Query | None = None ,
158
158
extra_body : Body | None = None ,
159
159
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
160
- ) -> BotManagementUpdateResponse :
160
+ ) -> Optional [ BotManagementUpdateResponse ] :
161
161
"""
162
162
Updates the Bot Management configuration for a zone.
163
163
@@ -212,7 +212,7 @@ def update(
212
212
extra_query : Query | None = None ,
213
213
extra_body : Body | None = None ,
214
214
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
215
- ) -> BotManagementUpdateResponse :
215
+ ) -> Optional [ BotManagementUpdateResponse ] :
216
216
"""
217
217
Updates the Bot Management configuration for a zone.
218
218
@@ -268,11 +268,11 @@ def update(
268
268
extra_query : Query | None = None ,
269
269
extra_body : Body | None = None ,
270
270
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
271
- ) -> BotManagementUpdateResponse :
271
+ ) -> Optional [ BotManagementUpdateResponse ] :
272
272
if not zone_id :
273
273
raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
274
274
return cast (
275
- BotManagementUpdateResponse ,
275
+ Optional [ BotManagementUpdateResponse ] ,
276
276
self ._put (
277
277
f"/zones/{ zone_id } /bot_management" ,
278
278
body = maybe_transform (
@@ -294,7 +294,7 @@ def update(
294
294
extra_query = extra_query ,
295
295
extra_body = extra_body ,
296
296
timeout = timeout ,
297
- post_parser = ResultWrapper [BotManagementUpdateResponse ]._unwrapper ,
297
+ post_parser = ResultWrapper [Optional [ BotManagementUpdateResponse ] ]._unwrapper ,
298
298
),
299
299
cast_to = cast (
300
300
Any , ResultWrapper [BotManagementUpdateResponse ]
@@ -312,7 +312,7 @@ def get(
312
312
extra_query : Query | None = None ,
313
313
extra_body : Body | None = None ,
314
314
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
315
- ) -> BotManagementGetResponse :
315
+ ) -> Optional [ BotManagementGetResponse ] :
316
316
"""
317
317
Retrieve a zone's Bot Management Config
318
318
@@ -330,15 +330,15 @@ def get(
330
330
if not zone_id :
331
331
raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
332
332
return cast (
333
- BotManagementGetResponse ,
333
+ Optional [ BotManagementGetResponse ] ,
334
334
self ._get (
335
335
f"/zones/{ zone_id } /bot_management" ,
336
336
options = make_request_options (
337
337
extra_headers = extra_headers ,
338
338
extra_query = extra_query ,
339
339
extra_body = extra_body ,
340
340
timeout = timeout ,
341
- post_parser = ResultWrapper [BotManagementGetResponse ]._unwrapper ,
341
+ post_parser = ResultWrapper [Optional [ BotManagementGetResponse ] ]._unwrapper ,
342
342
),
343
343
cast_to = cast (
344
344
Any , ResultWrapper [BotManagementGetResponse ]
@@ -369,7 +369,7 @@ async def update(
369
369
extra_query : Query | None = None ,
370
370
extra_body : Body | None = None ,
371
371
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
372
- ) -> BotManagementUpdateResponse :
372
+ ) -> Optional [ BotManagementUpdateResponse ] :
373
373
"""
374
374
Updates the Bot Management configuration for a zone.
375
375
@@ -416,7 +416,7 @@ async def update(
416
416
extra_query : Query | None = None ,
417
417
extra_body : Body | None = None ,
418
418
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
419
- ) -> BotManagementUpdateResponse :
419
+ ) -> Optional [ BotManagementUpdateResponse ] :
420
420
"""
421
421
Updates the Bot Management configuration for a zone.
422
422
@@ -472,7 +472,7 @@ async def update(
472
472
extra_query : Query | None = None ,
473
473
extra_body : Body | None = None ,
474
474
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
475
- ) -> BotManagementUpdateResponse :
475
+ ) -> Optional [ BotManagementUpdateResponse ] :
476
476
"""
477
477
Updates the Bot Management configuration for a zone.
478
478
@@ -527,7 +527,7 @@ async def update(
527
527
extra_query : Query | None = None ,
528
528
extra_body : Body | None = None ,
529
529
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
530
- ) -> BotManagementUpdateResponse :
530
+ ) -> Optional [ BotManagementUpdateResponse ] :
531
531
"""
532
532
Updates the Bot Management configuration for a zone.
533
533
@@ -583,11 +583,11 @@ async def update(
583
583
extra_query : Query | None = None ,
584
584
extra_body : Body | None = None ,
585
585
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
586
- ) -> BotManagementUpdateResponse :
586
+ ) -> Optional [ BotManagementUpdateResponse ] :
587
587
if not zone_id :
588
588
raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
589
589
return cast (
590
- BotManagementUpdateResponse ,
590
+ Optional [ BotManagementUpdateResponse ] ,
591
591
await self ._put (
592
592
f"/zones/{ zone_id } /bot_management" ,
593
593
body = await async_maybe_transform (
@@ -609,7 +609,7 @@ async def update(
609
609
extra_query = extra_query ,
610
610
extra_body = extra_body ,
611
611
timeout = timeout ,
612
- post_parser = ResultWrapper [BotManagementUpdateResponse ]._unwrapper ,
612
+ post_parser = ResultWrapper [Optional [ BotManagementUpdateResponse ] ]._unwrapper ,
613
613
),
614
614
cast_to = cast (
615
615
Any , ResultWrapper [BotManagementUpdateResponse ]
@@ -627,7 +627,7 @@ async def get(
627
627
extra_query : Query | None = None ,
628
628
extra_body : Body | None = None ,
629
629
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
630
- ) -> BotManagementGetResponse :
630
+ ) -> Optional [ BotManagementGetResponse ] :
631
631
"""
632
632
Retrieve a zone's Bot Management Config
633
633
@@ -645,15 +645,15 @@ async def get(
645
645
if not zone_id :
646
646
raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
647
647
return cast (
648
- BotManagementGetResponse ,
648
+ Optional [ BotManagementGetResponse ] ,
649
649
await self ._get (
650
650
f"/zones/{ zone_id } /bot_management" ,
651
651
options = make_request_options (
652
652
extra_headers = extra_headers ,
653
653
extra_query = extra_query ,
654
654
extra_body = extra_body ,
655
655
timeout = timeout ,
656
- post_parser = ResultWrapper [BotManagementGetResponse ]._unwrapper ,
656
+ post_parser = ResultWrapper [Optional [ BotManagementGetResponse ] ]._unwrapper ,
657
657
),
658
658
cast_to = cast (
659
659
Any , ResultWrapper [BotManagementGetResponse ]
0 commit comments