Skip to content

Commit beccdf7

Browse files
committed
Spec modifications
1 parent 672df95 commit beccdf7

File tree

3 files changed

+149
-68
lines changed

3 files changed

+149
-68
lines changed

Diff for: sdk/keyvault/azure-keyvault-securitydomain/azure/keyvault/securitydomain/aio/operations/_operations.py

+72-34
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ async def begin_download(
196196
*,
197197
content_type: str = "application/json",
198198
**kwargs: Any
199-
) -> AsyncLROPoller[None]:
199+
) -> AsyncLROPoller[_models.SecurityDomainOperationStatus]:
200200
"""Retrieves the Security Domain from the managed HSM. Calling this endpoint can
201201
be used to activate a provisioned managed HSM resource.
202202
@@ -207,15 +207,17 @@ async def begin_download(
207207
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
208208
Default value is "application/json".
209209
: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]
212214
:raises ~azure.core.exceptions.HttpResponseError:
213215
"""
214216

215217
@overload
216218
async def begin_download(
217219
self, certificate_info_object: JSON, *, content_type: str = "application/json", **kwargs: Any
218-
) -> AsyncLROPoller[None]:
220+
) -> AsyncLROPoller[_models.SecurityDomainOperationStatus]:
219221
"""Retrieves the Security Domain from the managed HSM. Calling this endpoint can
220222
be used to activate a provisioned managed HSM resource.
221223
@@ -226,15 +228,17 @@ async def begin_download(
226228
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
227229
Default value is "application/json".
228230
: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]
231235
:raises ~azure.core.exceptions.HttpResponseError:
232236
"""
233237

234238
@overload
235239
async def begin_download(
236240
self, certificate_info_object: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
237-
) -> AsyncLROPoller[None]:
241+
) -> AsyncLROPoller[_models.SecurityDomainOperationStatus]:
238242
"""Retrieves the Security Domain from the managed HSM. Calling this endpoint can
239243
be used to activate a provisioned managed HSM resource.
240244
@@ -245,15 +249,17 @@ async def begin_download(
245249
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
246250
Default value is "application/json".
247251
: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]
250256
:raises ~azure.core.exceptions.HttpResponseError:
251257
"""
252258

253259
@distributed_trace_async
254260
async def begin_download(
255261
self, certificate_info_object: Union[_models.CertificateInfoObject, JSON, IO[bytes]], **kwargs: Any
256-
) -> AsyncLROPoller[None]:
262+
) -> AsyncLROPoller[_models.SecurityDomainOperationStatus]:
257263
"""Retrieves the Security Domain from the managed HSM. Calling this endpoint can
258264
be used to activate a provisioned managed HSM resource.
259265
@@ -263,15 +269,17 @@ async def begin_download(
263269
JSON, IO[bytes] Required.
264270
:type certificate_info_object: ~azure.keyvault.securitydomain.models.CertificateInfoObject or
265271
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]
268276
:raises ~azure.core.exceptions.HttpResponseError:
269277
"""
270278
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
271279
_params = kwargs.pop("params", {}) or {}
272280

273281
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)
275283
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
276284
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
277285
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
@@ -287,9 +295,18 @@ async def begin_download(
287295
await raw_result.http_response.read() # type: ignore
288296
kwargs.pop("error_map", None)
289297

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())
291307
if cls:
292-
return cls(pipeline_response, None, {}) # type: ignore
308+
return cls(pipeline_response, deserialized, response_headers) # type: ignore
309+
return deserialized
293310

