
    N                     6   d Z ddlZddlmZ ddlmZ ddlmZ ddlm	Z	 dZ
dZd	Zd
ZdZej                  ej                    ej"                  ej$                  j&                  ej$                  j(                         G d dej*                                             Zy)z%services groups list members command.    N)serviceusage)base)common_flags)
propertieszprojects/{}z
folders/{}zorganizations/{}zservices/{}z	groups/{}c                   &    e Zd ZdZed        Zd Zy)ListGroupMembersah  List members of a specific service and group.

  List members of a specific service and group.

  ## EXAMPLES

   List members of service my-service and group my-group:

   $ {command} my-service my-group

   List members of service my-service and group my-group
   for a specific project '12345678':

    $ {command} my-service my-group --project=12345678

  c                 .   | j                  dd       | j                  dd       t        j                  |        t        j                  j                  | d       t        j                  j                  |        | j                  j                  d       y )NservicezName of the service.)helpgroupz/Service group name, for example "dependencies".2   zK
          table(
            name,
            reason
          )
        )
add_argumentr   add_resource_argsr   PAGE_SIZE_FLAG
SetDefaultURI_FLAGRemoveFromParserdisplay_info	AddFormat)parsers    +lib/surface/services/groups/list_members.pyArgszListGroupMembers.Args4   s    
	(>?
G   ""6*""62. 	MM""6*
!! #     c           	         |j                  d      r t        j                  |j                        }n|j                  d      r t        j                  |j
                        }nz|j                  d      r t        j                  |j                        }nIt        j                  j                  j                  j                  d      }t        j                  |      }t        j                  |dj                  t        j                  |j                        t         j                  |j"                              |j$                        }g }t'        j(                  ddd	g      }|D ]s  }|j*                  }|j,                  r-|j/                   ||j,                  |j0                               H|j/                   ||j2                  |j0                               u |S )
zRun command.

    Args:
      args: an argparse namespace. All the arguments that were provided to this
        command invocation.

    Returns:
      Resource name and its parent name.
    folderorganizationprojectT)requiredz{}/{}Membernamereason)IsSpecified_FOLDER_RESOURCEformatr   _ORGANIZATION_RESOURCEr   _PROJECT_RESOURCEr   r   VALUEScoreGetr   r   _SERVICE_RESOURCEr
   _GROUP_RESOURCEr   	page_sizecollections
namedtuplemember	groupNameappendr!   serviceName)	selfargsresource_namer   member_statesmembersresultsmember_stater/   s	            r   RunzListGroupMembers.RunH   sj    !&--dkk:m			.	),33D4E4EFm			)	$'..t||<m!!&&..22D2Ag'..w7m 11$$T\\2""4::.	
 	M G$$X/ABG%""f			wv//?@wv116==AB & Nr   N)__name__
__module____qualname____doc__staticmethodr   r:    r   r   r   r      s     "  &&r   r   )r>   r-   googlecloudsdk.api_lib.servicesr   googlecloudsdk.callioper   #googlecloudsdk.command_lib.servicesr   googlecloudsdk.corer   r&   r#   r%   r*   r+   UniverseCompatibleHiddenReleaseTracksReleaseTrackALPHABETAListCommandr   r@   r   r   <module>rL      s    ,  8 ( < *!  + !  D%%++T->->-C-CDLt'' L E  Lr   