
                            d Z ddlmZ ddlmZ ddlm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$                         G d de
j&                                      Ze
j                   e
j                  e
j                   j*                         G d de                    Zy)z/Command for spanner instance partitions update.    )absolute_import)division)unicode_literalsN)instance_partition_operations)instance_partitions)base)flags)resource_argsc                   N    e Zd ZdZd ej
                  d      iZed        Zd Z	y)UpdatezhUpdate a Spanner instance partition. You can't update the default instance partition using this command.EXAMPLESaY          To update the display name of a Spanner instance partition, run:

          $ {command} my-instance-partition-id --instance=my-instance-id --description=my-new-display-name

        To update the node count of a Spanner instance partition, run:

          $ {command} my-instance-partition-id --instance=my-instance-id --nodes=1
        c                     t        j                  | d       t        j                  dd      j	                  |        t
        j                  j	                  |        t        j                  | ddd       y)ax  Args is called by calliope to gather arguments for this command.

    Please add arguments in alphabetical order except for no- or a clear-
    pair for that argument which can follow the argument itself.
    Args:
      parser: An argparse parser that you can use to add arguments that go on
        the command line after this command. Positional arguments are allowed.
    	to updateF&Description of the instance partition.requiredtextTparseradd_autoscaling_argsautoscaling_args_hiddenrequire_all_autoscaling_argsNr
   AddInstancePartitionResourceArgr	   DescriptionAddToParserr   
ASYNC_FLAG#AddCapacityArgsForInstancePartitionr   s    1lib/surface/spanner/instance_partitions/update.pyArgszUpdate.Args1   s^     11&+F	Ek&OO'	--! $%*	    c                    t        j                  |j                  j                  j	                         |j
                  |j                  |j                  |j                  |j                  |j                  |j                  |j                  |j                  |j                        }|j                  r|S t!        j"                  |d      S )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:
      Some value that we want to have printed later.
    
descriptionnodesprocessing_unitsautoscaling_min_nodesautoscaling_max_nodes autoscaling_min_processing_units autoscaling_max_processing_units$autoscaling_high_priority_cpu_targetautoscaling_total_cpu_targetautoscaling_storage_targetUpdating instance partitionr   PatchCONCEPTSinstance_partitionParser%   r&   r'   r(   r)   r*   r+   r,   r-   r.   async_r   Awaitselfargsops      r    Runz
Update.RunG   s     
	"	"((..0$$jj.."88"88)-)N)N)-)N)N-1-V-V%)%F%F#'#B#B
B {{i(..
) r"   N)
__name__
__module____qualname____doc__textwrapdedentdetailed_helpstaticmethodr!   r;    r"   r    r   r      s?    
 q /(// # 
-  *r"   r   c                   >    e Zd ZdZej                  Zed        Zd Zy)AlphaUpdatez8Update a Spanner instance partition with ALPHA features.c                     t        j                  | d       t        j                  dd      j	                  |        t
        j                  j	                  |        t        j                  | ddd       y)See base class.r   Fr   r   Tr   Nr   r   s    r    r!   zAlphaUpdate.Argsl   s^     11&+F	Ek&OO'	--! $%*	r"   c                    t        j                  |j                  j                  j	                         |j
                  |j                  |j                  |j                  |j                  |j                  |j                  |j                  |j                  |j                        }|j                  r|S t!        j"                  |d      S )rH   r$   r/   r0   r7   s      r    r;   zAlphaUpdate.Run{   s    		"	"((..0$$jj.."88"88)-)N)N)-)N)N-1-V-V%)%F%F#'#B#B
B {{i(..
) r"   N)r<   r=   r>   r?   r   rC   r!   r;   rD   r"   r    rF   rF   e   s(     ANN' r"   rF   )r?   
__future__r   r   r   r@   googlecloudsdk.api_lib.spannerr   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.spannerr	   r
   DefaultUniverseOnlyReleaseTracksReleaseTrackGABETACommandr   ALPHArF   rD   r"   r    <module>rU      s    6 &  '  H > ( 4 < $++00@T\\ @ @F D%%++,'& ' - 'r"   