// List returns all memberships for a given organization, team, or user/machine
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
}
1366704
func (i *InmemBackend) List(ctx context.Context, prefix string) ([]string, error) {
	i.permitPool.Acquire()
	defer i.permitPool.Release()

	i.RLock()
	defer i.RUnlock()

	return i.ListInternal(ctx, prefix)
}
1172022
func (s *REST) List(ctx context.Context, options *metainternal.ListOptions) (runtime.Object, error) {
	user, ok := apirequest.UserFrom(ctx)
	if !ok {
		return nil, kerrors.NewForbidden(project.Resource("project"), "", fmt.Errorf("unable to list projects without a user on the context"))
	}
	labelSelector, _ := apihelpers.InternalListOptionsToSelectors(options)
	namespaceList, err := s.lister.List(user, labelSelector)
	if err != nil {
		return nil, err
	}
	return projectutil.ConvertNamespaceList(namespaceList), nil
}
1205163
func (c *Client) List() (*params.BackupsListResult, error) {
	var result params.BackupsListResult
	args := params.BackupsListArgs{}
	if err := c.facade.FacadeCall("List", args, &result); err != nil {
		return nil, errors.Trace(err)
	}
	return &result, nil
}
54294
func (s *Session) List(q *QueryOptions) ([]*SessionEntry, *QueryMeta, error) {
	var entries []*SessionEntry
	qm, err := s.c.query("/v1/session/list", &entries, q)
	if err != nil {
		return nil, nil, err
	}
	return entries, qm, nil
}
838773
func (c *WorkItemTypeGroupsController) List(ctx *app.ListWorkItemTypeGroupsContext) error {
	var typeGroups []*workitem.WorkItemTypeGroup
	err := application.Transactional(c.db, func(appl application.Application) error {
		list, err := appl.WorkItemTypeGroups().List(ctx, ctx.SpaceTemplateID)
		if err != nil {
			return errs.WithStack(err)
		}
		typeGroups = list
		return nil
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	res := &app.WorkItemTypeGroupList{
		Data: make([]*app.WorkItemTypeGroupData, len(typeGroups)),
		Links: &app.WorkItemTypeGroupLinks{
			Self: rest.AbsoluteURL(ctx.Request, app.SpaceTemplateHref(ctx.SpaceTemplateID)) + "/" + APIWorkItemTypeGroups,
		},
	}
	for i, group := range typeGroups {
		res.Data[i] = ConvertTypeGroup(ctx.Request, *group)
	}
	return ctx.OK(res)
}
162627
func (w *Worklog) List(ctx context.Context, orgID *identity.ID,
	itemType apitypes.WorklogType) ([]apitypes.WorklogItem, error) {

	org, err := w.engine.client.Orgs.Get(ctx, orgID)
	if err != nil {
		return nil, err
	}

	var items []apitypes.WorklogItem
	for t, h := range w.handlers {
		if t&itemType == 0 {
			continue
		}

		hItems, err := h.list(ctx, org)
		if err != nil {
			return nil, err
		}
		items = append(items, hItems...)
	}

	return items, nil
}
512493
func (p *ProjectsClient) List(ctx context.Context, orgID *identity.ID) ([]envelope.Project, error) {
	orgs := []identity.ID{*orgID}
	return p.Search(ctx, orgs, nil)
}
1031430
func (c *InvitesClient) List(ctx context.Context, teamID ID) *InviteIter {
	iter := InviteIter{
		first: true,
		i:     -1,
	}

	p := "/invites"

	q := make(url.Values)
	teamIDBytes, err := teamID.MarshalText()
	if err != nil {
		return &iter
	}
	q.Set("team_id", string(teamIDBytes))

	var req *http.Request
	req, iter.err = c.backend.NewRequest(http.MethodGet, p, q, nil)
	if iter.err != nil {
		return &iter
	}

	_, iter.err = c.backend.Do(ctx, req, &iter.page, func(code int) error {
		return &Error{}
	})
	return &iter
}
25124
func (s *Service) OrganizationInvoiceList(ctx context.Context, organizationIdentity string, lr *ListRange) (OrganizationInvoiceListResult, error) {
	var organizationInvoice OrganizationInvoiceListResult
	return organizationInvoice, s.Get(ctx, &organizationInvoice, fmt.Sprintf("/organizations/%v/invoices", organizationIdentity), nil, lr)
}
1120413
func (r *GormWorkItemTypeGroupRepository) List(ctx context.Context, spaceTemplateID uuid.UUID) ([]*WorkItemTypeGroup, error) {
	defer goa.MeasureSince([]string{"goa", "db", "workitemtypegroup", "list"}, time.Now())
	log.Debug(ctx, map[string]interface{}{"space_template_id": spaceTemplateID}, "loading work item type groups for space template")

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

	res := []*WorkItemTypeGroup{}
	db := r.db.Model(&res).Where("space_template_id=?", spaceTemplateID).Order("position ASC").Find(&res)
	if db.RecordNotFound() {
		log.Error(ctx, map[string]interface{}{"space_template_id": spaceTemplateID}, "work item type groups not found")
		return nil, errors.NewNotFoundError("work item type groups for space template", spaceTemplateID.String())
	}
	if err := db.Error; err != nil {
		return nil, errors.NewInternalError(ctx, err)
	}
	for _, group := range res {
		typeList, err := r.loadTypeList(ctx, group.ID)
		if err != nil {
			return nil, errs.WithStack(err)
		}
		group.TypeList = typeList
	}
	return res, nil
}
267853
func (t *Trie) MembersList() (members []string) {
	for _, mi := range t.Root.members([]byte{}) {
		members = append(members, mi.Value)
	}
	return
}
886240
func (c *FakeClusterRoleBindings) List(opts v1.ListOptions) (result *rbacv1.ClusterRoleBindingList, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootListAction(clusterrolebindingsResource, clusterrolebindingsKind, opts), &rbacv1.ClusterRoleBindingList{})
	if obj == nil {
		return nil, err
	}

	label, _, _ := testing.ExtractFromListOptions(opts)
	if label == nil {
		label = labels.Everything()
	}
	list := &rbacv1.ClusterRoleBindingList{ListMeta: obj.(*rbacv1.ClusterRoleBindingList).ListMeta}
	for _, item := range obj.(*rbacv1.ClusterRoleBindingList).Items {
		if label.Matches(labels.Set(item.Labels)) {
			list.Items = append(list.Items, item)
		}
	}
	return list, err
}
879364
func (c *TeamsClient) List(ctx context.Context) *TeamIter {
	iter := TeamIter{
		first: true,
		i:     -1,
	}

	p := "/teams"

	var req *http.Request
	req, iter.err = c.backend.NewRequest(http.MethodGet, p, nil, nil)
	if iter.err != nil {
		return &iter
	}

	_, iter.err = c.backend.Do(ctx, req, &iter.page, func(code int) error {
		return &Error{}
	})
	return &iter
}
255350
func (c *Client) OrganizationList(lr *ListRange) ([]Organization, error) {
	req, err := c.NewRequest("GET", "/organizations", nil, nil)
	if err != nil {
		return nil, err
	}

	if lr != nil {
		lr.SetHeader(req)
	}

	var organizationsRes []Organization
	return organizationsRes, c.DoReq(req, &organizationsRes)
}
914979
func (s *awsService) List(ctx context.Context) ([]Elastigroup, error) {
	output, err := s.svc.List(ctx, nil)
	if err != nil {
		return nil, err
	}

	groups := make([]Elastigroup, len(output.Groups))
	for i, group := range output.Groups {
		groups[i] = &awsElastigroup{group}
	}

	return groups, nil
}
1087484
func (e *Store) List(ctx context.Context, options *metainternalversion.ListOptions) (runtime.Object, error) {
	label := labels.Everything()
	if options != nil && options.LabelSelector != nil {
		label = options.LabelSelector
	}
	field := fields.Everything()
	if options != nil && options.FieldSelector != nil {
		field = options.FieldSelector
	}
	out, err := e.ListPredicate(ctx, e.PredicateFunc(label, field), options)
	if err != nil {
		return nil, err
	}
	if e.Decorator != nil {
		if err := e.Decorator(out); err != nil {
			return nil, err
		}
	}
	return out, nil
}