
                             S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r	  SSK
J	r  SSK
Jr  SSKJr  SS	KJr   " S
 S\R"                  5      rg)zDescribe a version.    )absolute_import)division)unicode_literals)base)
exceptions)flags)log)filesc                   .    \ rS rSrSr\S 5       rS rSrg)Describe   a&  Get metadata for a given version.

Returns metadata for the given version.

The optional flag `attestation-file` specifies file to write the attestation
object into. The attestation object enables the user to verify the integrity
and provenance of the key. See https://cloud.google.com/kms/docs/attest-key
for more information about attestations.

## EXAMPLES

The following command returns metadata for version 2 within key `frodo`
within the keyring `fellowship` in the location `us-east1`:

  $ {command} 2 --key=frodo --keyring=fellowship --location=us-east1

For key versions with protection level `HSM`, use the `--attestation-file`
flag to save the attestation to a local file.

  $ {command} 2 --key=frodo --keyring=fellowship --location=us-east1 \
      --attestation-file=path/to/attestation.dat
c                 ^    [         R                  " U S5        [         R                  " U 5        g )Nzto describe)r   AddKeyVersionResourceArgumentAddAttestationFileFlag)parsers    )lib/surface/kms/keys/versions/describe.pyArgsDescribe.Args6   s     	''>	  (    c                    [         R                  " 5       n[         R                  " 5       n[        R                  " U5      nUR                  5       (       d  [        R                  " SS5      eUR                  R                  UR                  UR                  5       S95      nUR                  (       aD  UR                  UR                  R                  R                   :w  a  ["        R$                  " S5      eUR                  (       aD  UR&                  UR                  R(                  R*                  :X  a  ["        R$                  " S5      eUR                  (       aC  UR,                  b6   [.        R0                  " UR                  UR,                  R2                  SSS9  UR,                  b"  S UR,                  l        S UR,                  l        U$ ! [4        R6                   a  n[        R8                  " U5      eS nAff = f)Nversionzversion id must be non-empty.)namez5Attestations are only available for HSM key versions.z>The attestation is unavailable until the version is generated.T)	overwritebinary)cloudkms_baseGetClientInstanceGetMessagesModuler   ParseCryptoKeyVersionNameNamer   InvalidArgumentException8projects_locations_keyRings_cryptoKeys_cryptoKeyVersionsGetFCloudkmsProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetRequestRelativeNameattestation_fileprotectionLevelCryptoKeyVersionProtectionLevelValueValuesEnumHSMkms_exceptionsArgumentErrorstateStateValueValuesEnumPENDING_GENERATIONattestationr	   WriteToFileOrStdoutcontentr
   ErrorBadFileException
certChains)selfargsclientmessagesversion_refr   es          r   RunDescribe.Run;   s   ,,.F..0H11$7K//
46 6MMQQNN))+ 	O 	-.G 	'"9"9!!@@DD#E((
AC C 	'--!!66II#J((
JL L !4!4!@-!!''		 & %)g! (,g$N [[ -))!,,-s   ,5G H&G<<H N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r;   __static_attributes__r=   r   r   r   r      s     . ) )+r   r   N)rB   
__future__r   r   r   googlecloudsdk.api_lib.cloudkmsr   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.kmsr*   r   googlecloudsdk.corer	   googlecloudsdk.core.utilr
   DescribeCommandr   r=   r   r   <module>rL      s<     &  ' A ( . G 0 # *Ht## Hr   