
    d	                         S r SSKJr  SSKJr  SSKJr  SSKrSSKJr  SSKJ	r	  SSK
Jr   " S	 S
\	R                  5      rg)z6Command for getting IAM policies for service accounts.    )absolute_import)division)unicode_literalsN)util)base)iam_utilc                       \ rS rSrSr\R                  " S5      SR                  S\R                  " S5      /5      S.r
\S 5       rS	 rS
rg)GetIamPolicy   a  Get the IAM policy for a service account.

This command gets the IAM policy for a service account. 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; see
$ gcloud iam service-accounts set-iam-policy for additional details.

If the service account does not exist, this command returns a
`PERMISSION_DENIED` error.
z
          To print the IAM policy for a given service account, run:

            $ {command} my-iam-account@my-project.iam.gserviceaccount.com
          z

z{description}zget the iam policy of)EXAMPLESDESCRIPTIONc                 l    [         R                  " U SS9  [        R                  R	                  U 5        g )Nzwhose policy to get)action)r   AddServiceAccountNameArgr   URI_FLAGRemoveFromParser)parsers    2lib/surface/iam/service_accounts/get_iam_policy.pyArgsGetIamPolicy.Args5   s*    %%$& 	MM""6*    c                     [         R                  " 5       u  p#UR                  R                  UR	                  [
        R                  " UR                  5      [
        R                  S95      $ )N)resourceoptions_requestedPolicyVersion)	r   GetClientAndMessagesprojects_serviceAccountsr
   -IamProjectsServiceAccountsGetIamPolicyRequestr   EmailToAccountResourceNameservice_account!MAX_LIBRARY_IAM_SUPPORTED_VERSION)selfargsclientmessagess       r   RunGetIamPolicy.Run<   s\    002F**77>>889M9MN66 	? 	89 9r    N)__name__
__module____qualname____firstlineno____doc__textwrapdedentjoinr    GetHintForServiceAccountResourcedetailed_helpstaticmethodr   r%   __static_attributes__r'   r   r   r
   r
      sa    
 // # 
 [[


3
34K
L"N O	- + +9r   r
   )r,   
__future__r   r   r   r-   googlecloudsdk.api_lib.iamr   googlecloudsdk.callioper   googlecloudsdk.command_lib.iamr   ListCommandr
   r'   r   r   <module>r9      s1     = &  '  + ( 3%94## %9r   