
    
                        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  e
j&                  e
j(                  j*                         G d de
j,                               Z e
j&                  e
j(                  j0                  e
j(                  j2                         G d de             Zy)z!Vertex AI indexes delete command.    )absolute_import)division)unicode_literals)
operations)client)base)	constants)endpoint_util)flags)indexes_util)operations_util)
console_ioc                   ,    e Zd ZdZed        Zd Zd Zy)DeleteV1Delete an existing Vertex AI index.

  ## EXAMPLES

  To delete an index `123` of project `example` in region `us-central1`, run:

    $ {command} 123 --project=example --region=us-central1
  c                 0    t        j                  | d       y )Nz	to delete)r   AddIndexResourceArg)parsers     lib/surface/ai/indexes/delete.pyArgszDeleteV1.Args+   s    	fk2    c                    |j                   j                  j                         }|j                         d   }|j                         d   }t	        j
                  ||      5  t        j                  dj                  |      d       t        j                  |      j                  |      }t        j                  t        j                         |t!        j"                  |j$                              cd d d        S # 1 sw Y   y xY w)	NlocationsId	indexesId)regionzThis will delete index [{}]...T)cancel_on_no)version)operations_clientopop_ref)CONCEPTSindexParseAsDictr
   AiplatformEndpointOverridesr   PromptContinueformatr   IndexesClientDeleter   WaitForOpMayber   OperationsClientr   ParseIndexOperationname)selfargsr   	index_refr   index_id	operations          r   _RunzDeleteV1._Run/   s    ##))+I.F!+.H		2	276	J
*
1
1(
;$P&&w7>>yIi++&77911)..AC	 
K	J	Js   "BC>>Dc                 B    | j                  |t        j                        S N)r3   r	   
GA_VERSIONr.   r/   s     r   RunzDeleteV1.Run<   s    99T9//00r   N)__name__
__module____qualname____doc__staticmethodr   r3   r8    r   r   r   r       s&     3 3C1r   r   c                       e Zd ZdZd Zy)DeleteV1Beta1r   c                 B    | j                  |t        j                        S r5   )r3   r	   BETA_VERSIONr7   s     r   r8   zDeleteV1Beta1.RunK   s    99T91122r   N)r9   r:   r;   r<   r8   r>   r   r   r@   r@   @   s    3r   r@   N)r<   
__future__r   r   r   googlecloudsdk.api_lib.air   !googlecloudsdk.api_lib.ai.indexesr   googlecloudsdk.callioper   googlecloudsdk.command_lib.air	   r
   r   r   r   googlecloudsdk.core.consoler   ReleaseTracksReleaseTrackGADeleteCommandr   ALPHABETAr@   r>   r   r   <module>rO      s    ( &  ' 0 4 ( 3 7 / 6 9 2 D%%(()1t!! 1 *1> D%%++T->->-C-CD3H 3 E3r   