
                         z    d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
  G d dej                        Zy	)
zRestore a version.    )absolute_import)division)unicode_literals)base)flagsc                   &    e Zd ZdZed        Zd Zy)Restorea  Restore a version scheduled for destruction.

  Restores the given version that was scheduled to be destroyed.

  This moves the version from Scheduled for destruction to Disabled.
  Only versions which are Scheduled for destruction can be Restored.

  ## EXAMPLES

  The following command restores version 9 of key `frodo` within
  keyring `fellowship` and location `us-east1` which was previously scheduled
  for destruction:

    $ {command} 9 --location=us-east1 --keyring=fellowship --key=frodo
  c                 0    t        j                  | d       y )Nz
to restore)r   AddKeyVersionResourceArgument)parsers    (lib/surface/kms/keys/versions/restore.pyArgszRestore.Args+   s    	''=    c                     t        j                         }t        j                         }t        j                  |      }|j                  |j                               }|j                  }|j                  |      S )N)name)	cloudkms_baseGetClientInstanceGetMessagesModuler   ParseCryptoKeyVersionNameJCloudkmsProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRestoreRequestRelativeName8projects_locations_keyRings_cryptoKeys_cryptoKeyVersionsr	   )selfargsclientmessagesversion_refreqckvs          r   RunzRestore.Run/   sl    ,,.F..0H11$7K

]
]%%' ^ )C 
I
IC;;sr   N)__name__
__module____qualname____doc__staticmethodr   r     r   r   r	   r	      s       > >
r   r	   N)r$   
__future__r   r   r   googlecloudsdk.api_lib.cloudkmsr   r   googlecloudsdk.calliopegooglecloudsdk.command_lib.kmsr   UpdateCommandr	   r&   r   r   <module>r,      s.     &  ' A ( 0d   r   