
                         ,   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	d
Zej                   ej                  ej                   j"                  ej                   j$                         G d dej&                                      Zee_        y)zLCommand to add an IAM policy binding to a Colab Enterprise runtime template.    )runtime_templates)util)base)endpoint_util)flags)iam_utilzO
        Add an IAM policy binding to a Colab Enterprise runtime template.
    aA  
        To set `someone@example.com` to have the `roles/aiplatform.notebookRuntimeUser` role for a runtime template with id `my-runtime-template` in region `us-central1`, run:

        $ {command} my-runtime-template --region=us-central1 --member=user:someone@example.com --role=roles/aiplatform.notebookRuntimeUser
    )DESCRIPTIONEXAMPLESc                   &    e Zd ZdZed        Zd Zy)AddIamPolicyBindingzAAdd an IAM policy binding to a Colab Enterprise runtime template.c                 .    t        j                  |        y)z Register flags for this command.N)r   AddFlagsToAddIamPolicyBinding)parsers    =lib/surface/colab/runtime_templates/add_iam_policy_binding.pyArgszAddIamPolicyBinding.Args*   s     
''/    c                 t   | j                         }t        j                  | j                               }|j                  j                  j                         }|j                         d   }t        j                  d|      5  t        j                  |      }|j                  }|j                  t        j                  ||            }t        j                  |j                   ||j"                  |j$                         |j'                  t        j(                  |||            cddd       S # 1 sw Y   yxY w)z9This is what gets called when the user runs this command.locationsIdBETA)versionregionN)ReleaseTrackr   GetMessagesCONCEPTSruntime_templateParseAsDictr   AiplatformEndpointOverrides	GetClient+projects_locations_notebookRuntimeTemplatesGetIamPolicyruntime_templates_util(CreateRuntimeTemplateGetIamPolicyRequestr   AddBindingToIamPolicyGoogleIamV1BindingmemberroleSetIamPolicy(CreateRuntimeTemplateSetIamPolicyRequest)	selfargsrelease_trackmessagesruntime_template_refr   
api_clientruntime_templates_service
iam_policys	            r   RunzAddIamPolicyBinding.Run/   s
   %%'M 1 1 34H==99??A!((*=9F		2	2v
 >>-0j

@
@   -99
 
I
IHj
 $$

%
%

++
))	 '33
 
I
I$%
 
 
s   B"D..D7N)__name__
__module____qualname____doc__staticmethodr   r2    r   r   r   r   %   s     J0 0r   r   N)r6   'googlecloudsdk.api_lib.colab_enterpriser   r"   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.air   +googlecloudsdk.command_lib.colab_enterpriser   googlecloudsdk.command_lib.iamr   _DETAILED_HELPDefaultUniverseOnlyReleaseTracksr   GAr   Commandr   detailed_helpr8   r   r   <module>rD      s    S _ 8 ( 7 = 3		 D%%(($*;*;*@*@A%$,, % B %N %3  !r   