From e19a84f48f7f14efe4953179aa389c47f11b617b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?McCoy=20Pati=C3=B1o?= <39780829+mccoyp@users.noreply.github.com> Date: Mon, 14 Mar 2022 17:28:39 -0700 Subject: [PATCH] [Key Vault] Address architect feedback (#23475) --- .../azure/keyvault/keys/_client.py | 6 +++--- .../azure/keyvault/keys/_models.py | 14 +++++++------- .../azure/keyvault/keys/aio/_client.py | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_client.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_client.py index 6d60bba138d5..9484cc8441db 100644 --- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_client.py +++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_client.py @@ -18,7 +18,7 @@ if TYPE_CHECKING: # pylint:disable=unused-import - from typing import Any, Iterable, Optional, Union + from typing import Any, List, Optional, Union from azure.core.paging import ItemPaged from azure.core.polling import LROPoller from ._models import JsonWebKey @@ -701,7 +701,7 @@ def release_key(self, name, target_attestation_token, **kwargs): :keyword str version: A specific version of the key to release. If unspecified, the latest version is released. :keyword algorithm: The encryption algorithm to use to protect the released key material. - :paramtype algorithm: ~azure.keyvault.keys.KeyExportEncryptionAlgorithm + :paramtype algorithm: Union[str, ~azure.keyvault.keys.KeyExportEncryptionAlgorithm] :keyword str nonce: A client-provided nonce for freshness. :return: The result of the key release. @@ -792,7 +792,7 @@ def update_key_rotation_policy(self, key_name, policy, **kwargs): :keyword lifetime_actions: Actions that will be performed by Key Vault over the lifetime of a key. This will override the lifetime actions of the provided ``policy``. - :paramtype lifetime_actions: Iterable[~azure.keyvault.keys.KeyRotationLifetimeAction] + :paramtype lifetime_actions: List[~azure.keyvault.keys.KeyRotationLifetimeAction] :keyword str expires_in: The expiry time of the policy that will be applied on new key versions, defined as an ISO 8601 duration. For example: 90 days is "P90D", 3 months is "P3M", and 48 hours is "PT48H". See `Wikipedia `_ for more information on ISO 8601 durations. diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_models.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_models.py index dd30eb8729e9..870b660c901f 100644 --- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_models.py +++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_models.py @@ -13,7 +13,7 @@ if TYPE_CHECKING: # pylint:disable=unused-import - from typing import Any, Dict, Optional, List + from typing import Any, Dict, List, Optional, Union from datetime import datetime from . import _generated_models as _models from ._enums import KeyOperation, KeyRotationPolicyAction, KeyType @@ -319,14 +319,14 @@ class KeyRotationPolicy(object): :ivar str id: The identifier of the key rotation policy. :ivar lifetime_actions: Actions that will be performed by Key Vault over the lifetime of a key. - :type lifetime_actions: list[~azure.keyvault.keys.KeyRotationLifetimeAction] + :vartype lifetime_actions: List[~azure.keyvault.keys.KeyRotationLifetimeAction] :ivar str expires_in: The expiry time of the policy that will be applied on new key versions, defined as an ISO 8601 duration. For example, 90 days is "P90D". See `Wikipedia `_ for more information on ISO 8601 durations. :ivar created_on: When the policy was created, in UTC - :type created_on: ~datetime.datetime + :vartype created_on: ~datetime.datetime :ivar updated_on: When the policy was last updated, in UTC - :type updated_on: ~datetime.datetime + :vartype updated_on: ~datetime.datetime """ def __init__(self, **kwargs): @@ -448,7 +448,7 @@ def key(self): @property def key_type(self): - # type: () -> KeyType + # type: () -> Union[str, KeyType] """The key's type. See :class:`~azure.keyvault.keys.KeyType` for possible values. :rtype: ~azure.keyvault.keys.KeyType or str @@ -458,10 +458,10 @@ def key_type(self): @property def key_operations(self): - # type: () -> List[KeyOperation] + # type: () -> List[Union[str, KeyOperation]] """Permitted operations. See :class:`~azure.keyvault.keys.KeyOperation` for possible values. - :rtype: list[~azure.keyvault.keys.KeyOperation or str] + :rtype: List[~azure.keyvault.keys.KeyOperation or str] """ # pylint:disable=no-member return self._key_material.key_ops # type: ignore[attr-defined] diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/aio/_client.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/aio/_client.py index bb702bf62143..c1961682cc14 100644 --- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/aio/_client.py +++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/aio/_client.py @@ -25,7 +25,7 @@ if TYPE_CHECKING: # pylint:disable=ungrouped-imports from azure.core.async_paging import AsyncItemPaged - from typing import Any, Iterable, Optional, Union + from typing import Any, List, Optional, Union from .. import KeyType @@ -686,7 +686,7 @@ async def release_key(self, name: str, target_attestation_token: str, **kwargs: :keyword str version: A specific version of the key to release. If unspecified, the latest version is released. :keyword algorithm: The encryption algorithm to use to protect the released key material. - :paramtype algorithm: ~azure.keyvault.keys.KeyExportEncryptionAlgorithm + :paramtype algorithm: Union[str, ~azure.keyvault.keys.KeyExportEncryptionAlgorithm] :keyword str nonce: A client-provided nonce for freshness. :return: The result of the key release. @@ -775,7 +775,7 @@ async def update_key_rotation_policy( :keyword lifetime_actions: Actions that will be performed by Key Vault over the lifetime of a key. This will override the lifetime actions of the provided ``policy``. - :paramtype lifetime_actions: Iterable[~azure.keyvault.keys.KeyRotationLifetimeAction] + :paramtype lifetime_actions: List[~azure.keyvault.keys.KeyRotationLifetimeAction] :keyword str expires_in: The expiry time of the policy that will be applied on new key versions, defined as an ISO 8601 duration. For example: 90 days is "P90D", 3 months is "P3M", and 48 hours is "PT48H". See `Wikipedia `_ for more information on ISO 8601 durations.