
                         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 create 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)CreatezCreate runtime-config resources.

  This command creates a new runtime-config resource with the specified name
  and optional description.
  EXAMPLESa   
          To create a runtime-config resource named "my-config", run:

            $ {command} my-config

          To create a runtime-config resource named "my-config" with a
          description, run:

            $ {command} --description="my new configuration" my-config
          c                 P    | j                  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--descriptionz4Optional description of the runtime-config resource.)helpnamez!The runtime-config resource name.N)add_argument)parsers    ,lib/surface/runtime_config/configs/create.pyArgszCreate.Args/   s4     C  E %HI    c           	         t        j                         }t        j                         }t        j                  |j                        }|j
                  }|j                  |j                  t        j                  |      |j                  |j                         |j                                    }t        j                  |       t        j                  |      S )a+  Run 'runtime-configs create'.

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

    Returns:
      The new runtime-config resource.

    Raises:
      HttpException: An http error response was received while executing api
          request.
    )r   description)parentruntimeConfig)r   ConfigClientMessagesParseConfigNamer   
projectsIdr
   )RuntimeconfigProjectsConfigsCreateRequestProjectPathRuntimeConfigRelativeNamer   r   CreatedResourceFormatConfig)selfargsconfig_clientmessagesconfig_resourceprojectresults          r   Runz
Create.Run>   s     %%'M}}H**4995O((G!!::##G,"00$113 ,, 1  	; 	
F (V$$r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r)    r   r   r
   r
      s3      	- J J%r   r
   N)r-   
__future__r   r   r   %googlecloudsdk.api_lib.runtime_configr   googlecloudsdk.callioper   googlecloudsdk.corer   CreateCommandr
   r0   r   r   <module>r6      s0     " &  ' 6 ( #B%T B%r   