
    ~                     \   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  e	j$                  e	j&                  j(                  e	j&                  j*                  e	j&                  j,                         G d de	j.                               Zy)zDeletes a AlloyDB cluster.    )absolute_import)division)unicode_literals)api_util)cluster_operations)base)flags)log)
properties)	resources)
console_ioc                   0    e Zd ZdZdddZed        Zd Zy)Deletez,Delete an AlloyDB cluster in a given region.z{description}za        To delete a cluster, run:

          $ {command} my-cluster --region=us-central1
        )DESCRIPTIONEXAMPLESc                     t         j                  j                  |        t        j                  |        t        j
                  |        t        j                  |        y)zySpecifies additional command flags.

    Args:
      parser: argparse.Parser: Parser object for command line inputs.
    N)r   
ASYNC_FLAGAddToParserr	   	AddRegion
AddClusterAddForce)parsers    &lib/surface/alloydb/clusters/delete.pyArgszDelete.Args0   s<     	OO'	OOF	V	NN6    c                 *   t        j                  | j                               }|j                  }|j                  }|j
                  j                  dt        j                  j                  j                  j                  |j                  |j                        }d}t        j                  |      sy|j!                  |j#                         |j$                        }|j&                  j)                  |      }t*        j,                  j/                  |j0                  d      }	t2        j4                  j7                  d	j9                  |	j;                                      |j<                  s&t?        j@                  |	d
| j                         d       |S )zConstructs and sends request.

    Args:
      args: argparse.Namespace, An object that contains the values for the
          arguments specified in the .Args() method.

    Returns:
      ProcessHttpResponse of the request made.
    z#alloydb.projects.locations.clusters)
projectsIdlocationsId
clustersIdzAAll of the cluster data will be lost when the cluster is deleted.)messageN)nameforcez%alloydb.projects.locations.operations)
collectionzOperation ID: {}zDeleting clusterF)!r   AlloyDBClientReleaseTrackalloydb_clientalloydb_messagesresource_parserCreater   VALUEScoreproject	GetOrFailregionclusterr   PromptContinue-AlloydbProjectsLocationsClustersDeleteRequestRelativeNamer"   projects_locations_clustersr   r   REGISTRYParseRelativeNamer!   r
   statusPrintformatNameasync_r   Await)
selfargsclientr&   r'   cluster_refprompt_messagereqopop_refs
             r   Runz
Delete.Run<   sK    ##D$5$5$78F**N..((//-$$))11;;KKDLL 0 :K 	L $$^<

H
H%%'tzz I ;C		3	3	:	:3	?B11
C 2 EFJJ'..v{{}=>;;v'94;L;L;N$&Ir   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   rD    r   r   r   r       s1     5 		- 	 	 r   r   N)rH   
__future__r   r   r   googlecloudsdk.api_lib.alloydbr   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.alloydbr	   googlecloudsdk.corer
   r   r   googlecloudsdk.core.consoler   ReleaseTracksr%   ALPHABETAGADeleteCommandr   rK   r   r   <module>rW      s    ! '  ' 3 = ( 4 # * ) 2 D%%++T->->-C-C%%((*:T :*:r   