
    
                     8   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  \	R                  " \	R                  R                   \	R                  R"                  \	R                  R$                  5       " S
 S\	R&                  5      5       rg))Lists databases for a Cloud SQL instance.    )absolute_import)division)unicode_literals)api_util)validate)base)flags)
propertiesc                   .    \ rS rSrSr\S 5       rS rSrg)List   r   c                     [         R                  " U 5        U R                  R                  S5        U R                  R	                  [         R
                  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.
zU
      table(
          name,
          charset,
          collation
        )
      N)r
   AddInstancedisplay_info	AddFormatAddCacheUpdaterDatabaseCompleter)parsers    !lib/surface/sql/databases/list.pyArgs	List.Args!   sG     
f
!! #
  ''(?(?@    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                  R!                  UR#                  UR                  UR                  S95      n[%        UR&                  5      $ )zLists databases for a Cloud SQL instance.

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

Returns:
  A dict object that has the list of database resources if the api request
  was successful.
projectzsql.instances)params
collection)r   instance)r   	SqlClientAPI_VERSION_DEFAULT
sql_clientsql_messagesr   ValidateInstanceNamer   resource_parserParser   VALUEScorer   	GetOrFail	databasesr   SqlDatabasesListRequestiteritems)selfargsclientr!   r"   instance_refresults          r   RunList.Run4   s      < <=F""J&&L!!$--0))//:,,1199CCD" 0 $L
 !!&&,, ((<3H3H 	- 	JKF r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r2   __static_attributes__r4   r   r   r   r      s      2A A$r   r   N)r9   
__future__r   r   r   googlecloudsdk.api_lib.sqlr   r   googlecloudsdk.callioper	   googlecloudsdk.command_lib.sqlr
   googlecloudsdk.corer   ReleaseTracksReleaseTrackGABETAALPHAListCommandr   r4   r   r   <module>rG      sy    0 &  ' / / ( 0 * D%%(($*;*;*@*@%%++-.4 .-.r   