
                            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 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*                  j2                  ej*                  j4                         G d de             Zy)z(Vertex AI models delete version command.    )absolute_import)division)unicode_literals)
operations)client)apis)base)	constants)endpoint_util)flags)models_util)operations_util)region_utilc                   ,    e Zd ZdZed        Zd Zd Zy)DeleteVersionV1zDelete an existing Vertex AI model version.

  ## EXAMPLES

  To delete a model `123` version `1234` under project `example` in region
  `us-central1`, run:

    $ {command} 123@1234 --project=example --region=us-central1
  c                 N    t        j                  | dt        j                         y )Nz	to delete)r   AddModelVersionResourceArgr   PromptForOpRegion)parsers    'lib/surface/ai/models/delete_version.pyArgszDeleteVersionV1.Args-   s    	$$V[%0%B%BD    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DeleteVersion)selfargsmodel_version_refr   client_instances        r   _RunzDeleteVersionV1._Run2   s    		2	2$$V
5..

(
(

+
+I,@,@
ACo    "2244AM5!
5 
5 
5s   A3B##B,c                     |j                   j                  j                         }|j                         d   }| j	                  |||      S )NlocationsId)CONCEPTSmodel_versionParseAsDictr*   )r&   r'   r(   r   s       r   RunzDeleteVersionV1.Run=   sB    3399;%%'6F99T,f55r   N)__name__
__module____qualname____doc__staticmethodr   r*   r1    r   r   r   r   !   s'     D D	!6r   r   c                       e Zd ZdZd Zy)DeleteVersionV1Beta1zDelete an existing Vertex AI model version.

  ## EXAMPLES

  To delete a model `123` of version `1234` under project `example` in region
  `us-central1`, run:

    $ {command} 123@1234 --project=example --region=us-central1
  c                 L   t        j                  t        j                  |      5  t	        j
                         j                  |      }t        j                  t        j                         |t        j                  |j                              cd d d        S # 1 sw Y   y xY w)Nr   )operations_clientopop_ref)r   r   r
   BETA_VERSIONr   r#   r%   r   WaitForOpMayber   OperationsClientr   ParseModelOperationname)r&   r'   r(   r   	operations        r   r*   zDeleteVersionV1Beta1._RunO   su    		2	2&&v
7%%'556GHi++&77900@B
7 
7 
7s   A*BB#N)r2   r3   r4   r5   r*   r7   r   r   r9   r9   C   s    Br   r9   N)r5   
__future__r   r   r   googlecloudsdk.api_lib.air    googlecloudsdk.api_lib.ai.modelsr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper	   googlecloudsdk.command_lib.air
   r   r   r   r   r   ReleaseTracksReleaseTrackGADeleteCommandr   ALPHABETAr9   r7   r   r   <module>rP      s    / &  ' 0 3 , ( 3 7 / 5 9 5 D%%(()6d(( 6 *6B D%%++T->->-C-CDB? B EBr   