
    	                         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  e
j"                  e
j$                  j&                         G d de
j(                               Zy)zSessions delete command.    )absolute_import)division)unicode_literals)dataproc)util)base)flags)log)
console_ioc                   .    e Zd ZdZddiZed        Zd Zy)DeletezDelete a session.EXAMPLESz          To delete a "my-session" session in the "us-central1" location, run:

            $ {command} my-session --location=us-central1
          c                     t         j                  j                  |        t        j                  |        t        j                         }t        j                  | d|j                         y )Ndelete)	r   
ASYNC_FLAGAddToParserr	   AddTimeoutFlagdpDataprocAddSessionResourceArgapi_version)parserr   s     'lib/surface/dataproc/sessions/delete.pyArgszDelete.Args*   sE    OO'	 {{}H	(2F2FG    c                    t        j                         }|j                  j                  j	                         }t        j                  dj                  |j                               dd       |j                  j                  |j                               }|j                  j                  j                  |      }|j                  r>t         j"                  j%                  dj                  |j                                      |S t'        j(                  ||dj                  |j                               |j*                        }t!        j,                  |j                                |S )	Nz"The session '{0}' will be deleted.TzDeletion canceled by user.)messagecancel_on_nocancel_string)namezDeleting session '{0}'z$Waiting for session '{0}' to delete.)r   	timeout_s)r   r   CONCEPTSsessionParser   PromptContinueformatNamemessages.DataprocProjectsLocationsSessionsDeleteRequestRelativeNameclientprojects_locations_sessionsr   async_r
   statuswriter   WaitForOperationtimeoutDeletedResource)selfargsr   
session_idrequest	operations         r   Runz
Delete.Run1   s"   {{}H&&,,.J4;;OO2	4 NN$$& O (G ;;BB7KI{{	jj/66
//
 %%6==OO,, I 
//12r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r8    r   r   r   r      s/    - H Hr   r   N)r<   
__future__r   r   r   googlecloudsdk.api_lib.dataprocr   r   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.dataprocr	   googlecloudsdk.corer
   googlecloudsdk.core.consoler   ReleaseTracksReleaseTrackBETACommandr   r?   r   r   <module>rJ      s]      &  ' : 0 ( 5 # 2 D%%**+.T\\ . ,.r   