
    J                     v   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dZe	j                    e	j"                  e	j$                  j&                  e	j$                  j(                  e	j$                  j*                         G d de	j,                                      Zee_        y)z9The Secure Source Manager delete instance command module.    )absolute_import)division)unicode_literalsN)	instances)base)flags)resource_args)logz<
          Delete a Secure Source Manager instance.
        a  
            To delete a Secure Source Manager instance named 'my-instance' in location 'us-central1' asynchronously, run:

            $ {command} my-instance --region=us-central1

            To delete a Secure Source Manager instance named 'my-instance' in location 'us-central1' synchronously, and wait a maximum of 30 minutes for it to finish being deleted, run:

            $ {command} my-instance --region=us-central1 --no-async --max-wait=30m
        )DESCRIPTIONEXAMPLESc                   &    e Zd ZdZed        Zd Zy)Deletez(Delete a Secure Source Manager instance.c                     t        j                  | d       t        j                  | d       t        j
                  j                  |        t        j
                  j                  | d       y )Nz	to delete60mT)r	   AddInstanceResourceArgr   
AddMaxWaitr   
ASYNC_FLAGAddToParser
SetDefault)parsers    .lib/surface/source_manager/instances/delete.pyArgszDelete.Args6   sH    ((=	VU#OO'OOvt,    c                 6   |j                   }t        j                  |j                        }t	        j
                         }|j                  j                  j                         }|j                  |      }t        j                  j                  dj                  |j                               |r|j                  d      sd|_        |S |j!                  |j#                  |      dj                  |j#                  |      j%                               d|      S )	N)seconds)instance_refzDelete request issued for [{}].formatdefaultz&Waiting for operation [{}] to completeF)operation_refmessage
has_resultmax_wait)async_datetime	timedeltar"   r   InstancesClientCONCEPTSinstanceParser   r
   statusPrintr   instancesIdIsSpecifiedWaitForOperationGetOperationRefRelativeName)selfargsis_asyncr"   clientr(   	operations          r   Runz
Delete.Run>   s    {{H!!$--8H &&(F}}%%++-H84IJJ6fX1124  h' "",,Y78	""9-::<
> #  r   N)__name__
__module____qualname____doc__staticmethodr   r6    r   r   r   r   /   s    
 1- -r   r   )r:   
__future__r   r   r   r$   *googlecloudsdk.api_lib.securesourcemanagerr   googlecloudsdk.callioper   )googlecloudsdk.command_lib.source_managerr   r	   googlecloudsdk.corer
   DETAILED_HELPDefaultUniverseOnlyReleaseTracksReleaseTrackALPHABETAGADeleteCommandr   detailed_helpr<   r   r   <module>rK      s    @ &  '  @ ( ; C #		$ T..33T5F5F5I5I(T ( (T % r   