
                            S r SSKJr  SSKJr  SSKJr  SSKrSSKJr  SSK	J
r  SSK	Jr  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKJr  SSKJr  SS0r\R2                  \R4                  " \R6                  R8                  \R6                  R:                  \R6                  R<                  5       " S S\R>                  5      5       5       r g)z:Command to delete one or more Dataproc Metastore services.    )absolute_import)division)unicode_literalsN)
exceptions)services_util)util)base)delete_util)resource_args)log)
console_ioEXAMPLESa            To delete a Dataproc Metastore service with the name
          `my-metastore-service` in location `us-central1`, run:

          $ {command} my-metastore-service --location=us-central1

          To delete multiple Dataproc Metastore services with the name
          `service-1` and `service-2` in the same location
          `us-central1`, run:

          $ {command} service-1 service-2 --location=us-central1
        c                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)Delete2   zDelete one or more Dataproc Metastore services.

If run asynchronously with `--async`, exits after printing
one or more operation names that can be used to poll the status of the
deletion(s) via:

  {top_command} metastore operations describe
c                 r    [         R                  " U SSSSS9  [        R                  R	                  U 5        g )Nz	to deleteT)pluralrequired
positional)r   AddServiceResourceArgr	   
ASYNC_FLAGAddToParser)parsers    (lib/surface/metastore/services/delete.pyArgsDelete.ArgsB   s.    ''D4DJOO'    c                    UR                   R                  R                  5       n[        R                  " [
        R                  " SU Vs/ s H)  nSR                  UR                  UR                  5      PM+     sn5      SSSS9  [        R                  " U R                  5       S9nSnU H  nS nS n [        R                  " UR                  5       U R                  5       S9nSR                  UR                   5      nUR#                  UR                  5       US	9  [.        R0                  " UR                  5       SSU(       a  S OSR                  UR                   5      US9  M     UR2                  (       d  UR5                  5       =(       d    UnU(       a  [6        R8                  " S5      eg s  snf ! [$        R&                   a2  n	[(        R*                  " U	R,                  5      S
   S   nSn S n	A	NS n	A	ff = f! [.        R0                  " UR                  5       SSU(       a  S OSR                  UR                   5      US9  f = f)Nz Deleting the following services:z[{}] in [{}]TzDeletion aborted by user.)messagecancel_on_nocancel_stringthrow_if_unattended)release_trackFzwith operation [{0}])service_name	operationerrorr   service)kindis_asyncdetailsfailedz)Some requested deletions did not succeed.)CONCEPTSservicesParser   PromptContinuecommand_utilConstructListformat
servicesIdlocationsIdr
   ServiceDeletionWaiterReleaseTrackservices_api_utilr   RelativeNamenameAddPendingDeleteapitools_exceptions	HttpErrorjsonloadscontentr   DeletedResourceasync_Waitapi_utilServiceDeleteError)
selfargsenv_refsenv_refwaiterencountered_errorsr%   r+   r*   es
             r   Run
Delete.RunH   s
   }}%%++-H**+M#P
# !!'"4"4g6I6IJ#P
  1 " ..'')+Fif%,,  "$2C2C2EG	 )//	? --/9 	  	F 	  ".D")))..9	 , ;;!;;=>,>''
57 7 GP
" !** "AII&w/	:!" 	  ".D")))..9	s7   
0F241F7%9H 7G=(G83H 8G==H  A
I
 N)__name__
__module____qualname____firstlineno____doc__DETAILED_HELPdetailed_helpstaticmethodr   rL   __static_attributes__rN   r   r   r   r   2   s%    
  -( (
(7r   r   )!rS   
__future__r   r   r   r=   apitools.base.pyr   r;    googlecloudsdk.api_lib.metastorer   r7   r   rC   googlecloudsdk.callioper	   $googlecloudsdk.command_lib.metastorer
   r   r0   googlecloudsdk.corer   googlecloudsdk.core.consoler   rT   DefaultUniverseOnlyReleaseTracksr6   ALPHABETAGADeleteCommandr   rN   r   r   <module>re      s    A &  '  > O = ( < > E # 2 	" T..33T5F5F5I5I:7T :7 :7r   