@@ -196,7 +196,7 @@ async def begin_download(
196
196
* ,
197
197
content_type : str = "application/json" ,
198
198
** kwargs : Any
199
- ) -> AsyncLROPoller [None ]:
199
+ ) -> AsyncLROPoller [_models . SecurityDomainOperationStatus ]:
200
200
"""Retrieves the Security Domain from the managed HSM. Calling this endpoint can
201
201
be used to activate a provisioned managed HSM resource.
202
202
@@ -207,15 +207,17 @@ async def begin_download(
207
207
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
208
208
Default value is "application/json".
209
209
:paramtype content_type: str
210
- :return: An instance of AsyncLROPoller that returns None
211
- :rtype: ~azure.core.polling.AsyncLROPoller[None]
210
+ :return: An instance of AsyncLROPoller that returns SecurityDomainOperationStatus. The
211
+ SecurityDomainOperationStatus is compatible with MutableMapping
212
+ :rtype:
213
+ ~azure.core.polling.AsyncLROPoller[~azure.keyvault.securitydomain.models.SecurityDomainOperationStatus]
212
214
:raises ~azure.core.exceptions.HttpResponseError:
213
215
"""
214
216
215
217
@overload
216
218
async def begin_download (
217
219
self , certificate_info_object : JSON , * , content_type : str = "application/json" , ** kwargs : Any
218
- ) -> AsyncLROPoller [None ]:
220
+ ) -> AsyncLROPoller [_models . SecurityDomainOperationStatus ]:
219
221
"""Retrieves the Security Domain from the managed HSM. Calling this endpoint can
220
222
be used to activate a provisioned managed HSM resource.
221
223
@@ -226,15 +228,17 @@ async def begin_download(
226
228
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
227
229
Default value is "application/json".
228
230
:paramtype content_type: str
229
- :return: An instance of AsyncLROPoller that returns None
230
- :rtype: ~azure.core.polling.AsyncLROPoller[None]
231
+ :return: An instance of AsyncLROPoller that returns SecurityDomainOperationStatus. The
232
+ SecurityDomainOperationStatus is compatible with MutableMapping
233
+ :rtype:
234
+ ~azure.core.polling.AsyncLROPoller[~azure.keyvault.securitydomain.models.SecurityDomainOperationStatus]
231
235
:raises ~azure.core.exceptions.HttpResponseError:
232
236
"""
233
237
234
238
@overload
235
239
async def begin_download (
236
240
self , certificate_info_object : IO [bytes ], * , content_type : str = "application/json" , ** kwargs : Any
237
- ) -> AsyncLROPoller [None ]:
241
+ ) -> AsyncLROPoller [_models . SecurityDomainOperationStatus ]:
238
242
"""Retrieves the Security Domain from the managed HSM. Calling this endpoint can
239
243
be used to activate a provisioned managed HSM resource.
240
244
@@ -245,15 +249,17 @@ async def begin_download(
245
249
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
246
250
Default value is "application/json".
247
251
:paramtype content_type: str
248
- :return: An instance of AsyncLROPoller that returns None
249
- :rtype: ~azure.core.polling.AsyncLROPoller[None]
252
+ :return: An instance of AsyncLROPoller that returns SecurityDomainOperationStatus. The
253
+ SecurityDomainOperationStatus is compatible with MutableMapping
254
+ :rtype:
255
+ ~azure.core.polling.AsyncLROPoller[~azure.keyvault.securitydomain.models.SecurityDomainOperationStatus]
250
256
:raises ~azure.core.exceptions.HttpResponseError:
251
257
"""
252
258
253
259
@distributed_trace_async
254
260
async def begin_download (
255
261
self , certificate_info_object : Union [_models .CertificateInfoObject , JSON , IO [bytes ]], ** kwargs : Any
256
- ) -> AsyncLROPoller [None ]:
262
+ ) -> AsyncLROPoller [_models . SecurityDomainOperationStatus ]:
257
263
"""Retrieves the Security Domain from the managed HSM. Calling this endpoint can
258
264
be used to activate a provisioned managed HSM resource.
259
265
@@ -263,15 +269,17 @@ async def begin_download(
263
269
JSON, IO[bytes] Required.
264
270
:type certificate_info_object: ~azure.keyvault.securitydomain.models.CertificateInfoObject or
265
271
JSON or IO[bytes]
266
- :return: An instance of AsyncLROPoller that returns None
267
- :rtype: ~azure.core.polling.AsyncLROPoller[None]
272
+ :return: An instance of AsyncLROPoller that returns SecurityDomainOperationStatus. The
273
+ SecurityDomainOperationStatus is compatible with MutableMapping
274
+ :rtype:
275
+ ~azure.core.polling.AsyncLROPoller[~azure.keyvault.securitydomain.models.SecurityDomainOperationStatus]
268
276
:raises ~azure.core.exceptions.HttpResponseError:
269
277
"""
270
278
_headers = case_insensitive_dict (kwargs .pop ("headers" , {}) or {})
271
279
_params = kwargs .pop ("params" , {}) or {}
272
280
273
281
content_type : Optional [str ] = kwargs .pop ("content_type" , _headers .pop ("Content-Type" , None ))
274
- cls : ClsType [None ] = kwargs .pop ("cls" , None )
282
+ cls : ClsType [_models . SecurityDomainOperationStatus ] = kwargs .pop ("cls" , None )
275
283
polling : Union [bool , AsyncPollingMethod ] = kwargs .pop ("polling" , True )
276
284
lro_delay = kwargs .pop ("polling_interval" , self ._config .polling_interval )
277
285
cont_token : Optional [str ] = kwargs .pop ("continuation_token" , None )
@@ -287,9 +295,18 @@ async def begin_download(
287
295
await raw_result .http_response .read () # type: ignore
288
296
kwargs .pop ("error_map" , None )
289
297
290
- def get_long_running_output (pipeline_response ): # pylint: disable=inconsistent-return-statements
298
+ def get_long_running_output (pipeline_response ):
299
+ response_headers = {}
300
+ response = pipeline_response .http_response
301
+ response_headers ["Azure-AsyncOperation" ] = self ._deserialize (
302
+ "str" , response .headers .get ("Azure-AsyncOperation" )
303
+ )
304
+ response_headers ["Retry-After" ] = self ._deserialize ("int" , response .headers .get ("Retry-After" ))
305
+
306
+ deserialized = _deserialize (_models .SecurityDomainOperationStatus , response .json ())
291
307
if cls :
292
- return cls (pipeline_response , None , {}) # type: ignore
308
+ return cls (pipeline_response , deserialized , response_headers ) # type: ignore
309
+ return deserialized
293
310
294
311
path_format_arguments = {
295
312
"vaultBaseUrl" : self ._serialize .url (
@@ -307,13 +324,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
307
324
else :
308
325
polling_method = polling
309
326
if cont_token :
310
- return AsyncLROPoller [None ].from_continuation_token (
327
+ return AsyncLROPoller [_models . SecurityDomainOperationStatus ].from_continuation_token (
311
328
polling_method = polling_method ,
312
329
continuation_token = cont_token ,
313
330
client = self ._client ,
314
331
deserialization_callback = get_long_running_output ,
315
332
)
316
- return AsyncLROPoller [None ](self ._client , raw_result , get_long_running_output , polling_method ) # type: ignore
333
+ return AsyncLROPoller [_models .SecurityDomainOperationStatus ](
334
+ self ._client , raw_result , get_long_running_output , polling_method # type: ignore
335
+ )
317
336
318
337
@distributed_trace_async
319
338
async def transfer_key (self , ** kwargs : Any ) -> _models .TransferKey :
@@ -444,70 +463,78 @@ async def _upload_initial(
444
463
@overload
445
464
async def begin_upload (
446
465
self , security_domain : _models .SecurityDomainObject , * , content_type : str = "application/json" , ** kwargs : Any
447
- ) -> AsyncLROPoller [None ]:
466
+ ) -> AsyncLROPoller [_models . SecurityDomainOperationStatus ]:
448
467
"""Restore the provided Security Domain.
449
468
450
469
:param security_domain: The Security Domain to be restored. Required.
451
470
:type security_domain: ~azure.keyvault.securitydomain.models.SecurityDomainObject
452
471
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
453
472
Default value is "application/json".
454
473
:paramtype content_type: str
455
- :return: An instance of AsyncLROPoller that returns None
456
- :rtype: ~azure.core.polling.AsyncLROPoller[None]
474
+ :return: An instance of AsyncLROPoller that returns SecurityDomainOperationStatus. The
475
+ SecurityDomainOperationStatus is compatible with MutableMapping
476
+ :rtype:
477
+ ~azure.core.polling.AsyncLROPoller[~azure.keyvault.securitydomain.models.SecurityDomainOperationStatus]
457
478
:raises ~azure.core.exceptions.HttpResponseError:
458
479
"""
459
480
460
481
@overload
461
482
async def begin_upload (
462
483
self , security_domain : JSON , * , content_type : str = "application/json" , ** kwargs : Any
463
- ) -> AsyncLROPoller [None ]:
484
+ ) -> AsyncLROPoller [_models . SecurityDomainOperationStatus ]:
464
485
"""Restore the provided Security Domain.
465
486
466
487
:param security_domain: The Security Domain to be restored. Required.
467
488
:type security_domain: JSON
468
489
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
469
490
Default value is "application/json".
470
491
:paramtype content_type: str
471
- :return: An instance of AsyncLROPoller that returns None
472
- :rtype: ~azure.core.polling.AsyncLROPoller[None]
492
+ :return: An instance of AsyncLROPoller that returns SecurityDomainOperationStatus. The
493
+ SecurityDomainOperationStatus is compatible with MutableMapping
494
+ :rtype:
495
+ ~azure.core.polling.AsyncLROPoller[~azure.keyvault.securitydomain.models.SecurityDomainOperationStatus]
473
496
:raises ~azure.core.exceptions.HttpResponseError:
474
497
"""
475
498
476
499
@overload
477
500
async def begin_upload (
478
501
self , security_domain : IO [bytes ], * , content_type : str = "application/json" , ** kwargs : Any
479
- ) -> AsyncLROPoller [None ]:
502
+ ) -> AsyncLROPoller [_models . SecurityDomainOperationStatus ]:
480
503
"""Restore the provided Security Domain.
481
504
482
505
:param security_domain: The Security Domain to be restored. Required.
483
506
:type security_domain: IO[bytes]
484
507
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
485
508
Default value is "application/json".
486
509
:paramtype content_type: str
487
- :return: An instance of AsyncLROPoller that returns None
488
- :rtype: ~azure.core.polling.AsyncLROPoller[None]
510
+ :return: An instance of AsyncLROPoller that returns SecurityDomainOperationStatus. The
511
+ SecurityDomainOperationStatus is compatible with MutableMapping
512
+ :rtype:
513
+ ~azure.core.polling.AsyncLROPoller[~azure.keyvault.securitydomain.models.SecurityDomainOperationStatus]
489
514
:raises ~azure.core.exceptions.HttpResponseError:
490
515
"""
491
516
492
517
@distributed_trace_async
493
518
async def begin_upload (
494
519
self , security_domain : Union [_models .SecurityDomainObject , JSON , IO [bytes ]], ** kwargs : Any
495
- ) -> AsyncLROPoller [None ]:
520
+ ) -> AsyncLROPoller [_models . SecurityDomainOperationStatus ]:
496
521
"""Restore the provided Security Domain.
497
522
498
523
:param security_domain: The Security Domain to be restored. Is one of the following types:
499
524
SecurityDomainObject, JSON, IO[bytes] Required.
500
525
:type security_domain: ~azure.keyvault.securitydomain.models.SecurityDomainObject or JSON or
501
526
IO[bytes]
502
- :return: An instance of AsyncLROPoller that returns None
503
- :rtype: ~azure.core.polling.AsyncLROPoller[None]
527
+ :return: An instance of AsyncLROPoller that returns SecurityDomainOperationStatus. The
528
+ SecurityDomainOperationStatus is compatible with MutableMapping
529
+ :rtype:
530
+ ~azure.core.polling.AsyncLROPoller[~azure.keyvault.securitydomain.models.SecurityDomainOperationStatus]
504
531
:raises ~azure.core.exceptions.HttpResponseError:
505
532
"""
506
533
_headers = case_insensitive_dict (kwargs .pop ("headers" , {}) or {})
507
534
_params = kwargs .pop ("params" , {}) or {}
508
535
509
536
content_type : Optional [str ] = kwargs .pop ("content_type" , _headers .pop ("Content-Type" , None ))
510
- cls : ClsType [None ] = kwargs .pop ("cls" , None )
537
+ cls : ClsType [_models . SecurityDomainOperationStatus ] = kwargs .pop ("cls" , None )
511
538
polling : Union [bool , AsyncPollingMethod ] = kwargs .pop ("polling" , True )
512
539
lro_delay = kwargs .pop ("polling_interval" , self ._config .polling_interval )
513
540
cont_token : Optional [str ] = kwargs .pop ("continuation_token" , None )
@@ -523,9 +550,18 @@ async def begin_upload(
523
550
await raw_result .http_response .read () # type: ignore
524
551
kwargs .pop ("error_map" , None )
525
552
526
- def get_long_running_output (pipeline_response ): # pylint: disable=inconsistent-return-statements
553
+ def get_long_running_output (pipeline_response ):
554
+ response_headers = {}
555
+ response = pipeline_response .http_response
556
+ response_headers ["Azure-AsyncOperation" ] = self ._deserialize (
557
+ "str" , response .headers .get ("Azure-AsyncOperation" )
558
+ )
559
+ response_headers ["Retry-After" ] = self ._deserialize ("int" , response .headers .get ("Retry-After" ))
560
+
561
+ deserialized = _deserialize (_models .SecurityDomainOperationStatus , response .json ())
527
562
if cls :
528
- return cls (pipeline_response , None , {}) # type: ignore
563
+ return cls (pipeline_response , deserialized , response_headers ) # type: ignore
564
+ return deserialized
529
565
530
566
path_format_arguments = {
531
567
"vaultBaseUrl" : self ._serialize .url (
@@ -543,13 +579,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
543
579
else :
544
580
polling_method = polling
545
581
if cont_token :
546
- return AsyncLROPoller [None ].from_continuation_token (
582
+ return AsyncLROPoller [_models . SecurityDomainOperationStatus ].from_continuation_token (
547
583
polling_method = polling_method ,
548
584
continuation_token = cont_token ,
549
585
client = self ._client ,
550
586
deserialization_callback = get_long_running_output ,
551
587
)
552
- return AsyncLROPoller [None ](self ._client , raw_result , get_long_running_output , polling_method ) # type: ignore
588
+ return AsyncLROPoller [_models .SecurityDomainOperationStatus ](
589
+ self ._client , raw_result , get_long_running_output , polling_method # type: ignore
590
+ )
553
591
554
592
@distributed_trace_async
555
593
async def upload_pending (self , ** kwargs : Any ) -> _models .SecurityDomainOperationStatus :
0 commit comments