
    /                         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 import job.

Returns metadata for the given import job.

The optional flag `--attestation-file` specifies file to write the attestation
into. The attestation 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 import job 'strider' within the
keyring 'fellowship' in the location 'us-central1':

  $ {command} strider --keyring=fellowship --location=us-central1

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

  $ {command} strider --keyring=fellowship --location=us-central1 \
      --attestation-file=path/to/attestation.dat
c                     [         R                  " U S5        [         R                  " U S5        [         R                  " U S5        [         R                  " U 5        g )Nz
import jobzto describe)r   AddKeyRingFlagAddLocationFlagAddPositionalImportJobArgumentAddAttestationFileFlag)parsers    'lib/surface/kms/import_jobs/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        U$ ! [4        R6                   a  n[        R8                  " U5      eS nAff = f)N
import_jobz import job id must be non-empty.)namez4Attestations are only available for HSM import jobs.zAThe attestation is unavailable until the import job is generated.T)	overwritebinary)cloudkms_baseGetClientInstanceGetMessagesModuler   ParseImportJobNameNamer   InvalidArgumentException&projects_locations_keyRings_importJobsGet5CloudkmsProjectsLocationsKeyRingsImportJobsGetRequestRelativeNameattestation_fileprotectionLevel	ImportJobProtectionLevelValueValuesEnumHSMkms_exceptionsArgumentErrorstateStateValueValuesEnumPENDING_GENERATIONattestationr	   WriteToFileOrStdoutcontentr
   ErrorBadFileException)selfargsclientmessagesimport_job_refr   es          r   RunDescribe.Run=   s   ,,.F..0H--d3N  //
:< <>>BBFF,,. 	G 	01J 	*"<"<99==#>((
@B B 	*"2"2h6H6H		00#1((
MO O !7!7!C-!!""**		 ) (,j$ [[ -))!,,-s   ,5G G0G++G0 N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r<   __static_attributes__r>   r   r   r   r      s     . ) )'r   r   N)rC   
__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>rM      s<     &  ' A ( . G 0 # *Ft## Fr   