
    !                     |   S 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
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                  \R4                  R8                  \R4                  R:                  5       " S S\R<                  5      5       rg)z=Command to delete one or more Dataproc Metastore federations.    )absolute_import)division)unicode_literals)
exceptions)federations_util)util)base)delete_util)resource_args)log)
console_ioEXAMPLESa            To delete a Dataproc Metastore federation with the name
          `my-metastore-federation` in location `us-central1`, run:

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

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

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

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   AddFederationResourceArgr	   
ASYNC_FLAGAddToParser)parsers    +lib/surface/metastore/federations/delete.pyArgsDelete.Args?   s.    **D4DJOO'    c                 p   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UR!                  UR                  5       US9  [.        R0                  " UR                  5       S	SU(       a  S OS
R                  UR2                  5      US9  M     UR4                  (       d  UR7                  5       =(       d    UnU(       a  [8        R:                  " S5      eg s  snf ! ["        R$                   a8  n[&        R(                  " U5      n	U	R*                  R,                  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R2                  5      US9  f = f)Nz#Deleting the following federations:z[{}] in [{}]TzDeletion aborted by user.)messagecancel_on_nocancel_stringthrow_if_unattended)release_trackF)federation_name	operation
federationzwith operation [{0}])kindis_asyncdetailsfailedz)Some requested deletions did not succeed.)CONCEPTSfederationsParser   PromptContinuecommand_utilConstructListformatfederationsIdlocationsIdr
   FederationDeletionWaiterReleaseTrackfederations_api_utilr   RelativeNameAddPendingDeleteapitools_exceptions	HttpErrorr   HttpExceptionpayloadstatus_messager   DeletedResourcenameasync_Waitapi_utilFederationDeleteError)
selfargsenv_refsenv_refwaiterencountered_errorsr%   r*   eexcs
             r   Run
Delete.RunE   s   }}((..0H**1  (4  (G %%g&;&;&-&9&9;'4 1 	" 11'')+Fif(//  "$2C2C2EG	 	#002i 	  	I 	  ".D")))..9	 , ;;!;;=>,>**
57 7 I4$ !** "&&q)++!" 	  ".D")))..9	s7   
0F41F%G+G(0.G#G+#G((G++A
H5 N)__name__
__module____qualname____firstlineno____doc__DETAILED_HELPdetailed_helpstaticmethodr   rL   __static_attributes__rN   r   r   r   r   1   s%      -( (
*7r   r   N) rS   
__future__r   r   r   apitools.base.pyr   r9    googlecloudsdk.api_lib.metastorer   r6   r   rB   googlecloudsdk.api_lib.utilgooglecloudsdk.callioper	   $googlecloudsdk.command_lib.metastorer
   r   r/   googlecloudsdk.corer   googlecloudsdk.core.consoler   rT   ReleaseTracksr5   ALPHABETAGADeleteCommandr   rN   r   r   <module>re      s    D &  ' > U = 2 ( < > E # 2 	" D%%++T->->-C-C%%((*<7T <7*<7r   