
                         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&                  j*                        ej,                   G d dej.                                      Zy)zICommand for creating or replacing an application from YAML specification.    )absolute_import)division)unicode_literals)base)pretty_print)deprecation_util)flags)messages_util)run_apps_operations)
exceptions)
console_ioc                   0    e Zd ZdZdddZed        Zd Zy)Deletez<Delete a Cloud Run Integration and its associated resources.z"          {description}
          z          To delete a redis integration and the associated resources

              $ {command} my-redis-integration

         )DESCRIPTIONEXAMPLESc                 X    t        j                  |       t        j                  |       y)z\Set up arguments for this command.

    Args:
      parser: An argparse.ArgumentParser.
    N)r	   AddNamePositionalArgAddServiceAccountArg)clsparsers     &lib/surface/run/integrations/delete.pyArgszDelete.Args0   s      
v&	v&    c                    t        j                          t        j                          |j                  }| j	                         }t        j                  dj                  |      dd       t        j                  ||      5 }|j                          	 |j                  |      }t        j                  d       t        j                  t        j                   ||d             	 ddd       y# t"        j$                  $ r/}t        j                  t        j&                  |             |d}~ww xY w# 1 sw Y   yxY w)	zDelete a Cloud Run Integration.z_Integration [{}] will be deleted. This will also delete any resources this integration created.T)messagethrow_if_unattendedcancel_on_no)name deleted)integration_typeintegration_nameactionN)r   CheckIfEndOfSaleAppliesDeprecationNoticer   ReleaseTrackr   PromptContinueformatr   ConnectVerifyLocationDeleteIntegrationr   InfoSuccessr
   GetSuccessMessager   IntegrationsOperationErrorGetDeleteErrorMessage)selfargsr"   release_trackclientr!   errs          r   Runz
Delete.Run:   s   ,,.&&(yy%%'ML
&!
"  
	$	$T=	9V
!339I3J
 	"++!1!1 	
 
:	9 22 -==>NOP		 
:	9s1   D5C0&A D50D2*D--D22D55D>N)__name__
__module____qualname____doc__detailed_helpclassmethodr   r6    r   r   r   r      s2     E	
- ' '
r   r   N)r:   
__future__r   r   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.runr   +googlecloudsdk.command_lib.run.integrationsr   r	   r
   r   "googlecloudsdk.command_lib.runappsr   googlecloudsdk.core.consoler   ReleaseTracksr&   ALPHABETADefaultUniverseOnlyCommandr   r=   r   r   <module>rI      s    P &  ' ( 7 H = E K 9 2 D%%++T->->-C-CD8
T\\ 8
  E8
r   