
    d
                     p   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 e	j                   e	j                  e	j                  j                          G d d	e	j"                                      Ze	j                   e	j                  e	j                  j&                         G d
 de                    Zy)z"Fetch the IAM policy for a secret.    )absolute_import)division)unicode_literals)api)base)argsc                   .    e Zd ZdZddiZed        Zd Zy)GetIamPolicyau  Get the IAM policy for the secret.

  Displays the IAM policy associated with the secret. If formatted as JSON,
  the output can be edited and used as a policy file for set-iam-policy. The
  output includes an "etag" field identifying the version emitted and
  allowing detection of concurrent policy updates.

  Run gcloud secrets set-iam-policy for additional details.
  EXAMPLESzp          To print the IAM policy for secret named 'my-secret', run:

          $ {command} my-secret
          c                     t        j                  | dddd       t        j                  | dd       t        j                  j                  |        y )N Tz0Name of the secret from which to get IAM policy.)purpose
positionalrequired	help_textzto get iam policyF)r   hidden)secrets_args	AddSecretAddLocationr   URI_FLAGRemoveFromParser)parsers    %lib/surface/secrets/get_iam_policy.pyArgszGetIamPolicy.Args/   sF    D V-@OMM""6*    c                     t        j                  | j                               }|j                  j                  j                         }t        j                  |      j                  ||j                        S )N)api_version)secret_location)	secrets_apiGetApiFromTrackReleaseTrackCONCEPTSsecretParseSecretsr
   location)selfr   r   	multi_refs       r   RunzGetIamPolicy.Run;   s`    --d.?.?.ABK$$**,I;7DD4== E  r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r)    r   r   r
   r
      s1      - 	+ 	+r   r
   c                       e Zd ZdZddiZy)GetIamPolicyBetazGet the IAM policy of a secret.

  Gets the IAM policy for the given secret.

  Returns an empty policy if the resource does not have a policy
  set.
  r   z~          To print the IAM policy for secret named 'my-secret', run:

          $ {command} my-secret [--location=]
          N)r*   r+   r,   r-   r.   r0   r   r   r2   r2   C   s      -r   r2   N)r-   
__future__r   r   r   googlecloudsdk.api_lib.secretsr   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.secretsr   r   DefaultUniverseOnlyReleaseTracksr!   GAListCommandr
   BETAr2   r0   r   r   <module>r<      s    ) &  ' = ( C D%%(()$4## $ * $N D%%**+|  , r   