
    	                     V   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  \
R                  \
R                   " \
R"                  R$                  \
R"                  R&                  \
R"                  R(                  5       " S
 S\
R*                  5      5       5       rg)zSet IAM cluster policy command.    )absolute_import)division)unicode_literals)dataproc)iam_helpers)base)flags)iam_utilc                   .    \ rS rSrSr\S 5       rS rSrg)SetIamPolicy   a  Set IAM policy for a cluster.

Sets the IAM policy for a cluster, given a cluster name and the policy.

## EXAMPLES

The following command sets the IAM policy for a cluster with the name
`example-cluster-name-1` using policy.yaml:

  $ {command} example-cluster-name-1 policy.yaml
c                     [         R                  " U R                  5       5      n[        R                  " USUR
                  5        UR                  SSSS9  g )Nzset the policy onpolicy_filePOLICY_FILEzW        Path to a local JSON or YAML formatted file containing a valid policy.
        )metavarhelp)dpDataprocReleaseTrackr	   AddClusterResourceArgapi_versionadd_argument)clsparserr   s      /lib/surface/dataproc/clusters/set_iam_policy.pyArgsSetIamPolicy.Args.   sS    {{3++-.H	(; ( 4 46
      c                    [         R                  " U R                  5       5      nUR                  n[        R
                  " UR                  UR                  5      n[        R                  Ul
        UR                  US9nUR                  R                  R                  5       nUR                  UR!                  5       US9nUR"                  R$                  R'                  U5      $ )N)policy)resourcesetIamPolicyRequest)r   r   r   messagesr
   ParsePolicyFiler   Policyr   !MAX_LIBRARY_IAM_SUPPORTED_VERSIONversionSetIamPolicyRequestCONCEPTSclusterParse2DataprocProjectsRegionsClustersSetIamPolicyRequestRelativeNameclientprojects_regions_clustersr   )selfargsr   r#   r    set_iam_policy_requestcluster_refrequests           r   RunSetIamPolicy.Run:   s    {{4,,./H  H%%d&6&6HF BBFN%999H--''--/KII))+2 J 4G ??44AA'JJr    N)	__name__
__module____qualname____firstlineno____doc__classmethodr   r5   __static_attributes__r7   r   r   r   r      s!    

 	 	Kr   r   N)r<   
__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   r7   r   r   <module>rJ      s     & &  ' : 7 ( 5 3 T..33T5F5F5I5I&K4<< &K &Kr   