
    }
                         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                   " S
 S\
R                   5      5       rg)z*Set IAM autoscaling policy 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 an autoscaling policy.

Sets the IAM policy for an autoscaling policy, given an autoscaling policy ID
and the IAM policy.

## EXAMPLES
  The following command will read an IAM policy defined in a JSON file
  'policy.json' and set it for an autoscaling-policy with identifier
  'example-autoscaling-policy'

      $ {command} autoscaling-policies set-iam-policy \
          example-autoscaling-policy policy.json

  See https://cloud.google.com/iam/docs/managing-policies for details of the
  policy file format and contents.
c                     [         R                  " U R                  5       5      n[        R                  " USUR
                  5        [        R                  " U5        g )Nzretrieve the IAM policy for)dpDataprocReleaseTrackr	   AddAutoscalingPolicyResourceArgapi_versionr
   AddArgForPolicyFile)clsparserr   s      ;lib/surface/dataproc/autoscaling_policies/set_iam_policy.pyArgsSetIamPolicy.Args/   sD    {{3++-.H	))&2O*2*>*>@  (    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
   ParsePolicyFilepolicy_filePolicyr   !MAX_LIBRARY_IAM_SUPPORTED_VERSIONversionSetIamPolicyRequestCONCEPTSautoscaling_policyParse=DataprocProjectsRegionsAutoscalingPoliciesSetIamPolicyRequestRelativeNameclient$projects_regions_autoscalingPoliciesr   )selfargsr   r   r   set_iam_policy_request
policy_refrequests           r   RunSetIamPolicy.Run6   s    {{4,,./H  H%%d&6&6HF BBFN%999H11779JTT((*2 U 4G
 ????LL r    N)	__name__
__module____qualname____firstlineno____doc__classmethodr   r2   __static_attributes__r4   r   r   r   r      s     " ) )r   r   N)r9   
__future__r   r   r   googlecloudsdk.api_lib.dataprocr   r   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.dataprocr	   googlecloudsdk.command_lib.iamr
   DefaultUniverseOnlyCommandr   r4   r   r   <module>rC      sG    1 &  ' : 7 ( 5 3 *4<< * *r   