  def ProjectAncestry(self) -> List[Any]:
    """List ancestor resources for a project.

    Returns:
      List[Any]: the list of ancestor resources. If the caller doesn't have
        permissions to call GetResource on a folder or organization this list
        will be incomplete.
    """

    ancestry = []
    current_resource = self.GetResource('projects/' + self.project_id)
    ancestry.append(current_resource)

    while 'parent' in current_resource:
      parent_name = current_resource['parent']
      try:
        current_resource = self.GetResource(parent_name)
      except google_api_errors.HttpError:
        # If the caller doesn't have permission to call GetResource on a
        # folder/organization at least record name from the child resource.
        current_resource = {
          'name': parent_name
        }
      ancestry.append(current_resource)

    return ancestry
List ancestor resources for a project.

Returns:
List[Any]: the list of ancestor resources. If the caller doesn't have
permissions to call GetResource on a folder or organization this list
will be incomplete.
libcloudforensics/providers/gcp/internal/cloudresourcemanager.py