
                         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 expanded members command.    N)serviceusage)base)common_flags)
propertieszprojects/%sz
folders/%szorganizations/%szservices/%sz	groups/%sc                   &    e Zd ZdZed        Zd Zy)ListExpandedMembersa  List expanded members of a specific service and group.

  List expanded members of a specific service and group.

  ## EXAMPLES

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

   $ {command} my-service my-group

   List expanded 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   z@
          table(
            Name:label=''
          )
        )
add_argumentr   add_resource_argsr   PAGE_SIZE_FLAG
SetDefaultURI_FLAGRemoveFromParserdisplay_info	AddFormat)parsers    4lib/surface/services/groups/list_expanded_members.pyArgszListExpandedMembers.Args3   s    
	(>?
G   ""6*""62. 	MM""6*
!! #     c                 v   |j                  d      rt        |j                  z  }n|j                  d      rt        |j                  z  }nb|j                  d      rt
        |j                  z  }n=t        j                  j                  j                  j                  d      }t
        |z  }t        j                  |dj                  t        |j                  z  t         |j"                  z        |j$                        }g }t'        j(                  dd	g      }|D ]  }|j+                   ||
              |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{}/{})	page_sizeServicename)r!   )IsSpecified_FOLDER_RESOURCEr   _ORGANIZATION_RESOURCEr   _PROJECT_RESOURCEr   r   VALUEScoreGetr   r   format_SERVICE_RESOURCEr
   _GROUP_RESOURCEr   r   collections
namedtupleappend)selfargsresource_namer   responseservice_namesresultsr
   s           r   RunzListExpandedMembers.RunF   s    !&4m			.	),t/@/@@m			)	$'$,,6m!!&&..22D2Ag''1m//,o

.J	
 ..H M$$Y9G701 r   N)__name__
__module____qualname____doc__staticmethodr   r5    r   r   r   r      s        $r   r   )r9   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>rG      s    5  8 ( < *!  + !  D%%++T->->-C-CDB$** B E  Br   