
                         ,   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)z-List command for Colab Enterprise Executions.    )
list_pager)util)
executions)base)endpoint_util)flagszY
        List your project's Colab Enterprise notebook executions in a given region.
    zm
        To list your executions in region `us-central1`, run:

        $ {command} --region=us-central1
    )DESCRIPTIONEXAMPLESc                   &    e Zd ZdZed        Zd Zy)Listz3List your Colab Enterprise notebook execution jobs.c                 d    t        j                  |        | j                  j                  d       y)z Register flags for this command.z
        table(name.segment(-1):label=ID,
        displayName,
        name.segment(-3):label=REGION,
        gcsOutputUri,
        jobState)
    N)r   AddListExecutionsFlagsdisplay_info	AddFormat)parsers    $lib/surface/colab/executions/list.pyArgsz	List.Args+   s+     
  (
!! # 	    c           
         | j                         }t        j                  | j                               }|j                  j                  j                         }|j                         d   }t        j                  d|      5  t        j                  |      }|j                  }t        j                  |t        j                  ||      d|j                  d|j                   d       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regionnotebookExecutionJobspageSizec                 .    t        j                  |        S )N)executions_utilIsWorkbenchExecution)	executions    r   <lambda>zList.Run.<locals>.<lambda>J   s    /*N*N+ 'r   )servicerequestfieldlimitbatch_size_attribute
batch_size	predicateN)ReleaseTrackr   GetMessagesCONCEPTSr   ParseAsDictr   AiplatformEndpointOverrides	GetClient(projects_locations_notebookExecutionJobsr   YieldFromListr   CreateExecutionListRequestr$   	page_size)selfargsrelease_trackmessages
region_refr   
api_clientexecutions_services           r   RunzList.Run7   s    %%'M 1 1 34H%%++-J /F		2	2v
 >>-0j%NN%%$!<<T8L'

)^^

 
 
s   A&C22C;N)__name__
__module____qualname____doc__staticmethodr   r:    r   r   r   r   &   s     <		 		r   r   N)r>   apitools.base.pyr   'googlecloudsdk.api_lib.colab_enterpriser   (googlecloudsdk.api_lib.notebook_executorr   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.air   ,googlecloudsdk.command_lib.notebook_executorr   _DETAILED_HELPDefaultUniverseOnlyReleaseTracksr(   GAr   ListCommandr   detailed_helpr@   r   r   <module>rM      s     4 ' 8 R ( 7 >		 D%%(($*;*;*@*@A%4 % B %P $ r   