
                         ,   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	S
.r\R                  \R                  " \R                  R                   \R                  R"                  5       " S S\R$                  5      5       5       r\\l        g)zLCommand to set an IAM policy binding on a Colab Enterprise runtime template.    )runtime_templates)util)base)	constants)endpoint_util)flagsz
        Set the IAM policy for a Colab Enterprise runtime template 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.
    z
        To set the IAM policy for a runtime template with id `my-runtime-template` in region `us-central1` to the policy defined in `policy.json`, run:

        $ {command} my-runtime-template policy.json --region=us-central1
    )DESCRIPTIONEXAMPLESc                   .    \ rS rSrSr\S 5       rS rSrg)SetIamPolicy'   zYSet IAM policy for a Colab Enterprise runtime template as defined in a JSON or YAML file.c                 0    [         R                  " U 5        g)z Register flags for this command.N)r   AddSetIamPolicyBindingFlags)parsers    5lib/surface/colab/runtime_templates/set_iam_policy.pyArgsSetIamPolicy.Args,   s     
%%f-    c                    U R                  5       n[        R                  " U R                  5       5      nUR                  R                  R                  5       nUR                  5       S   n[        R                  " [        R                  US9   [        R                  " U5      nUR                  nUR                  [        R                  " X5      5      sSSS5        $ ! , (       d  f       g= f)z9This is what gets called when the user runs this command.locationsId)versionregionN)ReleaseTrackr   GetMessagesCONCEPTSruntime_templateParseAsDictr   AiplatformEndpointOverridesr   BETA_VERSION	GetClient+projects_locations_notebookRuntimeTemplatesr   runtime_templates_util0CreateRuntimeTemplateSetIamPolicyRequestFromFile)selfargsrelease_trackmessagesruntime_template_refr   
api_clientruntime_templates_services           r   RunSetIamPolicy.Run1   s    %%'M 1 1 34H==99??A!((*=9F		2	2&&v
 >>-0j

@
@   '33
 
Q
Q
 
 
s   AC  
C. N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r,   __static_attributes__r.   r   r   r   r   '   s     b. .r   r   N)r3   'googlecloudsdk.api_lib.colab_enterpriser   r#   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.air   r   +googlecloudsdk.command_lib.colab_enterpriser   _DETAILED_HELPDefaultUniverseOnlyReleaseTracksr   GABETACommandr   detailed_helpr.   r   r   <module>rA      s    S _ 8 ( 3 7 = D%%(($*;*;*@*@A4<<  B 8 , r   