import 'package:servicestack/servicestack.dart';
abstract class UserOrGroup
{
int? ID;
String? Title;
bool? IsChecked;
String? Image;
UserOrGroup({this.ID,this.Title,this.IsChecked,this.Image});
UserOrGroup.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ID = json['ID'];
Title = json['Title'];
IsChecked = json['IsChecked'];
Image = json['Image'];
return this;
}
Map<String, dynamic> toJson() => {
'ID': ID,
'Title': Title,
'IsChecked': IsChecked,
'Image': Image
};
getTypeName() => "UserOrGroup";
TypeContext? context = _ctx;
}
class QuickAddOption implements IConvertible
{
String? Name;
String? EntityType;
QuickAddOption({this.Name,this.EntityType});
QuickAddOption.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Name = json['Name'];
EntityType = json['EntityType'];
return this;
}
Map<String, dynamic> toJson() => {
'Name': Name,
'EntityType': EntityType
};
getTypeName() => "QuickAddOption";
TypeContext? context = _ctx;
}
class UsersOrGroupsResponse implements IBaseQuickLookupResponse, IConvertible
{
int? NumberOfAllRecords;
List<UserOrGroup>? UsersOrGroups;
List<QuickAddOption>? QuickAddOptions;
UsersOrGroupsResponse({this.NumberOfAllRecords,this.UsersOrGroups,this.QuickAddOptions});
UsersOrGroupsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
NumberOfAllRecords = json['NumberOfAllRecords'];
UsersOrGroups = JsonConverters.fromJson(json['UsersOrGroups'],'List<UserOrGroup>',context!);
QuickAddOptions = JsonConverters.fromJson(json['QuickAddOptions'],'List<QuickAddOption>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'NumberOfAllRecords': NumberOfAllRecords,
'UsersOrGroups': JsonConverters.toJson(UsersOrGroups,'List<UserOrGroup>',context!),
'QuickAddOptions': JsonConverters.toJson(QuickAddOptions,'List<QuickAddOption>',context!)
};
getTypeName() => "UsersOrGroupsResponse";
TypeContext? context = _ctx;
}
class GetUsersAndGroups implements IConvertible
{
int? UserEnvironment;
int? PageSize;
int? PageNumber;
String? SearchCriteria;
List<int>? SelectedUserIDs;
List<int>? SelectedGroupIDs;
GetUsersAndGroups({this.UserEnvironment,this.PageSize,this.PageNumber,this.SearchCriteria,this.SelectedUserIDs,this.SelectedGroupIDs});
GetUsersAndGroups.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
UserEnvironment = json['UserEnvironment'];
PageSize = json['PageSize'];
PageNumber = json['PageNumber'];
SearchCriteria = json['SearchCriteria'];
SelectedUserIDs = JsonConverters.fromJson(json['SelectedUserIDs'],'List<int>',context!);
SelectedGroupIDs = JsonConverters.fromJson(json['SelectedGroupIDs'],'List<int>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'UserEnvironment': UserEnvironment,
'PageSize': PageSize,
'PageNumber': PageNumber,
'SearchCriteria': SearchCriteria,
'SelectedUserIDs': JsonConverters.toJson(SelectedUserIDs,'List<int>',context!),
'SelectedGroupIDs': JsonConverters.toJson(SelectedGroupIDs,'List<int>',context!)
};
getTypeName() => "GetUsersAndGroups";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'digiofficeapigateway.deltares.nl', types: <String, TypeInfo> {
'UserOrGroup': TypeInfo(TypeOf.AbstractClass),
'QuickAddOption': TypeInfo(TypeOf.Class, create:() => QuickAddOption()),
'UsersOrGroupsResponse': TypeInfo(TypeOf.Class, create:() => UsersOrGroupsResponse()),
'List<UserOrGroup>': TypeInfo(TypeOf.Class, create:() => <UserOrGroup>[]),
'List<QuickAddOption>': TypeInfo(TypeOf.Class, create:() => <QuickAddOption>[]),
'GetUsersAndGroups': TypeInfo(TypeOf.Class, create:() => GetUsersAndGroups()),
});
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.
POST /jsv/reply/GetUsersAndGroups HTTP/1.1
Host: digiofficeapigateway.deltares.nl
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
UserEnvironment: 0,
PageSize: 0,
PageNumber: 0,
SearchCriteria: String,
SelectedUserIDs:
[
0
],
SelectedGroupIDs:
[
0
]
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { NumberOfAllRecords: 0, UsersOrGroups: [ { } ], QuickAddOptions: [ { Name: String, EntityType: String } ] }