
                             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  G d	 d
ej                        Zy)z<Command to undeploy an Apigee API proxy from an environment.    )absolute_import)division)unicode_literals)apigee)base)defaults)resource_argsc                   .    e Zd ZdZddiZed        Zd Zy)Undeployz1Undeploy an Apigee API proxy from an environment.EXAMPLESaj    To undeploy an API proxy called ``my-api'' from the ``test'' environment of
  the active Cloud Platform project, run:

    $ {command} --environment=test --api=my-api

  To undeploy revision 3 of an `my-api` from the `test` environment of the
  organization named ``test-org'', run:

    $ {command} 3 --organization=test-org --environment=test --api=my-api
  c                     dddd}t        j                         t        j                  dd      g}t        j                  | dd||	       y )
NzAPI proxy to be undeployed. Must currently be deployed. To get a list of available deployed proxies, run `{{grandparent_command}} deployments list --environment=ENV`.zEnvironment from which to undeploy the API proxy. To get a list of available environments, run `{{grandparent_command}} environments list`.z1Apigee organization of the proxy and environment.)apienvironmentorganizationrevisionautoz%organization.environment.api.revisiona  API proxy revision to be undeployed and environment from which it should be removed.

Revisions can either be a positive revision number, or the special value ``auto'', which will undeploy whatever revision is currently deployed. If revision is unspecified, the default is ``auto''.)fallthroughs
help_texts)r   !GCPProductOrganizationFallthroughStaticFallthroughr	   AddSingleResourceArgument)parser	help_textr   s      #lib/surface/apigee/apis/undeploy.pyArgszUndeploy.Args+   sb    OF LI >>@..z6BDL++7	I
 "i9    c                     |j                   j                  j                         j                         }|d   dk(  r|d= t	        j
                  |       t        j                  j                  |      S )zRun the undeploy command.revisionsIdr   )	CONCEPTSr   ParseAsDictr   FallBackToDeployedProxyRevisionr   
APIsClientr   )selfargsidentifierss      r   RunzUndeploy.RunB   s]    --((..0779K=!V+
m
$..{;%%k22r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r'    r   r   r   r      s/    9 
- 9 9,3r   r   N)r+   
__future__r   r   r   googlecloudsdk.api_libr   googlecloudsdk.callioper   !googlecloudsdk.command_lib.apigeer   r	   SilentCommandr   r.   r   r   <module>r4      s2    C &  ' ) ( 6 ;/3t!! /3r   