
    0                        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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 models in Vertex AI.    )absolute_import)division)unicode_literals)client)apis)base)	constants)endpoint_util)flags)region_utilzb
        table(
            name.basename():label=MODEL_ID,
            displayName
        )
    c                   ,    e Zd ZdZed        Zd Zd Zy)ListV1zList the models of the given project and region.

  ## EXAMPLES

  List the models of project ``example'' in region ``us-central1'', run:

    $ {command} --project=example --region=us-central1
  c                     | j                   j                  t               t        j                  | dt
        j                         y )Nzto list models)prompt_func)display_info	AddFormat_DEFAULT_FORMATr   AddRegionResourceArgr   PromptForOpRegion)parsers    lib/surface/ai/models/list.pyArgszListV1.Args1   s3    
!!/2	 k.K.KM    c                 `   t        j                  t        j                  |      5  t	        j
                  t        j                  t        j                  t        j                           }t        j                  ||j                        j                  |      cd d d        S # 1 sw Y   y xY w)Nversionregion)r   messages
region_ref)r
   AiplatformEndpointOverridesr	   
GA_VERSIONr   GetClientInstanceAI_PLATFORM_API_NAMEAI_PLATFORM_API_VERSIONr   ModelsClientMESSAGES_MODULEList)selfargsr    r   client_instances        r   _RunzListV1._Run7   s    		2	2$$V
5..

(
(

+
+I,@,@
ACo    "22448DJD4O
5 
5 
5s   A4B$$B-c                     |j                   j                  j                         }|j                         d   }| j	                  |||      S )NlocationsId)CONCEPTSr   ParseAsDictr,   r)   r*   r    r   s       r   Runz
ListV1.RunA   s@    %%++-J /F99T:v..r   N)__name__
__module____qualname____doc__staticmethodr   r,   r3    r   r   r   r   &   s(     M M
P/r   r   c                       e Zd ZdZd Zy)ListV1Beta1zList the models of the given project and region.

  ## EXAMPLES

  List the models of project `example` in region `us-central1`, run:

    $ {command} --project=example --region=us-central1
  c                     t        j                  t        j                  |      5  t	        j
                         j                  |      cd d d        S # 1 sw Y   y xY w)Nr   r   )r
   r!   r	   BETA_VERSIONr   r&   r(   r2   s       r   r,   zListV1Beta1._RunR   sE    		2	2&&v
7  "'':'>
7 
7 
7s   $AAN)r4   r5   r6   r7   r,   r9   r   r   r;   r;   G   s    ?r   r;   N)r7   
__future__r   r   r    googlecloudsdk.api_lib.ai.modelsr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   googlecloudsdk.command_lib.air	   r
   r   r   r   ReleaseTracksReleaseTrackGAListCommandr   ALPHABETAr;   r9   r   r   <module>rI      s    + &  ' 3 , ( 3 7 / 5 D%%(()/T / */@ D%%++T->->-C-CD?& ? E?r   