POST | /bulksearches/list | Get all bulk searches |
---|
<?php namespace dtos;
use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};
// @DataContract
class Authentication implements JsonSerializable
{
public function __construct(
/** @description 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")
/** @var string */
public string $apiUserId='',
/** @description 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")
/** @var string */
public string $apiUserKey=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['apiUserId'])) $this->apiUserId = $o['apiUserId'];
if (isset($o['apiUserKey'])) $this->apiUserKey = $o['apiUserKey'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->apiUserId)) $o['apiUserId'] = $this->apiUserId;
if (isset($this->apiUserKey)) $o['apiUserKey'] = $this->apiUserKey;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class BaseRequest implements IBaseRequest, JsonSerializable
{
public function __construct(
/** @description The authentication credentials */
// @DataMember
// @ApiMember(Description="The authentication credentials", IsRequired=true, ParameterType="header, body")
/** @var Authentication|null */
public ?Authentication $authentication=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['authentication'])) $this->authentication = JsonConverters::from('Authentication', $o['authentication']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->authentication)) $o['authentication'] = JsonConverters::to('Authentication', $this->authentication);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class ResponseError implements JsonSerializable
{
public function __construct(
// @DataMember(Order=1)
/** @var string|null */
public ?string $errorCode=null,
// @DataMember(Order=2)
/** @var string|null */
public ?string $fieldName=null,
// @DataMember(Order=3)
/** @var string|null */
public ?string $message=null,
// @DataMember(Order=4)
/** @var array<string,string>|null */
public ?array $meta=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['errorCode'])) $this->errorCode = $o['errorCode'];
if (isset($o['fieldName'])) $this->fieldName = $o['fieldName'];
if (isset($o['message'])) $this->message = $o['message'];
if (isset($o['meta'])) $this->meta = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['meta']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->errorCode)) $o['errorCode'] = $this->errorCode;
if (isset($this->fieldName)) $o['fieldName'] = $this->fieldName;
if (isset($this->message)) $o['message'] = $this->message;
if (isset($this->meta)) $o['meta'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->meta);
return empty($o) ? new class(){} : $o;
}
}
/**
* @template array of ResponseError
*/
class ArrayOfResponseError extends \ArrayObject implements JsonSerializable
{
public function __construct(ResponseError ...$items) {
parent::__construct($items, \ArrayObject::STD_PROP_LIST);
}
/** @throws \Exception */
public function append($value): void {
if ($value instanceof ResponseError)
parent::append($value);
else
throw new \Exception("Can only append a ResponseError to " . __CLASS__);
}
/** @throws Exception */
public function fromMap($o): void {
foreach ($o as $item) {
$el = new ResponseError();
$el->fromMap($item);
$this->append($el);
}
}
/** @throws Exception */
public function jsonSerialize(): array {
return parent::getArrayCopy();
}
}
// @DataContract
class ResponseStatus implements JsonSerializable
{
public function __construct(
// @DataMember(Order=1)
/** @var string|null */
public ?string $errorCode=null,
// @DataMember(Order=2)
/** @var string|null */
public ?string $message=null,
// @DataMember(Order=3)
/** @var string|null */
public ?string $stackTrace=null,
// @DataMember(Order=4)
/** @var ArrayOfResponseError|null */
public ?ArrayOfResponseError $errors=null,
// @DataMember(Order=5)
/** @var array<string,string>|null */
public ?array $meta=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['errorCode'])) $this->errorCode = $o['errorCode'];
if (isset($o['message'])) $this->message = $o['message'];
if (isset($o['stackTrace'])) $this->stackTrace = $o['stackTrace'];
if (isset($o['errors'])) $this->errors = JsonConverters::from('ArrayOfResponseError', $o['errors']);
if (isset($o['meta'])) $this->meta = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['meta']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->errorCode)) $o['errorCode'] = $this->errorCode;
if (isset($this->message)) $o['message'] = $this->message;
if (isset($this->stackTrace)) $o['stackTrace'] = $this->stackTrace;
if (isset($this->errors)) $o['errors'] = JsonConverters::to('ArrayOfResponseError', $this->errors);
if (isset($this->meta)) $o['meta'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->meta);
return empty($o) ? new class(){} : $o;
}
}
class BaseResponse implements IBaseDataResponse, IHasResponseStatus, JsonSerializable
{
public function __construct(
/** @description The status of the response */
// @ApiMember(Description="The status of the response")
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
return empty($o) ? new class(){} : $o;
}
}
class BulkSearchStatus implements JsonSerializable
{
public function __construct(
/** @var int */
public int $bulkSearchId=0,
/** @var bool|null */
public ?bool $success=null,
/** @var string|null */
public ?string $status=null,
/** @var int */
public int $total=0,
/** @var string|null */
public ?string $message=null,
/** @var int */
public int $processed=0,
/** @var bool|null */
public ?bool $isPepSearch=null,
/** @var bool|null */
public ?bool $isSanctionsSearch=null,
/** @var int */
public int $totalPep=0,
/** @var int */
public int $processedPep=0,
/** @var int */
public int $totalSanctions=0,
/** @var int */
public int $processedSanctions=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['bulkSearchId'])) $this->bulkSearchId = $o['bulkSearchId'];
if (isset($o['success'])) $this->success = $o['success'];
if (isset($o['status'])) $this->status = $o['status'];
if (isset($o['total'])) $this->total = $o['total'];
if (isset($o['message'])) $this->message = $o['message'];
if (isset($o['processed'])) $this->processed = $o['processed'];
if (isset($o['isPepSearch'])) $this->isPepSearch = $o['isPepSearch'];
if (isset($o['isSanctionsSearch'])) $this->isSanctionsSearch = $o['isSanctionsSearch'];
if (isset($o['totalPep'])) $this->totalPep = $o['totalPep'];
if (isset($o['processedPep'])) $this->processedPep = $o['processedPep'];
if (isset($o['totalSanctions'])) $this->totalSanctions = $o['totalSanctions'];
if (isset($o['processedSanctions'])) $this->processedSanctions = $o['processedSanctions'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->bulkSearchId)) $o['bulkSearchId'] = $this->bulkSearchId;
if (isset($this->success)) $o['success'] = $this->success;
if (isset($this->status)) $o['status'] = $this->status;
if (isset($this->total)) $o['total'] = $this->total;
if (isset($this->message)) $o['message'] = $this->message;
if (isset($this->processed)) $o['processed'] = $this->processed;
if (isset($this->isPepSearch)) $o['isPepSearch'] = $this->isPepSearch;
if (isset($this->isSanctionsSearch)) $o['isSanctionsSearch'] = $this->isSanctionsSearch;
if (isset($this->totalPep)) $o['totalPep'] = $this->totalPep;
if (isset($this->processedPep)) $o['processedPep'] = $this->processedPep;
if (isset($this->totalSanctions)) $o['totalSanctions'] = $this->totalSanctions;
if (isset($this->processedSanctions)) $o['processedSanctions'] = $this->processedSanctions;
return empty($o) ? new class(){} : $o;
}
}
/**
* @template array of BulkSearchStatus
*/
class ArrayOfBulkSearchStatus extends \ArrayObject implements JsonSerializable
{
public function __construct(BulkSearchStatus ...$items) {
parent::__construct($items, \ArrayObject::STD_PROP_LIST);
}
/** @throws \Exception */
public function append($value): void {
if ($value instanceof BulkSearchStatus)
parent::append($value);
else
throw new \Exception("Can only append a BulkSearchStatus to " . __CLASS__);
}
/** @throws Exception */
public function fromMap($o): void {
foreach ($o as $item) {
$el = new BulkSearchStatus();
$el->fromMap($item);
$this->append($el);
}
}
/** @throws Exception */
public function jsonSerialize(): array {
return parent::getArrayCopy();
}
}
class GetBulkSearchHistoryData extends BaseResponse implements JsonSerializable
{
/**
* @param ResponseStatus|null $responseStatus
*/
public function __construct(
?ResponseStatus $responseStatus=null,
/** @var ArrayOfBulkSearchStatus|null */
public ?ArrayOfBulkSearchStatus $bulkSearchList=null,
/** @var int */
public int $currentPageNum=0,
/** @var int */
public int $maxPageNum=0,
/** @var int */
public int $totalBulkSearches=0,
/** @var int */
public int $pageSize=0
) {
parent::__construct($responseStatus);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['bulkSearchList'])) $this->bulkSearchList = JsonConverters::from('ArrayOfBulkSearchStatus', $o['bulkSearchList']);
if (isset($o['currentPageNum'])) $this->currentPageNum = $o['currentPageNum'];
if (isset($o['maxPageNum'])) $this->maxPageNum = $o['maxPageNum'];
if (isset($o['totalBulkSearches'])) $this->totalBulkSearches = $o['totalBulkSearches'];
if (isset($o['pageSize'])) $this->pageSize = $o['pageSize'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->bulkSearchList)) $o['bulkSearchList'] = JsonConverters::to('ArrayOfBulkSearchStatus', $this->bulkSearchList);
if (isset($this->currentPageNum)) $o['currentPageNum'] = $this->currentPageNum;
if (isset($this->maxPageNum)) $o['maxPageNum'] = $this->maxPageNum;
if (isset($this->totalBulkSearches)) $o['totalBulkSearches'] = $this->totalBulkSearches;
if (isset($this->pageSize)) $o['pageSize'] = $this->pageSize;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class GetBulkSearchHistoryResponse implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var GetBulkSearchHistoryData|null */
public ?GetBulkSearchHistoryData $data=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['data'])) $this->data = JsonConverters::from('GetBulkSearchHistoryData', $o['data']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->data)) $o['data'] = JsonConverters::to('GetBulkSearchHistoryData', $this->data);
return empty($o) ? new class(){} : $o;
}
}
class GetBulkSearchHistoryRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $subUserName=null,
/** @var int */
public int $page=0,
/** @var string|null */
public ?string $sortOrder=null,
/** @description The user id to filter on, in string format (GUID) */
// @ApiMember(Description="The user id to filter on, in string format (GUID)")
/** @var string|null */
public ?string $whereUserId=null,
/** @var DateTime|null */
public ?DateTime $whereDateFrom=null,
/** @var DateTime|null */
public ?DateTime $whereDateTo=null,
/** @var int|null */
public ?int $whereId=null,
/** @var int */
public int $pageSize=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['subUserName'])) $this->subUserName = $o['subUserName'];
if (isset($o['page'])) $this->page = $o['page'];
if (isset($o['sortOrder'])) $this->sortOrder = $o['sortOrder'];
if (isset($o['whereUserId'])) $this->whereUserId = $o['whereUserId'];
if (isset($o['whereDateFrom'])) $this->whereDateFrom = JsonConverters::from('DateTime', $o['whereDateFrom']);
if (isset($o['whereDateTo'])) $this->whereDateTo = JsonConverters::from('DateTime', $o['whereDateTo']);
if (isset($o['whereId'])) $this->whereId = $o['whereId'];
if (isset($o['pageSize'])) $this->pageSize = $o['pageSize'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->subUserName)) $o['subUserName'] = $this->subUserName;
if (isset($this->page)) $o['page'] = $this->page;
if (isset($this->sortOrder)) $o['sortOrder'] = $this->sortOrder;
if (isset($this->whereUserId)) $o['whereUserId'] = $this->whereUserId;
if (isset($this->whereDateFrom)) $o['whereDateFrom'] = JsonConverters::to('DateTime', $this->whereDateFrom);
if (isset($this->whereDateTo)) $o['whereDateTo'] = JsonConverters::to('DateTime', $this->whereDateTo);
if (isset($this->whereId)) $o['whereId'] = $this->whereId;
if (isset($this->pageSize)) $o['pageSize'] = $this->pageSize;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class GetBulkSearchHistory extends BaseRequest implements JsonSerializable
{
/**
* @param Authentication|null $authentication
*/
public function __construct(
?Authentication $authentication=null,
// @DataMember
/** @var GetBulkSearchHistoryRequest|null */
public ?GetBulkSearchHistoryRequest $request=null
) {
parent::__construct($authentication);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['request'])) $this->request = JsonConverters::from('GetBulkSearchHistoryRequest', $o['request']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->request)) $o['request'] = JsonConverters::to('GetBulkSearchHistoryRequest', $this->request);
return empty($o) ? new class(){} : $o;
}
}
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.
POST /bulksearches/list HTTP/1.1
Host: api.sanctionssearch.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<GetBulkSearchHistory xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
<Authentication>
<ApiUserId>String</ApiUserId>
<ApiUserKey>String</ApiUserKey>
</Authentication>
<Request>
<WhereUserId>String</WhereUserId>
</Request>
</GetBulkSearchHistory>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <GetBulkSearchHistoryResponse 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> <BulkSearchList> <BulkSearch> <BulkSearchId>0</BulkSearchId> <IsPepSearch>false</IsPepSearch> <IsSanctionsSearch>false</IsSanctionsSearch> <Message>String</Message> <Processed>0</Processed> <ProcessedPep>0</ProcessedPep> <ProcessedSanctions>0</ProcessedSanctions> <Status>String</Status> <Success>false</Success> <Total>0</Total> <TotalPep>0</TotalPep> <TotalSanctions>0</TotalSanctions> </BulkSearch> </BulkSearchList> <CurrentPageNum>0</CurrentPageNum> <MaxPageNum>0</MaxPageNum> <PageSize>0</PageSize> <TotalBulkSearches>0</TotalBulkSearches> </Data> </GetBulkSearchHistoryResponse>