Skip to content

Commit 14ff5a8

Browse files
authored
[Key Vault] Address architect feedback (Azure#23475)
1 parent 482d05a commit 14ff5a8

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
if TYPE_CHECKING:
2020
# pylint:disable=unused-import
21-
from typing import Any, Iterable, Optional, Union
21+
from typing import Any, List, Optional, Union
2222
from azure.core.paging import ItemPaged
2323
from azure.core.polling import LROPoller
2424
from ._models import JsonWebKey
@@ -701,7 +701,7 @@ def release_key(self, name, target_attestation_token, **kwargs):
701701
702702
:keyword str version: A specific version of the key to release. If unspecified, the latest version is released.
703703
:keyword algorithm: The encryption algorithm to use to protect the released key material.
704-
:paramtype algorithm: ~azure.keyvault.keys.KeyExportEncryptionAlgorithm
704+
:paramtype algorithm: Union[str, ~azure.keyvault.keys.KeyExportEncryptionAlgorithm]
705705
:keyword str nonce: A client-provided nonce for freshness.
706706
707707
:return: The result of the key release.
@@ -792,7 +792,7 @@ def update_key_rotation_policy(self, key_name, policy, **kwargs):
792792
793793
:keyword lifetime_actions: Actions that will be performed by Key Vault over the lifetime of a key. This will
794794
override the lifetime actions of the provided ``policy``.
795-
:paramtype lifetime_actions: Iterable[~azure.keyvault.keys.KeyRotationLifetimeAction]
795+
:paramtype lifetime_actions: List[~azure.keyvault.keys.KeyRotationLifetimeAction]
796796
:keyword str expires_in: The expiry time of the policy that will be applied on new key versions, defined as an
797797
ISO 8601 duration. For example: 90 days is "P90D", 3 months is "P3M", and 48 hours is "PT48H". See
798798
`Wikipedia <https://wikipedia.org/wiki/ISO_8601#Durations>`_ for more information on ISO 8601 durations.

sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_models.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
if TYPE_CHECKING:
1515
# pylint:disable=unused-import
16-
from typing import Any, Dict, Optional, List
16+
from typing import Any, Dict, List, Optional, Union
1717
from datetime import datetime
1818
from . import _generated_models as _models
1919
from ._enums import KeyOperation, KeyRotationPolicyAction, KeyType
@@ -319,14 +319,14 @@ class KeyRotationPolicy(object):
319319
320320
:ivar str id: The identifier of the key rotation policy.
321321
:ivar lifetime_actions: Actions that will be performed by Key Vault over the lifetime of a key.
322-
:type lifetime_actions: list[~azure.keyvault.keys.KeyRotationLifetimeAction]
322+
:vartype lifetime_actions: List[~azure.keyvault.keys.KeyRotationLifetimeAction]
323323
:ivar str expires_in: The expiry time of the policy that will be applied on new key versions, defined as an ISO 8601
324324
duration. For example, 90 days is "P90D". See `Wikipedia <https://wikipedia.org/wiki/ISO_8601#Durations>`_ for
325325
more information on ISO 8601 durations.
326326
:ivar created_on: When the policy was created, in UTC
327-
:type created_on: ~datetime.datetime
327+
:vartype created_on: ~datetime.datetime
328328
:ivar updated_on: When the policy was last updated, in UTC
329-
:type updated_on: ~datetime.datetime
329+
:vartype updated_on: ~datetime.datetime
330330
"""
331331

332332
def __init__(self, **kwargs):
@@ -448,7 +448,7 @@ def key(self):
448448

449449
@property
450450
def key_type(self):
451-
# type: () -> KeyType
451+
# type: () -> Union[str, KeyType]
452452
"""The key's type. See :class:`~azure.keyvault.keys.KeyType` for possible values.
453453
454454
:rtype: ~azure.keyvault.keys.KeyType or str
@@ -458,10 +458,10 @@ def key_type(self):
458458

459459
@property
460460
def key_operations(self):
461-
# type: () -> List[KeyOperation]
461+
# type: () -> List[Union[str, KeyOperation]]
462462
"""Permitted operations. See :class:`~azure.keyvault.keys.KeyOperation` for possible values.
463463
464-
:rtype: list[~azure.keyvault.keys.KeyOperation or str]
464+
:rtype: List[~azure.keyvault.keys.KeyOperation or str]
465465
"""
466466
# pylint:disable=no-member
467467
return self._key_material.key_ops # type: ignore[attr-defined]

sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/aio/_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
if TYPE_CHECKING:
2626
# pylint:disable=ungrouped-imports
2727
from azure.core.async_paging import AsyncItemPaged
28-
from typing import Any, Iterable, Optional, Union
28+
from typing import Any, List, Optional, Union
2929
from .. import KeyType
3030

3131

@@ -686,7 +686,7 @@ async def release_key(self, name: str, target_attestation_token: str, **kwargs:
686686
687687
:keyword str version: A specific version of the key to release. If unspecified, the latest version is released.
688688
:keyword algorithm: The encryption algorithm to use to protect the released key material.
689-
:paramtype algorithm: ~azure.keyvault.keys.KeyExportEncryptionAlgorithm
689+
:paramtype algorithm: Union[str, ~azure.keyvault.keys.KeyExportEncryptionAlgorithm]
690690
:keyword str nonce: A client-provided nonce for freshness.
691691
692692
:return: The result of the key release.
@@ -775,7 +775,7 @@ async def update_key_rotation_policy(
775775
776776
:keyword lifetime_actions: Actions that will be performed by Key Vault over the lifetime of a key. This will
777777
override the lifetime actions of the provided ``policy``.
778-
:paramtype lifetime_actions: Iterable[~azure.keyvault.keys.KeyRotationLifetimeAction]
778+
:paramtype lifetime_actions: List[~azure.keyvault.keys.KeyRotationLifetimeAction]
779779
:keyword str expires_in: The expiry time of the policy that will be applied on new key versions, defined as an
780780
ISO 8601 duration. For example: 90 days is "P90D", 3 months is "P3M", and 48 hours is "PT48H". See
781781
`Wikipedia <https://wikipedia.org/wiki/ISO_8601#Durations>`_ for more information on ISO 8601 durations.

0 commit comments

Comments
 (0)