
    	                     V   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                   e
j"                  j$                  e
j"                  j&                  e
j"                  j(                         G d
 de
j*                                      Zy)z!Set IAM operation policy command.    )absolute_import)division)unicode_literals)dataproc)iam_helpers)base)flags)iam_utilc                   N    e Zd ZdZ ej
                  dd      Zed        Zd Z	y)SetIamPolicyzrSet IAM policy for an operation.

  Sets the IAM policy for an operation, given an operation ID and the policy.
  	operationT)use_anc                     t        j                  | j                               }t        j                  |d|j
                         t        j                  |       y )Nzset the policy on)dpDataprocReleaseTrackr	   AddOperationResourceArgapi_versionr
   AddArgForPolicyFile)clsparserr   s      1lib/surface/dataproc/operations/set_iam_policy.pyArgszSetIamPolicy.Args*   sC    {{3++-.H	!!&*="*"6"68  (    c                    t        j                  | j                               }|j                  }t	        j
                  |j                  |j                        }t        j                  |_
        |j                  |      }|j                  j                  j                         }|j                  |j!                         |      }|j"                  j$                  j'                  |      S )N)policy)resourcesetIamPolicyRequest)r   r   r   messagesr
   ParsePolicyFilepolicy_filePolicyr   !MAX_LIBRARY_IAM_SUPPORTED_VERSIONversionSetIamPolicyRequestCONCEPTSr   Parse4DataprocProjectsRegionsOperationsSetIamPolicyRequestRelativeNameclientprojects_regions_operationsr   )selfargsr   msgsr   set_iam_policy_requestoperation_refrequests           r   RunzSetIamPolicy.Run1   s    {{4,,./HD%%d&6&6DF BBFN!55V5DMM++113MGG++-2 H 4G ??66CCGLLr   N)
__name__
__module____qualname____doc__r
   GetDetailedHelpForSetIamPolicydetailed_helpclassmethodr   r2    r   r   r   r      s;    

 :(99+AEG- ) )Mr   r   N)r6   
__future__r   r   r   googlecloudsdk.api_lib.dataprocr   r   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.dataprocr	   googlecloudsdk.command_lib.iamr
   UniverseCompatibleReleaseTracksr   ALPHABETAGACommandr   r:   r   r   <module>rF      s     ( &  ' : 7 ( 5 3 T..33T5F5F5I5IM4<< M Mr   