
    `                        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 index endpoints delete command.    )absolute_import)division)unicode_literals)
operations)client)base)	constants)endpoint_util)flags)index_endpoints_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 endpoint.

  ## EXAMPLES

  To delete an index endpoint `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   AddIndexEndpointResourceArg)parsers    (lib/surface/ai/index_endpoints/delete.pyArgszDeleteV1.Args,   s    	%%fk:    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indexEndpointsId)regionz'This will delete index endpoint [{}]...T)cancel_on_no)version)operations_clientopop_ref)CONCEPTSindex_endpointParseAsDictr
   AiplatformEndpointOverridesr   PromptContinueformatr   IndexEndpointsClientDeleter   WaitForOpMayber   OperationsClientr   ParseIndexEndpointOperationname)selfargsr   index_endpoint_refr   index_endpoint_id	operations          r   _RunzDeleteV1._Run0   s    55;;=&&(7F*1134FG		2	276	J
3
:
:;L
M --!6"45 ++&77H%AAnn 
K	J	Js   "BD  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%     ; ; 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.RunP   s    99T91122r   N)r9   r:   r;   r<   r8   r>   r   r   r@   r@   D   s    3r   r@   N)r<   
__future__r   r   r   googlecloudsdk.api_lib.air   )googlecloudsdk.api_lib.ai.index_endpointsr   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 &  ' 0 < ( 3 7 / > 9 2 D%%(() 1t!!  1 * 1F D%%++T->->-C-CD3H 3 E3r   