// List retrieves relevant envs by name and/or orgID and/or projectID
358927
func (e *EnvironmentsClient) List(ctx context.Context, orgIDs, projectIDs, teamIDs []identity.ID, names []string) ([]envelope.Environment, error) {
	v := &url.Values{}
	for _, id := range orgIDs {
		v.Add("org_id", id.String())
	}
	for _, id := range projectIDs {
		v.Add("project_id", id.String())
	}
	for _, id := range teamIDs {
		v.Add("team_id", id.String())
	}
	for _, n := range names {
		v.Add("name", n)
	}

	var envs []envelope.Environment
	err := e.client.RoundTrip(ctx, "GET", "/envs", v, nil, &envs)
	return envs, err
}
467859
func (f FakeClusterLister) List(projectID, zone string) (*container.ListClustersResponse, error) {
	return f.Resp, f.Err
}
753768
func (c *OrganizationController) List(ctx *app.ListOrganizationContext) error {
	currentUser, err := manager.ContextIdentity(ctx)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, errors.NewUnauthorizedError(err.Error()))
	}

	if currentUser == nil {
		return jsonapi.JSONErrorResponse(ctx, errors.NewUnauthorizedError("error finding the current user"))
	}

	orgs, err := c.app.OrganizationService().ListOrganizations(ctx, *currentUser)

	if err != nil {
		log.Error(ctx, map[string]interface{}{
			"err": err,
		}, "failed to list organizations")
		return jsonapi.JSONErrorResponse(ctx, errors.NewInternalError(ctx, err))
	}

	return ctx.OK(&app.OrganizationArray{Data: convertToAppOrganization(orgs)})
}
990510
func (m *GormIterationRepository) List(ctx context.Context, spaceID uuid.UUID) ([]Iteration, error) {
	defer goa.MeasureSince([]string{"goa", "db", "iteration", "query"}, time.Now())
	var objs []Iteration

	err := m.db.Where("space_id = ?", spaceID).Find(&objs).Error
	if err != nil && err != gorm.ErrRecordNotFound {
		log.Error(ctx, map[string]interface{}{
			"space_id": spaceID,
			"err":      err,
		}, "unable to list the iterations")
		return nil, errs.WithStack(err)
	}
	return objs, nil
}
1014725
func (s *Etcd) List(dir string) ([]string, error) {
	getOpts := &etcd.GetOptions{
		Quorum: true,
	}

	result, err := s.client.Get(context.Background(), s.normalize(dir), getOpts)
	if err != nil {
		if keyNotFound(err) {
			return nil, store.ErrKeyNotFound
		}
		return nil, err
	}

	var nodes []string

	for _, node := range result.Node.Nodes {
		nodes = append(nodes, node.Key)
	}

	return nodes, nil
}
1085522
func (r *AppRepo) List() ([]App, error) {
	apps := []App{}

	if err := r.DB.Select(&apps, "SELECT * FROM apps ORDER BY name ASC"); err != nil {
		return apps, err
	}

	return apps, nil
}
1303812
func (c *FakeAppProjects) List(opts v1.ListOptions) (result *v1alpha1.AppProjectList, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewListAction(appprojectsResource, appprojectsKind, c.ns, opts), &v1alpha1.AppProjectList{})

	if obj == nil {
		return nil, err
	}

	label, _, _ := testing.ExtractFromListOptions(opts)
	if label == nil {
		label = labels.Everything()
	}
	list := &v1alpha1.AppProjectList{ListMeta: obj.(*v1alpha1.AppProjectList).ListMeta}
	for _, item := range obj.(*v1alpha1.AppProjectList).Items {
		if label.Matches(labels.Set(item.Labels)) {
			list.Items = append(list.Items, item)
		}
	}
	return list, err
}
1151680
func (m *MachinesClient) List(ctx context.Context, orgID *identity.ID, state *string, name *string, teamID *identity.ID) ([]apitypes.MachineSegment, error) {
	v := &url.Values{}
	if orgID != nil {
		v.Add("org_id", (*orgID).String())
	}
	if state != nil {
		v.Add("state", *state)
	}
	if teamID != nil {
		v.Add("team_id", (*teamID).String())
	}
	if name != nil {
		v.Add("name", *name)
	}

	var results []apitypes.MachineSegment
	err := m.client.RoundTrip(ctx, "GET", "/machines", v, nil, &results)
	return results, err
}
10346
func (m *MembershipsClient) List(ctx context.Context, orgID *identity.ID,
	teamID *identity.ID, ownerID *identity.ID) ([]envelope.Membership, error) {

	query := &url.Values{}
	if orgID != nil {
		query.Set("org_id", orgID.String())
	}
	if teamID != nil {
		query.Set("team_id", teamID.String())
	}
	if ownerID != nil {
		query.Set("owner_id", ownerID.String())
	}

	var memberships []envelope.Membership
	err := m.client.RoundTrip(ctx, "GET", "/memberships", query, nil, &memberships)
	return memberships, err
}
284148
func (s *Server) List(ctx context.Context, q *RepoQuery) (*appsv1.RepositoryList, error) {
	urls, err := s.db.ListRepoURLs(ctx)
	if err != nil {
		return nil, err
	}
	items := make([]appsv1.Repository, 0)
	for _, url := range urls {
		if s.enf.Enforce(ctx.Value("claims"), rbacpolicy.ResourceRepositories, rbacpolicy.ActionGet, url) {
			items = append(items, appsv1.Repository{Repo: url})
		}
	}
	err = util.RunAllAsync(len(items), func(i int) error {
		items[i].ConnectionState = s.getConnectionState(ctx, items[i].Repo)
		return nil
	})
	if err != nil {
		return nil, err
	}
	return &appsv1.RepositoryList{Items: items}, nil
}
1026217
func (self *Version) List(zoneId int64) ([]*VersionInfo, error) {
	var res []interface{}
	params := []interface{}{self.Key, zoneId}
	if err := self.Call("domain.zone.version.list", params, &res); err != nil {
		return nil, err
	}

	versions := make([]*VersionInfo, 0)
	for _, r := range res {
		version := ToVersionInfo(r.(map[string]interface{}))
		versions = append(versions, version)
	}
	return versions, nil
}
263229
func (r *RepoResource) List() ([]*Repo, error) {
	repos := []*Repo{}
	const path = "/user/repositories"

	if err := r.client.do("GET", path, nil, nil, &repos); err != nil {
		return nil, err
	}

	return repos, nil
}
519960
func (c *Client) List(argv []string) error {
	usage := `Prints a list of installed units.

Usage:
  deisctl list
`
	// parse command-line arguments
	if _, err := docopt.Parse(usage, argv, true, "", false); err != nil {
		return err
	}
	return cmd.ListUnits(c.Backend)
}
624656
func (r *GormWorkItemLinkTypeRepository) List(ctx context.Context, spaceTemplateID uuid.UUID) ([]WorkItemLinkType, error) {
	defer goa.MeasureSince([]string{"goa", "db", "workitemlinktype", "list"}, time.Now())
	log.Info(ctx, map[string]interface{}{
		"space_template_id": spaceTemplateID,
	}, "Listing work item link types by space template ID %s", spaceTemplateID)

	// check space template exists
	if err := spacetemplate.NewRepository(r.db).CheckExists(ctx, spaceTemplateID); err != nil {
		return nil, errors.NewNotFoundError("space template", spaceTemplateID.String())
	}

	// We don't have any where clause or paging at the moment.
	var modelLinkTypes []WorkItemLinkType
	db := r.db.Where("space_template_id IN (?, ?)", spaceTemplateID, spacetemplate.SystemBaseTemplateID).Order("name")
	if err := db.Find(&modelLinkTypes).Error; err != nil {
		log.Error(ctx, map[string]interface{}{
			"err":               err,
			"space_template_id": spaceTemplateID,
		}, "failed to list work item link types")
		return nil, errs.Wrapf(err, "failed to find link types")
	}
	return modelLinkTypes, nil
}
488734
func (c *FakeProjects) List(opts v1.ListOptions) (result *project.ProjectList, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootListAction(projectsResource, projectsKind, opts), &project.ProjectList{})
	if obj == nil {
		return nil, err
	}

	label, _, _ := testing.ExtractFromListOptions(opts)
	if label == nil {
		label = labels.Everything()
	}
	list := &project.ProjectList{ListMeta: obj.(*project.ProjectList).ListMeta}
	for _, item := range obj.(*project.ProjectList).Items {
		if label.Matches(labels.Set(item.Labels)) {
			list.Items = append(list.Items, item)
		}
	}
	return list, err
}
862744
func (pts *PipelineTemplatesService) List(ctx context.Context) (pt []*PipelineTemplate, resp *APIResponse, err error) {
	apiVersion, err := pts.client.getAPIVersion(ctx, "admin/templates")
	if err != nil {
		return nil, nil, err
	}

	ptr := PipelineTemplatesResponse{}
	_, resp, err = pts.client.getAction(ctx, &APIClientRequest{
		Path:         "admin/templates",
		APIVersion:   apiVersion,
		ResponseBody: &ptr,
	})
	pt = ptr.Embedded.Templates

	return
}
1349495
func (remoteAccessVpnUserApi *RemoteAccessVpnUserApi) List() ([]RemoteAccessVpnUser, error) {
	data, err := remoteAccessVpnUserApi.entityService.List(map[string]string{})
	if err != nil {
		return nil, err
	}
	return parseRemoteAccessVpnUserList(data), nil
}