
                            S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSKJr  SS	KJr  SS
KJr  SSKJr  SSKJr  \
R"                  " \
R$                  R&                  5       " S S\
R(                  5      5       r\
R"                  " \
R$                  R,                  \
R$                  R.                  5       " S S\5      5       rg)z1Vertex AI index endpoints undeploy-index command.    )absolute_import)division)unicode_literals)
operations)client)base)	constants)endpoint_util)flags)index_endpoints_util)operations_utilc                   4    \ rS rSrSr\S 5       rS rS rSr	g)UndeployIndexV1   3  Undeploy an index from a Vertex AI index endpoint.

## EXAMPLES

To undeploy the deployed-index ``deployed-index-345'' from an index endpoint
``456'' under project ``example'' in region ``us-central1'', run:

  $ {command} 456 --project=example --region=us-central1
  --deployed-index-id=deployed-index-345
c                 z    [         R                  " U S5        [         R                  " 5       R                  U 5        g )Nzto undeploy an index)r   AddIndexEndpointResourceArgGetDeployedIndexIdAddToParser)parsers    0lib/surface/ai/index_endpoints/undeploy_index.pyArgsUndeployIndexV1.Args,   s*    	%%f.DE	**62    c                    UR                   R                  R                  5       nUR                  5       S   n[        R
                  " X$S9   [        R                  " US9nU[        R                  :X  a  UR                  UU5      nOUR                  X15      n[        R                  " [        R                  " US9U[         R"                  " UR$                  5      S9sS S S 5        $ ! , (       d  f       g = f)NlocationsId)region)version)operations_clientopop_ref)CONCEPTSindex_endpointParseAsDictr
   AiplatformEndpointOverridesr   IndexEndpointsClientr	   
GA_VERSIONUndeployIndexUndeployIndexBetar   WaitForOpMayber   OperationsClientr   ParseIndexEndpointOperationname)selfargsr   index_endpoint_refr   index_endpoint_client	operations          r   _RunUndeployIndexV1._Run1   s    55;;=&&(7F		2	27	J$99'J	I((	()778J8<>	 *;;&	++&77H%AAnn 
K	J	Js   BC((
C6c                 B    U R                  U[        R                  5      $ N)r4   r	   r(   r/   r0   s     r   RunUndeployIndexV1.RunB   s    99T9//00r    N)
__name__
__module____qualname____firstlineno____doc__staticmethodr   r4   r9   __static_attributes__r;   r   r   r   r      s%    	 3 3"1r   r   c                       \ rS rSrSrS rSrg)UndeployIndexV1Beta1F   r   c                 B    U R                  U[        R                  5      $ r7   )r4   r	   BETA_VERSIONr8   s     r   r9   UndeployIndexV1Beta1.RunS   s    99T91122r   r;   N)r<   r=   r>   r?   r@   r9   rB   r;   r   r   rD   rD   F   s    	3r   rD   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   ReleaseTracksReleaseTrackGACommandr   ALPHABETArD   r;   r   r   <module>rT      s    8 &  ' 0 < ( 3 7 / > 9 D%%(()#1dll #1 *#1L D%%++T->->-C-CD3? 3 E3r   