func (us *UserService) Count(ctx context.Context, realm string) (uint32, error) {
	path := "/realms/{realm}/users/count"
	var result uint32
	_, err := us.client.newRequest(ctx).
		SetPathParams(map[string]string{
			"realm": realm,
		}).
		SetResult(&result).
		Get(path)
	return result, err
}
Count gets user count in a realm
package keycloak
import (
	"context"
	"net/url"
	"strings"
)
type UserService service
func NewUserService(c *Client) *UserService {
	return &UserService{
		client: c,
	}
}
func (us *UserService) Find(ctx context.Context, realm string, params map[string]string) ([]UserRepresentation, error) {
	path := "/realms/{realm}/users"
	var user []UserRepresentation
	_, err := us.client.newRequest(ctx).
		SetQueryParams(params).
		SetPathParams(map[string]string{
			"realm": realm,
		}).
		SetResult(&user).
		Get(path)
	if err != nil {
		return nil, err
	}
	return user, nil
}
func (us *UserService) Create(ctx context.Context, realm string, user *UserRepresentation) (string, error) {
	path := "/realms/{realm}/users"
	response, err := us.client.newRequest(ctx).
		SetPathParams(map[string]string{
			"realm": realm,
		}).
		SetBody(user).
		Post(path)
	if err != nil {
		return "", err
	}
	location, err := url.Parse(response.Header().Get("Location"))
	if err != nil {
		return "", err
	}
	components := strings.Split(location.Path, "/")
	return components[len(components)-1], nil
}
func (us *UserService) Get(ctx context.Context, realm string, userID string) (*UserRepresentation, error) {
	path := "/realms/{realm}/users/{id}"
	user := &UserRepresentation{}
	_, err := us.client.newRequest(ctx).
		SetPathParams(map[string]string{
			"realm": realm,
			"id":    userID,
		}).
		SetResult(user).
		Get(path)
	if err != nil {
		return nil, err
	}
	return user, nil
}
func (us *UserService) Update(ctx context.Context, realm string, user *UserRepresentation) error {
	path := "/realms/{realm}/users/{id}"
	_, err := us.client.newRequest(ctx).
		SetPathParams(map[string]string{
			"realm": realm,
			"id":    user.ID,
		}).
		SetBody(user).
		Put(path)
	return err
}
func (us *UserService) Delete(ctx context.Context, realm string, userID string) error {
	path := "/realms/{realm}/users/{id}"
	_, err := us.client.newRequest(ctx).
		SetPathParams(map[string]string{
			"realm": realm,
			"id":    userID,
		}).
		Delete(path)
	return err
}
func (us *UserService) Impersonate(ctx context.Context, realm string, userID string) (AttributeMap, error) {
	path := "/realms/{realm}/users/{id}/impersonation"
	a := AttributeMap{}
	_, err := us.client.newRequest(ctx).
		SetPathParams(map[string]string{
			"realm": realm,
			"id":    userID,
		}).
		SetResult(&a).
		Post(path)
	return a, err
}