
    '                         S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSK	Jr  SS	K	Jr  \R                   " S
 S\R                  5      5       rg)z1Implementation of buckets get-iam-policy command.    )absolute_import)division)unicode_literals)api_factory)base)errors_util)iam_command_util)storage_urlc                   8    \ rS rSrSrSSS.r\S 5       rS rSr	g	)
GetIamPolicy   z Get the IAM policy for a bucket.z
      Get the IAM policy for a bucket. For more information, see [Cloud
      Identity and Access
      Management](https://cloud.google.com/storage/docs/access-control/iam).
      z
      To get the IAM policy for BUCKET:

        $ {command} gs://BUCKET

      To output the IAM policy for BUCKET to a file:

        $ {command} gs://BUCKET > policy.txt
      )DESCRIPTIONEXAMPLESc                 $    U R                  SSS9  g )Nurlz#Request IAM policy for this bucket.)help)add_argument)parsers    -lib/surface/storage/buckets/get_iam_policy.pyArgsGetIamPolicy.Args3   s    
$IJ    c                 6   [         R                  " UR                  5      n[        R                  " UR
                  U5        [        R                  " UR                  5      n[        R                  " UR                  5      R                  UR                  5      $ )N)r
   storage_url_from_stringr   r   raise_error_if_not_gcs_bucketcommand_pathr	   get_single_matching_urlr   get_apischemeget_bucket_iam_policybucket_name)selfargs
url_objectmatching_urls       r   RunGetIamPolicy.Run7   sm    44TXX>J--d.?.?L#;;DHHEL|223II  " "r    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r&   __static_attributes__r(   r   r   r   r      s1    (

-& K K"r   r   N)r-   
__future__r   r   r   googlecloudsdk.api_lib.storager   googlecloudsdk.callioper   "googlecloudsdk.command_lib.storager   r	   r
   UniverseCompatibleCommandr   r(   r   r   <module>r7      sG    8 &  ' 6 ( : ? : "4<< " "r   