
    #
                     z    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
  G d d	ej                        Zy
)zThe configs update command.    )absolute_import)division)unicode_literals)util)base)logc                   .    e Zd ZdZddiZed        Zd Zy)UpdatezyUpdate runtime-config resources.

  This command updates the runtime-config resource with the specified
  description.
  EXAMPLESa
  
          To update a runtime-config resource's description, run:

            $ {command} --description="My new description" my-config

          To remove a runtime-config resource's description, run:

            $ {command} --description="" my-config
          c                 R    | j                  ddd       | j                  dd       y)	zArgs is called by calliope to gather arguments for this command.

    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.
    z--descriptionz)The new description of the configuration.T)helprequirednamezThe configuration name.)r   N)add_argument)parsers    ,lib/surface/runtime_config/configs/update.pyArgszUpdate.Args.   s6     8  
 %>?    c                 X   t        j                         }t        j                         }t        j                  |j                        }|j                  |j                  |j                         |j                              }t        j                  |       t        j                  |      S )a/  Run 'runtime-configs update'.

    Args:
      args: argparse.Namespace, The arguments that this command was invoked
          with.

    Returns:
      The updated runtime-config resource.

    Raises:
      HttpException: An http error response was received while executing api
          request.
    )r   description)r   ConfigClientMessagesParseConfigNamer   r
   RuntimeConfigRelativeNamer   r   UpdatedResourceFormatConfig)selfargsconfig_clientmessagesconfig_resourceresults         r   Runz
Update.Run>   s     %%'M}}H**4995O!! --/(( 	 	
F (V$$r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r$    r   r   r
   r
      s3      
- @ @%r   r
   N)r(   
__future__r   r   r   %googlecloudsdk.api_lib.runtime_configr   googlecloudsdk.callioper   googlecloudsdk.corer   UpdateCommandr
   r+   r   r   <module>r1      s.     " &  ' 6 ( #>%T >%r   