ó
    €Ïï
  ã                   óÔ   • 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  SS
KJr  SSKJr  SSKJr  \
R&                   " S S\
R(                  5      5       rg)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                   ó8   • \ rS rSrSrSSS.r\S 5       rS rSr	g	)
ÚAddIamPolicyBindingé   z&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                 óN   • U R                  SSS9  [        R                  " U SS9  g )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ÚArgsÚAddIamPolicyBinding.Args:   s,   € à
×ÑØÐAð ñ Cä×*Ò*¨6ÀÓFó    c                 óp  • [         R                  " UR                  5      n[        R                  " UR
                  U5        [        R                  " UR                  5      R                  UR                  5      n[        R                  " UU[        R                  " SS5      U[        R                   5      $ )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   ÚRunÚ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__Ú__firstlineno__Ú__doc__Údetailed_helpÚstaticmethodr   r/   Ú__static_attributes__r1   r   r   r   r      s1   † á.ð
ð
ñ€-ð. ñGó ðGõ
r   r   N)r6   Ú
__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   r1   r   r   Ú<module>rC      sQ   ðñ @å &Ý Ý 'å 6Ý ,Ý (Ý 3Ý :Ý ?Ý :Ý Hð ×Ñô+˜$Ÿ,™,ó +ó ñ+r   