mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-11 18:44:26 +00:00
Commit from m3o/m3o action
This commit is contained in:
19
user/user.go
19
user/user.go
@@ -32,6 +32,14 @@ func (t *UserService) Delete(request *DeleteRequest) (*DeleteResponse, error) {
|
||||
|
||||
}
|
||||
|
||||
// List all users. Returns a paged list of results
|
||||
func (t *UserService) List(request *ListRequest) (*ListResponse, error) {
|
||||
|
||||
rsp := &ListResponse{}
|
||||
return rsp, t.client.Call("user", "List", request, rsp)
|
||||
|
||||
}
|
||||
|
||||
// Login using username or email. The response will return a new session for successful login,
|
||||
// 401 in the case of login failure and 500 for any other error
|
||||
func (t *UserService) Login(request *LoginRequest) (*LoginResponse, error) {
|
||||
@@ -164,6 +172,17 @@ type DeleteRequest struct {
|
||||
type DeleteResponse struct {
|
||||
}
|
||||
|
||||
type ListRequest struct {
|
||||
// Maximum number of records to return. Default limit is 25.
|
||||
// Maximum limit is 1000. Anything higher will return an error.
|
||||
Limit int32 `json:"limit"`
|
||||
Offset int32 `json:"offset"`
|
||||
}
|
||||
|
||||
type ListResponse struct {
|
||||
Users []Account `json:"users"`
|
||||
}
|
||||
|
||||
type LoginRequest struct {
|
||||
// The email address of the user
|
||||
Email string `json:"email"`
|
||||
|
||||
Reference in New Issue
Block a user