
    r                     .   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r\R(                  \R*                  " \R,                  R.                  5       " S S\R0                  5      5       5       rg)zFRetrieves the minimal storage size a Cloud SQL instance can be shrunk.    )absolute_import)division)unicode_literals)
exceptions)api_util)validate)base)flags)
propertiesNc                   .    \ rS rSrSr\S 5       rS rSrg)GetStorageShrinkConfig"   zTDisplays the minimum storage size to which a Cloud SQL instance can be decreased.
  c                 B    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 it to add arguments that go on
    the command line after this command. Positional arguments are allowed.
instancezCloud SQL instance ID.)	completerhelpN)add_argumentr
   InstanceCompleter)parsers    6lib/surface/sql/instances/get_storage_shrink_config.pyArgsGetStorageShrinkConfig.Args(   s&     ))%  '    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&                   a  nUR(                  [*        R,                  R.                  R0                  :X  a3  [2        R4                  " SR7                  UR9                  5       5      5      e[:        R<                  " U5      eSnAff = f)a  Displays the minimum storage size to which a Cloud SQL instance can be decreased.

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

Returns:
  A kind string representing the request run and the minimum storage
  size to which a Cloud SQL instance can be decreased.

Raises:
  HttpException: A http error response was received while executing api
      request.
  ResourceNotFoundError: The SQL instance isn't found.
projectzsql.instances)params
collection)r   r   zFThere'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.SqlProjectsInstancesGetDiskShrinkConfigRequestprojects_instancesGetDiskShrinkConfigapitools_exceptions	HttpErrorstatus_codesixmoveshttp_client	FORBIDDENr   ResourceNotFoundErrorformatRelativeNamecalliope_exceptionsHttpException)	selfargsclientr    r!   instance_refrequestr   errors	            r   RunGetStorageShrinkConfig.Run5   sA      < <=F""J&&L!!$--0))//:,,1199CCD" 0 $L
5KK&&1F1F L Hg..BB7Kho(( 5			cii33==	=.. 9 9 ;<> 	>  --e445s   1A C2 2FA;FF N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r=   __static_attributes__r?   r   r   r   r   "   s      
' 
'#5r   r   )rD   
__future__r   r   r   apitools.base.pyr   r+   googlecloudsdk.api_lib.sqlr   r   googlecloudsdk.callioper	   r5   googlecloudsdk.command_lib.sqlr
   googlecloudsdk.corer   six.moves.http_clientr.   HiddenReleaseTracksReleaseTrackALPHACommandr   r?   r   r   <module>rS      sq    M &  ' > / 1 / ( E 0 *  D%%++,45T\\ 45 - 45r   