
                            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l	mZ dd	l	mZ dd
l	mZ ddlmZ ddlmZ  ej"                  ej$                  j&                         G d dej(                               Z ej"                  ej$                  j,                  ej$                  j.                         G d de             Zy)z)Command to list custom jobs in Vertex AI.    )absolute_import)division)unicode_literals)client)base)	constants)endpoint_util)flags)region_util)custom_jobs_util)
validationc                   >    e Zd ZdZej
                  Zed        Zd Z	y)ListGALists the existing custom jobs.

  ## EXAMPLES

  To list the jobs of project ``example'' in region
  ``us-central1'', run:

    $ {command} --project=example --region=us-central1
  c                     t        j                  |dt        j                  t        j
                               t        j                  |t        j                  t        j                  | j                            y)zMethod called by Calliope to set up arguments for this command.

    Args:
      parser: A argparse.Parser to register accepted arguments in command input.
    zto list custom jobs)prompt_func)
collectionapi_versionN)r
   AddRegionResourceArgr   GetPromptForRegionFuncr   SUPPORTED_TRAINING_REGIONSAddUriFlagsr   CUSTOM_JOB_COLLECTIONAI_PLATFORM_API_VERSION_api_version)clsparsers     "lib/surface/ai/custom_jobs/list.pyArgszListGA.Args,   s`     
660023
 
#9955c6F6FGI    c                    |j                   j                  j                         }|j                         d   }t	        j
                  |       t        j                  | j                  |      5  t        j                  | j                        j                  |j                               cddd       S # 1 sw Y   yxY w)zExecutes the list command.

    Args:
      args: an argparse.Namespace, it contains all arguments that this command
        was invoked with.

    Returns:
      The list of resources
    locationsId)versionregion)r#   )r$   N)CONCEPTSr$   ParseAsDictr   ValidateRegionr	   AiplatformEndpointOverridesr   r   CustomJobsClientListRelativeName)selfargs
region_refr$   s       r   Runz
ListGA.Run=   s     %%++-J /Ff%		2	2!!&
2$$T->->?DD((* E ,
2 
2 
2s   .>B66B?N)
__name__
__module____qualname____doc__r   
GA_VERSIONr   classmethodr   r0    r    r   r   r      s-     %%,I I ,r    r   c                   (    e Zd ZdZej
                  Zy)	ListPreGAr   N)r1   r2   r3   r4   r   BETA_VERSIONr   r7   r    r   r9   r9   Q   s     '',r    r9   N)r4   
__future__r   r   r   %googlecloudsdk.api_lib.ai.custom_jobsr   googlecloudsdk.callioper   googlecloudsdk.command_lib.air   r	   r
   r   )googlecloudsdk.command_lib.ai.custom_jobsr   r   ReleaseTracksReleaseTrackGAListCommandr   BETAALPHAr9   r7   r    r   <module>rF      s    0 &  ' 8 ( 3 7 / 5 F @ D%%(().,T ., *.,b D%%**D,=,=,C,CD( ( E(r    