
    s                         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 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*                   G d dej,                               Zy)z Command for deleting executions.    )absolute_import)division)unicode_literals)base)connection_context)deletion)flags)pretty_print)resource_args)serverless_operations)concept_parsers)presentation_specs)log)
console_ioc                   @    e Zd ZdZdddZed        Zed        Zd Zy)	DeleteDelete an execution.z#
          {description}
          zU
          To delete an execution:

              $ {command} my-execution
          )DESCRIPTIONEXAMPLESc                     t        j                  dt        j                         ddd      }t	        j
                  | d       t        j                  |g      j                  |        y )N	EXECUTIONzExecution to delete.TF)requiredprefixes)default_async_for_cluster)	r   ResourcePresentationSpecr   GetExecutionResourceSpecr	   AddAsyncFlagr   ConceptParserAddToParser)parserexecution_presentations     )lib/surface/run/jobs/executions/delete.py
CommonArgszDelete.CommonArgs1   s_    /HH..0 
$ !!#9":;GGO    c                 .    t         j                  |        y )N)r   r#   )r    s    r"   ArgszDelete.Args?   s    
fr$   c                    t        j                  |t        j                  j                  | j                               }|j                  j                  j                         }t        j                  dj                  |j                        dd       t        j                  |      5 }t        j                   ||j"                  |j$                  |j&                         ddd       |j&                  r/t)        j*                  dj                  |j                               yt-        j.                  |j                  d       y# 1 sw Y   exY w)r   zExecution [{}] will be deleted.T)messagethrow_if_unattendedcancel_on_noNz Execution [{}] is being deleted.	execution)r   GetConnectionContextr	   ProductRUNReleaseTrackCONCEPTSr+   Parser   PromptContinueformatexecutionsIdr   Connectr   r   GetExecutionDeleteExecutionasync_r
   Successr   DeletedResource)selfargsconn_contextex_refclients        r"   Runz
Delete.RunC   s    %::emm!2!2!4L ]]$$**,F1889L9LM  
	&	&|	4oo
&%%v'='=t{{ 
5 {{
,
3
3F4G4G
H 
&--{; 
5	4s   (7EEN)	__name__
__module____qualname____doc__detailed_helpstaticmethodr#   r&   r@    r$   r"   r   r   "   sE    		- P P  <r$   r   N)rD   
__future__r   r   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.runr   r   r	   r
   r   r   (googlecloudsdk.command_lib.util.conceptsr   r   googlecloudsdk.corer   googlecloudsdk.core.consoler   UniverseCompatibleCommandr   rG   r$   r"   <module>rP      sY    ' &  ' ( = 3 0 7 8 @ D G # 2 6<T\\ 6< 6<r$   