@@ -91,19 +91,16 @@ def create(
91
91
92
92
timeout: Override the client-level default timeout for this request, in seconds
93
93
"""
94
- if not account_id :
95
- raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
96
- if not zone_id :
97
- raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
98
- if not account_id and not zone_id :
99
- raise ValueError ("You must provide either account_id or zone_id" )
100
94
if account_id and zone_id :
101
95
raise ValueError ("You cannot provide both account_id and zone_id" )
102
96
103
97
if account_id :
104
98
account_or_zone = "accounts"
105
99
account_or_zone_id = account_id
106
100
else :
101
+ if not zone_id :
102
+ raise ValueError ("You must provide either account_id or zone_id" )
103
+
107
104
account_or_zone = "zones"
108
105
account_or_zone_id = zone_id
109
106
return cast (
@@ -176,19 +173,16 @@ def list(
176
173
177
174
timeout: Override the client-level default timeout for this request, in seconds
178
175
"""
179
- if not account_id :
180
- raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
181
- if not zone_id :
182
- raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
183
- if not account_id and not zone_id :
184
- raise ValueError ("You must provide either account_id or zone_id" )
185
176
if account_id and zone_id :
186
177
raise ValueError ("You cannot provide both account_id and zone_id" )
187
178
188
179
if account_id :
189
180
account_or_zone = "accounts"
190
181
account_or_zone_id = account_id
191
182
else :
183
+ if not zone_id :
184
+ raise ValueError ("You must provide either account_id or zone_id" )
185
+
192
186
account_or_zone = "zones"
193
187
account_or_zone_id = zone_id
194
188
return self ._get_api_list (
@@ -246,19 +240,16 @@ def delete(
246
240
247
241
timeout: Override the client-level default timeout for this request, in seconds
248
242
"""
249
- if not account_id :
250
- raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
251
- if not zone_id :
252
- raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
253
- if not account_id and not zone_id :
254
- raise ValueError ("You must provide either account_id or zone_id" )
255
243
if account_id and zone_id :
256
244
raise ValueError ("You cannot provide both account_id and zone_id" )
257
245
258
246
if account_id :
259
247
account_or_zone = "accounts"
260
248
account_or_zone_id = account_id
261
249
else :
250
+ if not zone_id :
251
+ raise ValueError ("You must provide either account_id or zone_id" )
252
+
262
253
account_or_zone = "zones"
263
254
account_or_zone_id = zone_id
264
255
return self ._delete (
@@ -314,19 +305,16 @@ def edit(
314
305
315
306
timeout: Override the client-level default timeout for this request, in seconds
316
307
"""
317
- if not account_id :
318
- raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
319
- if not zone_id :
320
- raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
321
- if not account_id and not zone_id :
322
- raise ValueError ("You must provide either account_id or zone_id" )
323
308
if account_id and zone_id :
324
309
raise ValueError ("You cannot provide both account_id and zone_id" )
325
310
326
311
if account_id :
327
312
account_or_zone = "accounts"
328
313
account_or_zone_id = account_id
329
314
else :
315
+ if not zone_id :
316
+ raise ValueError ("You must provide either account_id or zone_id" )
317
+
330
318
account_or_zone = "zones"
331
319
account_or_zone_id = zone_id
332
320
return cast (
@@ -383,19 +371,16 @@ def get(
383
371
384
372
timeout: Override the client-level default timeout for this request, in seconds
385
373
"""
386
- if not account_id :
387
- raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
388
- if not zone_id :
389
- raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
390
- if not account_id and not zone_id :
391
- raise ValueError ("You must provide either account_id or zone_id" )
392
374
if account_id and zone_id :
393
375
raise ValueError ("You cannot provide both account_id and zone_id" )
394
376
395
377
if account_id :
396
378
account_or_zone = "accounts"
397
379
account_or_zone_id = account_id
398
380
else :
381
+ if not zone_id :
382
+ raise ValueError ("You must provide either account_id or zone_id" )
383
+
399
384
account_or_zone = "zones"
400
385
account_or_zone_id = zone_id
401
386
return cast (
@@ -467,19 +452,16 @@ async def create(
467
452
468
453
timeout: Override the client-level default timeout for this request, in seconds
469
454
"""
470
- if not account_id :
471
- raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
472
- if not zone_id :
473
- raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
474
- if not account_id and not zone_id :
475
- raise ValueError ("You must provide either account_id or zone_id" )
476
455
if account_id and zone_id :
477
456
raise ValueError ("You cannot provide both account_id and zone_id" )
478
457
479
458
if account_id :
480
459
account_or_zone = "accounts"
481
460
account_or_zone_id = account_id
482
461
else :
462
+ if not zone_id :
463
+ raise ValueError ("You must provide either account_id or zone_id" )
464
+
483
465
account_or_zone = "zones"
484
466
account_or_zone_id = zone_id
485
467
return cast (
@@ -552,19 +534,16 @@ def list(
552
534
553
535
timeout: Override the client-level default timeout for this request, in seconds
554
536
"""
555
- if not account_id :
556
- raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
557
- if not zone_id :
558
- raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
559
- if not account_id and not zone_id :
560
- raise ValueError ("You must provide either account_id or zone_id" )
561
537
if account_id and zone_id :
562
538
raise ValueError ("You cannot provide both account_id and zone_id" )
563
539
564
540
if account_id :
565
541
account_or_zone = "accounts"
566
542
account_or_zone_id = account_id
567
543
else :
544
+ if not zone_id :
545
+ raise ValueError ("You must provide either account_id or zone_id" )
546
+
568
547
account_or_zone = "zones"
569
548
account_or_zone_id = zone_id
570
549
return self ._get_api_list (
@@ -622,19 +601,16 @@ async def delete(
622
601
623
602
timeout: Override the client-level default timeout for this request, in seconds
624
603
"""
625
- if not account_id :
626
- raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
627
- if not zone_id :
628
- raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
629
- if not account_id and not zone_id :
630
- raise ValueError ("You must provide either account_id or zone_id" )
631
604
if account_id and zone_id :
632
605
raise ValueError ("You cannot provide both account_id and zone_id" )
633
606
634
607
if account_id :
635
608
account_or_zone = "accounts"
636
609
account_or_zone_id = account_id
637
610
else :
611
+ if not zone_id :
612
+ raise ValueError ("You must provide either account_id or zone_id" )
613
+
638
614
account_or_zone = "zones"
639
615
account_or_zone_id = zone_id
640
616
return await self ._delete (
@@ -690,19 +666,16 @@ async def edit(
690
666
691
667
timeout: Override the client-level default timeout for this request, in seconds
692
668
"""
693
- if not account_id :
694
- raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
695
- if not zone_id :
696
- raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
697
- if not account_id and not zone_id :
698
- raise ValueError ("You must provide either account_id or zone_id" )
699
669
if account_id and zone_id :
700
670
raise ValueError ("You cannot provide both account_id and zone_id" )
701
671
702
672
if account_id :
703
673
account_or_zone = "accounts"
704
674
account_or_zone_id = account_id
705
675
else :
676
+ if not zone_id :
677
+ raise ValueError ("You must provide either account_id or zone_id" )
678
+
706
679
account_or_zone = "zones"
707
680
account_or_zone_id = zone_id
708
681
return cast (
@@ -759,19 +732,16 @@ async def get(
759
732
760
733
timeout: Override the client-level default timeout for this request, in seconds
761
734
"""
762
- if not account_id :
763
- raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
764
- if not zone_id :
765
- raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
766
- if not account_id and not zone_id :
767
- raise ValueError ("You must provide either account_id or zone_id" )
768
735
if account_id and zone_id :
769
736
raise ValueError ("You cannot provide both account_id and zone_id" )
770
737
771
738
if account_id :
772
739
account_or_zone = "accounts"
773
740
account_or_zone_id = account_id
774
741
else :
742
+ if not zone_id :
743
+ raise ValueError ("You must provide either account_id or zone_id" )
744
+
775
745
account_or_zone = "zones"
776
746
account_or_zone_id = zone_id
777
747
return cast (
0 commit comments