
    	                     b   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 e	j                    e	j"                  e	j$                  j&                  e	j$                  j(                  e	j$                  j*                         G d de	j,                                      Zy)z)The gcloud firestore bulk delete command.    )absolute_import)division)unicode_literals)bulk_delete)
operations)base)flags)
properties)
console_ioc                   .    e Zd ZdZddiZed        Zd Zy)
BulkDeletez&bulk delete Cloud Firestore documents.EXAMPLESaS            To bulk delete a specific set of collections groups asynchronously, run:

            $ {command} --collection-ids='specific collection group1','specific collection group2' --async

          To bulk delete all collection groups from certain namespace, run:

            $ {command} --namespace-ids='specific namespace id'
      c                     t        j                  |        t        j                  |        t        j                  |        t        j
                  j                  |        y)z Register flags for this command.N)r	   AddCollectionIdsFlagAddNamespaceIdsFlagAddDatabaseIdFlagr   
ASYNC_FLAGAddToParser)parsers    $lib/surface/firestore/bulk_delete.pyArgszBulkDelete.Args.   s@     
v&	f%	F#OO'    c                    t         j                  j                  j                  j	                  d      }dj                  |j                  |j                        }t        j                  |dd       t        j                  ||j                  |j                  |j                        }|j                  st        j                  |       |S )NT)requiredzNYou are about to bulk delete data from namespace ids:{} and collection ids: {})messagethrow_if_unattendedcancel_on_no)namespace_idscollection_ids)r
   VALUEScoreprojectGetformatr   r   r   PromptContinuer   r   databaseasync_r   WaitForOperation)selfargsr"   r   responses        r   RunzBulkDelete.Run6   s    $$,,00$0?G	$fT%7%79L9LM  T %%((**	H ;;!!(+Or   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r,    r   r   r   r      s/    
 /  
 - ( (r   r   N)r0   
__future__r   r   r    googlecloudsdk.api_lib.firestorer   r   googlecloudsdk.callioper   $googlecloudsdk.command_lib.firestorer	   googlecloudsdk.corer
   googlecloudsdk.core.consoler   DefaultUniverseOnlyReleaseTracksReleaseTrackALPHABETAGACommandr   r3   r   r   <module>rA      s    0 &  ' 8 7 ( 6 * 2 T..33T5F5F5I5I) ) )r   