
                            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  ej                  ej                  j                  ej                  j                         G d	 d
ej                                Zy)zFetch the IAM policy for a key.    )absolute_import)division)unicode_literals)iam)base)flags)resource_argsc                   &    e Zd ZdZed        Zd Zy)GetIamPolicyaZ  Get the IAM policy for a key.

  Gets the IAM policy for the given key.

  Returns an empty policy if the resource does not have a policy
  set.

  ## EXAMPLES

  The following command gets the IAM policy for the key `frodo` within
  the keyring `fellowship` and location `global`:

    $ {command} frodo --keyring=fellowship --location=global
  c                 p    t        j                  | dd       t        j                  j	                  |        y )NTkey)r	   AddKmsKeyResourceArgForKMSr   URI_FLAGRemoveFromParser)parsers    &lib/surface/kms/keys/get_iam_policy.pyArgszGetIamPolicy.Args,   s&    ,,VT5AMM""6*    c                 R    t        j                  t        j                  |            S )N)r   GetCryptoKeyIamPolicyr   ParseCryptoKeyName)selfargss     r   RunzGetIamPolicy.Run1   s    $$U%=%=d%CDDr   N)__name__
__module____qualname____doc__staticmethodr   r    r   r   r   r      s!     + +Er   r   N)r   
__future__r   r   r   googlecloudsdk.api_lib.cloudkmsr   googlecloudsdk.callioper   googlecloudsdk.command_lib.kmsr   r	   ReleaseTracksReleaseTrackBETAGAListCommandr   r    r   r   <module>r*      sk    & &  ' / ( 0 8 D%%**D,=,=,@,@AE4## E BEr   