| GET | /users | Get a list of users |
|---|
import 'package:servicestack/servicestack.dart';
class GetUserResponse implements IConvertible
{
/**
* Unique Identifier of a User
*/
// @ApiMember(Description="Unique Identifier of a User", IsRequired=true)
String? userId;
/**
* User's Email address
*/
// @ApiMember(Description="User's Email address", IsRequired=true)
String? emailAddress;
/**
* First Name
*/
// @ApiMember(Description="First Name", IsRequired=true)
String? firstName;
/**
* Last Name
*/
// @ApiMember(Description="Last Name", IsRequired=true)
String? lastName;
/**
* User's Password Expiration Date
*/
// @ApiMember(Description="User's Password Expiration Date")
String? passwordExpirationDate;
/**
* If the User must change the password
*/
// @ApiMember(Description="If the User must change the password", IsRequired=true)
bool? passwordMustBeChanged;
/**
* User Type of the User
*/
// @ApiMember(Description="User Type of the User", IsRequired=true)
String? userType;
/**
* Culture ID of the User
*/
// @ApiMember(Description="Culture ID of the User", IsRequired=true)
String? culture;
/**
* If the User account is locked
*/
// @ApiMember(Description="If the User account is locked", IsRequired=true)
bool? accountLocked;
GetUserResponse({this.userId,this.emailAddress,this.firstName,this.lastName,this.passwordExpirationDate,this.passwordMustBeChanged,this.userType,this.culture,this.accountLocked});
GetUserResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
userId = json['userId'];
emailAddress = json['emailAddress'];
firstName = json['firstName'];
lastName = json['lastName'];
passwordExpirationDate = json['passwordExpirationDate'];
passwordMustBeChanged = json['passwordMustBeChanged'];
userType = json['userType'];
culture = json['culture'];
accountLocked = json['accountLocked'];
return this;
}
Map<String, dynamic> toJson() => {
'userId': userId,
'emailAddress': emailAddress,
'firstName': firstName,
'lastName': lastName,
'passwordExpirationDate': passwordExpirationDate,
'passwordMustBeChanged': passwordMustBeChanged,
'userType': userType,
'culture': culture,
'accountLocked': accountLocked
};
getTypeName() => "GetUserResponse";
TypeContext? context = _ctx;
}
class GetUsersResponse implements IConvertible
{
/**
* Index of the result set returnedr
*/
// @ApiMember(Description="Index of the result set returnedr", IsRequired=true)
int? page;
/**
* Size of the result set returned
*/
// @ApiMember(Description="Size of the result set returned", IsRequired=true)
int? items;
/**
* Total amount of pages / result sets
*/
// @ApiMember(Description="Total amount of pages / result sets", IsRequired=true)
int? totalPages;
/**
* Total amount of results
*/
// @ApiMember(Description="Total amount of results", IsRequired=true)
int? totalResults;
/**
* List of Users
*/
// @ApiMember(Description="List of Users", IsRequired=true)
List<GetUserResponse>? elements;
GetUsersResponse({this.page,this.items,this.totalPages,this.totalResults,this.elements});
GetUsersResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
page = json['page'];
items = json['items'];
totalPages = json['totalPages'];
totalResults = json['totalResults'];
elements = JsonConverters.fromJson(json['elements'],'List<GetUserResponse>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'page': page,
'items': items,
'totalPages': totalPages,
'totalResults': totalResults,
'elements': JsonConverters.toJson(elements,'List<GetUserResponse>',context!)
};
getTypeName() => "GetUsersResponse";
TypeContext? context = _ctx;
}
class GetUsers implements IPagedRequest, IConvertible
{
/**
* Index of the result set returned
*/
// @ApiMember(Description="Index of the result set returned", IsRequired=true)
int? page;
/**
* Size of the result set returned
*/
// @ApiMember(Description="Size of the result set returned", IsRequired=true)
int? items;
/**
* Omit precise record count - save on performance
*/
// @ApiMember(Description="Omit precise record count - save on performance")
bool? noCount;
/**
* Sorting expression
*/
// @ApiMember(Description="Sorting expression")
String? sortBy;
/**
* Email address
*/
// @ApiMember(Description="Email address")
String? email;
/**
* Also retreive users with locked account
*/
// @ApiMember(Description="Also retreive users with locked account")
bool? includeLockedAccounts;
GetUsers({this.page,this.items,this.noCount,this.sortBy,this.email,this.includeLockedAccounts});
GetUsers.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
page = json['page'];
items = json['items'];
noCount = json['noCount'];
sortBy = json['sortBy'];
email = json['email'];
includeLockedAccounts = json['includeLockedAccounts'];
return this;
}
Map<String, dynamic> toJson() => {
'page': page,
'items': items,
'noCount': noCount,
'sortBy': sortBy,
'email': email,
'includeLockedAccounts': includeLockedAccounts
};
getTypeName() => "GetUsers";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev_api_booster.richemont.com', types: <String, TypeInfo> {
'GetUserResponse': TypeInfo(TypeOf.Class, create:() => GetUserResponse()),
'GetUsersResponse': TypeInfo(TypeOf.Class, create:() => GetUsersResponse()),
'List<GetUserResponse>': TypeInfo(TypeOf.Class, create:() => <GetUserResponse>[]),
'GetUsers': TypeInfo(TypeOf.Class, create:() => GetUsers()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /users HTTP/1.1 Host: dev-api-booster.richemont.com Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
page: 0,
items: 0,
totalPages: 0,
totalResults: 0
}