
    v                     :   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                  5       " S S\R2                  5      5       5       rg)zAResets a Cloud SQL read replica size to its primary storage size.    )absolute_import)division)unicode_literals)
exceptions)api_util)
operations)validate)base)flags)
propertiesNc                   .    \ rS rSrSr\S 5       rS rSrg)ResetReplicaSize#   zIResets a Cloud SQL read replica storage size to its primary storage size.c                     [         R                  R                  U 5        U R                  S[        R
                  SS9  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.
replicazCloud SQL read replica ID.)	completerhelpN)r
   
ASYNC_FLAGAddToParseradd_argumentr   InstanceCompleter)parsers    /lib/surface/sql/instances/reset_replica_size.pyArgsResetReplicaSize.Args(   s8     	OO'
)))      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UR"                  R%                  U5      nUR                  R'                  SUR(                  UR                  S9nUR*                  (       a/  UR                   UR                  UR(                  UR,                  S.$ [.        R0                  R3                  UUS5        UR4                  R7                  UR9                  UR                  UR                   S95      n	UR                   UR                  U	R:                  R<                  S	.$ ! [>        R@                   a  n
U
RB                  [D        RF                  RH                  RJ                  :X  a3  [L        RN                  " S
RQ                  URS                  5       5      5      e[T        RV                  " U
5      eSn
A
ff = f)a  Resets a Cloud SQL read replica storage size to its primary storage size.

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

Returns:
  A dict object representing the operations resource describing the reset
  replica size operation if the reset was successful.

Raises:
  HttpException: A http error response was received while executing an api
      request.
  ResourceNotFoundError: The SQL instance isn't found.
projectzsql.instances)params
collection)r   instancezsql.operations)	operationr   )NameProjectOperationIdStatusz*Resetting the Cloud SQL read replica size.)r#   r$   StorageSizeGbzFThere's no instance found at {} or you're not authorized to access it.N),r   	SqlClientAPI_VERSION_DEFAULT
sql_clientsql_messagesr	   ValidateInstanceNamer   resource_parserParser   VALUEScorer   	GetOrFail+SqlProjectsInstancesResetReplicaSizeRequestr!   projects_instancesr   Createnameasync_statusr   OperationsV1Beta4WaitForOperation	instancesGetSqlInstancesGetRequestsettingsdataDiskSizeGbapitools_exceptions	HttpErrorstatus_codesixmoveshttp_client	FORBIDDENr   ResourceNotFoundErrorformatRelativeNamecalliope_exceptionsHttpException)selfargsclientr*   r+   instance_refrequestresult_operationoperation_refchanged_instance_resourceerrors              r   RunResetReplicaSize.Run7   s0      < <=F""J&&L!!$,,/))//:,,1199CCD" 0 L*5HH&&1F1F I g $66GGP,,33
$))&& 4 m
 
 ))#+++00&--	
 	
 ""33


6 #-"6"6":":

-
-"**\5J5J . # ''!))4==LL 
 (( 5			cii33==	=.. 9 9 ;<> 	>  --e445s!   1B-G+ BG+ +I??A;I::I? N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   rT   __static_attributes__rV   r   r   r   r   #   s      R E5r   r   )r[   
__future__r   r   r   apitools.base.pyr   r?   googlecloudsdk.api_lib.sqlr   r   r	   googlecloudsdk.callioper
   rI   googlecloudsdk.command_lib.sqlr   googlecloudsdk.corer   six.moves.http_clientrB   HiddenReleaseTracksReleaseTrackALPHACommandr   rV   r   r   <module>rj      sw    H &  ' > / 1 1 / ( E 0 *  D%%++,W5t|| W5 - W5r   