
    F                     p   d Z ddl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 ej                  d	      d
Z ej                   ej"                  j$                  ej"                  j&                  ej"                  j(                        ej*                   G d dej,                                      Zy)z%Cancels a Cloud Deploy AutomationRun.    N)automation_run)
exceptions)base)resource_args)logz{description}z     To cancel an AutomationRun `test-run` for delivery pipeline `test-pipeline`
     in region `us-central1`, run:

      $ {command} test-run --delivery-pipeline=test-pipeline
      --region=us-central1
      )DESCRIPTIONEXAMPLESc                   h    e Zd ZdZeZed        Z ej                  e
j                        d        Zy)Cancelz&Cancels a Cloud Deploy Automation Run.c                 2    t        j                  | d       y )NT)
positional)r   AddAutomationRunResourceArg)parsers    ,lib/surface/deploy/automation_runs/cancel.pyArgszCancel.Args0   s    --fF    c                 $   |j                   j                  j                         }t        j                  j                  dj                  |j                                      t        j                         j                  |j                               S )NzCancelling automation run {}.
)
CONCEPTSr   Parser   statusPrintformatRelativeNameAutomationRunsClientr   )selfargsautomation_run_refs      r   Runz
Cancel.Run4   ss     55;;=JJ)00++-	
 ..077'') r   N)__name__
__module____qualname____doc___DETAILED_HELPdetailed_helpstaticmethodr   gcloud_exception CatchHTTPErrorRaiseHTTPExceptiondeploy_exceptionsHTTP_ERROR_FORMATr    r   r   r   r   '   sK    
 / -G G 544))

r   r   )r"   textwrap"googlecloudsdk.api_lib.clouddeployr   googlecloudsdk.api_lib.utilr   r&   googlecloudsdk.callioper   !googlecloudsdk.command_lib.deployr(   r   googlecloudsdk.corer   dedentr#   ReleaseTracksReleaseTrackALPHABETAGADefaultUniverseOnlyCreateCommandr   r*   r   r   <module>r9      s    ,  = F ( M ; # # !
 	 T..33T5F5F5I5I T  r   