
    A                     b   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	 ddl
mZ dd	l
mZ dd
lmZ  e	j                  e	j                   j"                  e	j                   j$                  e	j                   j&                        e	j(                   G d de	j*                                      Zy)z)`gcloud api-gateway apis delete` command.    )absolute_import)division)unicode_literals)apis)
operations)base)operations_util)resource_args)
console_ioc                   0    e Zd ZdZdddZed        Zd Zy)DeletezDeletes an API.z          {description}

          NOTE: All API configs belonging to the API will need to be deleted before
          the API can be deleted.
          z          To delete an API 'my-api', run:

            $ {command} my-api

          NOTE: All API configs belonging to the API will need to be deleted before
          the API can be deleted.
          )DESCRIPTIONEXAMPLESc                 r    t         j                  j                  |        t        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will be deletedT)
positionalN)r   
ASYNC_FLAGAddToParserr
   AddApiResourceArg)parsers    &lib/surface/api_gateway/apis/delete.pyArgszDelete.Args7   s)     	OO'##F,=$O    c                    |j                   j                  j                         }t        j                  dj                  |j                               dddd       t        j                         j                  |      }dj                  |j                               }t        j                  |j                  t        j                         ||j                         S )zRun 'api-gateway apis delete'.

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

    Returns:
      The response from the Delete API call (or None if cancelled).
    zcAre you sure? This will delete the API '{}', along with all of the associated consumer information.zContinue anywayT)messageprompt_stringdefaultthrow_if_unattendedcancel_on_noz"Waiting for API [{}] to be deleted)wait_stringis_async)CONCEPTSapiParser   PromptContinueformatRelativeNamer   	ApiClientr   Namer	   PrintOperationResultnamer   OperationsClientasync_)selfargsapi_refrespwaits        r   Runz
Delete.RunC   s     mm%%'Gvg2245'  >>""7+D/66D //		:..0d r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r2    r   r   r   r      s3     -& 	P 	Pr   r   N)r6   
__future__r   r   r   "googlecloudsdk.api_lib.api_gatewayr   r   googlecloudsdk.callioper   &googlecloudsdk.command_lib.api_gatewayr	   r
   googlecloudsdk.core.consoler   ReleaseTracksReleaseTrackALPHABETAGADefaultUniverseOnlyDeleteCommandr   r9   r   r   <module>rF      s     0 &  ' 3 9 ( B @ 2 D%%++T->->-C-C%%((*?T ? *?r   