
    %                     P   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  ej*                  ej,                  j.                  ej,                  j0                        ej2                   G d dej4                                      Zy)Deletes a Backup Plan.    )absolute_import)division)unicode_literals)
exceptions)util)BackupPlansClient)base)flags)log)
console_ioc                   2    e Zd ZdZddddZed        Zd Zy)	Deleter   zDeletes a specific backup planz{description}z        To delete a backup plan `sample-backup-plan` in project `sample-project` and location `us-central1` , run:

          $ {command} sample-backup-plan --project=sample-project --location=us-central1
        )BRIEFDESCRIPTIONEXAMPLESc                     t         j                  j                  |        t         j                  j                  | d       t	        j
                  | d       y)zySpecifies additional command flags.

    Args:
      parser: argparse.Parser: Parser object for command line inputs.
    Tz!Name of the backup plan to deleteN)r
   
ASYNC_FLAGAddToParser
SetDefaultr   AddBackupPlanResourceArg)parsers    ,lib/surface/backup_dr/backup_plans/delete.pyArgszDelete.Args.   s>     	OO'OOvt,	""+    c                 n   t               }|j                  }|j                  j                  j	                         }t        j                  ddd       	 |j                  |      }|rPt        j                  |j!                         ddt        j"                  j%                  |j&                               |S |j)                  |j+                  |      dj%                  |j!                               d	      S # t        j                  $ r*}t        j                  |t        j                        |d}~ww xY w)
zConstructs and sends request.

    Args:
      args: argparse.Namespace, An object that contains the values for the
        arguments specified in the .Args() method.

    Returns:
      ProcessHttpResponse of the request made.
    z=The backup plan will be deleted. You cannot undo this action.T)messagedefaultcancel_on_noNzbackup plan)kindis_asyncdetailszGDeleting backup plan [{}]. (This operation could take up to 2 minutes.)F)operation_refr   
has_result)r	   async_CONCEPTSbackup_planParser   PromptContinuer   apitools_exceptions	HttpErrorr   HttpExceptionr   HTTP_ERROR_FORMATr   DeletedResourceRelativeNameASYNC_OPERATION_MESSAGEformatnameWaitForOperationGetOperationRef)selfargsclientr!   r'   	operationes          r   Runz
Delete.Run<   s     F{{H--++113KKG--,i 	

"
"
$..55innE	  "",,Y7;VK,,./ #   (( G$$Q(>(>?QFGs   C7 7D4
%D//D4N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r:    r   r   r   r      s4      0$-  -r   r   N)r>   
__future__r   r   r   apitools.base.pyr   r*   googlecloudsdk.api_lib.backupdrr   ,googlecloudsdk.api_lib.backupdr.backup_plansr	   googlecloudsdk.api_lib.utilgooglecloudsdk.callioper
   #googlecloudsdk.command_lib.backupdrr   googlecloudsdk.corer   googlecloudsdk.core.consoler   ReleaseTracksReleaseTrackALPHAGADefaultUniverseOnlyDeleteCommandr   rA   r   r   <module>rQ      s     &  ' > 0 J 2 ( 5 # 2 D%%++T->->-A-ABHT H  CHr   