@@ -291,12 +291,14 @@ class KeyRotationLifetimeAction(object):
291
291
:param action: The action that will be executed.
292
292
:type action: ~azure.keyvault.keys.KeyRotationPolicyAction or str
293
293
294
- :keyword str time_after_create: Time after creation to attempt the specified action, as an ISO 8601 duration.
294
+ :keyword time_after_create: Time after creation to attempt the specified action, as an ISO 8601 duration.
295
295
For example, 90 days is "P90D". See `Wikipedia <https://wikipedia.org/wiki/ISO_8601#Durations>`_ for more
296
296
information on ISO 8601 durations.
297
- :keyword str time_before_expiry: Time before expiry to attempt the specified action, as an ISO 8601 duration.
297
+ :paramtype time_after_create: Optional[str]
298
+ :keyword time_before_expiry: Time before expiry to attempt the specified action, as an ISO 8601 duration.
298
299
For example, 90 days is "P90D". See `Wikipedia <https://wikipedia.org/wiki/ISO_8601#Durations>`_ for more
299
300
information on ISO 8601 durations.
301
+ :paramtype time_before_expiry: Optional[str]
300
302
"""
301
303
302
304
def __init__ (self , action , ** kwargs ):
@@ -319,30 +321,32 @@ def _from_generated(cls, lifetime_action):
319
321
class KeyRotationPolicy (object ):
320
322
"""The key rotation policy that belongs to a key.
321
323
322
- :ivar str id: The identifier of the key rotation policy.
324
+ :ivar id: The identifier of the key rotation policy.
325
+ :vartype id: Optional[str]
323
326
:ivar lifetime_actions: Actions that will be performed by Key Vault over the lifetime of a key.
324
327
:vartype lifetime_actions: List[~azure.keyvault.keys.KeyRotationLifetimeAction]
325
- :ivar str expires_in: The expiry time of the policy that will be applied on new key versions, defined as an ISO 8601
328
+ :ivar expires_in: The expiry time of the policy that will be applied on new key versions, defined as an ISO 8601
326
329
duration. For example, 90 days is "P90D". See `Wikipedia <https://wikipedia.org/wiki/ISO_8601#Durations>`_ for
327
330
more information on ISO 8601 durations.
331
+ :vartype expires_in: Optional[str]
328
332
:ivar created_on: When the policy was created, in UTC
329
- :vartype created_on: ~datetime.datetime
333
+ :vartype created_on: Optional[ ~datetime.datetime]
330
334
:ivar updated_on: When the policy was last updated, in UTC
331
- :vartype updated_on: ~datetime.datetime
335
+ :vartype updated_on: Optional[ ~datetime.datetime]
332
336
"""
333
337
334
338
def __init__ (self , ** kwargs ):
335
339
# type: (**Any) -> None
336
340
self .id = kwargs .get ("policy_id" , None )
337
- self .lifetime_actions = kwargs .get ("lifetime_actions" , None )
341
+ self .lifetime_actions = kwargs .get ("lifetime_actions" , [] )
338
342
self .expires_in = kwargs .get ("expires_in" , None )
339
343
self .created_on = kwargs .get ("created_on" , None )
340
344
self .updated_on = kwargs .get ("updated_on" , None )
341
345
342
346
@classmethod
343
347
def _from_generated (cls , policy ):
344
348
lifetime_actions = (
345
- None
349
+ []
346
350
if policy .lifetime_actions is None
347
351
else [KeyRotationLifetimeAction ._from_generated (action ) for action in policy .lifetime_actions ] # pylint:disable=protected-access
348
352
)
0 commit comments