
    u                        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$                  ej"                  j&                         G d
 dej(                               Zy)z7Command to set-iam-policy for a Dataplex zone resource.    )absolute_import)division)unicode_literals)zone)
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)SetIamPolicyzSet the IAM policy to a Dataplex zone as defined in a JSON or YAML file.

    See https://cloud.google.com/iam/docs/managing-policies for details of
    the policy file format and contents.

  EXAMPLESa6            The following command will read an IAM policy defined in a JSON file
          `policy.son` and set it for the Dataplex zone `test-zone` defined in
          lake `test-lake` in location `us-central1`:

            $ {command} test-zone --location=us-central1 --lake=test-lake policy.json

          c                 Z    t        j                  | d       t        j                  |        y )Nzto set IAM policy binding to.)r	   AddZoneResourceArgr
   AddArgForPolicyFile)parsers    ,lib/surface/dataplex/zones/set_iam_policy.pyArgszSetIamPolicy.Args1   s!    $$V-LM  (    z-Status code: {status_code}. {status_message}.c                     |j                   j                  j                         }t        j                  ||j                        }|S )N)CONCEPTSr   ParseSetIamPolicyFromFilepolicy_file)selfargszone_refresults       r   RunzSetIamPolicy.Run6   s9     }}!!'')H&&x1A1ABFMr   N)
__name__
__module____qualname____doc__detailed_helpstaticmethodr   gcloud_exception CatchHTTPErrorRaiseHTTPExceptionr    r   r   r   r      sQ     
- ) ) 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GACommandr   r'   r   r   <module>r3      si    > &  ' 0 F ( = 3 D%%++T->->-A-AB4<<  Cr   