
    
                     v   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  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,Vertex AI indexes remove datapoints command.    )absolute_import)division)unicode_literals)client)base)	constants)endpoint_util)flagsc                   ,    e Zd ZdZed        Zd Zd Zy)RemoveDatapointsV1af  Remove data points from the specified index.

  ## EXAMPLES

  To remove datapoints from an index '123', run:

    $ {command} 123 --datapoint-ids=example1,example2
    --project=example --region=us-central1

  Or put datapoint ids in a json file and run:

    $ {command} 123 --datapoints-from-file=example.json
    --project=example --region=us-central1
  c                 ^    t        j                  | d       t        j                  d| d       y )Nzto remove data points fromindexT)r
   AddIndexResourceArg&AddDatapointSourceGroupForStreamUpdate)parsers    +lib/surface/ai/indexes/remove_datapoints.pyArgszRemoveDatapointsV1.Args-   s%    	f&BC	00&$G    c                 j   |j                   j                  j                         }|j                         d   }t	        j
                  ||      5  t        j                  |      }|t        j                  k(  r|j                  ||      }n|j                  ||      }|cd d d        S # 1 sw Y   y xY w)NlocationsId)region)version)CONCEPTSr   ParseAsDictr	   AiplatformEndpointOverridesr   IndexesClientr   
GA_VERSIONRemoveDatapointsRemoveDatapointsBeta)selfargsr   	index_refr   index_client	operations          r   _RunzRemoveDatapointsV1._Run2   s    ##))+I.F		2	276	J))':l	I((	( 11)TB	 55iF	 
K	J	Js   AB))B2c                 B    | j                  |t        j                        S N)r&   r   r   r!   r"   s     r   RunzRemoveDatapointsV1.Run=   s    99T9//00r   N)__name__
__module____qualname____doc__staticmethodr   r&   r*    r   r   r   r      s'     H H	1r   r   c                       e Zd ZdZd Zy)RemoveDatapointsV1Betaag  Remove data points from the specified index.

  ## EXAMPLES

  To remove data points from an index `123`, run:

    $ {command} 123 --datapoint-ids=example1,example2
    --project=example --region=us-central1

  Or put datapoint ids in a JSON file and run:

    $ {command} 123 --datapoints-from-file=example.json
    --project=example --region=us-central1
  c                 B    | j                  |t        j                        S r(   )r&   r   BETA_VERSIONr)   s     r   r*   zRemoveDatapointsV1Beta.RunR   s    99T91122r   N)r+   r,   r-   r.   r*   r0   r   r   r2   r2   A   s    3r   r2   N)r.   
__future__r   r   r   !googlecloudsdk.api_lib.ai.indexesr   googlecloudsdk.callioper   googlecloudsdk.command_lib.air   r	   r
   ReleaseTracksReleaseTrackGACreateCommandr   ALPHABETAr2   r0   r   r   <module>r?      s    3 &  ' 4 ( 3 7 / D%%(()!1++ !1 *!1H D%%++T->->-C-CD3/ 3 E3r   