Ë
    €Ïï
  ã                   óÔ   — 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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&                   G d„ de
j(                  «      «       Zy)z9Implementation of buckets add-iam-policy-binding command.é    )Úabsolute_import)Údivision)Úunicode_literals)Úapi_factory)Úapis)Úbase)Úiam_util)Úerrors_util)Úiam_command_util)Ústorage_url)Úset_iam_policy_taskc                   ó0   — e Zd ZdZdddœZed„ «       Zd„ Zy)ÚAddIamPolicyBindingz&Add an IAM policy binding to a bucket.z¼
      Add an IAM policy binding to a bucket. For more information, see [Cloud
      Identity and Access
      Management](https://cloud.google.com/storage/docs/access-control/iam).
      aÑ  
      To grant a single role to a single principal for BUCKET:

        $ {command} gs://BUCKET --member=user:john.doe@example.com --role=roles/storage.objectCreator

      To make objects in BUCKET publicly readable:

        $ {command} gs://BUCKET --member=allUsers --role=roles/storage.objectViewer

      To specify a custom role for a principal on BUCKET:

        $ {command} gs://BUCKET --member=user:john.doe@example.com --role=roles/customRoleName
      )ÚDESCRIPTIONÚEXAMPLESc                 óX   — | j                  dd¬«       t        j                  | d¬«       y )NÚurlz+URL of bucket to add IAM policy binding to.)ÚhelpT)Úadd_condition)Úadd_argumentr	   ÚAddArgsForAddIamPolicyBinding)Úparsers    ú5lib/surface/storage/buckets/add_iam_policy_binding.pyÚArgszAddIamPolicyBinding.Args:   s,   € à
×ÑØÐAð ô Cä×*Ñ*¨6ÀÖFó    c                 óf  — t        j                  |j                  «      }t        j                  |j
                  |«       t        j                  |j                  «      j                  |j                  «      }t        j                  ||t        j                  dd«      |t        j                   «      S )NÚstorageÚv1)r   Ústorage_url_from_stringr   r
   Úraise_error_if_not_gcs_bucketÚcommand_pathr   Úget_apiÚschemeÚget_bucket_iam_policyÚbucket_namer   Úadd_iam_binding_to_resourcer   ÚGetMessagesModuler   ÚSetBucketIamPolicyTask)ÚselfÚargsÚ
url_objectÚpolicys       r   ÚRunzAddIamPolicyBinding.Run@   s‹   € Ü×4Ñ4°T·X±XÓ>€JÜ×-Ñ-¨d×.?Ñ.?ÀÔLÜ× Ñ  ×!2Ñ!2Ó3×IÑIØ×Ñó €Fä×7Ñ7ØØÜ×Ñ˜y¨$Ó/ØÜ×2Ñ2óð r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Údetailed_helpÚstaticmethodr   r-   © r   r   r   r      s1   „ á.ð
ð
ñ€-ð. ñGó ðGó
r   r   N)r1   Ú
__future__r   r   r   Úgooglecloudsdk.api_lib.storager   Úgooglecloudsdk.api_lib.utilr   Úgooglecloudsdk.callioper   Úgooglecloudsdk.command_lib.iamr	   Ú"googlecloudsdk.command_lib.storager
   r   r   Ú(googlecloudsdk.command_lib.storage.tasksr   ÚUniverseCompatibleÚCommandr   r4   r   r   Ú<module>r>      sQ   ðñ @å &Ý Ý 'å 6Ý ,Ý (Ý 3Ý :Ý ?Ý :Ý Hð ×Ñô+˜$Ÿ,™,ó +ó ñ+r   