
    
                     0   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)'Lists AlloyDB users in a given cluster.    )absolute_import)division)unicode_literals)api_util)base)flags)
propertieszq
    table(
        name,
        userType:label="USER_TYPE",
        databaseRoles:label="DATABASE_ROLES"
    )
c                   0    e Zd ZdZdddZed        Zd Zy)Listr   z{description}z_      To list users, run:

        $ {command} --cluster=my-cluster --region=us-central1
      )DESCRIPTIONEXAMPLESc                     t        j                  |        t        j                  | d       | j                  j	                  t
               y)zxSpecifies additional command flags.

    Args:
      parser: argparse.Parser, Parser object for command line inputs
    FN)r	   	AddRegion
AddClusterdisplay_info	AddFormat_USER_FORMAT)parsers    !lib/surface/alloydb/users/list.pyArgsz	List.Args3   s4     
OOF	VU#
!!,/    c                    t        j                  | j                               }|j                  }|j                  }|j
                  j                  dt        j                  j                  j                  j                  |j                  |j                        }t        j                  |j                  |j!                  |j#                               d|j$                  |j&                  d      }|S )zConstructs and sends request.

    Args:
      args: argparse.Namespace, An object that contains the values for the
        arguments specified in the .Args() method.

    Returns:
      ProcessHttpResponse of the request made.
    z#alloydb.projects.locations.clusters)
projectsIdlocationsId
clustersId)parentuserspageSize)fieldlimit
batch_sizebatch_size_attribute)r   AlloyDBClientReleaseTrackalloydb_clientalloydb_messagesresource_parserCreater
   VALUEScoreproject	GetOrFailregioncluster YieldFromListHandlingUnreachable!projects_locations_clusters_users0AlloydbProjectsLocationsClustersUsersListRequestRelativeNamer!   	page_size)selfargsclientr&   r'   cluster_refresults          r   RunzList.Run>   s     ##D$5$5$78F**N..((//-$$))11;;KK<<	 0 K 6688II++- 	J 	
 jj>>'	F Mr   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r:    r   r   r   r   $   s1     0 %
- 0 0r   r   N)r>   
__future__r   r   r   googlecloudsdk.api_lib.alloydbr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.alloydbr	   googlecloudsdk.corer
   r   ReleaseTracksr%   ALPHABETAGAListCommandr   rA   r   r   <module>rL      s    . '  ' 3 ( 4 * T..33T5F5F5I5I64 66r   