
    4	                         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  ej                   ej"                  j$                         G d
 dej&                               Zy)zI`gcloud dataplex data-attribute-bindings add-iam-policy-binding` command.    )absolute_import)division)unicode_literals)data_taxonomy)
exceptions)base)resource_args)iam_utilc                   X    e Zd ZdZddiZed        Z ej                  d      d        Z	y)AddIamPolicyBindingz<Add IAM policy binding to a Dataplex Data Attribute Binding.EXAMPLESa            To add an IAM policy binding for the role of `roles/dataplex.viewer`
          for the user `test-user@gmail.com` to Data Attribute Binding `test-attribute-binding` in location
          `us-central`, run:

            $ {command} test-attribute-binding --project=test-project  --location=us-central1 --role=roles/dataplex.viewer --member=user:foo@gmail.com

          See https://cloud.google.com/dataplex/docs/iam-roles for details of
          policy role and member types.
          c                 Z    t        j                  | d       t        j                  |        y )Nzto add IAM policy binding to.)r	   "AddDataAttributeBindingResourceArgr
   AddArgsForAddIamPolicyBinding)parsers    Flib/surface/dataplex/data_attribute_bindings/add_iam_policy_binding.pyArgszAddIamPolicyBinding.Args0   s&    44/1 **62    z-Status code: {status_code}. {status_message}.c                     |j                   j                  j                         }t        j                  ||j
                  |j                        }|S )N)CONCEPTSdata_attribute_bindingParser   'DataAttributeBindingAddIamPolicyBindingmemberrole)selfargsattribute_binding_refresults       r   RunzAddIamPolicyBinding.Run7   sA     !MM@@FFHBBt{{DII7FMr   N)
__name__
__module____qualname____doc__detailed_helpstaticmethodr   gcloud_exception CatchHTTPErrorRaiseHTTPExceptionr     r   r   r   r      sO    D 	- 3 3 544577r   r   N)r$   
__future__r   r   r   googlecloudsdk.api_lib.dataplexr   googlecloudsdk.api_lib.utilr   r'   googlecloudsdk.callioper   #googlecloudsdk.command_lib.dataplexr	   googlecloudsdk.command_lib.iamr
   ReleaseTracksReleaseTrackALPHACommandr   r)   r   r   <module>r4      s_    P '  ' : F ( = 3 D%%++,$,,  -r   