
    f
                         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  G d dej&                        Zy)z)Command to delete a Data Fusion instance.    )absolute_import)division)unicode_literals)
datafusion)waiter)base)operation_poller)resource_args)log)
console_ioc                   &    e Zd ZdZed        Zd Zy)Deletea  Deletes a Cloud Data Fusion instance.

  If run asynchronously with `--async`, exits after printing an operation
  that can be used to poll the status of the creation operation via:

    {command} operations list

  ## EXAMPLES

  To delete instance `my-instance` in project `my-project` and location
  `my-location`, run:

    $ {command} my-instance --project=my-project --location=my-location
  c                 n    t        j                  | d       t        j                  j	                  |        y )NzInstance to delete.)r
   AddInstanceResourceArgr   
ASYNC_FLAGAddToParser)parsers    +lib/surface/data_fusion/instances/delete.pyArgszDelete.Args.   s%    ((1FGOO'    c                    t        j                         }|j                  j                  j	                         }|j                         }|j                  j                  |j                               }t        j                  dj                  |      ddd       |j                  j                  j                  |      }t        j                  j!                  dj                  |j                         |j"                               |j$                  r|S t'        j(                  t+        j,                         |j"                  dj                  |j"                               y )N)namez'{0}' will be deletedTzDeletion aborted by user.)messagecancel_on_nocancel_stringthrow_if_unattendedz$Deleting [{0}] with operation [{1}].z;Waiting for [{}] to complete. This may take several minutes)df
DatafusionCONCEPTSinstanceParseRelativeNamemessages1DatafusionProjectsLocationsInstancesDeleteRequestr   PromptContinueformatclientprojects_locations_instancesr   r   statuswriter   async_r   WaitForr	   OperationPoller)selfargsr   instance_refr   req	operations          r   Runz
Delete.Run3   s   J==))//1L$$&D



O
O&&( P *C '..t41 	" !!>>EEcJIJJ;BB!!#Y^^5 6 {{nn

*
*
,inn
G
N
Nnnr   N)__name__
__module____qualname____doc__staticmethodr   r3    r   r   r   r      s      ( (r   r   N)r7   
__future__r   r   r   "googlecloudsdk.api_lib.data_fusionr   r   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   &googlecloudsdk.command_lib.data_fusionr	   r
   googlecloudsdk.corer   googlecloudsdk.core.consoler   DeleteCommandr   r9   r   r   <module>rB      s:    0 &  ' ? . ( C @ # 2.T .r   