
    *                        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
 rS r\R                   " \R"                  R$                  \R"                  R&                  5       " S S\R(                  5      5       rg)z8Command to update a Tensorboard experiment in Vertex AI.    )client)base)	constants)endpoint_util)errors)flags)labels_util)logc                     [         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tensorboard experimentF)required)r   #AddTensorboardExperimentResourceArgGetDisplayNameArgAddToParserGetDescriptionArgr	   AddUpdateLabelsFlagsparsers    0lib/surface/ai/tensorboard_experiments/update.py_AddArgsr      sW    ++FK@00;F0C23??G""6*    c                 <  ^  T R                   R                  R                  5       nUR                  5       S   T l        [
        R                  " UT R                  S9    [        R                  " US9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)
4Update an existing Vertex AI Tensorboard experiment.locationsId)region)versionz Vertex AI Tensorboard experiment)kindN)display_nameupdate_labelsclear_labelsremove_labelsdescriptionc              3   F   >#    U  H  nTR                  U5      v   M     g 7fN)IsSpecified).0argargss     r   	<genexpr>_Run.<locals>.<genexpr>1   s!     H2G3!!#&&2Gs   !zNo update to perform.)CONCEPTStensorboard_experimentParseAsDictr   r   AiplatformEndpointOverridesr   TensorboardExperimentsClientPatchr
   UpdatedResourcenamer   NoFieldsSpecifiedErroranystatusPrint)r'   r   tensorboard_exp_refopavailable_update_argss   `    r   _Runr:   $   s    <<BBD#**,];$+00M..w?EE
t%b 
"''(JK NM ((  H2GHHH	jj./ NM	 NMs1   D$B- D-AD
?D	D

D
Dc                   6    \ rS rSrSrSS0r\S 5       rS rSr	g)	
UpdateBeta:   r   EXAMPLESa            To update a Tensorboard Experiment `my-tensorboard-experiment` in Tensorboard `12345`, region `us-central1`, and project `my-project`, with the display name `updated display name`:

              $ {command} projects/my-project/locations/us-central1/tensorboards/12345/experiments/my-tensorboard-experiment --display-name="updated display name"

          Or with flags:

              $ {command} my-tensorboard-experiment --tensorboard-id=12345 --display-name="updated display name"
          c                     [        U 5        g r#   )r   r   s    r   ArgsUpdateBeta.ArgsK   s
    Vr   c                 6    [        U[        R                  5      $ r#   )r:   r   BETA_VERSION)selfr'   s     r   RunUpdateBeta.RunO   s    i,,--r    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr@   rE   __static_attributes__rG   r   r   r<   r<   :   s/    < -  .r   r<   N)rL   1googlecloudsdk.api_lib.ai.tensorboard_experimentsr   googlecloudsdk.callioper   googlecloudsdk.command_lib.air   r   r   r   $googlecloudsdk.command_lib.util.argsr	   googlecloudsdk.corer
   r   r:   ReleaseTracksReleaseTrackBETAALPHAUpdateCommandr<   rG   r   r   <module>rZ      sv    ? E ( 3 7 0 / < #+, D%%**D,=,=,C,CD.## . E.r   