
    
                     ,   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)zFCommand to get the IAM policy for a Colab Enterprise runtime template.    )runtime_templates)util)base)	constants)endpoint_util)flagszI
        Get the IAM policy for a Colab Enterprise runtime template.
    a  
        To get the IAM policy for a runtime template with id `my-runtime-template` in region `us-central1`, run:

        $ {command} my-runtime-template --location=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)GetIamPolicyz7Get IAM policy for a Colab Enterprise runtime template.c                 l    t        j                  |        t        j                  j	                  |        y)z Register flags for this command.N)r   AddGetIamPolicyFlagsr   URI_FLAGRemoveFromParser)parsers    5lib/surface/colab/runtime_templates/get_iam_policy.pyArgszGetIamPolicy.Args+   s&     
v& 	MM""6*    c                    | j                         }t        j                  | j                               }|j                  j                  j                         }|j                         d   }t        j                  t        j                  |      5  t        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)versionregionN)ReleaseTrackr   GetMessagesCONCEPTSruntime_templateParseAsDictr   AiplatformEndpointOverridesr   BETA_VERSION	GetClient+projects_locations_notebookRuntimeTemplatesr   runtime_templates_util(CreateRuntimeTemplateGetIamPolicyRequest)selfargsrelease_trackmessagesruntime_template_refr   
api_clientruntime_templates_services           r   RunzGetIamPolicy.Run3   s    %%'M 1 1 34H==99??A!((*=9F		2	2&&v
 >>-0j

@
@   '33
 
I
IH
 
 
s   AC  C)N)__name__
__module____qualname____doc__staticmethodr   r,    r   r   r   r   &   s     @+ +r   r   N)r0   '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ListCommandr   detailed_helpr2   r   r   <module>r>      s    M _ 8 ( 3 7 =	
 D%%(($*;*;*@*@A4##  B > , r   