
                         \   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 an AlloyDB instance.    )absolute_import)division)unicode_literals)api_util)instance_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)Deletez3Deletes an AlloyDB instance within a given cluster.z{description}zy        To delete an instance, run:

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

    Args:
      parser: argparse.Parser, Parser object for command line inputs
    FN)r   
ASYNC_FLAGAddToParserr	   
AddClusterAddInstance	AddRegion)parsers    'lib/surface/alloydb/instances/delete.pyArgszDelete.Args1   s@     	OO'	VU#	f	OOF    c                 *   t        j                  | j                               }|j                  }|j                  }|j
                  j                  dt        j                  j                  j                  j                  |j                  |j                  |j                        }d}t        j                   |      sy|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.instances)
projectsIdlocationsId
clustersIdinstancesIdz;Instance settings and IPs will be deleted on upon deletion.)messageN)namez%alloydb.projects.locations.operations)
collectionzOperation ID: {}zDeleting instanceF)!r   AlloyDBClientReleaseTrackalloydb_clientalloydb_messagesresource_parserCreater   VALUEScoreproject	GetOrFailregionclusterinstancer   PromptContinue6AlloydbProjectsLocationsClustersInstancesDeleteRequestRelativeName%projects_locations_clusters_instancesr   r   REGISTRYParseRelativeNamer"   r
   statusPrintformatNameasync_r   Await)
selfargsclientr&   r'   instance_refprompt_messagereqopop_refs
             r   Runz
Delete.Run=   sK    ##D$5$5$78F**N..))007$$))11;;KK<<MM 1 #L 	F $$^<

Q
Q&&( R *C		=	=	D	DS	IB11
C 2 EFJJ'..v{{}=>;;(;T=N=N=PRWXIr   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   rE    r   r   r   r   !   s1     < 		- 	 	!r   r   N)rI   
__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   rL   r   r   <module>rX      s    # '  ' 4 > ( 4 # * ) 2 D%%++T->->-C-C%%((*;T ;*;r   