
    '                     ,   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  \R                  " \R                  R                  \R                  R                   \R                  R"                  5       " S	 S
\R$                  5      5       rg)z'Deletes a database in a given instance.    )api_util)
operations)base)flags)log)
properties)
console_ioc                   .    \ rS rSrSr\S 5       rS rSrg)Delete   z\Deletes a Cloud SQL database.

For MySQL, also deletes all files in the database directory.
c                     [         R                  " U 5        [         R                  " U 5        U R                  R	                  [         R
                  5        g)zArgs is called by calliope to gather arguments for this command.

Args:
  parser: An argparse parser that you can use it to add arguments that go
      on the command line after this command. Positional arguments are
      allowed.
N)r   AddInstanceAddDatabaseNamedisplay_infoAddCacheUpdaterDatabaseCompleter)parsers    #lib/surface/sql/databases/delete.pyArgsDelete.Args#   s:     
f	&!
''(?(?@    c                 
   [         R                  " [         R                  5      nUR                  nUR                  n[
        R                  R                  R                  R                  SS9nUR                  R                  UR                  S[
        R                  R                  R                  R                  0SS9n[        R                  " SSSS9  UR                   R#                  UR%                  XQR                  UR&                  S95      nUR                  R)                  S	UR*                  UR                  S
9n[,        R.                  R1                  X8S5        [2        R4                  " UR&                  S5        g)zDeletes a Cloud SQL database.

For MySQL, also deletes all files in the database directory.

Args:
  args: argparse.Namespace, The arguments that this command was invoked
      with.

Returns:
  SQL database resource iterator.
T)requiredprojectzsql.instances)params
collectionzmThe database will be deleted. Any data stored in the database will be destroyed. You cannot undo this action.)messagedefaultcancel_on_no)r   instancedatabasezsql.operations)	operationr   zDeleting Cloud SQL databaser!   N)r   	SqlClientAPI_VERSION_DEFAULT
sql_clientsql_messagesr   VALUEScorer   Getresource_parserParser    	GetOrFailr	   PromptContinue	databasesr   SqlDatabasesDeleteRequestr!   Createnamer   OperationsV1Beta4WaitForOperationr   DeletedResource)	selfargsclientr%   r&   
project_idinstance_refresult_operationoperation_refs	            r   Run
Delete.Run0   sR     < <=F""J&&L""''//33T3BJ))//:,,1199CCD" 0 $L
 :	 "++22.. 	/ 	PQ **11"''$$ 2 &M
   11*2OQz2r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r<   __static_attributes__r>   r   r   r   r      s"    
 
A 
A(3r   r   N)rC   googlecloudsdk.api_lib.sqlr   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.sqlr   googlecloudsdk.corer   r   googlecloudsdk.core.consoler	   ReleaseTracksReleaseTrackGABETAALPHADeleteCommandr   r>   r   r   <module>rQ      sx    . 0 1 ( 0 # * 2 D%%(($*;*;*@*@%%++-;3T ;3-;3r   