
                            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$                  5       " S S\	R&                  5      5       5       r\\l        g)z&List command for Workbench Executions.    )
list_pager)util)
executions)base)endpoint_util)flagszI
        List your project's Workbench executions in a given region.
    zm
        To list your executions in region `us-central1`, run:

        $ {command} --region=us-central1
    )DESCRIPTIONEXAMPLESc                   .    \ rS rSrSr\S 5       rS rSrg)List&   z"List your notebook execution jobs.c                 d    [         R                  " U SS9  U R                  R                  S5        g)zSRegister flags for this command.

Args:
  parser: argparse parser to add flags to.
T)for_workbenchz
        table(name.segment(-1):label=ID,
        displayName,
        name.segment(-3):label=REGION,
        gcsOutputUri,
        jobState)
    N)r   AddListExecutionsFlagsdisplay_info	AddFormat)parsers    (lib/surface/workbench/executions/list.pyArgs	List.Args+   s-     
  t<
!! # 	    c                    U R                  5       n[        R                  " U R                  5       5      nUR                  R                  R                  5       nUR                  5       S   n[        R                  " SUS9   [        R                  " U5      nUR                  n[        R                  " [        R                  U[        R                  " X5      SUR                   SUR"                  S9sSSS5        $ ! , (       d  f       g= f)zThis is what gets called when the user runs this command.

Args:
  args: The arguments that the command was run with.

Returns:
  A list of Workbench executions in the specified region.
locationsIdBETA)versionregionnotebookExecutionJobspageSize)	predicateservicerequestfieldlimitbatch_size_attribute
batch_sizeN)ReleaseTrackr   GetMessagesCONCEPTSr   ParseAsDictr   AiplatformEndpointOverrides	GetClient(projects_locations_notebookExecutionJobsr   YieldFromListexecutions_utilIsWorkbenchExecutionCreateExecutionListRequestr#   	page_size)selfargsrelease_trackmessages
region_refr   
api_clientexecutions_services           r   RunList.Run;   s     %%'M 1 1 34H%%++-J /F		2	2v
 >>-0j

=
=  %% $88$!<< (

)^^
 
 
s   A2C==
D N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r:   __static_attributes__r<   r   r   r   r   &   s     +	 	!r   r   N)rA   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&   r   ListCommandr   detailed_helpr<   r   r   <module>rO      s~     - ' 8 R ( 7 >		 D%%**+44 4 , 4l $ r   