GET | /clients | Get all clients |
---|
import 'package:servicestack/servicestack.dart';
// @DataContract
class Authentication implements IConvertible
{
/**
* The API User ID provided by us when you signed up to use our API
*/
// @DataMember
// @ApiMember(Description="The API User ID provided by us when you signed up to use our API", IsRequired=true, ParameterType="header, body")
String? apiUserId;
/**
* The API User Key provided by us when you signed up to use our API
*/
// @DataMember
// @ApiMember(Description="The API User Key provided by us when you signed up to use our API", IsRequired=true, ParameterType="header, body")
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;
}
// @DataContract
class BaseRequest implements IBaseRequest, IConvertible
{
/**
* The authentication credentials
*/
// @DataMember
// @ApiMember(Description="The authentication credentials", IsRequired=true, ParameterType="header, body")
Authentication? authentication;
BaseRequest({this.authentication});
BaseRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
authentication = JsonConverters.fromJson(json['authentication'],'Authentication',context!);
return this;
}
Map<String, dynamic> toJson() => {
'authentication': JsonConverters.toJson(authentication,'Authentication',context!)
};
getTypeName() => "BaseRequest";
TypeContext? context = _ctx;
}
// @DataContract
class PagedRequest extends BaseRequest implements IConvertible
{
/**
* The maximum number of records to be returned in one page
*/
// @DataMember(Name="page[limit]")
// @ApiMember(Description="The maximum number of records to be returned in one page", ParameterType="query")
int? page_limit_;
/**
* The starting point in the list of records from where the data should be fetched. Zero based index.
*/
// @DataMember(Name="page[offset]")
// @ApiMember(Description="The starting point in the list of records from where the data should be fetched. Zero based index.", ParameterType="query")
int? page_offset_;
/**
* The term to determine the order in which the data is returned
*/
// @DataMember
// @ApiMember(Description="The term to determine the order in which the data is returned", ParameterType="query")
String? sort;
PagedRequest({this.page_limit_,this.page_offset_,this.sort});
PagedRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
page_limit_ = json['pageLimit'];
page_offset_ = json['pageOffset'];
sort = json['sort'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'page_limit_': page_limit_,
'page_offset_': page_offset_,
'sort': sort
});
getTypeName() => "PagedRequest";
TypeContext? context = _ctx;
}
// @DataContract(Name="ClientState", Namespace="http://schemas.servicestack.net/types")
enum ClientState
{
Undefined,
PendingCompletion,
PendingOcr,
PendingVerification,
Verified,
}
// @DataContract
class GetClients extends PagedRequest implements IConvertible
{
/**
* Filter the results to those that have a State matching the state specified
*/
// @DataMember
// @ApiMember(Description="Filter the results to those that have a State matching the state specified", ParameterType="query")
ClientState? state;
/**
* Filter the results to those that have a IsValidateMe flag matching the specified value
*/
// @DataMember
// @ApiMember(Description="Filter the results to those that have a IsValidateMe flag matching the specified value", ParameterType="query")
bool? isValidateMe;
/**
* Filter the results to those that have a Name including the specified value
*/
// @DataMember
// @ApiMember(Description="Filter the results to those that have a Name including the specified value", ParameterType="query")
String? name;
/**
* Filter the results to those that were created after (or on) this date
*/
// @DataMember
// @ApiMember(Description="Filter the results to those that were created after (or on) this date", ParameterType="query")
DateTime? dateFrom;
/**
* Filter the results to those that were created before this date
*/
// @DataMember
// @ApiMember(Description="Filter the results to those that were created before this date", ParameterType="query")
DateTime? dateTo;
/**
* If the searches are being accessed by a sub user, specify their username here to only return searches they have permissions to view
*/
// @DataMember
// @ApiMember(Description="If the searches are being accessed by a sub user, specify their username here to only return searches they have permissions to view", ParameterType="query")
String? subUserName;
GetClients({this.state,this.isValidateMe,this.name,this.dateFrom,this.dateTo,this.subUserName});
GetClients.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
state = JsonConverters.fromJson(json['state'],'ClientState',context!);
isValidateMe = json['isValidateMe'];
name = json['name'];
dateFrom = JsonConverters.fromJson(json['dateFrom'],'DateTime',context!);
dateTo = JsonConverters.fromJson(json['dateTo'],'DateTime',context!);
subUserName = json['subUserName'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'state': JsonConverters.toJson(state,'ClientState',context!),
'isValidateMe': isValidateMe,
'name': name,
'dateFrom': JsonConverters.toJson(dateFrom,'DateTime',context!),
'dateTo': JsonConverters.toJson(dateTo,'DateTime',context!),
'subUserName': subUserName
});
getTypeName() => "GetClients";
TypeContext? context = _ctx;
}
class Links implements IConvertible
{
// @apiMember()
String? self;
Links({this.self});
Links.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
self = json['self'];
return this;
}
Map<String, dynamic> toJson() => {
'self': self
};
getTypeName() => "Links";
TypeContext? context = _ctx;
}
class Image implements IConvertible
{
int? id;
String? name;
int? ocrId;
String? url;
Image({this.id,this.name,this.ocrId,this.url});
Image.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
ocrId = json['ocrId'];
url = json['url'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'name': name,
'ocrId': ocrId,
'url': url
};
getTypeName() => "Image";
TypeContext? context = _ctx;
}
class ClientShort implements IConvertible
{
int? id;
DateTime? dateCreated;
String? name;
String? reference;
bool? isValidateMe;
ClientState? state;
Links? links;
int? numOfDocuments;
Image? photo;
ClientShort({this.id,this.dateCreated,this.name,this.reference,this.isValidateMe,this.state,this.links,this.numOfDocuments,this.photo});
ClientShort.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
dateCreated = JsonConverters.fromJson(json['dateCreated'],'DateTime',context!);
name = json['name'];
reference = json['reference'];
isValidateMe = json['isValidateMe'];
state = JsonConverters.fromJson(json['state'],'ClientState',context!);
links = JsonConverters.fromJson(json['links'],'Links',context!);
numOfDocuments = json['numOfDocuments'];
photo = JsonConverters.fromJson(json['photo'],'Image',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'dateCreated': JsonConverters.toJson(dateCreated,'DateTime',context!),
'name': name,
'reference': reference,
'isValidateMe': isValidateMe,
'state': JsonConverters.toJson(state,'ClientState',context!),
'links': JsonConverters.toJson(links,'Links',context!),
'numOfDocuments': numOfDocuments,
'photo': JsonConverters.toJson(photo,'Image',context!)
};
getTypeName() => "ClientShort";
TypeContext? context = _ctx;
}
class ArrayOfClientShort extends ListBase<ClientShort> implements IConvertible
{
final List<ClientShort> l = [];
set length(int newLength) { l.length = newLength; }
int get length => l.length;
ClientShort operator [](int index) => l[index];
void operator []=(int index, ClientShort value) { l[index] = value; }
ArrayOfClientShort();
ArrayOfClientShort.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "ArrayOfClientShort";
TypeContext? context = _ctx;
}
class GetClientsData extends PagedResponse<GetClients> implements IConvertible
{
ArrayOfClientShort? clients;
GetClientsData({this.clients});
GetClientsData.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
clients = JsonConverters.fromJson(json['clients'],'ArrayOfClientShort',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'clients': JsonConverters.toJson(clients,'ArrayOfClientShort',context!)
});
getTypeName() => "GetClientsData";
TypeContext? context = _ctx;
}
// @DataContract
class GetClientsResponse implements IConvertible
{
// @DataMember
GetClientsData? data;
GetClientsResponse({this.data});
GetClientsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
data = JsonConverters.fromJson(json['data'],'GetClientsData',context!);
return this;
}
Map<String, dynamic> toJson() => {
'data': JsonConverters.toJson(data,'GetClientsData',context!)
};
getTypeName() => "GetClientsResponse";
TypeContext? context = _ctx;
}
// @DataContract
class ResponseError implements IConvertible
{
// @DataMember(Order=1)
String? errorCode;
// @DataMember(Order=2)
String? fieldName;
// @DataMember(Order=3)
String? message;
// @DataMember(Order=4)
Map<String,String?>? meta;
ResponseError({this.errorCode,this.fieldName,this.message,this.meta});
ResponseError.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
errorCode = json['errorCode'];
fieldName = json['fieldName'];
message = json['message'];
meta = JsonConverters.toStringMap(json['meta']);
return this;
}
Map<String, dynamic> toJson() => {
'errorCode': errorCode,
'fieldName': fieldName,
'message': message,
'meta': meta
};
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;
// @DataMember(Order=5)
Map<String,String?>? meta;
ResponseStatus({this.errorCode,this.message,this.stackTrace,this.errors,this.meta});
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!);
meta = JsonConverters.toStringMap(json['meta']);
return this;
}
Map<String, dynamic> toJson() => {
'errorCode': errorCode,
'message': message,
'stackTrace': stackTrace,
'errors': JsonConverters.toJson(errors,'ArrayOfResponseError',context!),
'meta': meta
};
getTypeName() => "ResponseStatus";
TypeContext? context = _ctx;
}
class BaseResponse implements IBaseDataResponse, IHasResponseStatus, IConvertible
{
/**
* The status of the response
*/
// @ApiMember(Description="The status of the response")
ResponseStatus? responseStatus;
BaseResponse({this.responseStatus});
BaseResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
};
getTypeName() => "BaseResponse";
TypeContext? context = _ctx;
}
class PagedResponse<T> extends BaseResponse implements IConvertible
{
/**
* The response Metadata
*/
// @ApiMember(Description="The response Metadata")
Meta<T>? meta;
PagedResponse({this.meta});
PagedResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
meta = JsonConverters.fromJson(json['meta'],'Meta<${runtimeGenericTypeDefs(this,[0]).join(",")}>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'meta': JsonConverters.toJson(meta,'Meta<T>',context!)
});
getTypeName() => "PagedResponse<$T>";
TypeContext? context = _ctx;
}
class MetaLinks extends Links implements IConvertible
{
/**
* The link to the first page of records
*/
// @ApiMember(Description="The link to the first page of records")
String? first;
/**
* The link to the last page of records
*/
// @ApiMember(Description="The link to the last page of records")
String? last;
/**
* The link to the next page of records, if applicable
*/
// @ApiMember(Description="The link to the next page of records, if applicable")
String? next;
/**
* The link to the last page of records, if applicable
*/
// @ApiMember(Description="The link to the last page of records, if applicable")
String? prev;
MetaLinks({this.first,this.last,this.next,this.prev});
MetaLinks.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
first = json['first'];
last = json['last'];
next = json['next'];
prev = json['prev'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'first': first,
'last': last,
'next': next,
'prev': prev
});
getTypeName() => "MetaLinks";
TypeContext? context = _ctx;
}
class Meta<T> implements IConvertible
{
/**
* Pagination links
*/
// @ApiMember(Description="Pagination links")
MetaLinks? links;
/**
* The total number of records for the query
*/
// @ApiMember(Description="The total number of records for the query")
int? totalCount;
/**
* The maximum number of records to be returned in one page
*/
// @ApiMember(Description="The maximum number of records to be returned in one page")
int? pageLimit;
/**
* The starting point in the list of records from where the data should be fetched. Zero based index.
*/
// @ApiMember(Description="The starting point in the list of records from where the data should be fetched. Zero based index.")
int? pageOffset;
Meta({this.links,this.totalCount,this.pageLimit,this.pageOffset});
Meta.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
links = JsonConverters.fromJson(json['links'],'MetaLinks',context!);
totalCount = json['totalCount'];
pageLimit = json['pageLimit'];
pageOffset = json['pageOffset'];
return this;
}
Map<String, dynamic> toJson() => {
'links': JsonConverters.toJson(links,'MetaLinks',context!),
'totalCount': totalCount,
'pageLimit': pageLimit,
'pageOffset': pageOffset
};
getTypeName() => "Meta<$T>";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.sanctionssearch.com', types: <String, TypeInfo> {
'Authentication': TypeInfo(TypeOf.Class, create:() => Authentication()),
'BaseRequest': TypeInfo(TypeOf.Class, create:() => BaseRequest()),
'PagedRequest': TypeInfo(TypeOf.Class, create:() => PagedRequest()),
'ClientState': TypeInfo(TypeOf.Enum, enumValues:ClientState.values),
'GetClients': TypeInfo(TypeOf.Class, create:() => GetClients()),
'Links': TypeInfo(TypeOf.Class, create:() => Links()),
'Image': TypeInfo(TypeOf.Class, create:() => Image()),
'ClientShort': TypeInfo(TypeOf.Class, create:() => ClientShort()),
'ArrayOfClientShort': TypeInfo(TypeOf.Class, create:() => ArrayOfClientShort()),
'GetClientsData': TypeInfo(TypeOf.Class, create:() => GetClientsData()),
'GetClientsResponse': TypeInfo(TypeOf.Class, create:() => GetClientsResponse()),
'ArrayOfResponseError': TypeInfo(TypeOf.Class, create:() => ArrayOfResponseError()),
'BaseResponse': TypeInfo(TypeOf.Class, create:() => BaseResponse()),
'PagedResponse<T>': TypeInfo(TypeOf.Class, create:() => PagedResponse<T>()),
'MetaLinks': TypeInfo(TypeOf.Class, create:() => MetaLinks()),
'Meta<T>': TypeInfo(TypeOf.Class, create:() => Meta<T>()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /clients HTTP/1.1 Host: api.sanctionssearch.com Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <GetClientsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types"> <Data> <ResponseStatus> <ErrorCode>String</ErrorCode> <Message>String</Message> <StackTrace>String</StackTrace> <Errors> <ResponseError> <ErrorCode>String</ErrorCode> <FieldName>String</FieldName> <Message>String</Message> <Meta xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d6p1:KeyValueOfstringstring> <d6p1:Key>String</d6p1:Key> <d6p1:Value>String</d6p1:Value> </d6p1:KeyValueOfstringstring> </Meta> </ResponseError> </Errors> <Meta xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d4p1:KeyValueOfstringstring> <d4p1:Key>String</d4p1:Key> <d4p1:Value>String</d4p1:Value> </d4p1:KeyValueOfstringstring> </Meta> </ResponseStatus> <Meta> <Links> <Self>String</Self> <First>String</First> <Last>String</Last> <Next>String</Next> <Prev>String</Prev> </Links> <PageLimit>0</PageLimit> <PageOffset>0</PageOffset> <TotalCount>0</TotalCount> </Meta> <Clients> <ClientShort> <DateCreated>0001-01-01T00:00:00</DateCreated> <Id>0</Id> <IsValidateMe>false</IsValidateMe> <Links> <Self>String</Self> </Links> <Name>String</Name> <NumOfDocuments>0</NumOfDocuments> <Photo> <Id>0</Id> <Name>String</Name> <OcrId>0</OcrId> <Url>String</Url> </Photo> <Reference>String</Reference> <State>Undefined</State> </ClientShort> </Clients> </Data> </GetClientsResponse>