
                         2   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  ej                  ej                  j                  ej                  j                  ej                  j                        ej                   G d dej                                      Zy	)
z'Gets the IAM policy for the repository.    )absolute_import)division)unicode_literals)
sourcerepo)basec                   &    e Zd ZdZed        Zd Zy)GetIamPolicyzGet the IAM policy for the named cloud source repository.

  This command gets the IAM policy for the given repository.

  ## EXAMPLES

  To get the IAM policy, issue the following command:

    $ {command} REPOSITORY_NAME

  c                 h    | j                  dd       t        j                  j                  |        y )Nrepository_namezName of the repository.)help)add_argumentr   URI_FLAGRemoveFromParser)parsers    *lib/surface/source/repos/get_iam_policy.pyArgszGetIamPolicy.Args*   s)    
)0IJMM""6*    c                     t        j                  |j                        }t        j                         }|j	                  |      S )aW  Gets the IAM policy for the repository.

    Args:
      args: argparse.Namespace, the arguments this command is run with.

    Returns:
      (sourcerepo_v1_messages.Policy) The IAM policy.

    Raises:
      sourcerepo.RepoResourceError: on resource initialization errors.
      apitools.base.py.exceptions.HttpError: on request errors.
    )r   	ParseRepor   Sourcer	   )selfargsressources       r   RunzGetIamPolicy.Run/   s9     

t33
4C Fs##r   N)__name__
__module____qualname____doc__staticmethodr   r    r   r   r	   r	      s     

 + +$r   r	   N)r   
__future__r   r   r   googlecloudsdk.api_lib.sourcer   googlecloudsdk.callioper   ReleaseTracksReleaseTrackGAALPHABETADefaultUniverseOnlyListCommandr	   r!   r   r   <module>r,      s    . &  ' 4 ( $++1143D3D3I3I !$4## !$ !$r   