
                         R   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d
ZdZdZdZej$                  ej&                   ej(                  ej*                  j,                  ej*                  j.                         G d dej0                                             Zy)z-services groups list ancestor groups command.    )absolute_import)division)unicode_literals)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)ListAncestorGroupsa9  List ancestor groups of a specific service.

  List ancestor groups of a specific service.

  ## EXAMPLES

    List ancestor groups of service my-service:

   $ {command} my-service

   List ancestor groups of service my-service for a specific project '12345678':

    $ {command} my-service --project=12345678
  c                    | j                  dd       t        j                  |        t        j                  j                  | d       t        j                  j                  |        | j                  j                  d       y )NservicezName of the service.)help2   zE
          table(
            groupName:label=''
          )
        )
add_argumentr   add_resource_argsr   PAGE_SIZE_FLAG
SetDefaultURI_FLAGRemoveFromParserdisplay_info	AddFormat)parsers    3lib/surface/services/groups/list_ancestor_groups.pyArgszListAncestorGroups.Args4   sg    
	(>?""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                  |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)required)IsSpecified_FOLDER_RESOURCE_TEMPLATEr   _ORGANIZATION_RESOURCE_TEMPLATEr   _PROJECT_RESOURCE_TEMPLATEr   r	   VALUEScoreGetr   r   _SERVICE_RESOURCE_TEMPLATEr   )selfargsresource_namer   responses        r   RunzListAncestorGroups.RunE   s     !/$++=m			.	)58I8IIm			)	$04<<?m!!&&..22D2Ag07:m.."T\\1H
 Or   N)__name__
__module____qualname____doc__staticmethodr   r-    r   r   r   r   !   s        r   r   N)r1   
__future__r   r   r   googlecloudsdk.api_lib.servicesr   googlecloudsdk.callioper   #googlecloudsdk.command_lib.servicesr   googlecloudsdk.corer	   r$   r"   r#   r(   _GROUP_RESOURCE_TEMPLATEUniverseCompatibleHiddenReleaseTracksReleaseTrackALPHABETAListCommandr   r3   r   r   <module>rA      s    4 &  ' 8 ( < ** ( "4 * &  D%%++T->->-C-CD9)) 9 E  9r   