
                             S r SSK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\R                  \R                  " \R                  R                  5       " S	 S
\R                   5      5       5       rg)z%Bigtable memory layer update command.    N)memory_layers)util)base)	arguments)logc                 B    [         R                  " XR                  5      $ )a  Updates a cluster memory layer with the given arguments.

Args:
  cluster_ref: A resource reference of the cluster to update.
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Returns:
  Long running operation.
)r   Updateenable)cluster_refargss     ,lib/surface/bigtable/memory_layers/update.py_UpdateMemoryLayerr      s     
		k;;	77    c                   V    \ rS rSrSrS\R                  " S5      0r\S 5       r	S r
Srg)	UpdateMemoryLayer)   zUpdate a Bigtable memory layer.EXAMPLESz          To enable a memory layer, run:

            $ {command} my-cluster-id --instance=my-instance-id --enable

          To disable a memory layer, run:

            $ {command} my-cluster-id --instance=my-instance-id --disable

          c                 (   [         R                  " U S5        U R                  SS9n[         R                  " U5      R	                  5         [         R                  " U5      R                  5         [         R                  " U 5      R                  5         g)z Register flags for this command.zof the memory layer to updateT)requiredN)r   AddClusterResourceArgadd_mutually_exclusive_groupArgAdderAddMemoryLayerEnableAddMemoryLayerDisableAddAsync)parserupdate_groups     r   ArgsUpdateMemoryLayer.Args;   so     ##F,KL 666EL|$99;|$::<v'')r   c                 f   A UR                   R                  R                  5       n[        X!5      nUR                  (       d?  [
        R                  " U5      n[
        R                  " USUR                  5        S35      $ [        R                  " UR                  5       S-   SUR                  S9  g)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 memory layer for cluster []z/memoryLayerzmemory layer)kindis_asyncN)CONCEPTSclusterParser   async_r   GetOperationRefAwaitMemoryLayerNamer   UpdatedResourceRelativeName)selfr   r   	operationoperation_refs        r   RunUpdateMemoryLayer.RunG   s     	--''--/K";5I;;**95m""
/0@0@0B/C1
E 
   "^3
 r    N)__name__
__module____qualname____firstlineno____doc__textwrapdedentdetailed_helpstaticmethodr   r0   __static_attributes__r2   r   r   r   r   )   s<     ( (// 	# 	- 	* 	*r   r   )r7   r8   googlecloudsdk.api_lib.bigtabler   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.bigtabler   googlecloudsdk.corer   r   UniverseCompatibleReleaseTracksReleaseTrackALPHAUpdateCommandr   r2   r   r   <module>rF      sg    ,  9 0 ( 9 #8 D%%++,5** 5 - 5r   