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

  ## EXAMPLES

  List the model version of a model `123` of project `example` in region
  `us-central1`, run:

    $ {command} 123 --project=example --region=us-central1
  c                     | j                   j                  t               t        j                  | dt
        j                         y)zSee base class.zto list versionsN)display_info	AddFormat_DEFAULT_FORMATr   AddModelResourceArgr   PromptForOpRegion)parsers    %lib/surface/ai/models/list_version.pyArgszListVersionV1.Args3   s4     !!/2	f&8);;=    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)aU  Runs command with model client.

    Concrete gCloud SDK command subclasses are required to override this.

    Args:
      args: Command arguments.
      model_ref: The model resource reference.
      region: The region of the model resource reference.

    Returns:
      The response from running the given command with model client.
    versionregion)r   messagesN)r
   AiplatformEndpointOverridesr	   
GA_VERSIONr   GetClientInstanceAI_PLATFORM_API_NAMEAI_PLATFORM_API_VERSIONr   ModelsClientMESSAGES_MODULEListVersion)selfargs	model_refr   client_instances        r   _RunzListVersionV1._Run:   s     
	2	2$$V
5..

(
(

+
+I,@,@
ACo    "2244?K5
5 
5 
5s   A3B##B,c                     |j                   j                  j                         }|j                         d   }| j	                  |||      S )NlocationsId)CONCEPTSmodelParseAsDictr+   r'   r(   r)   r   s       r   RunzListVersionV1.RunQ   s@    ##))+I.F99T9f--r   N)__name__
__module____qualname____doc__staticmethodr   r+   r3    r   r   r   r   '   s%     = =..r   r   c                       e Zd ZdZd Zy)ListVersionV1Beta1r   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	   BETA_VERSIONr   r$   r&   r2   s       r   r+   zListVersionV1Beta1._Runc   sB    		2	2&&v
7  "..y9
7 
7 
7s   #AAN)r4   r5   r6   r7   r+   r9   r   r   r;   r;   W   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 , ( 3 7 / 5 D%%((),.D$$ ,. *,.^ D%%++T->->-C-CD: : E:r   