<?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 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
) {
}
/** @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'];
}
/** @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;
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
) {
}
/** @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']);
}
/** @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);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class UpdateSearchStatusData implements IBaseDataResponse, IHasResponseStatus, JsonSerializable
{
public function __construct(
/** @description Response status object */
// @DataMember
// @ApiMember(DataType="ResponseStatus", Description="Response status object")
/** @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;
}
}
// @DataContract
class UpdateSearchStatusResponse implements JsonSerializable
{
public function __construct(
/** @description Response object */
// @DataMember
// @ApiMember(DataType="UpdateSearchStatusData", Description="Response object")
/** @var UpdateSearchStatusData|null */
public ?UpdateSearchStatusData $Data=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Data'])) $this->Data = JsonConverters::from('UpdateSearchStatusData', $o['Data']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Data)) $o['Data'] = JsonConverters::to('UpdateSearchStatusData', $this->Data);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class Authentication implements IAuthentication, JsonSerializable
{
public function __construct(
/** @description 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)
/** @var string */
public string $ApiUserId='',
/** @description 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)
/** @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 UpdateSearchStatusRequest implements JsonSerializable
{
public function __construct(
/** @description The ID of the sanctions search that is being resolved/updated. */
// @DataMember
// @ApiMember(DataType="integer", Description="The ID of the sanctions search that is being resolved/updated.", Format="int64", IsRequired=true)
/** @var int */
public int $Id=0,
/** @description Whether the search results <b>did</b> contain the client. Set this to "<b>true</b>" if the client <b>WAS</b> found in the search results. */
// @DataMember
// @ApiMember(DataType="boolean", Description="Whether the search results <b>did</b> contain the client. Set this to \"<b>true</b>\" if the client <b>WAS</b> found in the search results.", IsRequired=true)
/** @var bool|null */
public ?bool $ClientInResults=null,
/** @description Whether the search results <b>did not</b> contain the client. Set this to "<b>true</b>" if the client <b>WAS NOT</b> found in the search results. */
// @DataMember
// @ApiMember(DataType="boolean", Description="Whether the search results <b>did not</b> contain the client. Set this to \"<b>true</b>\" if the client <b>WAS NOT</b> found in the search results.", IsRequired=true)
/** @var bool|null */
public ?bool $ClientNotInResults=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['ClientInResults'])) $this->ClientInResults = $o['ClientInResults'];
if (isset($o['ClientNotInResults'])) $this->ClientNotInResults = $o['ClientNotInResults'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->ClientInResults)) $o['ClientInResults'] = $this->ClientInResults;
if (isset($this->ClientNotInResults)) $o['ClientNotInResults'] = $this->ClientNotInResults;
return empty($o) ? new class(){} : $o;
}
}
/** @description Update/resolve a sanctions search */
// @Api(Description="Update/resolve a sanctions search")
// @ApiResponse(Description="Your request is successful if the \"<em>Data.ResponseStatus.Message</em>\" field is \"<b>Success</b>\".", StatusCode=200)
// @DataContract
class UpdateSearchStatus implements IBaseRequest, JsonSerializable
{
public function __construct(
/** @description Authentication object */
// @DataMember
// @ApiMember(DataType="Authentication", Description="Authentication object", IsRequired=true)
/** @var Authentication|null */
public ?Authentication $Authentication=null,
/** @description Request object */
// @DataMember
// @ApiMember(DataType="UpdateSearchStatusRequest", Description="Request object", IsRequired=true)
/** @var UpdateSearchStatusRequest|null */
public ?UpdateSearchStatusRequest $Request=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Authentication'])) $this->Authentication = JsonConverters::from('Authentication', $o['Authentication']);
if (isset($o['Request'])) $this->Request = JsonConverters::from('UpdateSearchStatusRequest', $o['Request']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Authentication)) $o['Authentication'] = JsonConverters::to('Authentication', $this->Authentication);
if (isset($this->Request)) $o['Request'] = JsonConverters::to('UpdateSearchStatusRequest', $this->Request);
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .soap12 suffix or ?format=soap12
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /soap12 HTTP/1.1
Host: api.sanctionssearch.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<UpdateSearchStatus xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
<Authentication>
<ApiUserId>String</ApiUserId>
<ApiUserKey>String</ApiUserKey>
</Authentication>
<Request>
<ClientInResults>false</ClientInResults>
<ClientNotInResults>false</ClientNotInResults>
<Id>0</Id>
</Request>
</UpdateSearchStatus>
</soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <UpdateSearchStatusResponse 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> </ResponseError> </Errors> </ResponseStatus> </Data> </UpdateSearchStatusResponse> </soap12:Body> </soap12:Envelope>