
                             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KJr  SSKJr  SSKJr  SSKJr  \R&                   " S S\R(                  5      5       rg)z!Command for canceling executions.    )absolute_import)division)unicode_literals)base)cancellation)connection_context)flags)pretty_print)resource_args)serverless_operations)concept_parsers)presentation_specs)
console_ioc                   H    \ rS rSrSrSSS.r\S 5       r\S 5       rS r	S	r
g
)Cancel!   Cancel an execution.z#
          {description}
          zU
          To cancel an execution:

              $ {command} my-execution
          )DESCRIPTIONEXAMPLESc                     [         R                  " S[        R                  " 5       SSSS9n[        R
                  " U SS9  [        R                  " U/5      R                  U 5        g )N	EXECUTIONzExecution to cancel.TF)requiredprefixes)default_async_for_cluster)	r   ResourcePresentationSpecr   GetExecutionResourceSpecr	   AddAsyncFlagr   ConceptParserAddToParser)parserexecution_presentations     )lib/surface/run/jobs/executions/cancel.py
CommonArgsCancel.CommonArgs0   s_    /HH..0 
$ !!#9":;GGO    c                 .    [         R                  U 5        g )N)r   r#   )r    s    r"   ArgsCancel.Args>   s    
fr%   c                    [         R                  " U[        R                  R                  U R                  5       5      nUR                  R                  R                  5       n[        R                  " SR                  UR                  5      SSS9  [        R                  " U5       n[        R                   " X4R"                  UR$                  UR&                  5        SSS5        UR&                  (       a0  [(        R*                  " SR                  UR                  5      5        g[(        R*                  " SR                  UR                  5      5        g! , (       d  f       N= f)r   z!Execution [{}] will be cancelled.T)messagethrow_if_unattendedcancel_on_noNz"Execution [{}] is being cancelled.zCancelled execution [{}].)r   GetConnectionContextr	   ProductRUNReleaseTrackCONCEPTS	executionParser   PromptContinueformatexecutionsIdr   Connectr   r   GetExecutionCancelExecutionasync_r
   Success)selfargsconn_contextex_refclients        r"   Run
Cancel.RunB   s   %::emm!2!2!4L ]]$$**,F3::6;N;NO  
	&	&|	4
%%v'='=t{{ 
5 {{
.
5
5f6I6I
J 
%
,
,V-@-@
A 
5	4s   (7E
E& N)__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr#   r'   rA   __static_attributes__rC   r%   r"   r   r   !   sE    		- P P  r%   r   N)rH   
__future__r   r   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.runr   r   r	   r
   r   r   (googlecloudsdk.command_lib.util.conceptsr   r   googlecloudsdk.core.consoler   UniverseCompatibleCommandr   rC   r%   r"   <module>rS      sV    ( &  ' ( 7 = 0 7 8 @ D G 2 8T\\ 8 8r%   