
    u                     2   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 Zd Z ej$                  ej&                  j(                  ej&                  j*                         G d dej,                               Zy)z9Command to update a Tensorboard time series in Vertex AI.    )absolute_import)division)unicode_literals)client)base)	constants)endpoint_util)errors)flags)logc                 T   t        j                  | d       t        j                  dd      j                  |        t        j                  d      j                  |        t        j
                  d      j                  |        t        j                  d      j                  |        y )Nz	to updateztensorboard time seriesF)requiredztensorboard-time-series)r   #AddTensorboardTimeSeriesResourceArgGetDisplayNameArgAddToParserGetDescriptionArgGetPluginNameArgGetPluginDataArgparsers    0lib/surface/ai/tensorboard_time_series/update.py_AddArgsr      s}    ++FK@%11<V1D34@@H23??G23??G    c                 0     j                   j                  j                         }|j                         d    _        t        j                  | j                        5  	 t        j                  |      j                  |       }t        j                  |j                  d       |cddd       S # t        j                  $ rC g d}t         fd|D              s t        j                   j#                  d	       Y ddd       yw xY w# 1 sw Y   yxY w)
5Update an existing Vertex AI Tensorboard time series.locationsId)region)versionz!Vertex AI Tensorboard time series)kindN)display_namedescriptionplugin_nameplugin_datac              3   @   K   | ]  }j                  |        y wN)IsSpecified).0argargss     r   	<genexpr>z_Run.<locals>.<genexpr>3   s     H2G3!!#&2Gs   zNo update to perform.)CONCEPTStensorboard_time_seriesParseAsDictr   r	   AiplatformEndpointOverridesr   TensorboardTimeSeriesClientPatchr   UpdatedResourcenamer
   NoFieldsSpecifiedErroranystatusPrint)r)   r   tensorboard_time_series_refopavailable_update_argss   `    r   _Runr;   '   s     $ E E K K M+224]C$+00M--g>DD
%t-b 
"''(KL NM ((  H2GHH	jj./ NM	 NMs1   D!&B3"D3AD	>DD		DDc                   .    e Zd ZdZddiZed        Zd Zy)
UpdateBetar   EXAMPLESa            To update a Tensorboard Time Series `123` in Tensorboard `12345`, Tensorboard Experiment `my-tensorboard-experiment`, Tensorboard Run `my-tensorboard-run`, 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/runs/my-tensorboard-run/timeSeries/123 --display-name="updated display name"

          Or with flags:

              $ {command} 123 --tensorboard-id=12345 --tensorboard-experiment-id=my-tensorboard-experiment --tensorboard-run-id=my-tensorboard-run --display-name="updated display name"
          c                     t        |        y r%   )r   r   s    r   ArgszUpdateBeta.ArgsM   s
    Vr   c                 6    t        |t        j                        S r%   )r;   r   BETA_VERSION)selfr)   s     r   RunzUpdateBeta.RunQ   s    i,,--r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr@   rD    r   r   r=   r=   <   s/    = -  .r   r=   N)rH   
__future__r   r   r   1googlecloudsdk.api_lib.ai.tensorboard_time_seriesr   googlecloudsdk.callioper   googlecloudsdk.command_lib.air   r	   r
   r   googlecloudsdk.corer   r   r;   ReleaseTracksReleaseTrackBETAALPHAUpdateCommandr=   rK   r   r   <module>rV      s}    @ &  ' D ( 3 7 0 / #H* D%%**D,=,=,C,CD.## . E.r   