
    k                        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ZdZ e
j(                  e
j*                  j,                         G d de
j.                               Zy)z:Command to delete a database migration private connection.    )absolute_import)division)unicode_literals)api_util)private_connections)resource_args)base)flags)log)
console_ioz.Delete a Database Migration private connectionz    To delete a private connection called 'my-private-connection', run:

        $ {command} my-private-connection --region=us-central1


   c                   @    e Zd ZdZeedZed        Zed        Z	d Z
y)Deletez/Delete a Database Migration private connection.)DESCRIPTIONEXAMPLESc                 Z    t        j                  | d       t        j                  |        y)zCommon arguments for all release tracks.

    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.
    z	to deleteN)r   %AddPrivateConnectionDeleteResourceArgpc_flagsAddNoAsyncFlagparsers    <lib/surface/database_migration/private_connections/delete.py
CommonArgszDelete.CommonArgs,   s"     77LF#    c                 .    t         j                  |        y)z@Args is called by calliope to gather arguments for this command.N)r   r   r   s    r   ArgszDelete.Args7   s     fr   c                 T   |j                   j                  j                         }dj                  |j	                               }t        j                  |      syt        j                  | j                               }|j                  |j	                               }t        j                  | j                               }t        j                  | j                               }t        j                  | j                               }|j                  d      rt         j"                  j%                  dj                  |j&                  |j(                               t        j*                  |||j,                  d       t         j"                  j%                  d	j                  |j&                  |j(                               y|j/                  d
|j(                  |j0                  |j2                        }	|j4                  j7                  |j9                  |	j:                              S )a$  Delete a Database Migration private connection.

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

    Returns:
      A dict object representing the operations resource describing the delete
      operation if the delete was successful.
    z<You are about to delete private_connection {}.
Are you sure?)messageN)release_trackno_asyncz;Waiting for private connection [{}] to be deleted with [{}]T)no_resourcez"Deleted private connection {} [{}]z+datamigration.projects.locations.operations)operationsId
projectsIdlocationsId)name)CONCEPTSprivate_connectionParseformatRelativeNamer   PromptContinuer   PrivateConnectionsClientReleaseTrackr   r   GetClientInstanceGetMessagesModuleGetResourceParserIsKnownAndSpecifiedr   statusPrintprivateConnectionsIdr$   	HandleLRO%projects_locations_privateConnectionsCreater"   r#   projects_locations_operationsGet2DatamigrationProjectsLocationsOperationsGetRequestr!   )
selfargsprivate_connection_refdelete_warning	pc_clientresult_operationclientmessagesresource_parseroperation_refs
             r   Runz
Delete.Run<   s    "]]==CCE&&,f0==?'A  $$^<#<<'')+I ''(>(K(K(MN''(9(9(;<F))$*;*;*=>H001B1B1DEO
+	jj
G
N
N$99##%&
 



6
6	 
jj;BB
 
5
57G7L7LN O#**5%**)44*66	 + 8M //33CC++ 	D 	-. .r   N)__name__
__module____qualname____doc__r   r   detailed_helpstaticmethodr   r   rD    r   r   r   r   '   s:    7"-8D-$ $  3.r   r   N)rH   
__future__r   r   r   )googlecloudsdk.api_lib.database_migrationr   r   r   googlecloudsdk.callioper	   Agooglecloudsdk.command_lib.database_migration.private_connectionsr
   r   googlecloudsdk.corer   googlecloudsdk.core.consoler   r   r   ReleaseTracksr,   GACommandr   rK   r   r   <module>rU      sp    A &  ' > I C ( _ # 2> D%%(()G.T\\ G. *G.r   