
                         2   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	 Z ej                  ej                  j                   ej                  j"                  ej                  j$                         G d
 dej&                               Zy)ARetrieves information about a Cloud SQL user in a given instance.    )absolute_import)division)unicode_literals)api_util)base)flags)
propertiesc                     t        j                  |        t        j                  |        t        j                  |        y N)r	   AddInstanceAddUsernameAddHostparsers    !lib/surface/sql/users/describe.pyAddBaseArgsr      s*    FF--    c                   .    e Zd ZdZddiZed        Zd Zy)Getr   EXAMPLESz          To fetch a user with name 'my-user' and optional host '%' in instance 'my-instance', run:

          $ {command} my-user --host=% --instance=my-instance

        c                     t        |        y r   )r   r   s    r   ArgszGet.Args0   s
    r   c                 x   t        j                  t         j                        }|j                  }|j                  }t
        j                  j                  j                  j                  d      }|j                  j                  |j                  ||j                  |j                  |j                              S )zRetrieves information about a Cloud SQL user in a given instance.

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

    Returns:
      SQL user resource.
    T)required)projectinstancenamehost)r   	SqlClientAPI_VERSION_DEFAULT
sql_clientsql_messagesr
   VALUEScorer   r   usersSqlUsersGetRequestr   usernamer   )selfargsclientr"   r#   
project_ids         r   RunzGet.Run4   s      < <=F""J&&L""''//33T3BJ'']]	 	( 	 r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r-    r   r   r   r   !   s2     J -  r   r   N)r1   
__future__r   r   r   googlecloudsdk.api_lib.sqlr   googlecloudsdk.callioper   googlecloudsdk.command_lib.sqlr	   googlecloudsdk.corer
   r   ReleaseTracksReleaseTrackALPHABETAGADescribeCommandr   r4   r   r   <module>r@      s~    H &  ' / ( 0 * D%%++T->->-C-C%%((*&$

 &*&r   