
    v
                     8   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ dd	lmZ  e	j                  e	j                  j                   e	j                  j"                  e	j                  j$                         G d
 de	j&                               Zy)z1Retrieves information about a Cloud SQL database.    )absolute_import)division)unicode_literals)api_util)validate)base)flags)
propertiesc                   &    e Zd ZdZed        Zd Zy)GetzDisplays configuration and metadata about a Cloud SQL database.

  Information such as database name, charset, and collation will be displayed.
  c                 X    t        j                  |        t        j                  |        y)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.
    N)r	   AddDatabaseNameAddInstance)parsers    %lib/surface/sql/databases/describe.pyArgszGet.Args$   s      
&!	f    c                    t        j                  t         j                        }|j                  }|j                  }t        j                  |j                         |j                  j                  |j                  dt        j                  j                  j                  j                  id      }|j                  |j                  |j                  |j                         }|j"                  j%                  |      S )aq  Displays configuration and metadata about a Cloud SQL database.

    Information such as database name, charset, and collation will be displayed.

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

    Returns:
      A dict object representing the database resource if fetching the database
      was successful.
    projectzsql.instances)params
collection)r   instancedatabase)r   	SqlClientAPI_VERSION_DEFAULT
sql_clientsql_messagesr   ValidateInstanceNamer   resource_parserParser
   VALUEScorer   	GetOrFailSqlDatabasesGetRequestr   	databasesr   )selfargsclientr   r   instance_refdatabase_requests          r   RunzGet.Run0   s      < <=F""J&&L!!$--0))//:,,1199CCD" 0 $L
 $::$$&& ;   ##$455r   N)__name__
__module____qualname____doc__staticmethodr   r+    r   r   r   r      s     
 	 	6r   r   N)r/   
__future__r   r   r   googlecloudsdk.api_lib.sqlr   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.sqlr	   googlecloudsdk.corer
   ReleaseTracksReleaseTrackGABETAALPHADescribeCommandr   r1   r   r   <module>r=      s{    8 &  ' / / ( 0 * D%%(($*;*;*@*@%%++-.6$

 .6-.6r   