
                            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r\R*                  \R,                  " \R.                  R0                  \R.                  R2                  \R.                  R4                  5       " S S\R6                  5      5       5       rg)Deletes a Cloud SQL instance.    )absolute_import)division)unicode_literals)
exceptions)api_util)
operations)validate)base)flags)log)
properties)
console_ioNc                   .    \ rS rSrSr\S 5       rS rSrg)Delete"   r   c                 N   [         R                  R                  U 5        U R                  S[        R
                  SS9  [        R                  " U 5        [        R                  " U 5        U R                  SS9n[        R                  " U5        [        R                  " U5        g)zArgs is called by calliope to gather arguments for this command.

Args:
  parser: An argparse parser that you can use to add arguments that go
      on the command line after this command. Positional arguments are
      allowed.
instancezCloud SQL instance ID.)	completerhelpF)requiredN)r   
ASYNC_FLAGAddToParseradd_argumentr   InstanceCompleterAddEnableFinalBackupAddFinalbackupDescriptionadd_mutually_exclusive_group AddFinalBackupExpiryTimeArgumentAddFinalbackupRetentionDays)parser
expirations     #lib/surface/sql/instances/delete.pyArgsDelete.Args(   s     	OO'
))%  ' 
v&	##F+44e4DJ	**:6	%%j1    c                 D   [         R                  " [         R                  5      nUR                  nUR                  nSn[
        R                  " UR                  5        UR                  R                  UR                  S[        R                  R                  R                  R                  0SS9n UR                  R!                  UR#                  UR                  UR                  S95      nUb  UR0                  R2                  (       a  Sn	OSn	[4        R6                  " U	5      (       d  gSn
UR8                  b  UR8                  S	:  a  UR8                  nOSnUR:                  b  UR:                  R=                  S
5      n
 UR                  R?                  URA                  UR                  UR                  URB                  UURD                  U
S95      nUR                  RG                  SURH                  UR                  S9nURJ                  (       a=  URL                  R!                  URO                  UR                  URP                  S95      $ [L        RR                  RU                  X5S5        [(        RV                  " U5        g! [$        R&                   a8  nSn[(        R*                  " S[,        R.                  " U5      5         SnAGNSnAff = f! [$        R&                   a-    [(        R*                  " S[,        R.                  " U5      5        e f = f)zDeletes a Cloud SQL instance.

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

Returns:
  A dict object representing the operations resource describing the delete
  operation if the delete was successful.
Nprojectzsql.instances)params
collection)r(   r   z0Ignoring the error to get instance resource : %sz_All of the instance data will be lost except the existing backups when the instance is deleted.zCAll of the instance data will be lost when the instance is deleted.r   z%Y-%m-%dT%H:%M:%S.%fZ)r   r(   enableFinalBackupfinalBackupTtlDaysfinalBackupDescriptionfinalBackupExpiryTimezsql.operations)	operationr(   )r(   r/   zDeleting Cloud SQL instancezoperation : %s),r   	SqlClientAPI_VERSION_DEFAULT
sql_clientsql_messagesr
   ValidateInstanceNamer   resource_parserParser   VALUEScorer(   	GetOrFail	instancesGetSqlInstancesGetRequestr   	HttpErrorr   debugsix	text_typesettingsretainBackupsOnDeleter   PromptContinuefinal_backup_retention_daysfinal_backup_expiry_timestrftimer   SqlInstancesDeleteRequestenable_final_backupfinal_backup_descriptionCreatenameasync_r	   SqlOperationsGetRequestr/   OperationsV1Beta4WaitForOperationDeletedResource)selfargsclientr2   r3   operation_refinstance_refinstance_resourceerrorpromptexpiry_timeretention_daysresults                r#   Run
Delete.Run<   s     < <=F""J&&LM!!$--0))//:,,1199CCD" 0 L$..22

-
-"**\5J5J .   	%&&<<+  P  $$V,,K((4,,q077nn$$011::
!k##**

0
0#,,"** $ 8 8!/%)%B%B$/ 1 	f ,,33
fkk<;O;O 4 Qm 
$$((00%--'11 1 34 	4
 ""33
%BD 
,'G   
ii
<
--
 J  	ii #--">?s,   3=J CK 6K K#-KKAL N)	__name__
__module____qualname____firstlineno____doc__staticmethodr$   r\   __static_attributes__r^   r&   r#   r   r   "   s     &2 2&dr&   r   )rc   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.sqlr   r	   r
   googlecloudsdk.callioper   googlecloudsdk.command_lib.sqlr   googlecloudsdk.corer   r   googlecloudsdk.core.consoler   r?   DefaultUniverseOnlyReleaseTracksReleaseTrackGABETAALPHACommandr   r^   r&   r#   <module>rt      s    $ &  ' ' / 1 / ( 0 # * 2 
 D%%(($*;*;*@*@%%++-{T\\ {- {r&   