
                             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                  \R                   " S
 S\R                  5      5       5       rg)z1Implementation of objects 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 access policy for an object.z
      *{command}* behaves similarly to *{parent_command} get-object-acl*, but
      uses the IAM policy binding syntax in the output.
      z
      To get the access policy for OBJECT in BUCKET:

        $ {command} gs://BUCKET/OBJECT

      To output the access policy for OBJECT in BUCKET to a file:

        $ {command} gs://BUCKET/OBJECT > policy.txt
      )DESCRIPTIONEXAMPLESc                 $    U R                  SSS9  g )Nurlz#Request IAM policy for this object.)help)add_argument)parsers    -lib/surface/storage/objects/get_iam_policy.pyArgsGetIamPolicy.Args3   s    
$IJ    c                    [         R                  " UR                  5      n[        R                  " UR
                  U5        [        R                  " UR
                  U5        [        R                  " UR                  5      n[        R                  " UR                  5      R                  UR                  UR                  UR                  5      $ )N)r
   storage_url_from_stringr   r   raise_error_if_not_cloud_objectcommand_pathraise_error_if_not_gcsr	   get_single_matching_urlr   get_apischemeget_object_iam_policybucket_nameresource_name
generation)selfargs
url_objectmatching_urls       r   RunGetIamPolicy.Run7   s    44TXX>J//0A0A:N&&t'8'8*E#;;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      s3     -


-$ K K!r   r   N)r0   
__future__r   r   r   googlecloudsdk.api_lib.storager   googlecloudsdk.callioper   "googlecloudsdk.command_lib.storager   r	   r
   HiddenUniverseCompatibleCommandr   r+   r   r   <module>r;      sS    8 &  ' 6 ( : ? :  !4<<  !   !r   