
    	                     |   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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,Deletes a Gcloud Deploy Automation resource.    N)client_util)
exceptions)base)automation_util)resource_args)
console_ioz{description}z        To delete an automation `test-automation` for delivery pipeline `test-pipeline`, in region `us-central1`, run:

          $ {command} test-automation --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)Deletez"Deletes a Cloud Deploy Automation.c                 2    t        j                  | d       y )NT)
positional)r   AddAutomationResourceArg)parsers    (lib/surface/deploy/automations/delete.pyArgszDelete.Args.   s    **6dC    c                 (   t        j                  dd       |j                  j                  j	                         }t        j                  |j                               }t        j                         j                  |j                         |id       y)zEntry point of the delete command.

    Args:
      args: argparse.Namespace, An object that contains the values for the
        arguments specified in the .Args() method.
    z6Once an automation is deleted, it cannot be recovered.T)prompt_stringcancel_on_noz$Deleted Cloud Deploy automation: {}.N)r   PromptContinueCONCEPTS
automationParser   DeleteAutomationRelativeNamer   OperationsClientCheckOperationStatus)selfargsautomation_refops       r   Runz
Delete.Run2   sv     N ]]--335N		)	).*E*E*G	HB  "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    
 + -D D 544))r   r   )r'   textwrap"googlecloudsdk.api_lib.clouddeployr   googlecloudsdk.api_lib.utilr   r+   googlecloudsdk.callioper   !googlecloudsdk.command_lib.deployr   r-   r   googlecloudsdk.core.consoler   dedentr(   ReleaseTracksReleaseTrackALPHABETAGADefaultUniverseOnlyDeleteCommandr   r/   r   r   <module>r>      s    3  : F ( = M ; 2 # !  T..33T5F5F5I5I T  r   