
                            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	 rS
 r\R                  " \R                   R"                  5      \R$                   " S S\R&                  5      5       5       r\R                  " \R                   R*                  5      \R$                   " S S\5      5       5       r\R                  " \R                   R.                  5      \R$                   " S S\5      5       5       rg)zlLists users in a given project.

Lists users in a given project in the alphabetical order of the user name.
    )absolute_import)division)unicode_literals)api_util)base)flags)
propertiesc                     [         R                  " U 5        U R                  R                  [         R                  5        g N)r   AddInstancedisplay_infoAddCacheUpdaterUserCompleterparsers    lib/surface/sql/users/list.pyAddBaseArgsr      s*    F%%e&9&9:    c                 P   [         R                  " [         R                  5      nUR                  nUR                  n[
        R                  R                  R                  R                  SS9nUR                  R                  UR                  XPR                  S95      R                  nSnSnU Hz  n	U	R                  (       a  SnU	R                   n
U	R"                  UR$                  R&                  R(                  :X  a  SU	l        U	R"                  (       a  SnU
(       d  Ms  SU
l        M|     U[,        R.                  R0                  :X  a.  U R3                  5       R5                  SR7                  XxS	95        U$ U R3                  5       R5                  S
R7                  XxS	95        U$ )zLists Cloud SQL users in a given instance.

Args:
  args: argparse.Namespace, The arguments that this command was invoked with.
  release_track: base.ReleaseTrack, the release track that this was run under.

Returns:
  SQL user resource iterator.
T)required)projectinstance zdualPasswordType,Nz
iamStatus,z
      table(
        name.yesno(no='(anonymous)'),
        host,
        type.yesno(no='BUILT_IN'),
        {dualPasswordType}
        {iamStatus}
        passwordPolicy
      )
    )dualPasswordType	iamStatusz
      table(
        name.yesno(no='(anonymous)'),
        host,
        type.yesno(no='BUILT_IN'),
        {dualPasswordType}
        {iamStatus}
        iamEmail,
        passwordPolicy
      )
    )r   	SqlClientAPI_VERSION_DEFAULT
sql_clientsql_messagesr	   VALUEScorer   GetusersListSqlUsersListRequestr   itemsr   passwordPolicyr   UserIamStatusValueValuesEnumIAM_STATUS_UNSPECIFIEDenableFailedAttemptsCheckr   ReleaseTrackGAGetDisplayInfo	AddFormatformat)argsrelease_trackclientr   r   
project_idr#   dual_password_type
iam_statususerpolicys              r   RunBaseListCommandr9   #   s    h::;&  *$$,  %%--1141@*




&&}} ' 677<u  *d.  F55LL	M dn~~j'+F$ & d''***## 	% 	 2I	K. 
, 	## 
% 	 2I
K 
,r   c                   .    \ rS rSrSr\S 5       rS rSrg)r$   m   Lists Cloud SQL users in a given instance.

Lists Cloud SQL users in a given instance in the alphabetical
order of the user name.
c                     [        U 5        g r   r   r   s    r   Args	List.Argsv   
    r   c                 4    [        XR                  5       5      $ r   )r9   r,   )selfr1   s     r   RunList.Runz   s    d$5$5$788r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr?   rD   __static_attributes__rF   r   r   r$   r$   m   s       9r   r$   c                   (    \ rS rSrSr\S 5       rSrg)ListBeta~   r<   c                     [        U 5        g r   r>   r   s    r   r?   ListBeta.Args   rA   r   rF   NrG   rH   rI   rJ   rK   rL   r?   rM   rF   r   r   rO   rO   ~         r   rO   c                   (    \ rS rSrSr\S 5       rSrg)	ListAlpha   r<   c                     [        U 5        g r   r>   r   s    r   r?   ListAlpha.Args   rA   r   rF   NrS   rF   r   r   rV   rV      rT   r   rV   N)rK   
__future__r   r   r   googlecloudsdk.api_lib.sqlr   googlecloudsdk.callioper   googlecloudsdk.command_lib.sqlr   googlecloudsdk.corer	   r   r9   ReleaseTracksr,   r-   UniverseCompatibleListCommandr$   BETArO   ALPHArV   rF   r   r   <module>rd      s   
 '  ' / ( 0 *;
GT D%%(()94 9  *9 D%%**+	t 	  ,	 D%%++,	 	  -	r   