
                          @   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iZ ej                  ej                   j"                  ej                   j$                  ej                   j&                         G d dej(                               Zy)'Cancels a Cloud SQL instance operation.    )absolute_import)division)unicode_literals)api_util)base)log)
properties)
console_ioEXAMPLESz        To cancel an operation with the id "prod-operation-id",
        like "acb40108-a483-4a8b-8a5c-e27100000032", run:

          $ {command} prod-operation-id
        c                   *    e Zd ZdZeZed        Zd Zy)Cancelr   c                 *    | j                  dd       y)zArgs is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use it to add arguments that go on
        the command line after this command. Positional arguments are allowed.
    	operationz,Name that uniquely identifies the operation.)helpN)add_argument)parsers    $lib/surface/sql/operations/cancel.pyArgszCancel.Args-   s     H  J    c                    t        j                  t         j                        }|j                  }|j                  }|j
                  j                  |j                  ddt        j                  j                  j                  j                  i      }t        j                  dj                  |j                               t!        j"                  d       |j$                  j'                  |j)                  |j                  |j                              }t        j*                  j-                  d	j                  |j                               |S )
zCancels a Cloud SQL instance operation.

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

    Returns:
      An empty response.
    zsql.operationsproject)
collectionparamsz/Warning: You are about to cancel [{operation}].)r   T)cancel_on_no)r   r   z&Cancellation issued on [{operation}].
)r   	SqlClientAPI_VERSION_DEFAULT
sql_clientsql_messagesresource_parserParser   r
   VALUEScorer   	GetOrFailr	   warningformatr   PromptContinue
operationsr   SqlOperationsCancelRequeststatuswrite)selfargsclientr   r   operation_refemptys          r   Runz
Cancel.Run8   s!     < <=F""J&&L**00#:,,1199CCD 1 FM
 KKAHH)) I + ,40!!((//!))]5L5L 	0 	NOE JJ>EE)) F + ,Lr   N)	__name__
__module____qualname____doc__DETAILED_HELPdetailed_helpstaticmethodr   r1    r   r   r   r   &   s%     0-J Jr   r   N)r5   
__future__r   r   r   googlecloudsdk.api_lib.sqlr   googlecloudsdk.callioper   googlecloudsdk.corer	   r
   googlecloudsdk.core.consoler   r6   ReleaseTracksReleaseTrackGABETAALPHAUpdateCommandr   r9   r   r   <module>rE      s    . &  ' / ( # * 2 	 D%%(($*;*;*@*@%%++-,T ,-,r   