
                         x   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  \
R$                  \
R&                  " \
R(                  R*                  5       " S S\
R,                  5      5       5       r\
R$                  \
R&                  " \
R(                  R0                  5       " S S\
R,                  5      5       5       r\
R$                  \
R&                  " \
R(                  R4                  5       " S S\
R,                  5      5       5       rS rS rS rS rS r g)4Reset SSL materials according to the reset SSL mode.    )absolute_import)division)unicode_literals)api_util)
operations)validate)base)flags)log)
properties)
console_ioc                   .    \ rS rSrSr\S 5       rS rSrg)ResetSslConfigBase   r   c                     [        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.
N)AddBaseArgsparsers    -lib/surface/sql/instances/reset_ssl_config.pyArgsResetSslConfigBase.Args$   s         c                 4    [        XR                  5       5      $ a  Reset SSL materials according to the reset SSL mode.

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

Returns:
  A dict object representing the operations resource describing the
  resetSslConfig operation if the reset was successful.
RunBaseResetSslConfigCommandReleaseTrackselfargss     r   RunResetSslConfigBase.Run/        (.?.?.ABBr    N	__name__
__module____qualname____firstlineno____doc__staticmethodr   r"   __static_attributes__r%   r   r   r   r           = Cr   r   c                   .    \ rS rSrSr\S 5       rS rSrg)ResetSslConfigBeta=   r   c                 0    [        U 5        [        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.
N)r   AddBetaArgsr   s    r   r   ResetSslConfigBeta.ArgsB   s     r   c                 4    [        XR                  5       5      $ r   r   r   s     r   r"   ResetSslConfigBeta.RunM   r$   r   r%   Nr&   r%   r   r   r0   r0   =   r.   r   r0   c                   .    \ rS rSrSr\S 5       rS rSrg)ResetSslConfigAlpha[   r   c                 F    [        U 5        [        U 5        [        U 5        gr3   )r   r4   AddAlphaArgsr   s    r   r   ResetSslConfigAlpha.Args`   s     r   c                 4    [        XR                  5       5      $ r   r   r   s     r   r"   ResetSslConfigAlpha.Runl   r$   r   r%   Nr&   r%   r   r   r9   r9   [   s     =	 	Cr   r9   c                    [         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UR                  UR                  UR                  S9nSnU R!                  S5      (       aT  UR                  R"                  R%                  U R&                  R)                  5       5      Ul        U R&                  S:X  a  Sn[+        U5      (       a   [,        R.                  " US	S	S
9  UR0                  R3                  U5      nUR                  R5                  SUR6                  UR                  S9n	U R8                  (       a=  UR:                  R=                  UR?                  U	R                  U	R@                  S95      $ [:        RB                  RE                  X9S5        [F        RH                  RK                  SRM                  US95        g)aJ  Reset SSL materials according to the reset SSL mode.

Args:
  args: argparse.Namespace, The arguments that this command was invoked with.
  release_track: string, The release track GA/BETA/ALPHA.

Returns:
  A dict object representing the operations resource describing the
  resetSslConfig operation if the reset was successful.
projectzsql.instances)params
collection)rA   instancezkResetting your SSL configuration will delete all client certificates and generate a new server certificate.modeSYNC_FROM_PRIMARYzWSyncing related SSL configs from the primary may cause SSL update operations if needed.T)messagedefaultcancel_on_nozsql.operations)	operationrA   )rA   rJ   zResetting SSL configz#Reset SSL config for [{resource}].
)resourceN)'r   	SqlClientAPI_VERSION_DEFAULT
sql_clientsql_messagesr	   ValidateInstanceNamerD   resource_parserParser   VALUEScorerA   	GetOrFail!SqlInstancesResetSslConfigRequestIsSpecifiedModeValueValuesEnumlookup_by_namerE   upperIsBetaOrNewerr   PromptContinue	instancesResetSslConfigCreatenameasync_r   GetSqlOperationsGetRequestrJ   OperationsV1Beta4WaitForOperationr   statuswriteformat)
r!   release_trackclientrN   rO   instance_refreq
prompt_msgresult_operationoperation_refs
             r   r   r   z   s    h::;&  *$$,
.''--
mm**//77AAB  . , 	66""\-B-B 	7 	#,  
f==QQ``		CH yy''#  =!!J4P))88=((// %%"" 0 - 
[[  $$,,!))]5L5L 	- 	
  //!7 **,33\3Jr   c                     g)z(Adds alpha args and flags to the parser.Nr%   unused_parsers    r   r<   r<          r   c                     g)z'Adds beta args and flags to the parser.Nr%   rq   s    r   r4   r4      rs   r   c                     [         R                  R                  U 5        U R                  S[        R
                  SS9  U R                  SSSS.SS	S
S9  g	)z'Adds base args and flags to the parser.rD   zCloud SQL instance ID.)	completerhelpz--modez7Refresh all TLS configs. This is the default behaviour.zRefreshes the replication-related TLS configuration settings provided by the primary instance. Not applicable to on-premises replication instances.)ALLrF   FNz%Selectively refresh the SSL materials)choicesrequiredrH   rw   )r
   
ASYNC_FLAGAddToParseradd_argumentr   InstanceCompleterr   s    r   r   r      sf    //f%''#  
 	J4 2  r   c                     U [         R                  R                  :H  =(       d    U [         R                  R                  :H  $ )z3Returns true if the release track is beta or newer.)r
   r   BETAALPHA)ri   s    r   r[   r[      s6     t((--- 2	$++11	1r   N)!r+   
__future__r   r   r   googlecloudsdk.api_lib.sqlr   r   r	   googlecloudsdk.callioper
   googlecloudsdk.command_lib.sqlr   googlecloudsdk.corer   r   googlecloudsdk.core.consoler   DefaultUniverseOnlyReleaseTracksr   GACommandr   r   r0   r   r9   r   r<   r4   r   r[   r%   r   r   <module>r      s   ; &  ' / 1 / ( 0 # * 2 D%%(()C C * C8 D%%**+C C , C8 D%%++,C$,, C - C:@F

0r   