
    p
                     Z   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	d
Zd Z ej                   ej"                  j$                  ej"                  j&                  ej"                  j(                        ej*                   G d dej,                                      Zy)zDeletes(n >= 0) Delivery Pipeline(s), Target(s), Custom Target Type(s), Deploy Policy(ies), and Automation(s) with current project's Cloud Deploy service..    )deploy)
exceptions)base)flags)resource_args)yamlz{description}z     To delete the resources in a Cloud Deploy YAML file `deploy.yaml`:

       $ {command} --file=deploy.yaml --region=us-central1

  )DESCRIPTIONEXAMPLESc                     t        j                  |        t        j                  | d       t        j                  |        y)zRegister flags for this command.

  Args:
    parser: An argparse.ArgumentParser-like object. It is mocked out in order to
      capture some information, but behaves like an ArgumentParser.
  zYIf true, the delivery pipeline and its sub-resources (releases and rollouts) are deleted.N)r   AddConfigFileAddForcer   AddLocationResourceArgparsers    lib/surface/deploy/delete.py_CommonArgsr   '   s7     f.. ?@ &&v.    c                   h    e Zd ZdZeZed        Z ej                  e
j                        d        Zy)DeletezjDeletes Delivery Pipeline(s), Target(s), Custom Target Type(s), and Automation(s) in a yaml configuration.c                     t        |        y )N)r   r   s    r   ArgszDelete.Args>   s
    r   c                 $   t        t        j                  |j                              }t	        j
                         }|j                  j                  j                         }|j                         d   }|j                  |||j                         y)z9This is what gets called when the user runs this command.locationsIdN)listr   load_all_pathfiler   DeployClientCONCEPTSregionParseAsDictDeleteResourcesforce)selfargsloaded_yamldeploy_client
region_refr   s         r   Runz
Delete.RunB   sl    
 t))$))45K'')M%%++-J /F!!+vtzzBr   N)__name__
__module____qualname____doc___DETAILED_HELPdetailed_helpstaticmethodr   gcloud_exception CatchHTTPErrorRaiseHTTPExceptiondeploy_exceptionsHTTP_ERROR_FORMATr)    r   r   r   r   5   sL    
 s -  544))CCr   r   N)r-   "googlecloudsdk.api_lib.clouddeployr   googlecloudsdk.api_lib.utilr   r1   googlecloudsdk.callioper   !googlecloudsdk.command_lib.deployr3   r   r   googlecloudsdk.corer   r.   r   ReleaseTracksReleaseTrackALPHABETAGADefaultUniverseOnlyUpdateCommandr   r5   r   r   <module>rB      s    b 6 F ( M 3 ; $ 			
/ T..33T5F5F5I5I CT C Cr   