POST | /searches/list | Get all sanctions searches |
---|
import 'package:servicestack/servicestack.dart';
// @DataContract
class ResponseError implements IConvertible
{
// @DataMember(Order=1)
String? ErrorCode;
// @DataMember(Order=2)
String? FieldName;
// @DataMember(Order=3)
String? Message;
ResponseError({this.ErrorCode,this.FieldName,this.Message});
ResponseError.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ErrorCode = json['ErrorCode'];
FieldName = json['FieldName'];
Message = json['Message'];
return this;
}
Map<String, dynamic> toJson() => {
'ErrorCode': ErrorCode,
'FieldName': FieldName,
'Message': Message
};
getTypeName() => "ResponseError";
TypeContext? context = _ctx;
}
class ArrayOfResponseError extends ListBase<ResponseError> implements IConvertible
{
final List<ResponseError> l = [];
set length(int newLength) { l.length = newLength; }
int get length => l.length;
ResponseError operator [](int index) => l[index];
void operator []=(int index, ResponseError value) { l[index] = value; }
ArrayOfResponseError();
ArrayOfResponseError.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "ArrayOfResponseError";
TypeContext? context = _ctx;
}
// @DataContract
class ResponseStatus implements IConvertible
{
// @DataMember(Order=1)
String? ErrorCode;
// @DataMember(Order=2)
String? Message;
// @DataMember(Order=3)
String? StackTrace;
// @DataMember(Order=4)
ArrayOfResponseError? Errors;
ResponseStatus({this.ErrorCode,this.Message,this.StackTrace,this.Errors});
ResponseStatus.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ErrorCode = json['ErrorCode'];
Message = json['Message'];
StackTrace = json['StackTrace'];
Errors = JsonConverters.fromJson(json['Errors'],'ArrayOfResponseError',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ErrorCode': ErrorCode,
'Message': Message,
'StackTrace': StackTrace,
'Errors': JsonConverters.toJson(Errors,'ArrayOfResponseError',context!)
};
getTypeName() => "ResponseStatus";
TypeContext? context = _ctx;
}
class SearchCriteria implements IConvertible
{
String? Name;
String? DateOfBirth;
String? CountryOfBirth;
String? Nationality;
String? Address;
SearchCriteria({this.Name,this.DateOfBirth,this.CountryOfBirth,this.Nationality,this.Address});
SearchCriteria.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Name = json['Name'];
DateOfBirth = json['DateOfBirth'];
CountryOfBirth = json['CountryOfBirth'];
Nationality = json['Nationality'];
Address = json['Address'];
return this;
}
Map<String, dynamic> toJson() => {
'Name': Name,
'DateOfBirth': DateOfBirth,
'CountryOfBirth': CountryOfBirth,
'Nationality': Nationality,
'Address': Address
};
getTypeName() => "SearchCriteria";
TypeContext? context = _ctx;
}
class SearchListItem implements IConvertible
{
int? Id;
String? SearchType;
DateTime? DateSearched;
DateTime? DateUpdated;
int? NumOfResults;
bool? ClientInResults;
bool? ClientNotInResults;
bool? AffectedByUpdate;
SearchCriteria? SearchCriteria;
SearchListItem({this.Id,this.SearchType,this.DateSearched,this.DateUpdated,this.NumOfResults,this.ClientInResults,this.ClientNotInResults,this.AffectedByUpdate,this.SearchCriteria});
SearchListItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
SearchType = json['SearchType'];
DateSearched = JsonConverters.fromJson(json['DateSearched'],'DateTime',context!);
DateUpdated = JsonConverters.fromJson(json['DateUpdated'],'DateTime',context!);
NumOfResults = json['NumOfResults'];
ClientInResults = json['ClientInResults'];
ClientNotInResults = json['ClientNotInResults'];
AffectedByUpdate = json['AffectedByUpdate'];
SearchCriteria = JsonConverters.fromJson(json['SearchCriteria'],'SearchCriteria',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'SearchType': SearchType,
'DateSearched': JsonConverters.toJson(DateSearched,'DateTime',context!),
'DateUpdated': JsonConverters.toJson(DateUpdated,'DateTime',context!),
'NumOfResults': NumOfResults,
'ClientInResults': ClientInResults,
'ClientNotInResults': ClientNotInResults,
'AffectedByUpdate': AffectedByUpdate,
'SearchCriteria': JsonConverters.toJson(SearchCriteria,'SearchCriteria',context!)
};
getTypeName() => "SearchListItem";
TypeContext? context = _ctx;
}
class ArrayOfSearchListItem extends ListBase<SearchListItem> implements IConvertible
{
final List<SearchListItem> l = [];
set length(int newLength) { l.length = newLength; }
int get length => l.length;
SearchListItem operator [](int index) => l[index];
void operator []=(int index, SearchListItem value) { l[index] = value; }
ArrayOfSearchListItem();
ArrayOfSearchListItem.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "ArrayOfSearchListItem";
TypeContext? context = _ctx;
}
// @DataContract
class GetListSearchesData implements IBaseDataResponse, IHasResponseStatus, IConvertible
{
// @DataMember
ResponseStatus? ResponseStatus;
// @DataMember
int? TotalSearchRecords;
// @DataMember
int? CurrentPageNum;
// @DataMember
int? MaxPageNum;
// @DataMember
ArrayOfSearchListItem? SearchRecords;
GetListSearchesData({this.ResponseStatus,this.TotalSearchRecords,this.CurrentPageNum,this.MaxPageNum,this.SearchRecords});
GetListSearchesData.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
TotalSearchRecords = json['TotalSearchRecords'];
CurrentPageNum = json['CurrentPageNum'];
MaxPageNum = json['MaxPageNum'];
SearchRecords = JsonConverters.fromJson(json['SearchRecords'],'ArrayOfSearchListItem',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'TotalSearchRecords': TotalSearchRecords,
'CurrentPageNum': CurrentPageNum,
'MaxPageNum': MaxPageNum,
'SearchRecords': JsonConverters.toJson(SearchRecords,'ArrayOfSearchListItem',context!)
};
getTypeName() => "GetListSearchesData";
TypeContext? context = _ctx;
}
// @DataContract
class GetListSearchesResponse implements IConvertible
{
// @DataMember
GetListSearchesData? Data;
GetListSearchesResponse({this.Data});
GetListSearchesResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Data = JsonConverters.fromJson(json['Data'],'GetListSearchesData',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Data': JsonConverters.toJson(Data,'GetListSearchesData',context!)
};
getTypeName() => "GetListSearchesResponse";
TypeContext? context = _ctx;
}
// @DataContract
class Authentication implements IAuthentication, IConvertible
{
/**
* The API User ID that will authenticate your request
*/
// @DataMember
// @ApiMember(DataType="string", Description="The API User ID that will authenticate your request", IsRequired=true)
String? ApiUserId;
/**
* The API User Key that will authenticate your request
*/
// @DataMember
// @ApiMember(DataType="string", Description="The API User Key that will authenticate your request", IsRequired=true)
String? ApiUserKey;
Authentication({this.ApiUserId,this.ApiUserKey});
Authentication.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ApiUserId = json['ApiUserId'];
ApiUserKey = json['ApiUserKey'];
return this;
}
Map<String, dynamic> toJson() => {
'ApiUserId': ApiUserId,
'ApiUserKey': ApiUserKey
};
getTypeName() => "Authentication";
TypeContext? context = _ctx;
}
// @ApiResponse(Description="Your request is successful if the \"<em>Data.ResponseStatus.Message</em>\" field is \"<b>Success</b>\".", StatusCode=200)
// @DataContract
class GetListSearches implements IBaseRequest, IConvertible
{
// @DataMember
Authentication? Authentication;
// @DataMember
int? Page;
// @DataMember
String? SortOrder;
// @DataMember
String? NameSearch;
GetListSearches({this.Authentication,this.Page,this.SortOrder,this.NameSearch});
GetListSearches.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Authentication = JsonConverters.fromJson(json['Authentication'],'Authentication',context!);
Page = json['Page'];
SortOrder = json['SortOrder'];
NameSearch = json['NameSearch'];
return this;
}
Map<String, dynamic> toJson() => {
'Authentication': JsonConverters.toJson(Authentication,'Authentication',context!),
'Page': Page,
'SortOrder': SortOrder,
'NameSearch': NameSearch
};
getTypeName() => "GetListSearches";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.sanctionssearch.com', types: <String, TypeInfo> {
'ArrayOfResponseError': TypeInfo(TypeOf.Class, create:() => ArrayOfResponseError()),
'SearchCriteria': TypeInfo(TypeOf.Class, create:() => SearchCriteria()),
'SearchListItem': TypeInfo(TypeOf.Class, create:() => SearchListItem()),
'ArrayOfSearchListItem': TypeInfo(TypeOf.Class, create:() => ArrayOfSearchListItem()),
'GetListSearchesData': TypeInfo(TypeOf.Class, create:() => GetListSearchesData()),
'GetListSearchesResponse': TypeInfo(TypeOf.Class, create:() => GetListSearchesResponse()),
'Authentication': TypeInfo(TypeOf.Class, create:() => Authentication()),
'GetListSearches': TypeInfo(TypeOf.Class, create:() => GetListSearches()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /searches/list HTTP/1.1
Host: api.sanctionssearch.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"Authentication":{"ApiUserId":"String","ApiUserKey":"String"},"Page":0,"SortOrder":"String","NameSearch":"String"}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"Data":{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String"}]},"TotalSearchRecords":0,"CurrentPageNum":0,"MaxPageNum":0,"SearchRecords":[{"Id":0,"SearchType":"String","DateSearched":"\/Date(-62135596800000-0000)\/","DateUpdated":"\/Date(-62135596800000-0000)\/","NumOfResults":0,"ClientInResults":false,"ClientNotInResults":false,"AffectedByUpdate":false,"SearchCriteria":{"Name":"String","DateOfBirth":"String","CountryOfBirth":"String","Nationality":"String","Address":"String"}}]}}