
    C                     :   d Z ddl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                  ej                  j                  ej                  j                  ej                  j                          G d d	ej"                                      Zy)
z$Bigtable logical views list command.    N)logical_views)util)base)	arguments)logc                   T    e Zd ZdZd ej
                  d      iZed        Zd Z	d Z
y)UpdateLogicalViewzUpdate a Bigtable logical view.EXAMPLESaW            To update a logical view to a new query, run:

            $ {command} my-logical-view-id --instance=my-instance-id --query="SELECT my-column-family2 FROM my-table"

          To enable deletion protection on a logical view, run:

            $ {command} my-logical-view-id --instance=my-instance-id --deletion-protection

          c                    t        j                  | d       | j                  d      }t        j                  |      }|j	                          |j                          t        j                  |       j                          y)z Register flags for this command.z	to updateT)requiredN)r   AddLogicalViewResourceArg	add_groupArgAdderAddDeletionProtectionAddViewQueryAddAsync)parserupdate_group	arg_adders      ,lib/surface/bigtable/logical_views/update.pyArgszUpdateLogicalView.Args.   sf     ''<##T#2L""<0I##%v'')    c                 X    t        j                  ||j                  |j                        S )a  Updates a logical view with the given arguments.

    Args:
      logical_view_ref: A resource reference of the new logical view.
      args: an argparse namespace. All the arguments that were provided to this
        command invocation.

    Returns:
      Long running operation.
    )r   Updatequerydeletion_protection)selflogical_view_refargss      r   _UpdateLogicalViewz$UpdateLogicalView._UpdateLogicalView9   s(     $**d&>&> r   c                 x   |j                   j                  j                         }| j                  ||      }|j                  sHt        j                  |      }t        j                  |dj                  |j                                     S t        j                  |j                         d|j                         y)zThis is what gets called when the user runs this command.

    Args:
      args: an argparse namespace. All the arguments that were provided to this
        command invocation.

    Returns:
      Updated resource.
    zUpdating logical view {0}zlogical view)kindis_asyncN)CONCEPTSlogical_viewParser    async_r   GetOperationRefAwaitLogicalViewformatNamer   UpdatedResource)r   r   r   	operationoperation_refs        r   RunzUpdateLogicalView.RunH   s     }}11779''(8$?I;;**95m""

%
,
,-=-B-B-D
E 
 nt{{ r   N)__name__
__module____qualname____doc__textwrapdedentdetailed_helpstaticmethodr   r    r/    r   r   r	   r	      sC    
 ( /(// 	# 	- * *r   r	   )r3   r4   googlecloudsdk.api_lib.bigtabler   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.bigtabler   googlecloudsdk.corer   UniverseCompatibleReleaseTracksReleaseTrackGABETAALPHAUpdateCommandr	   r8   r   r   <module>rD      s    +  9 0 ( 9 # $++00$2C2C2I2I@** @ @r   