
    1                         S r SSKJr  SSKJr  SSKJr  SSKJ	r	  SSK
Jr  SSK
Jr  SSK
Jr  SSKJr  SS	KJr  S
S0r " S S\	R(                  5      rg)z!Command to delete an environment.    )
exceptions)environments_util)base)delete_util)resource_args)util)log)
console_ioEXAMPLESzq          To delete the environment named ``environment-1'', run:

            $ {command} environment-1
        c                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)Delete(   a  Delete one or more Cloud Composer environments.

Environments cannot be deleted unless they are in one of the RUNNING or
ERROR states. If run asynchronously with `--async`, exits after printing
one or more operation names that can be used to poll the status of the
deletion(s) via:

  {top_command} composer operations describe

If any of the environments are already in the process of being deleted,
the original deletion operations are waited on (default) or printed
(`--async`).
c                 r    [         R                  " U SSSSS9  [        R                  R	                  U 5        g )Nz	to deleteT)pluralrequired
positional)r   AddEnvironmentResourceArgr   
ASYNC_FLAGAddToParser)parsers    +lib/surface/composer/environments/delete.pyArgsDelete.Args9   s.    ++D4DJOO'    c                     UR                   R                  R                  5       n[        R                  " [
        R                  " SU Vs/ s H)  nSR                  UR                  UR                  5      PM+     sn5      SSSS9  [        R                  " U R                  5       S9nSnU H  nS nS nS n [        R                  " X0R                  5       S9nSR                  UR                  5      nUR!                  UR#                  5       US	9  [0        R2                  " UR#                  5       S
SUUS9  M     UR4                  (       d  UR7                  5       =(       d    UnU(       a  [
        R8                  " S5      eg s  snf ! [$        R&                   a6  n	[(        R*                  " U	5      R,                  R.                  nSn S n	A	NS n	A	ff = f! [0        R2                  " UR#                  5       S
SUUS9  f = f)Nz%Deleting the following environments: z[{}] in [{}]TzDeletion aborted by user.)messagecancel_on_nocancel_stringthrow_if_unattended)release_trackFzwith operation [{0}])environment_name	operationenvironment)kindis_asyncdetailsfailedzSome requested deletions did not succeed. Please, refer to https://cloud.google.com/composer/docs/how-to/managing/updating and Composer Delete Troubleshooting pages to resolve this issue.)CONCEPTSenvironmentsParser
   PromptContinuecommand_utilConstructListformatenvironmentsIdlocationsIdr   EnvironmentDeletionWaiterReleaseTrackenvironments_api_utilr   nameAddPendingDeleteRelativeNameapitools_exceptions	HttpErrorr   HttpExceptionpayloadstatus_messager	   DeletedResourceasync_WaitEnvironmentDeleteError)
selfargsenv_refsenv_refwaiterencountered_errorsr"   r'   r&   es
             r   Run
Delete.Run?   s   }}))//1H**3  (6  (G %%g&<&<&-&9&9;'6 1 	" 22'')+Fifg)00#4#4#68	 )//	?$113y 	  	J 	  "	 , ;;!;;=>,>//MN N I6& !** "))!,44CC!" 	  "	s6   
0F6"F9GG,GGGG(G= N)__name__
__module____qualname____firstlineno____doc__DETAILED_HELPdetailed_helpstaticmethodr   rG   __static_attributes__rI   r   r   r   r   (   s&      -( (
-Nr   r   N)rN   apitools.base.pyr   r7   googlecloudsdk.api_lib.composerr   r3   googlecloudsdk.api_lib.utilgooglecloudsdk.callioper   #googlecloudsdk.command_lib.composerr   r   r   r,   googlecloudsdk.corer	   googlecloudsdk.core.consoler
   rO   DeleteCommandr   rI   r   r   <module>r[      sN    ( ? V 2 ( ; = D # 2 	DNT DNr   