
                             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  G d dej                         Zy)z$`gcloud tasks queues purge` command.    )absolute_import)division)unicode_literals)GetApiAdapter)base)flags)parsers)log)
console_ioc                   0    e Zd ZdZdddZed        Zd Zy)PurgeaD  Purge a queue by deleting all of its tasks.

  This command purges a queue by deleting all of its tasks. Purge operations can
  take up to one minute to take effect. Tasks might be dispatched before the
  purge takes effect. A purge is irreversible. All tasks created before this
  command is run are permanently deleted.
  z"          {description}
          zI          To purge a queue:

              $ {command} my-queue
         )DESCRIPTIONEXAMPLESc                 Z    t        j                  | d       t        j                  |        y )Nzto purge)r   AddQueueResourceArgAddLocationFlag)parsers    !lib/surface/tasks/queues/purge.pyArgsz
Purge.Args0   s     	fj1	&!    c                    t        | j                               j                  }t        j                  |j
                  |j                        }t        j                  |j                               }t        j                  ddj                  |             |j                  |       t        j                  j                  dj                  |             y )NTz$Are you sure you want to purge: [{}])cancel_on_noprompt_stringzPurged queue [{}].)r   ReleaseTrackqueuesr	   
ParseQueuequeuelocationGetConsolePromptStringRelativeNamer   PromptContinueformatr   r
   statusPrint)selfargsqueues_client	queue_refqueue_shorts        r   Runz	Purge.Run5   s    !$"3"3"56==M""4::t}}=I001G1G1IJK<CC 	"JJ)00=>r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r*    r   r   r   r      s1    		- " "	?r   r   N)r.   
__future__r   r   r   googlecloudsdk.api_lib.tasksr   googlecloudsdk.callioper    googlecloudsdk.command_lib.tasksr   r	   googlecloudsdk.corer
   googlecloudsdk.core.consoler   Commandr   r1   r   r   <module>r9      s5    + &  ' 6 ( 2 4 # 2!?DLL !?r   