// Lists user accounts
977351
func (c *Client) ListUsers(p *ListUsersParameter) ([]*User, error) {
	obj, err := c.Request("listUsers", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.([]*User), err
}
137496
func (rtm *Client) UsersList() ([]User, error) {
	res := usersListResponse{}
	err := NewExternalRequest().
		AsPost().
		WithScheme(APIScheme).
		WithHost(APIEndpoint).
		WithPath("api/users.list").
		WithPostData("token", rtm.Token).
		JSON(&res)

	if err != nil {
		return nil, err
	}

	if !IsEmpty(res.Error) {
		return nil, exception.New(res.Error)
	}

	return res.Users, nil
}
47792
func (c *CloudPersister) ListUsers() ([]*models.User, error) {
	ctx := context.Background()
	Users := make([]*models.User, 0)
	q := datastore.NewQuery("User")

	keys, err := c.DatastoreClient().GetAll(ctx, q, &Users)

	if err != nil {
		return nil, fmt.Errorf("datastoredb: could not list Users: %v", err)
	}

	for i, k := range keys {
		Users[i].ID = k.ID()
	}

	return Users, nil
}
597551
func (c *UsersController) List(ctx *app.ListUsersContext) error {
	var users []accountrepo.User
	var identities []accountrepo.Identity
	err := transaction.Transactional(c.app, func(tr transaction.TransactionalResources) error {
		var err error
		users, identities, err = filterUsers(tr, ctx)
		return err
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	return ctx.ConditionalEntities(users, c.config.GetCacheControlUsers, func() error {
		appUsers := make([]*app.UserData, len(users))
		for i := range users {
			appUser := ConvertToAppUser(ctx.RequestData, &users[i], &identities[i], false)
			appUsers[i] = appUser.Data
		}
		return ctx.OK(&app.UserArray{Data: appUsers})
	})
}
212970
func (c *Client) ListAccountsAsync() FutureListAccountsResult {
	cmd := btcjson.NewListAccountsCmd(nil)
	return c.sendCmd(cmd)
}
901511
func ListIPUsers(client *TwilioIPMessagingClient, serviceSid string) (*IPUserList, error) {
	var userList *IPUserList

	body, err := client.get(nil, "/Services/"+serviceSid+"/Users.json")

	if err != nil {
		return userList, err
	}

	userList = new(IPUserList)
	userList.Client = client
	err = json.Unmarshal(body, userList)

	return userList, err
}
547063
func (c *APIClient) UsersList() ([]*User, error) {
	dest := UsersList{}
	if err := c.slackMethodAndParse("users.list", &dest); err != nil {
		return nil, err
	}

	return dest.Users, nil
}
1012590
func (auth *Auth) ListUsers(maxResults int64) *ListAccountCursor {
	return &ListAccountCursor{MaxResults: maxResults, auth: auth}
}
650297
func (s *OrganizationsService) List(ctx context.Context, user string, opt *ListOptions) ([]*Organization, *Response, error) {
	var u string
	if user != "" {
		u = fmt.Sprintf("users/%v/orgs", user)
	} else {
		u = "user/orgs"
	}
	u, err := addOptions(u, opt)
	if err != nil {
		return nil, nil, err
	}

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	var orgs []*Organization
	resp, err := s.client.Do(ctx, req, &orgs)
	if err != nil {
		return nil, resp, err
	}

	return orgs, resp, nil
}
64758
func (s *Service) AddOnListByUser(ctx context.Context, accountIdentity string, lr *ListRange) (AddOnListByUserResult, error) {
	var addOn AddOnListByUserResult
	return addOn, s.Get(ctx, &addOn, fmt.Sprintf("/users/%v/addons", accountIdentity), nil, lr)
}
875752
func (s *DeviceEKStorage) ListAllForUser(mctx libkb.MetaContext) (all []string, err error) {
	defer mctx.TraceTimed("DeviceEKStorage#ListAllForUser", func() error { return err })()

	s.Lock()
	defer s.Unlock()

	return s.listAllForUser(mctx, mctx.ActiveDevice().Username(mctx))
}
1248579
func (s *Service) OAuthAuthorizationList(ctx context.Context, lr *ListRange) (OAuthAuthorizationListResult, error) {
	var oauthAuthorization OAuthAuthorizationListResult
	return oauthAuthorization, s.Get(ctx, &oauthAuthorization, fmt.Sprintf("/oauth/authorizations"), nil, lr)
}
525111
func (a *Account) ListOAuthClients() (clients []*OAuthClient, err error) {
	err = a.get(a.auth.WithScope(scope.Clients), "/api/v2/clients", &clients)
	return clients, err
}
993697
func List(c *client.Client, appID string) ([]string, error) {
	body, err := c.BasicRequest("GET", fmt.Sprintf("/v1/apps/%s/perms/", appID), nil)

	if err != nil {
		return []string{}, err
	}

	var users api.PermsAppResponse
	if err = json.Unmarshal([]byte(body), &users); err != nil {
		return []string{}, err
	}

	return users.Users, nil
}
721799
func (c *Client) ListUsers() (rec []UserInfo, err error) {
	req, err := newGETRequest(c, "users/")
	if err != nil {
		return []UserInfo{}, err
	}

	if err = executeAndParseRequest(c, req, &rec); err != nil {
		return []UserInfo{}, err
	}

	return rec, nil
}
1135634
func (s *UserService) list(req *restful.Request, resp *restful.Response) {
	// TODO (m0sth8): do not show emails and other fields for everyone
	// TODO (m0sth8): filter by email for admin only
	query, err := fltr.FromRequest(req, manager.UserFltr{})
	if err != nil {
		resp.WriteServiceError(http.StatusBadRequest, services.NewBadReq(err.Error()))
		return
	}

	mgr := s.Manager()
	defer mgr.Close()

	skip, limit := s.Paginator.Parse(req)
	opt := manager.Opts{
		Sort:  s.sorter.Parse(req),
		Limit: limit,
		Skip:  skip,
	}
	results, count, err := mgr.Users.FilterByQuery(query, opt)
	if err != nil {
		logrus.Error(stackerr.Wrap(err))
		resp.WriteServiceError(http.StatusInternalServerError, services.DbErr)
		return
	}

	previous, next := s.Paginator.Urls(req, skip, limit, count)
	result := &user.UserList{
		Meta:    pagination.Meta{Count: count, Previous: previous, Next: next},
		Results: results,
	}
	resp.WriteEntity(result)
}
1171375
func (s *AutoScaleService) ListCounters(p *ListCountersParams) (*ListCountersResponse, error) {
	resp, err := s.cs.newRequest("listCounters", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r ListCountersResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}