| 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 = 0;
/**
* Size of the result set returned
*/
// @ApiMember(Description="Size of the result set returned", IsRequired=true)
int items = 0;
/**
* Total amount of pages / result sets
*/
// @ApiMember(Description="Total amount of pages / result sets", IsRequired=true)
int totalPages = 0;
/**
* Total amount of results
*/
// @ApiMember(Description="Total amount of results", IsRequired=true)
int totalResults = 0;
/**
* List of Users
*/
// @ApiMember(Description="List of Users", IsRequired=true)
List<GetUserResponse>? elements;
GetUsersResponse({this.page=0,this.items=0,this.totalPages=0,this.totalResults=0,this.elements});
GetUsersResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
page = json['page'] ?? 0;
items = json['items'] ?? 0;
totalPages = json['totalPages'] ?? 0;
totalResults = json['totalResults'] ?? 0;
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 = 0;
/**
* Size of the result set returned
*/
// @ApiMember(Description="Size of the result set returned", IsRequired=true)
int items = 0;
/**
* 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;
/**
* Filter users whose LastLoggedOnDate is greater than or equal to this date (Format: yyyy-MM-dd)
*/
// @ApiMember(Description="Filter users whose LastLoggedOnDate is greater than or equal to this date (Format: yyyy-MM-dd)")
DateTime? lastLoggedOnDateFrom;
/**
* Filter users whose LastLoggedOnDate is less than or equal to this date (Format: yyyy-MM-dd)
*/
// @ApiMember(Description="Filter users whose LastLoggedOnDate is less than or equal to this date (Format: yyyy-MM-dd)")
DateTime? lastLoggedOnDateTo;
/**
* Filter by User Type (1 or 2)
*/
// @ApiMember(Description="Filter by User Type (1 or 2)")
int? userType;
GetUsers({this.page=0,this.items=0,this.noCount,this.sortBy,this.email,this.includeLockedAccounts,this.lastLoggedOnDateFrom,this.lastLoggedOnDateTo,this.userType});
GetUsers.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
page = json['page'] ?? 0;
items = json['items'] ?? 0;
noCount = json['noCount'];
sortBy = json['sortBy'];
email = json['email'];
includeLockedAccounts = json['includeLockedAccounts'];
lastLoggedOnDateFrom = JsonConverters.fromJson(json['lastLoggedOnDateFrom'],'DateTime',context!);
lastLoggedOnDateTo = JsonConverters.fromJson(json['lastLoggedOnDateTo'],'DateTime',context!);
userType = json['userType'];
return this;
}
Map<String, dynamic> toJson() => {
'page': page,
'items': items,
'noCount': noCount,
'sortBy': sortBy,
'email': email,
'includeLockedAccounts': includeLockedAccounts,
'lastLoggedOnDateFrom': JsonConverters.toJson(lastLoggedOnDateFrom,'DateTime',context!),
'lastLoggedOnDateTo': JsonConverters.toJson(lastLoggedOnDateTo,'DateTime',context!),
'userType': userType
};
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
}