
    J	                        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	d
Z
e	j                   e	j                  e	j                  j                         G d de	j                                      Ze
e_        y)z''logging views get_iam_policy' command.    )absolute_import)division)unicode_literals)util)arg_parsers)basez,
        Get the IAM policy for a view.
    zr
     To describe a view in a project, run:

        $ {command} my-view --bucket=my-bucket --location=global
    )DESCRIPTIONEXAMPLESc                   &    e Zd ZdZed        Zd Zy)GetIamPolicyz"Display the IAM policy for a view.c                     | j                  dd       t        j                  | d       t        j                  | dd       | j                  ddt	        j
                  dd	      d
       y)z Register flags for this command.VIEW_IDz"ID of the view to fetch IAM policy)helpzview to fetch IAM policyTz-Location of the bucket that contains the viewz--bucketz.+zmust be non-emptyz%ID of the bucket that holds the view.)requiredtyper   N)add_argumentr   AddParentArgsAddBucketLocationArgr   RegexpValidator)parsers    +lib/surface/logging/views/get_iam_policy.pyArgszGetIamPolicy.Args+   sn     	(LMv9:E ((0CD4	      c                     t        j                  t        j                  t        j                  |      d|j                        d|j                        }t        j
                  |      S )zThis is what get-iam-policy called when the user runs this command.

    Args:
      args: an argparse namespace. All the arguments that were provided to this
        command invocation.

    Returns:
      The IAM policy for the specified view
    bucketsviews)r   CreateResourceNameGetBucketLocationFromArgsbucketr   r   )selfargsviews      r   RunzGetIamPolicy.Run:   sW     ""**40)T[[	
 	D T""r   N)__name__
__module____qualname____doc__staticmethodr   r#    r   r   r   r   &   s     + #r   r   N)r'   
__future__r   r   r   googlecloudsdk.api_lib.loggingr   googlecloudsdk.callioper   r   DETAILED_HELPUniverseCompatibleReleaseTracksReleaseTrackGACommandr   detailed_helpr)   r   r   <module>r4      s    . '  ' / / (		 D%%(()##4<< ## * ##L + r   