
                         .   d 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)z1services groups list descendant services command.    )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)ListDescendantServicesa  List descendant services of a specific service and group.

  List descendant services of a specific service and group.

  ## EXAMPLES

   List descendant services of service my-service and group my-group:

   $ {command} my-service my-group

   List descendant services 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   zG
          table(
            serviceName:label=''
          )
        )
add_argumentr   add_resource_argsr   PAGE_SIZE_FLAG
SetDefaultURI_FLAGRemoveFromParserdisplay_info	AddFormat)parsers    7lib/surface/services/groups/list_descendant_services.pyArgszListDescendantServices.Args2   s    
	(>?
G   ""6*""62. 	MM""6*
!! #     c                    |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              }|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{}/{})IsSpecified_FOLDER_RESOURCEr   _ORGANIZATION_RESOURCEr   _PROJECT_RESOURCEr   r   VALUEScoreGetr   r   format_SERVICE_RESOURCEr
   _GROUP_RESOURCEr   )selfargsresource_namer   responses        r   RunzListDescendantServices.RunE   s     !&4m			.	),t/@/@@m			)	$'$,,6m!!&&..22D2Ag''1m22,o

.J	
H Or   N)__name__
__module____qualname____doc__staticmethodr   r-    r   r   r   r      s        $r   r   N)r1   googlecloudsdk.api_lib.servicesr   googlecloudsdk.callioper   #googlecloudsdk.command_lib.servicesr   googlecloudsdk.corer   r"   r    r!   r'   r(   UniverseCompatibleHiddenReleaseTracksReleaseTrackALPHABETAListCommandr   r3   r   r   <module>r?      s    8 8 ( < *!  + !  D%%++T->->-C-CD=T-- = E  =r   