
                            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\5      r\R,                  " \R.                  R0                  \R.                  R2                  \R.                  R4                  5       " S S\\R6                  5      5       rg)4Deletes an SSL certificate for a Cloud SQL instance.    )absolute_import)division)unicode_literals)api_util)cert)
exceptions)
operations)validate)base)flags)log)
properties)
console_ioc                   (    \ rS rSrSr\S 5       rSrg)_BaseDelete!   z$Base class for sql ssl_certs delete.c                     [         R                  R                  U 5        U R                  SSS9  [        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.
common_namez7User supplied name. Constrained to ```[a-zA-Z.-_ ]+```.)helpN)r   
ASYNC_FLAGAddToParseradd_argumentr   AddInstance)parsers    #lib/surface/sql/ssl_certs/delete.pyArgs_BaseDelete.Args$   s@     	OO'
F  H 
f     N)__name__
__module____qualname____firstlineno____doc__staticmethodr   __static_attributes__r    r   r   r   r   !   s    , r   r   c                       \ rS rSrSrS rSrg)Delete4   r   c                 z   [         R                  " [         R                  5      nUR                  nUR                  n[
        R                  " UR                  5        UR                  R                  UR                  S[        R                  R                  R                  R                  0SS9n[        R                   " SR#                  UR$                  5      SSS9  [&        R(                  " X4UR                  UUR$                  5      nU(       d.  [*        R,                  " SR#                  UR$                  US95      eUR.                  R1                  UR3                  UR                  UR                  UR4                  S	95      nUR                  R7                  S
UR8                  UR                  S9nUR:                  (       a=  UR<                  R?                  URA                  UR                  URB                  S95      $ [<        RD                  RG                  X8S5        [H        RJ                  " U5        g)ag  Deletes an SSL certificate for 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 api request was successful.
Raises:
  ResourceNotFoundError: The ssl cert could not be found for the instance.
projectzsql.instances)params
collectionzy{0} will be deleted. New connections can no longer be made using this certificate. Existing connections are not affected.T)messagedefaultcancel_on_noz4no ssl cert named [{name}] for instance [{instance}])nameinstance)r,   r3   sha1Fingerprintzsql.operations)	operationr,   )r,   r5   zDeleting sslCertN)&r   	SqlClientAPI_VERSION_DEFAULT
sql_clientsql_messagesr   ValidateInstanceNamer3   resource_parserParser   VALUEScorer,   	GetOrFailr   PromptContinueformatr   r   GetCertRefFromNamer	   ResourceNotFoundErrorsslCertsr)   SqlSslCertsDeleteRequestr4   Creater2   async_r
   GetSqlOperationsGetRequestr5   OperationsV1Beta4WaitForOperationr   DeletedResource)	selfargsclientr8   r9   instance_refcert_refresultoperation_refs	            r   Run
Delete.Run9   s     < <=F""J&&L!!$--0))//:,,1199CCD" 0 $L IIOJ &&z'-'='=|'+'7'79H ,,
@
G
G##l H <= =   ''--$$&&$44 	. 	67F **11FKK9I9I 2 KM {{""&&

.
.#++%// / 12 2
   11*2DF !r   r    N)r!   r"   r#   r$   r%   rT   r'   r    r   r   r)   r)   4   s     =;"r   r)   N)r%   
__future__r   r   r   googlecloudsdk.api_lib.sqlr   r   r	   r
   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.sqlr   googlecloudsdk.corer   r   googlecloudsdk.core.consoler   objectr   ReleaseTracksReleaseTrackGABETAALPHACommandr)   r    r   r   <module>rc      s    ; &  ' / + 1 1 / ( 0 # * 2& & D%%(($*;*;*@*@%%++->"[$,, >"->"r   