
    X                         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 ddlmZ ddlmZ ddlmZ ddlmZ ej&                   G d dej(                               Zy)z2Implementation of rb command for deleting buckets.    )absolute_import)division)unicode_literals)base)errors_util)flags)name_expansion)plurality_checkable_iterator)storage_url)task_executor)task_graph_executor)task_status)delete_task_iterator_factoryc                   0    e Zd ZdZdddZed        Zd Zy)DeletezDeletes Cloud Storage buckets.z8
      Deletes one or more Cloud Storage buckets.
      z

      Delete a Google Cloud Storage bucket named "my-bucket":

        $ {command} gs://my-bucket

      Delete two buckets:

        $ {command} gs://my-bucket gs://my-other-bucket
      )DESCRIPTIONEXAMPLESc                     | j                  ddd       t        j                  |        t        j                  |        y )Nurls+z,Specifies the URLs of the buckets to delete.)nargshelp)add_argumentr   add_additional_headers_flagadd_continue_on_error_flag)parsers    %lib/surface/storage/buckets/delete.pyArgszDelete.Args7   s:    
c N  P	%%f-	$$V,    c           	      Z   |j                   D ]7  }t        j                  |      }t        j                  |j
                  |       9 t        j                  j                         }t        j                  t        j                  |j                   t        j                  j                        |      j                         }t!        j"                  |      }t%        j&                  |d|t)        j*                  t(        j,                  j.                  d       |j0                        | _        y )N)include_buckets)task_status_queueT)increment_typemanifest_path)parallelizabler"   progress_manager_argscontinue_on_error)r   r   storage_url_from_stringr   raise_error_if_not_bucketcommand_pathr   multiprocessing_contextQueuer   DeleteTaskIteratorFactoryr	   NameExpansionIteratorBucketSettingYESbucket_iteratorr
   PluralityCheckableIteratorr   execute_tasksr   ProgressManagerArgsIncrementTypeINTEGERr'   	exit_code)selfargs
url_stringurlr"   r1   #plurality_checkable_bucket_iterators          r   Runz
Delete.Run>   s    ii
//
;c++D,=,=sC   ,CCIIK2LL,,II~'C'C'G'G	
 ,	
 o  	%??	 ( #00++)==&44<<  002DNr   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r=    r   r   r   r   !   s/    &
	
-$ - -2r   r   N)rA   
__future__r   r   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.storager   r   r	   r
   r   (googlecloudsdk.command_lib.storage.tasksr   r   r   +googlecloudsdk.command_lib.storage.tasks.rmr   UniverseCompatibleCommandr   rD   r   r   <module>rL      sV    9 &  ' ( : 4 = K : B H @ T 42T\\ 42 42r   