
                         ^   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  SSKJr  SSKJr  SSKJr  Sr\
R4                  " \
R6                  R8                  5       " S S\R:                  \
R<                  5      5       rg)zdeployments delete command.    )absolute_import)division)unicode_literals)
exceptions)dm_api_util)dm_base)apis)base)dm_util)dm_write)flags)
properties)
console_ioi  c                       \ rS rSrSrSS0r\R                  " \R                  " SS5      R                  R                  5      r\S 5       rS rS	rg
)Delete*   z^Delete a deployment.

This command deletes a deployment and deletes all associated resources.
EXAMPLESao  
To delete a deployment, run:

  $ {command} my-deployment

To issue a delete command without waiting for the operation to complete, run:

  $ {command} my-deployment --async

To delete several deployments, run:

  $ {command} my-deployment-one my-deployment-two my-deployment-three

To disable the confirmation prompt on delete, run:

  $ {command} my-deployment -q
deploymentmanagerv2c                     U R                  SSSS9  [        R                  R                  R	                  U 5        [
        R                  " U 5        g)zArgs is called by calliope to gather arguments for this command.

Args:
  parser: An argparse parser that you can use to add arguments that go
      on the command line after this command. Positional arguments are
      allowed.
deployment_name+zDeployment name.)nargshelpN)add_argumentr   _delete_policy_flag_map
choice_argAddToParserr   AddAsyncFlag)parsers    4lib/surface/deployment_manager/deployments/delete.pyArgsDelete.ArgsI   sC     );MN
""--99&A	v    c           
         SSR                  UR                  5      -   nUR                  (       d0  [        R                  " USS9(       d  [
        R                  " S5      e/ n/ nUR                   GH  nU R                  R                  US[        R                  R                  R                  R                  0SS9n U R                  R                  R!                  U R"                  R%                  [&        R(                  " 5       UR*                  [         R,                  R/                  UR0                  5      S	95      nUR2                  (       a  UR5                  U5        M  UR6                  n [8        R:                  " U R                  U R"                  US
[&        R(                  " 5       [<        S9n[>        R@                  " US5        U R                  RD                  RG                  U R"                  RI                  [&        R(                  " 5       US95      n
UR5                  U
5        GM     U(       a  [V        RX                  " U5      eU$ ! [
        R                   a>  n	UR5                  [
        R                  " SRC                  X5      5      5         Sn	A	NSn	A	ff = f! [J        RL                   a@  nUR5                  [N        RP                  " U[R        RT                  5      5         SnAGM  SnAff = f)aU  Run 'deployments delete'.

Args:
  args: argparse.Namespace, The arguments that this command was invoked
      with.

Returns:
  If --async=true, returns Operation to poll.
  Else, returns boolean indicating whether insert operation succeeded.

Raises:
  HttpException: An http error response was received while executing api
      request.
z-The following deployments will be deleted:
- z
- F)messagedefaultzDeletion aborted by user.projectzdeploymentmanager.deployments)params
collection)r(   
deploymentdeletePolicydelete)timeoutr   z Delete operation {0} failed.
{1}N)r(   	operation)-joinr   quietr   PromptContinuer   OperationError	resourcesParser   VALUEScorer(   	GetOrFailclientdeploymentsr   messages)DeploymentmanagerDeploymentsDeleteRequestr   
GetProjectr+   r   GetEnumForChoicedelete_policyasync_appendnamer   WaitForOperationOPERATION_TIMEOUTr   LogOperationStatusformat
operationsGet%DeploymentmanagerOperationsGetRequestapitools_exceptions	HttpErrorapi_exceptionsHttpExceptionr   HTTP_ERROR_FORMATcore_exceptions
MultiError)selfargsprompt_messagerG   errorsr   deployment_refr/   op_nameecompleted_operationerrors               r!   Run
Delete.RunV   sp    GD$8$89:N::&&~uM''(CDDJF//~~++
Z..33;;EEF4 , 6n#3KK++22MMCC**,)44$<<..t/A/AB	 D 
	 ;;


I
&NN'I 11""$)+I &&y(; !% 6 6 : :mmAA!,,.# B !
 

/
0K 0T &&v..! ** IMM*333::7FH I II !** 3n22;002 	3 	33sK   >B$J&$J&1AIA!J&J#%4JJ&J##J&&K::4K55K: N)__name__
__module____qualname____firstlineno____doc__detailed_helpr   GetDeleteFlagEnumMapr	   GetMessagesModuler<   DeletePolicyValueValuesEnumr   staticmethodr"   rZ   __static_attributes__r\   r$   r!   r   r   *   sc      -( "66148112M2MP 
 
Cr$   r   N) ra   
__future__r   r   r   apitools.base.pyr   rJ   )googlecloudsdk.api_lib.deployment_managerr   r   googlecloudsdk.api_lib.utilr	   rL   googlecloudsdk.callioper
   -googlecloudsdk.command_lib.deployment_managerr   r   r   googlecloudsdk.corerO   r   googlecloudsdk.core.consoler   rD   UseDmApiDmApiVersionV2DeleteCommand	DmCommandr   r\   r$   r!   <module>ru      s     " &  ' > A = @ , D ( A B ? = * 2   	'&&))*nT!2!2 n +nr$   