
    I                        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  SSKJr  \R&                  " \R(                  R*                  5       " S S\R,                  5      5       r\R&                  " \R(                  R0                  \R(                  R2                  5       " S S\5      5       rg)z)Vertex AI index endpoints update command.    )absolute_import)division)unicode_literals)client)base)	constants)endpoint_util)errors)flags)
validation)labels_util)logc                   4    \ rS rSrSr\S 5       rS rS rSr	g)UpdateV1    Update an Vertex AI index endpoint.

## EXAMPLES

To update display name of index endpoint `123` under project `example` in
region `us-central1`, run:

  $ {command} --display-name=new-name --project=example --region=us-central1
c                     [         R                  " U S5        [         R                  " SSS9R                  U 5        [         R                  " S5      R                  U 5        [
        R                  " U 5        g )Nz	to updatezindex endpointF)required)r   AddIndexEndpointResourceArgGetDisplayNameArgAddToParserGetDescriptionArgr   AddUpdateLabelsFlags)parsers    (lib/surface/ai/index_endpoints/update.pyArgsUpdateV1.Args,   sW    	%%fk:	5**5+f*=	,-99&A$$V,    c                   ^ [         R                  " TR                  5        T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T5      nOUR                  UT5      n[        R                   " UR"                  SS9  UsS S S 5        $ ! [$        R&                   aI    / SQn[)        U4S jU 5       5      (       d  e [        R*                  R-                  S5         S S S 5        g f = f! , (       d  f       g = f)	NlocationsId)region)versionzVertex AI index endpoint)kind)display_namedescriptionupdate_labelsclear_labelsremove_labelsc              3   F   >#    U  H  nTR                  U5      v   M     g 7fN)IsSpecified).0argargss     r   	<genexpr> UpdateV1._Run.<locals>.<genexpr>D   s!     J4IS4##C((4Is   !zNo update to perform.)r   ValidateDisplayNamer$   CONCEPTSindex_endpointParseAsDictr	   AiplatformEndpointOverridesr   IndexEndpointsClientr   
GA_VERSIONPatch	PatchBetar   UpdatedResourcenamer
   NoFieldsSpecifiedErroranystatusPrint)selfr.   r"   index_endpoint_refr!   index_endpoint_clientresultavailable_update_argss    `      r   _RunUpdateV1._Run4   s   ""4#4#4555;;=&&(7F		2	27	J$99'Ji***(../A4H&(223EtL& 	FKK.HI% 
K	J ** !
 J4IJJJ


01 
K	J 
K	Js1   -E9C&< E&AE8EEE
Ec                 B    U R                  U[        R                  5      $ r*   )rF   r   r8   rA   r.   s     r   RunUpdateV1.RunL   s    99T9//00r    N)
__name__
__module____qualname____firstlineno____doc__staticmethodr   rF   rJ   __static_attributes__rL   r   r   r   r       s%     - -01r   r   c                       \ rS rSrSrS rSrg)UpdateV1Beta1P   r   c                 B    U R                  U[        R                  5      $ r*   )rF   r   BETA_VERSIONrI   s     r   rJ   UpdateV1Beta1.Run\   s    99T91122r   rL   N)rM   rN   rO   rP   rQ   rJ   rS   rL   r   r   rU   rU   P   s    3r   rU   N)rQ   
__future__r   r   r   )googlecloudsdk.api_lib.ai.index_endpointsr   googlecloudsdk.callioper   googlecloudsdk.command_lib.air   r	   r
   r   r   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   ReleaseTracksReleaseTrackGAUpdateCommandr   BETAALPHArU   rL   r   r   <module>rf      s    0 &  ' < ( 3 7 0 / 4 < # D%%((),1t!! ,1 *,1^ D%%**D,=,=,C,CD3H 3 E3r   