
                         x   d Z ddlmZ ddlmZ ddlmZ ddl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*                  j0                         G d de	j2                               Zddde_        y)z3Command for Managed Microsoft AD operations cancel.    )absolute_import)division)unicode_literalsN)
exceptions)base)display)flags)util)log)
console_io)resource_printerc                   &    e Zd ZdZed        Zd Zy)Cancel(Cancel a Managed Microsoft AD operation.c                 0    t        j                  | d       y)z Register flags for this command.z	to cancelN)r	   AddOperationResourceArg)parsers    1lib/surface/active_directory/operations/cancel.pyArgszCancel.Args&   s     
!!&+6    c                 4   |j                   j                  j                         }t        j                  |      }t        j
                  |      }|j                  |j                               }|j                  j                  |      }t        j                         }t        j                  | |      j                         }t        j                   |||       t#        j$                  dj'                  |j)                                     st+        j,                  d      |j/                  |j                               }	|j                  j1                  |	       t2        j4                  j7                  dj'                  |j                                      y )N)name)outz"{}
This operation will be canceled)messagezCancel aborted by user.zCanceled [{0}].
)CONCEPTSr   Parser
   GetClientForResourceGetMessagesForResource<ManagedidentitiesProjectsLocationsGlobalOperationsGetRequestRelativeName$projects_locations_global_operationsGetioStringIOr   	Displayer	GetFormatr   Printr   PromptContinueformatgetvaluer   ActiveDirectoryError?ManagedidentitiesProjectsLocationsGlobalOperationsCancelRequestr   r   statuswrite)
selfargsresourceclientmessagesget_reqopoperation_stringprint_format
cancel_reqs
             r   Runz
Cancel.Run+   sO   }}!!'')H&&x0F**84HMM&&( 	N 	*  
	4	4	8	8	AB{{}$$T40::<L2|1AB$$5<<%%')* ++,EFFPP&&( 	Q 	*  //66zBJJ(//0E0E0GHIr   N)__name__
__module____qualname____doc__staticmethodr   r9    r   r   r   r       s     17 7Jr   r   r   z
        The following command cancels an operation called
        `operation-1484002552235-425b144f8c3f8-81aa4b49-0830d1e9`:

          $ {command} operation-1484002552235-425b144f8c3f8-81aa4b49-0830d1e9
        )briefEXAMPLES)r=   
__future__r   r   r   r#   'googlecloudsdk.api_lib.active_directoryr   googlecloudsdk.callioper   r   +googlecloudsdk.command_lib.active_directoryr	   r
   googlecloudsdk.corer   googlecloudsdk.core.consoler   googlecloudsdk.core.resourcer   ReleaseTracksReleaseTrackALPHABETAGACommandr   detailed_helpr?   r   r   <module>rP      s    : &  ' 	 > ( + = < # 2 9 D%%++%%**%%((*JT\\ J*JD 	3		
 r   