
    v                         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	 ddl
mZ  G d d	ej                        Zy
)zDescribe a key.    )absolute_import)division)unicode_literals)base)
exceptions)resource_argsc                   &    e Zd ZdZed        Zd Zy)Describea  Get metadata for a given key.

  Returns metadata for the given key.

  ## EXAMPLES

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

    $ {command} frodo --keyring=fellowship --location=us-east1
  c                 2    t        j                  | dd       y )NTkey)r   AddKmsKeyResourceArgForKMS)parsers     lib/surface/kms/keys/describe.pyArgszDescribe.Args(   s    ,,VT5A    c                    t        j                         }t        j                         }|j                  j                  j                         }|j                         st        j                  dd      |j                  j                  |j                  |j                                     }|j                  r'|j                  j                  rd |j                  _        |S )Nr   zkey id must be non-empty.)name)cloudkms_baseGetClientInstanceGetMessagesModuleCONCEPTSr   ParseNamer   InvalidArgumentException&projects_locations_keyRings_cryptoKeysGet5CloudkmsProjectsLocationsKeyRingsCryptoKeysGetRequestRelativeNameprimaryattestation)selfargsclientmessagescrypto_key_refresps         r   RunzDescribe.Run,   s    ,,.F..0H]]&&,,.N //0KM M88<<FF,,. 	G 	01D ||00!%dllKr   N)__name__
__module____qualname____doc__staticmethodr   r'    r   r   r
   r
      s"    
 B Br   r
   N)r+   
__future__r   r   r   googlecloudsdk.api_lib.cloudkmsr   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.kmsr   DescribeCommandr
   r-   r   r   <module>r3      s1     &  ' A ( . 8"t## "r   