
                            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  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 get a model in Vertex AI.    )absolute_import)division)unicode_literals)client)apis)base)	constants)endpoint_util)flags)region_utilc                   ,    e Zd ZdZed        Zd Zd Zy)
DescribeV1q  Get detailed model information about the given model id.

  ## EXAMPLES

  Describe a model `123` of project `example` in region `us-central1`,
  run:

    $ {command} 123 --project=example --region=us-central1

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

    $ {command} 123@2 --project=example --region=us-central1
  c                 N    t        j                  | dt        j                         y )Nzto describe)r   AddModelResourceArgr   PromptForOpRegion)parsers    !lib/surface/ai/models/describe.pyArgszDescribeV1.Args/   s    	fm);;=    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)r
   AiplatformEndpointOverridesr	   
GA_VERSIONr   GetClientInstanceAI_PLATFORM_API_NAMEAI_PLATFORM_API_VERSIONr   ModelsClientMESSAGES_MODULEGet)selfargs	model_refr   client_instances        r   _RunzDescribeV1._Run4   s~    		2	2$$V
5..

(
(

+
+I,@,@
ACo    "22447C	N
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DescribeV1.Run>   s@    ##))+I.F99T9f--r   N)__name__
__module____qualname____doc__staticmethodr   r(   r/    r   r   r   r      s&     = =C.r   r   c                       e Zd ZdZd Zy)DescribeV1Beta1r   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#   )r$   r%   r&   r   responses        r   r(   zDescribeV1Beta1._RunU   sG    		2	2&&v
7$$&**95h
7 
7 
7s   %AAN)r0   r1   r2   r3   r(   r5   r   r   r7   r7   D   s    r   r7   N)r3   
__future__r   r   r    googlecloudsdk.api_lib.ai.modelsr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   googlecloudsdk.command_lib.air	   r
   r   r   ReleaseTracksReleaseTrackGADescribeCommandr   ALPHABETAr7   r5   r   r   <module>rF      s    + &  ' 3 , ( 3 7 / 5 D%%(()".%% ". *".J D%%++T->->-C-CDj  Er   