20
20
async_to_streamed_response_wrapper ,
21
21
)
22
22
from ..._wrappers import ResultWrapper
23
- from ...types .zones import hold_edit_params , hold_create_params , hold_delete_params
23
+ from ...types .zones import hold_create_params , hold_delete_params , hold_update_params
24
24
from ..._base_client import make_request_options
25
25
from ...types .zones .zone_hold import ZoneHold
26
26
@@ -94,11 +94,12 @@ def create(
94
94
cast_to = cast (Type [ZoneHold ], ResultWrapper [ZoneHold ]),
95
95
)
96
96
97
- def delete (
97
+ def update (
98
98
self ,
99
99
* ,
100
100
zone_id : str ,
101
101
hold_after : str | NotGiven = NOT_GIVEN ,
102
+ include_subdomains : bool | NotGiven = NOT_GIVEN ,
102
103
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
103
104
# The extra values given here take precedence over values defined on the client or passed to this method.
104
105
extra_headers : Headers | None = None ,
@@ -107,15 +108,22 @@ def delete(
107
108
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
108
109
) -> ZoneHold :
109
110
"""
110
- Stop enforcement of a zone hold on the zone, permanently or temporarily,
111
- allowing the creation and activation of zones with this zone's hostname .
111
+ Update the `hold_after` and/or `include_subdomains` values on an existing zone
112
+ hold. The hold is enabled if the `hold_after` date-time value is in the past .
112
113
113
114
Args:
114
115
zone_id: Identifier
115
116
116
- hold_after: If `hold_after` is provided, the hold will be temporarily disabled, then
117
- automatically re-enabled by the system at the time specified in this
118
- RFC3339-formatted timestamp. Otherwise, the hold will be disabled indefinitely.
117
+ hold_after: If `hold_after` is provided and future-dated, the hold will be temporarily
118
+ disabled, then automatically re-enabled by the system at the time specified in
119
+ this RFC3339-formatted timestamp. A past-dated `hold_after` value will have no
120
+ effect on an existing, enabled hold. Providing an empty string will set its
121
+ value to the current time.
122
+
123
+ include_subdomains: If `true`, the zone hold will extend to block any subdomain of the given zone,
124
+ as well as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with
125
+ the hostname 'example.com' and include_subdomains=true will block 'example.com',
126
+ 'staging.example.com', 'api.staging.example.com', etc.
119
127
120
128
extra_headers: Send extra headers
121
129
@@ -127,25 +135,30 @@ def delete(
127
135
"""
128
136
if not zone_id :
129
137
raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
130
- return self ._delete (
138
+ return self ._patch (
131
139
f"/zones/{ zone_id } /hold" ,
140
+ body = maybe_transform (
141
+ {
142
+ "hold_after" : hold_after ,
143
+ "include_subdomains" : include_subdomains ,
144
+ },
145
+ hold_update_params .HoldUpdateParams ,
146
+ ),
132
147
options = make_request_options (
133
148
extra_headers = extra_headers ,
134
149
extra_query = extra_query ,
135
150
extra_body = extra_body ,
136
151
timeout = timeout ,
137
- query = maybe_transform ({"hold_after" : hold_after }, hold_delete_params .HoldDeleteParams ),
138
152
post_parser = ResultWrapper [ZoneHold ]._unwrapper ,
139
153
),
140
154
cast_to = cast (Type [ZoneHold ], ResultWrapper [ZoneHold ]),
141
155
)
142
156
143
- def edit (
157
+ def delete (
144
158
self ,
145
159
* ,
146
160
zone_id : str ,
147
161
hold_after : str | NotGiven = NOT_GIVEN ,
148
- include_subdomains : bool | NotGiven = NOT_GIVEN ,
149
162
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
150
163
# The extra values given here take precedence over values defined on the client or passed to this method.
151
164
extra_headers : Headers | None = None ,
@@ -154,22 +167,15 @@ def edit(
154
167
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
155
168
) -> ZoneHold :
156
169
"""
157
- Update the `hold_after` and/or `include_subdomains` values on an existing zone
158
- hold. The hold is enabled if the `hold_after` date-time value is in the past .
170
+ Stop enforcement of a zone hold on the zone, permanently or temporarily,
171
+ allowing the creation and activation of zones with this zone's hostname .
159
172
160
173
Args:
161
174
zone_id: Identifier
162
175
163
- hold_after: If `hold_after` is provided and future-dated, the hold will be temporarily
164
- disabled, then automatically re-enabled by the system at the time specified in
165
- this RFC3339-formatted timestamp. A past-dated `hold_after` value will have no
166
- effect on an existing, enabled hold. Providing an empty string will set its
167
- value to the current time.
168
-
169
- include_subdomains: If `true`, the zone hold will extend to block any subdomain of the given zone,
170
- as well as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with
171
- the hostname 'example.com' and include_subdomains=true will block 'example.com',
172
- 'staging.example.com', 'api.staging.example.com', etc.
176
+ hold_after: If `hold_after` is provided, the hold will be temporarily disabled, then
177
+ automatically re-enabled by the system at the time specified in this
178
+ RFC3339-formatted timestamp. Otherwise, the hold will be disabled indefinitely.
173
179
174
180
extra_headers: Send extra headers
175
181
@@ -181,20 +187,14 @@ def edit(
181
187
"""
182
188
if not zone_id :
183
189
raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
184
- return self ._patch (
190
+ return self ._delete (
185
191
f"/zones/{ zone_id } /hold" ,
186
- body = maybe_transform (
187
- {
188
- "hold_after" : hold_after ,
189
- "include_subdomains" : include_subdomains ,
190
- },
191
- hold_edit_params .HoldEditParams ,
192
- ),
193
192
options = make_request_options (
194
193
extra_headers = extra_headers ,
195
194
extra_query = extra_query ,
196
195
extra_body = extra_body ,
197
196
timeout = timeout ,
197
+ query = maybe_transform ({"hold_after" : hold_after }, hold_delete_params .HoldDeleteParams ),
198
198
post_parser = ResultWrapper [ZoneHold ]._unwrapper ,
199
199
),
200
200
cast_to = cast (Type [ZoneHold ], ResultWrapper [ZoneHold ]),
@@ -310,11 +310,12 @@ async def create(
310
310
cast_to = cast (Type [ZoneHold ], ResultWrapper [ZoneHold ]),
311
311
)
312
312
313
- async def delete (
313
+ async def update (
314
314
self ,
315
315
* ,
316
316
zone_id : str ,
317
317
hold_after : str | NotGiven = NOT_GIVEN ,
318
+ include_subdomains : bool | NotGiven = NOT_GIVEN ,
318
319
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
319
320
# The extra values given here take precedence over values defined on the client or passed to this method.
320
321
extra_headers : Headers | None = None ,
@@ -323,15 +324,22 @@ async def delete(
323
324
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
324
325
) -> ZoneHold :
325
326
"""
326
- Stop enforcement of a zone hold on the zone, permanently or temporarily,
327
- allowing the creation and activation of zones with this zone's hostname .
327
+ Update the `hold_after` and/or `include_subdomains` values on an existing zone
328
+ hold. The hold is enabled if the `hold_after` date-time value is in the past .
328
329
329
330
Args:
330
331
zone_id: Identifier
331
332
332
- hold_after: If `hold_after` is provided, the hold will be temporarily disabled, then
333
- automatically re-enabled by the system at the time specified in this
334
- RFC3339-formatted timestamp. Otherwise, the hold will be disabled indefinitely.
333
+ hold_after: If `hold_after` is provided and future-dated, the hold will be temporarily
334
+ disabled, then automatically re-enabled by the system at the time specified in
335
+ this RFC3339-formatted timestamp. A past-dated `hold_after` value will have no
336
+ effect on an existing, enabled hold. Providing an empty string will set its
337
+ value to the current time.
338
+
339
+ include_subdomains: If `true`, the zone hold will extend to block any subdomain of the given zone,
340
+ as well as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with
341
+ the hostname 'example.com' and include_subdomains=true will block 'example.com',
342
+ 'staging.example.com', 'api.staging.example.com', etc.
335
343
336
344
extra_headers: Send extra headers
337
345
@@ -343,25 +351,30 @@ async def delete(
343
351
"""
344
352
if not zone_id :
345
353
raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
346
- return await self ._delete (
354
+ return await self ._patch (
347
355
f"/zones/{ zone_id } /hold" ,
356
+ body = await async_maybe_transform (
357
+ {
358
+ "hold_after" : hold_after ,
359
+ "include_subdomains" : include_subdomains ,
360
+ },
361
+ hold_update_params .HoldUpdateParams ,
362
+ ),
348
363
options = make_request_options (
349
364
extra_headers = extra_headers ,
350
365
extra_query = extra_query ,
351
366
extra_body = extra_body ,
352
367
timeout = timeout ,
353
- query = await async_maybe_transform ({"hold_after" : hold_after }, hold_delete_params .HoldDeleteParams ),
354
368
post_parser = ResultWrapper [ZoneHold ]._unwrapper ,
355
369
),
356
370
cast_to = cast (Type [ZoneHold ], ResultWrapper [ZoneHold ]),
357
371
)
358
372
359
- async def edit (
373
+ async def delete (
360
374
self ,
361
375
* ,
362
376
zone_id : str ,
363
377
hold_after : str | NotGiven = NOT_GIVEN ,
364
- include_subdomains : bool | NotGiven = NOT_GIVEN ,
365
378
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
366
379
# The extra values given here take precedence over values defined on the client or passed to this method.
367
380
extra_headers : Headers | None = None ,
@@ -370,22 +383,15 @@ async def edit(
370
383
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
371
384
) -> ZoneHold :
372
385
"""
373
- Update the `hold_after` and/or `include_subdomains` values on an existing zone
374
- hold. The hold is enabled if the `hold_after` date-time value is in the past .
386
+ Stop enforcement of a zone hold on the zone, permanently or temporarily,
387
+ allowing the creation and activation of zones with this zone's hostname .
375
388
376
389
Args:
377
390
zone_id: Identifier
378
391
379
- hold_after: If `hold_after` is provided and future-dated, the hold will be temporarily
380
- disabled, then automatically re-enabled by the system at the time specified in
381
- this RFC3339-formatted timestamp. A past-dated `hold_after` value will have no
382
- effect on an existing, enabled hold. Providing an empty string will set its
383
- value to the current time.
384
-
385
- include_subdomains: If `true`, the zone hold will extend to block any subdomain of the given zone,
386
- as well as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with
387
- the hostname 'example.com' and include_subdomains=true will block 'example.com',
388
- 'staging.example.com', 'api.staging.example.com', etc.
392
+ hold_after: If `hold_after` is provided, the hold will be temporarily disabled, then
393
+ automatically re-enabled by the system at the time specified in this
394
+ RFC3339-formatted timestamp. Otherwise, the hold will be disabled indefinitely.
389
395
390
396
extra_headers: Send extra headers
391
397
@@ -397,20 +403,14 @@ async def edit(
397
403
"""
398
404
if not zone_id :
399
405
raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
400
- return await self ._patch (
406
+ return await self ._delete (
401
407
f"/zones/{ zone_id } /hold" ,
402
- body = await async_maybe_transform (
403
- {
404
- "hold_after" : hold_after ,
405
- "include_subdomains" : include_subdomains ,
406
- },
407
- hold_edit_params .HoldEditParams ,
408
- ),
409
408
options = make_request_options (
410
409
extra_headers = extra_headers ,
411
410
extra_query = extra_query ,
412
411
extra_body = extra_body ,
413
412
timeout = timeout ,
413
+ query = await async_maybe_transform ({"hold_after" : hold_after }, hold_delete_params .HoldDeleteParams ),
414
414
post_parser = ResultWrapper [ZoneHold ]._unwrapper ,
415
415
),
416
416
cast_to = cast (Type [ZoneHold ], ResultWrapper [ZoneHold ]),
@@ -464,12 +464,12 @@ def __init__(self, holds: HoldsResource) -> None:
464
464
self .create = to_raw_response_wrapper (
465
465
holds .create ,
466
466
)
467
+ self .update = to_raw_response_wrapper (
468
+ holds .update ,
469
+ )
467
470
self .delete = to_raw_response_wrapper (
468
471
holds .delete ,
469
472
)
470
- self .edit = to_raw_response_wrapper (
471
- holds .edit ,
472
- )
473
473
self .get = to_raw_response_wrapper (
474
474
holds .get ,
475
475
)
@@ -482,12 +482,12 @@ def __init__(self, holds: AsyncHoldsResource) -> None:
482
482
self .create = async_to_raw_response_wrapper (
483
483
holds .create ,
484
484
)
485
+ self .update = async_to_raw_response_wrapper (
486
+ holds .update ,
487
+ )
485
488
self .delete = async_to_raw_response_wrapper (
486
489
holds .delete ,
487
490
)
488
- self .edit = async_to_raw_response_wrapper (
489
- holds .edit ,
490
- )
491
491
self .get = async_to_raw_response_wrapper (
492
492
holds .get ,
493
493
)
@@ -500,12 +500,12 @@ def __init__(self, holds: HoldsResource) -> None:
500
500
self .create = to_streamed_response_wrapper (
501
501
holds .create ,
502
502
)
503
+ self .update = to_streamed_response_wrapper (
504
+ holds .update ,
505
+ )
503
506
self .delete = to_streamed_response_wrapper (
504
507
holds .delete ,
505
508
)
506
- self .edit = to_streamed_response_wrapper (
507
- holds .edit ,
508
- )
509
509
self .get = to_streamed_response_wrapper (
510
510
holds .get ,
511
511
)
@@ -518,12 +518,12 @@ def __init__(self, holds: AsyncHoldsResource) -> None:
518
518
self .create = async_to_streamed_response_wrapper (
519
519
holds .create ,
520
520
)
521
+ self .update = async_to_streamed_response_wrapper (
522
+ holds .update ,
523
+ )
521
524
self .delete = async_to_streamed_response_wrapper (
522
525
holds .delete ,
523
526
)
524
- self .edit = async_to_streamed_response_wrapper (
525
- holds .edit ,
526
- )
527
527
self .get = async_to_streamed_response_wrapper (
528
528
holds .get ,
529
529
)
0 commit comments