
                            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  \R                  " \R                  R                   5      \R"                   " S S	\R$                  5      5       5       r\R                  " \R                  R(                  5      \R"                   " S
 S\5      5       5       rSSSSS.\l        g)z)Command to set IAM policy for a resource.    )base_classes)base)flags)scope)backend_buckets_utils)iam_utilc                   .    \ rS rSrSr\S 5       rS rSrg)SetIamPolicy   ?Set the IAM policy binding for a Compute Engine backend bucket.c                 l    [         R                  R                  U SS9  [        R                  " U 5        g )NsetIamPolicy)operation_type)r   &GLOBAL_REGIONAL_BACKEND_BUCKET_ARG_IAMAddArgumentr   AddArgForPolicyFile)parsers    5lib/surface/compute/backend_buckets/set_iam_policy.pyArgsSetIamPolicy.Args    s0    	00<<~ =    (    c                    [         R                  " U R                  5       5      nUR                  n[        R
                  R                  UUR                  [        R                  R                  [        R                  " UR                  5      S9n[        R                  " UR                  UR                   R"                  5      n[        R$                  Ul        [(        R*                  " XCU5      $ )N)default_scopescope_lister)r   ComputeApiHolderReleaseTrackclientr   r   ResolveAsResource	resourcescompute_scope	ScopeEnumGLOBALcompute_flagsGetDefaultScopeListerr   ParsePolicyFilepolicy_filemessagesPolicy!MAX_LIBRARY_IAM_SUPPORTED_VERSIONversionr   r
   )selfargsholderr   backend_bucket_refpolicys         r   RunSetIamPolicy.Run'   s    **4+<+<+>?F]]F44FF'1188&<<V]]K	 	G 	
  %%d&6&68N8NOF??FN --F r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r0   __static_attributes__r2   r   r   r
   r
      s     H) )r   r
   c                       \ rS rSrSrSrg)SetIamPolicyAlpha;   r   r2   N)r3   r4   r5   r6   r7   r9   r2   r   r   r;   r;   ;   s     Hr   r;   r   z^
    Sets the IAM policy for the given backend bucket as defined in a
    JSON or YAML file.  aZ      The following command will read an IAM policy defined in a JSON file
    'policy.json' and set it for the regionalbackend bucket `my-backend-bucket`:

      $ {command} my-backend-bucket policy.json --region=REGION

    The following commands will read an IAM policy defined in a JSON file
    'policy.json' and set it for the global backend bucket `my-backend-bucket`:

      $ {command} my-backend-bucket policy.json --global

      $ {command} my-backend-bucket policy.json

    See https://cloud.google.com/iam/docs/managing-policies for details of the
    policy file format and contents.
    z    This command uses the compute API. The full documentation for this
    API can be found at: https://cloud.google.com/compute/)briefDESCRIPTIONEXAMPLESzAPI REFERENCEN)r7   googlecloudsdk.api_lib.computer   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer   r#   r   r    2googlecloudsdk.command_lib.compute.backend_bucketsr   googlecloudsdk.command_lib.iamr   ReleaseTracksr   BETADefaultUniverseOnlyCommandr
   ALPHAr;   detailed_helpr2   r   r   <module>rK      s    0 8 ( E E T D 3 D%%**+4<<   ,< D%%++,H H  -H
 O >- r   