
    	                     8   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  ej                  ej                  j                   ej                  j"                  ej                  j$                         G d
 dej&                               Zy)Cancels an AlloyDB operation.    )absolute_import)division)unicode_literals)api_util)base)flags)log)
propertiesc                   0    e Zd ZdZdddZed        Zd Zy)Cancelr   z{description}zm        To cancel an operation, run:

          $ {command} operation-123456789 --region=us-central1
        )DESCRIPTIONEXAMPLESc                 X    t        j                  |        t        j                  |        y)zySpecifies additional command flags.

    Args:
      parser: argparse.Parser: Parser object for command line inputs.
    N)r	   	AddRegionAddOperation)parsers    (lib/surface/alloydb/operations/cancel.pyArgszCancel.Args-   s     
OOF	v    c                    d|_         t        j                  | j                               }|j                  j                  dt        j                  j                  j                  j                  |j                  |j                        }|j                  j                  |j                               }|j                   j"                  j%                  |       t&        j(                  j+                  d       y)zConstructs and sends request.

    Args:
      args: argparse.Namespace, An object that contains the values for the
          arguments specified in the .Args() method.

    Returns:
      ProcessHttpResponse of the request made.
    defaultz%alloydb.projects.locations.operations)
projectsIdlocationsIdoperationsId)namezOperation cancelled.
N)formatr   AlloyDBClientReleaseTrackresource_parserCreater   VALUEScoreproject	GetOrFailregion	operationalloydb_messages/AlloydbProjectsLocationsOperationsCancelRequestRelativeNamealloydb_clientprojects_locations_operationsr   r
   statuswrite)selfargsclientoperation_refreqs        r   Runz
Cancel.Run7   s     DK##D$5$5$78F**11/$$))11;;KK^^	 2 %M
 
!
!
Q
Q'') R +C
77>>sCJJ-.r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r4    r   r   r   r      s1     & 		-  /r   r   N)r8   
__future__r   r   r   googlecloudsdk.api_lib.alloydbr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.alloydbr	   googlecloudsdk.corer
   r   ReleaseTracksr   ALPHABETAGACommandr   r;   r   r   <module>rF      s{    $ '  ' 3 ( 4 # * D%%++T->->-C-C%%((*,/T\\ ,/*,/r   