294311
path_format_arguments = {
295312
"vaultBaseUrl": self._serialize.url(
@@ -307,13 +324,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
307324
else:
308325
polling_method = polling
309326
if cont_token:
310-
return AsyncLROPoller[None].from_continuation_token(
327+
return AsyncLROPoller[_models.SecurityDomainOperationStatus].from_continuation_token(
311328
polling_method=polling_method,
312329
continuation_token=cont_token,
313330
client=self._client,
314331
deserialization_callback=get_long_running_output,
315332
)
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+
)
317336

318337
@distributed_trace_async
319338
async def transfer_key(self, **kwargs: Any) -> _models.TransferKey:
@@ -444,70 +463,78 @@ async def _upload_initial(
444463
@overload
445464
async def begin_upload(
446465
self, security_domain: _models.SecurityDomainObject, *, content_type: str = "application/json", **kwargs: Any
447-
) -> AsyncLROPoller[None]:
466+
) -> AsyncLROPoller[_models.SecurityDomainOperationStatus]:
448467
"""Restore the provided Security Domain.
449468
450469
:param security_domain: The Security Domain to be restored. Required.
451470
:type security_domain: ~azure.keyvault.securitydomain.models.SecurityDomainObject
452471
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
453472
Default value is "application/json".
454473
: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]
457478
:raises ~azure.core.exceptions.HttpResponseError:
458479
"""
459480

460481
@overload
461482
async def begin_upload(
462483
self, security_domain: JSON, *, content_type: str = "application/json", **kwargs: Any
463-
) -> AsyncLROPoller[None]:
484+
) -> AsyncLROPoller[_models.SecurityDomainOperationStatus]:
464485
"""Restore the provided Security Domain.
465486
466487
:param security_domain: The Security Domain to be restored. Required.
467488
:type security_domain: JSON
468489
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
469490
Default value is "application/json".
470491
: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]
473496
:raises ~azure.core.exceptions.HttpResponseError:
474497
"""
475498

476499
@overload
477500
async def begin_upload(
478501
self, security_domain: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
479-
) -> AsyncLROPoller[None]:
502+
) -> AsyncLROPoller[_models.SecurityDomainOperationStatus]:
480503
"""Restore the provided Security Domain.
481504
482505
:param security_domain: The Security Domain to be restored. Required.
483506
:type security_domain: IO[bytes]
484507
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
485508
Default value is "application/json".
486509
: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]
489514
:raises ~azure.core.exceptions.HttpResponseError:
490515
"""
491516

492517
@distributed_trace_async
493518
async def begin_upload(
494519
self, security_domain: Union[_models.SecurityDomainObject, JSON, IO[bytes]], **kwargs: Any
495-
) -> AsyncLROPoller[None]:
520+
) -> AsyncLROPoller[_models.SecurityDomainOperationStatus]:
496521
"""Restore the provided Security Domain.
497522
498523
:param security_domain: The Security Domain to be restored. Is one of the following types:
499524
SecurityDomainObject, JSON, IO[bytes] Required.
500525
:type security_domain: ~azure.keyvault.securitydomain.models.SecurityDomainObject or JSON or
501526
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]
504531
:raises ~azure.core.exceptions.HttpResponseError:
505532
"""
506533
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
507534
_params = kwargs.pop("params", {}) or {}
508535

509536
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)
511538
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
512539
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
513540
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
@@ -523,9 +550,18 @@ async def begin_upload(
523550
await raw_result.http_response.read() # type: ignore
524551
kwargs.pop("error_map", None)
525552

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())
527562
if cls:
528-
return cls(pipeline_response, None, {}) # type: ignore
563+
return cls(pipeline_response, deserialized, response_headers) # type: ignore
564+
return deserialized
529565

530566
path_format_arguments = {
531567
"vaultBaseUrl": self._serialize.url(
@@ -543,13 +579,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
543579
else:
544580
polling_method = polling
545581
if cont_token:
546-
return AsyncLROPoller[None].from_continuation_token(
582+
return AsyncLROPoller[_models.SecurityDomainOperationStatus].from_continuation_token(
547583
polling_method=polling_method,
548584
continuation_token=cont_token,
549585
client=self._client,
550586
deserialization_callback=get_long_running_output,
551587
)
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+
)
553591

554592
@distributed_trace_async
555593
async def upload_pending(self, **kwargs: Any) -> _models.SecurityDomainOperationStatus:

Diff for: sdk/keyvault/azure-keyvault-securitydomain/azure/keyvault/securitydomain/models/_models.py

+5
Original file line numberDiff line numberDiff line change
@@ -181,19 +181,24 @@ class SecurityDomainOperationStatus(_model_base.Model):
181181
:vartype status: str or ~azure.keyvault.securitydomain.models.OperationStatus
182182
:ivar status_details: Details of the operation status.
183183
:vartype status_details: str
184+
:ivar value: The Security Domain.
185+
:vartype value: str
184186
"""
185187

186188
status: Optional[Union[str, "_models.OperationStatus"]] = rest_field()
187189
"""Operation status. Known values are: \"Success\", \"InProgress\", and \"Failed\"."""
188190
status_details: Optional[str] = rest_field()
189191
"""Details of the operation status."""
192+
value: Optional[str] = rest_field()
193+
"""The Security Domain."""
190194

191195
@overload
192196
def __init__(
193197
self,
194198
*,
195199
status: Optional[Union[str, "_models.OperationStatus"]] = None,
196200
status_details: Optional[str] = None,
201+
value: Optional[str] = None,
197202
) -> None: ...
198203

199204
@overload

0 commit comments

Comments
 (0)