Sanctions Search API: v2

<back to all web services

AddClient

Clients
The following routes are available for this service:
POST/clientsAdd a client
<?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 LinkedTo implements JsonSerializable
{
    public function __construct(
        /** @var int|null */
        public ?int $clientId=null,
        /** @var int|null */
        public ?int $id=null,
        /** @var string|null */
        public ?string $type=null,
        /** @var string|null */
        public ?string $subtype=null,
        /** @var string|null */
        public ?string $status=null,
        /** @var string|null */
        public ?string $description=null,
        /** @var bool|null */
        public ?bool $isArchived=null,
        /** @var string|null */
        public ?string $name=null,
        /** @var DateTime|null */
        public ?DateTime $date=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['clientId'])) $this->clientId = $o['clientId'];
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['type'])) $this->type = $o['type'];
        if (isset($o['subtype'])) $this->subtype = $o['subtype'];
        if (isset($o['status'])) $this->status = $o['status'];
        if (isset($o['description'])) $this->description = $o['description'];
        if (isset($o['isArchived'])) $this->isArchived = $o['isArchived'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['date'])) $this->date = JsonConverters::from('DateTime', $o['date']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->clientId)) $o['clientId'] = $this->clientId;
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->type)) $o['type'] = $this->type;
        if (isset($this->subtype)) $o['subtype'] = $this->subtype;
        if (isset($this->status)) $o['status'] = $this->status;
        if (isset($this->description)) $o['description'] = $this->description;
        if (isset($this->isArchived)) $o['isArchived'] = $this->isArchived;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->date)) $o['date'] = JsonConverters::to('DateTime', $this->date);
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template array of LinkedTo
 */
class ArrayOfLinkedTo extends \ArrayObject implements JsonSerializable
{
    public function __construct(LinkedTo ...$items) {
        parent::__construct($items, \ArrayObject::STD_PROP_LIST);
    }
    
    /** @throws \Exception */
    public function append($value): void {
        if ($value instanceof LinkedTo)
            parent::append($value);
        else
            throw new \Exception("Can only append a LinkedTo to " . __CLASS__);
    }
    
    /** @throws Exception */
    public function fromMap($o): void {
        foreach ($o as $item) {
            $el = new LinkedTo();
            $el->fromMap($item);
            $this->append($el);
        }
    }
    
    /** @throws Exception */
    public function jsonSerialize(): array {
        return parent::getArrayCopy();
    }
}

// @DataContract(Name="ClientState", Namespace="http://schemas.servicestack.net/types")
enum ClientState : string
{
    case Undefined = 'Undefined';
    case PendingCompletion = 'PendingCompletion';
    case PendingOcr = 'PendingOcr';
    case PendingVerification = 'PendingVerification';
    case Verified = 'Verified';
}

class Face implements JsonSerializable
{
    public function __construct(
        /** @var float|null */
        public ?float $age=null,
        /** @var string|null */
        public ?string $gender=null,
        /** @var string|null */
        public ?string $emotion=null,
        /** @var float|null */
        public ?float $smile=null,
        /** @var string|null */
        public ?string $hairColour=null,
        /** @var string|null */
        public ?string $facialHair=null,
        /** @var string|null */
        public ?string $makeup=null,
        /** @var string|null */
        public ?string $glasses=null,
        /** @var string|null */
        public ?string $accessories=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['age'])) $this->age = $o['age'];
        if (isset($o['gender'])) $this->gender = $o['gender'];
        if (isset($o['emotion'])) $this->emotion = $o['emotion'];
        if (isset($o['smile'])) $this->smile = $o['smile'];
        if (isset($o['hairColour'])) $this->hairColour = $o['hairColour'];
        if (isset($o['facialHair'])) $this->facialHair = $o['facialHair'];
        if (isset($o['makeup'])) $this->makeup = $o['makeup'];
        if (isset($o['glasses'])) $this->glasses = $o['glasses'];
        if (isset($o['accessories'])) $this->accessories = $o['accessories'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->age)) $o['age'] = $this->age;
        if (isset($this->gender)) $o['gender'] = $this->gender;
        if (isset($this->emotion)) $o['emotion'] = $this->emotion;
        if (isset($this->smile)) $o['smile'] = $this->smile;
        if (isset($this->hairColour)) $o['hairColour'] = $this->hairColour;
        if (isset($this->facialHair)) $o['facialHair'] = $this->facialHair;
        if (isset($this->makeup)) $o['makeup'] = $this->makeup;
        if (isset($this->glasses)) $o['glasses'] = $this->glasses;
        if (isset($this->accessories)) $o['accessories'] = $this->accessories;
        return empty($o) ? new class(){} : $o;
    }
}

class VideoTimestamp implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $tagName=null,
        /** @var int|null */
        public ?int $milli=null,
        /** @var string|null */
        public ?string $imageUrl=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['tagName'])) $this->tagName = $o['tagName'];
        if (isset($o['milli'])) $this->milli = $o['milli'];
        if (isset($o['imageUrl'])) $this->imageUrl = $o['imageUrl'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->tagName)) $o['tagName'] = $this->tagName;
        if (isset($this->milli)) $o['milli'] = $this->milli;
        if (isset($this->imageUrl)) $o['imageUrl'] = $this->imageUrl;
        return empty($o) ? new class(){} : $o;
    }
}

class Video implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $id=0,
        /** @var string|null */
        public ?string $videoUrl=null,
        /** @var string|null */
        public ?string $imageUrl=null,
        /** @var array<VideoTimestamp>|null */
        public ?array $videoTimestamps=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['videoUrl'])) $this->videoUrl = $o['videoUrl'];
        if (isset($o['imageUrl'])) $this->imageUrl = $o['imageUrl'];
        if (isset($o['videoTimestamps'])) $this->videoTimestamps = JsonConverters::fromArray('VideoTimestamp', $o['videoTimestamps']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->videoUrl)) $o['videoUrl'] = $this->videoUrl;
        if (isset($this->imageUrl)) $o['imageUrl'] = $this->imageUrl;
        if (isset($this->videoTimestamps)) $o['videoTimestamps'] = JsonConverters::toArray('VideoTimestamp', $this->videoTimestamps);
        return empty($o) ? new class(){} : $o;
    }
}

class Location implements JsonSerializable
{
    public function __construct(
        /** @var float */
        public float $latitude=0.0,
        /** @var float */
        public float $longitude=0.0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['latitude'])) $this->latitude = $o['latitude'];
        if (isset($o['longitude'])) $this->longitude = $o['longitude'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->latitude)) $o['latitude'] = $this->latitude;
        if (isset($this->longitude)) $o['longitude'] = $this->longitude;
        return empty($o) ? new class(){} : $o;
    }
}

class Image implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $id=0,
        /** @var string|null */
        public ?string $name=null,
        /** @var int|null */
        public ?int $ocrId=null,
        /** @var string|null */
        public ?string $url=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['ocrId'])) $this->ocrId = $o['ocrId'];
        if (isset($o['url'])) $this->url = $o['url'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->ocrId)) $o['ocrId'] = $this->ocrId;
        if (isset($this->url)) $o['url'] = $this->url;
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template array of Image
 */
class ArrayOfImages extends \ArrayObject implements JsonSerializable
{
    public function __construct(Image ...$items) {
        parent::__construct($items, \ArrayObject::STD_PROP_LIST);
    }
    
    /** @throws \Exception */
    public function append($value): void {
        if ($value instanceof Image)
            parent::append($value);
        else
            throw new \Exception("Can only append a Image to " . __CLASS__);
    }
    
    /** @throws Exception */
    public function fromMap($o): void {
        foreach ($o as $item) {
            $el = new Image();
            $el->fromMap($item);
            $this->append($el);
        }
    }
    
    /** @throws Exception */
    public function jsonSerialize(): array {
        return parent::getArrayCopy();
    }
}

class PassportChipData implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $isIssuerVerified=null,
        /** @var string|null */
        public ?string $issuerCommonName=null,
        /** @var string|null */
        public ?string $issuerOrganisationName=null,
        /** @var string|null */
        public ?string $issuerCountry=null,
        /** @var string|null */
        public ?string $mrzLine1=null,
        /** @var string|null */
        public ?string $mrzLine2=null,
        /** @var bool|null */
        public ?bool $isMrzLine1Verified=null,
        /** @var bool|null */
        public ?bool $isMrzLine2Verified=null,
        /** @var int[]|null */
        public ?array $dataGroupsVerified=null,
        /** @var int[]|null */
        public ?array $dataGroupsFailed=null,
        /** @var bool|null */
        public ?bool $isFaceMatch=null,
        /** @var float|null */
        public ?float $faceMatchConfidence=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['isIssuerVerified'])) $this->isIssuerVerified = $o['isIssuerVerified'];
        if (isset($o['issuerCommonName'])) $this->issuerCommonName = $o['issuerCommonName'];
        if (isset($o['issuerOrganisationName'])) $this->issuerOrganisationName = $o['issuerOrganisationName'];
        if (isset($o['issuerCountry'])) $this->issuerCountry = $o['issuerCountry'];
        if (isset($o['mrzLine1'])) $this->mrzLine1 = $o['mrzLine1'];
        if (isset($o['mrzLine2'])) $this->mrzLine2 = $o['mrzLine2'];
        if (isset($o['isMrzLine1Verified'])) $this->isMrzLine1Verified = $o['isMrzLine1Verified'];
        if (isset($o['isMrzLine2Verified'])) $this->isMrzLine2Verified = $o['isMrzLine2Verified'];
        if (isset($o['dataGroupsVerified'])) $this->dataGroupsVerified = JsonConverters::fromArray('int', $o['dataGroupsVerified']);
        if (isset($o['dataGroupsFailed'])) $this->dataGroupsFailed = JsonConverters::fromArray('int', $o['dataGroupsFailed']);
        if (isset($o['isFaceMatch'])) $this->isFaceMatch = $o['isFaceMatch'];
        if (isset($o['faceMatchConfidence'])) $this->faceMatchConfidence = $o['faceMatchConfidence'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->isIssuerVerified)) $o['isIssuerVerified'] = $this->isIssuerVerified;
        if (isset($this->issuerCommonName)) $o['issuerCommonName'] = $this->issuerCommonName;
        if (isset($this->issuerOrganisationName)) $o['issuerOrganisationName'] = $this->issuerOrganisationName;
        if (isset($this->issuerCountry)) $o['issuerCountry'] = $this->issuerCountry;
        if (isset($this->mrzLine1)) $o['mrzLine1'] = $this->mrzLine1;
        if (isset($this->mrzLine2)) $o['mrzLine2'] = $this->mrzLine2;
        if (isset($this->isMrzLine1Verified)) $o['isMrzLine1Verified'] = $this->isMrzLine1Verified;
        if (isset($this->isMrzLine2Verified)) $o['isMrzLine2Verified'] = $this->isMrzLine2Verified;
        if (isset($this->dataGroupsVerified)) $o['dataGroupsVerified'] = JsonConverters::toArray('int', $this->dataGroupsVerified);
        if (isset($this->dataGroupsFailed)) $o['dataGroupsFailed'] = JsonConverters::toArray('int', $this->dataGroupsFailed);
        if (isset($this->isFaceMatch)) $o['isFaceMatch'] = $this->isFaceMatch;
        if (isset($this->faceMatchConfidence)) $o['faceMatchConfidence'] = $this->faceMatchConfidence;
        return empty($o) ? new class(){} : $o;
    }
}

class Passport implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $clientFileId=0,
        /** @var string|null */
        public ?string $firstName=null,
        /** @var string|null */
        public ?string $middleName=null,
        /** @var string|null */
        public ?string $lastName=null,
        /** @var string|null */
        public ?string $dateOfBirth=null,
        /** @var string|null */
        public ?string $gender=null,
        /** @var string|null */
        public ?string $mrzLineOne=null,
        /** @var string|null */
        public ?string $mrzLineTwo1=null,
        /** @var string|null */
        public ?string $mrzLineTwo2=null,
        /** @var string|null */
        public ?string $mrzLineTwo3=null,
        /** @var string|null */
        public ?string $mrzLineTwo4=null,
        /** @var string|null */
        public ?string $mrzLineTwo5=null,
        /** @var string|null */
        public ?string $mrzLineTwo6=null,
        /** @var string|null */
        public ?string $mrzLineTwo7=null,
        /** @var string|null */
        public ?string $mrzLineTwo8=null,
        /** @var ArrayOfImages|null */
        public ?ArrayOfImages $images=null,
        /** @var bool|null */
        public ?bool $isVerified=null,
        /** @var bool|null */
        public ?bool $isFaceMatch=null,
        /** @var float|null */
        public ?float $faceMatchConfidence=null,
        /** @var bool|null */
        public ?bool $hasPcvSearch=null,
        /** @var bool|null */
        public ?bool $hasDfaSearch=null,
        /** @var bool|null */
        public ?bool $isPassportChipVerified=null,
        /** @var PassportChipData|null */
        public ?PassportChipData $passportChipData=null,
        /** @var bool|null */
        public ?bool $isEligibleForPcv=null,
        /** @var bool|null */
        public ?bool $isEligibleForDfa=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['clientFileId'])) $this->clientFileId = $o['clientFileId'];
        if (isset($o['firstName'])) $this->firstName = $o['firstName'];
        if (isset($o['middleName'])) $this->middleName = $o['middleName'];
        if (isset($o['lastName'])) $this->lastName = $o['lastName'];
        if (isset($o['dateOfBirth'])) $this->dateOfBirth = $o['dateOfBirth'];
        if (isset($o['gender'])) $this->gender = $o['gender'];
        if (isset($o['mrzLineOne'])) $this->mrzLineOne = $o['mrzLineOne'];
        if (isset($o['mrzLineTwo1'])) $this->mrzLineTwo1 = $o['mrzLineTwo1'];
        if (isset($o['mrzLineTwo2'])) $this->mrzLineTwo2 = $o['mrzLineTwo2'];
        if (isset($o['mrzLineTwo3'])) $this->mrzLineTwo3 = $o['mrzLineTwo3'];
        if (isset($o['mrzLineTwo4'])) $this->mrzLineTwo4 = $o['mrzLineTwo4'];
        if (isset($o['mrzLineTwo5'])) $this->mrzLineTwo5 = $o['mrzLineTwo5'];
        if (isset($o['mrzLineTwo6'])) $this->mrzLineTwo6 = $o['mrzLineTwo6'];
        if (isset($o['mrzLineTwo7'])) $this->mrzLineTwo7 = $o['mrzLineTwo7'];
        if (isset($o['mrzLineTwo8'])) $this->mrzLineTwo8 = $o['mrzLineTwo8'];
        if (isset($o['images'])) $this->images = JsonConverters::from('ArrayOfImages', $o['images']);
        if (isset($o['isVerified'])) $this->isVerified = $o['isVerified'];
        if (isset($o['isFaceMatch'])) $this->isFaceMatch = $o['isFaceMatch'];
        if (isset($o['faceMatchConfidence'])) $this->faceMatchConfidence = $o['faceMatchConfidence'];
        if (isset($o['hasPcvSearch'])) $this->hasPcvSearch = $o['hasPcvSearch'];
        if (isset($o['hasDfaSearch'])) $this->hasDfaSearch = $o['hasDfaSearch'];
        if (isset($o['isPassportChipVerified'])) $this->isPassportChipVerified = $o['isPassportChipVerified'];
        if (isset($o['passportChipData'])) $this->passportChipData = JsonConverters::from('PassportChipData', $o['passportChipData']);
        if (isset($o['isEligibleForPcv'])) $this->isEligibleForPcv = $o['isEligibleForPcv'];
        if (isset($o['isEligibleForDfa'])) $this->isEligibleForDfa = $o['isEligibleForDfa'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->clientFileId)) $o['clientFileId'] = $this->clientFileId;
        if (isset($this->firstName)) $o['firstName'] = $this->firstName;
        if (isset($this->middleName)) $o['middleName'] = $this->middleName;
        if (isset($this->lastName)) $o['lastName'] = $this->lastName;
        if (isset($this->dateOfBirth)) $o['dateOfBirth'] = $this->dateOfBirth;
        if (isset($this->gender)) $o['gender'] = $this->gender;
        if (isset($this->mrzLineOne)) $o['mrzLineOne'] = $this->mrzLineOne;
        if (isset($this->mrzLineTwo1)) $o['mrzLineTwo1'] = $this->mrzLineTwo1;
        if (isset($this->mrzLineTwo2)) $o['mrzLineTwo2'] = $this->mrzLineTwo2;
        if (isset($this->mrzLineTwo3)) $o['mrzLineTwo3'] = $this->mrzLineTwo3;
        if (isset($this->mrzLineTwo4)) $o['mrzLineTwo4'] = $this->mrzLineTwo4;
        if (isset($this->mrzLineTwo5)) $o['mrzLineTwo5'] = $this->mrzLineTwo5;
        if (isset($this->mrzLineTwo6)) $o['mrzLineTwo6'] = $this->mrzLineTwo6;
        if (isset($this->mrzLineTwo7)) $o['mrzLineTwo7'] = $this->mrzLineTwo7;
        if (isset($this->mrzLineTwo8)) $o['mrzLineTwo8'] = $this->mrzLineTwo8;
        if (isset($this->images)) $o['images'] = JsonConverters::to('ArrayOfImages', $this->images);
        if (isset($this->isVerified)) $o['isVerified'] = $this->isVerified;
        if (isset($this->isFaceMatch)) $o['isFaceMatch'] = $this->isFaceMatch;
        if (isset($this->faceMatchConfidence)) $o['faceMatchConfidence'] = $this->faceMatchConfidence;
        if (isset($this->hasPcvSearch)) $o['hasPcvSearch'] = $this->hasPcvSearch;
        if (isset($this->hasDfaSearch)) $o['hasDfaSearch'] = $this->hasDfaSearch;
        if (isset($this->isPassportChipVerified)) $o['isPassportChipVerified'] = $this->isPassportChipVerified;
        if (isset($this->passportChipData)) $o['passportChipData'] = JsonConverters::to('PassportChipData', $this->passportChipData);
        if (isset($this->isEligibleForPcv)) $o['isEligibleForPcv'] = $this->isEligibleForPcv;
        if (isset($this->isEligibleForDfa)) $o['isEligibleForDfa'] = $this->isEligibleForDfa;
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template array of Passport
 */
class ArrayOfPassports extends \ArrayObject implements JsonSerializable
{
    public function __construct(Passport ...$items) {
        parent::__construct($items, \ArrayObject::STD_PROP_LIST);
    }
    
    /** @throws \Exception */
    public function append($value): void {
        if ($value instanceof Passport)
            parent::append($value);
        else
            throw new \Exception("Can only append a Passport to " . __CLASS__);
    }
    
    /** @throws Exception */
    public function fromMap($o): void {
        foreach ($o as $item) {
            $el = new Passport();
            $el->fromMap($item);
            $this->append($el);
        }
    }
    
    /** @throws Exception */
    public function jsonSerialize(): array {
        return parent::getArrayCopy();
    }
}

class DrivingLicence implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $clientFileId=0,
        /** @var string|null */
        public ?string $firstName=null,
        /** @var string|null */
        public ?string $middleName=null,
        /** @var string|null */
        public ?string $lastName=null,
        /** @var string|null */
        public ?string $dateOfBirth=null,
        /** @var string|null */
        public ?string $address=null,
        /** @var string|null */
        public ?string $drivingLicenceNumber=null,
        /** @var ArrayOfImages|null */
        public ?ArrayOfImages $images=null,
        /** @var bool|null */
        public ?bool $isVerified=null,
        /** @var bool|null */
        public ?bool $isFaceMatch=null,
        /** @var float|null */
        public ?float $faceMatchConfidence=null,
        /** @var bool|null */
        public ?bool $hasDfaSearch=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['clientFileId'])) $this->clientFileId = $o['clientFileId'];
        if (isset($o['firstName'])) $this->firstName = $o['firstName'];
        if (isset($o['middleName'])) $this->middleName = $o['middleName'];
        if (isset($o['lastName'])) $this->lastName = $o['lastName'];
        if (isset($o['dateOfBirth'])) $this->dateOfBirth = $o['dateOfBirth'];
        if (isset($o['address'])) $this->address = $o['address'];
        if (isset($o['drivingLicenceNumber'])) $this->drivingLicenceNumber = $o['drivingLicenceNumber'];
        if (isset($o['images'])) $this->images = JsonConverters::from('ArrayOfImages', $o['images']);
        if (isset($o['isVerified'])) $this->isVerified = $o['isVerified'];
        if (isset($o['isFaceMatch'])) $this->isFaceMatch = $o['isFaceMatch'];
        if (isset($o['faceMatchConfidence'])) $this->faceMatchConfidence = $o['faceMatchConfidence'];
        if (isset($o['hasDfaSearch'])) $this->hasDfaSearch = $o['hasDfaSearch'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->clientFileId)) $o['clientFileId'] = $this->clientFileId;
        if (isset($this->firstName)) $o['firstName'] = $this->firstName;
        if (isset($this->middleName)) $o['middleName'] = $this->middleName;
        if (isset($this->lastName)) $o['lastName'] = $this->lastName;
        if (isset($this->dateOfBirth)) $o['dateOfBirth'] = $this->dateOfBirth;
        if (isset($this->address)) $o['address'] = $this->address;
        if (isset($this->drivingLicenceNumber)) $o['drivingLicenceNumber'] = $this->drivingLicenceNumber;
        if (isset($this->images)) $o['images'] = JsonConverters::to('ArrayOfImages', $this->images);
        if (isset($this->isVerified)) $o['isVerified'] = $this->isVerified;
        if (isset($this->isFaceMatch)) $o['isFaceMatch'] = $this->isFaceMatch;
        if (isset($this->faceMatchConfidence)) $o['faceMatchConfidence'] = $this->faceMatchConfidence;
        if (isset($this->hasDfaSearch)) $o['hasDfaSearch'] = $this->hasDfaSearch;
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template array of DrivingLicence
 */
class ArrayOfDrivingLicences extends \ArrayObject implements JsonSerializable
{
    public function __construct(DrivingLicence ...$items) {
        parent::__construct($items, \ArrayObject::STD_PROP_LIST);
    }
    
    /** @throws \Exception */
    public function append($value): void {
        if ($value instanceof DrivingLicence)
            parent::append($value);
        else
            throw new \Exception("Can only append a DrivingLicence to " . __CLASS__);
    }
    
    /** @throws Exception */
    public function fromMap($o): void {
        foreach ($o as $item) {
            $el = new DrivingLicence();
            $el->fromMap($item);
            $this->append($el);
        }
    }
    
    /** @throws Exception */
    public function jsonSerialize(): array {
        return parent::getArrayCopy();
    }
}

class OtherDocument implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $clientFileId=0,
        /** @var string|null */
        public ?string $type=null,
        /** @var string|null */
        public ?string $typeOther=null,
        /** @var string|null */
        public ?string $description=null,
        /** @var string|null */
        public ?string $originalImageUrl=null,
        /** @var string|null */
        public ?string $croppedImageUrl=null,
        /** @var bool|null */
        public ?bool $isVerified=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['clientFileId'])) $this->clientFileId = $o['clientFileId'];
        if (isset($o['type'])) $this->type = $o['type'];
        if (isset($o['typeOther'])) $this->typeOther = $o['typeOther'];
        if (isset($o['description'])) $this->description = $o['description'];
        if (isset($o['originalImageUrl'])) $this->originalImageUrl = $o['originalImageUrl'];
        if (isset($o['croppedImageUrl'])) $this->croppedImageUrl = $o['croppedImageUrl'];
        if (isset($o['isVerified'])) $this->isVerified = $o['isVerified'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->clientFileId)) $o['clientFileId'] = $this->clientFileId;
        if (isset($this->type)) $o['type'] = $this->type;
        if (isset($this->typeOther)) $o['typeOther'] = $this->typeOther;
        if (isset($this->description)) $o['description'] = $this->description;
        if (isset($this->originalImageUrl)) $o['originalImageUrl'] = $this->originalImageUrl;
        if (isset($this->croppedImageUrl)) $o['croppedImageUrl'] = $this->croppedImageUrl;
        if (isset($this->isVerified)) $o['isVerified'] = $this->isVerified;
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template array of OtherDocument
 */
class ArrayOfOtherDocuments extends \ArrayObject implements JsonSerializable
{
    public function __construct(OtherDocument ...$items) {
        parent::__construct($items, \ArrayObject::STD_PROP_LIST);
    }
    
    /** @throws \Exception */
    public function append($value): void {
        if ($value instanceof OtherDocument)
            parent::append($value);
        else
            throw new \Exception("Can only append a OtherDocument to " . __CLASS__);
    }
    
    /** @throws Exception */
    public function fromMap($o): void {
        foreach ($o as $item) {
            $el = new OtherDocument();
            $el->fromMap($item);
            $this->append($el);
        }
    }
    
    /** @throws Exception */
    public function jsonSerialize(): array {
        return parent::getArrayCopy();
    }
}

class ProofOfDocument implements JsonSerializable
{
    public function __construct(
        /** @description The ID of the ProofOfDocument */
        // @ApiMember(Description="The ID of the ProofOfDocument", IsRequired=true)
        /** @var int */
        public int $id=0,

        /** @description The name of the ProofOfDocument */
        // @ApiMember(Description="The name of the ProofOfDocument", IsRequired=true)
        /** @var string */
        public string $name=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['name'])) $this->name = $o['name'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->name)) $o['name'] = $this->name;
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template array of ProofOfDocument
 */
class ArrayOfProofOfDocuments extends \ArrayObject implements JsonSerializable
{
    public function __construct(ProofOfDocument ...$items) {
        parent::__construct($items, \ArrayObject::STD_PROP_LIST);
    }
    
    /** @throws \Exception */
    public function append($value): void {
        if ($value instanceof ProofOfDocument)
            parent::append($value);
        else
            throw new \Exception("Can only append a ProofOfDocument to " . __CLASS__);
    }
    
    /** @throws Exception */
    public function fromMap($o): void {
        foreach ($o as $item) {
            $el = new ProofOfDocument();
            $el->fromMap($item);
            $this->append($el);
        }
    }
    
    /** @throws Exception */
    public function jsonSerialize(): array {
        return parent::getArrayCopy();
    }
}

class ProofOfDocumentCategory implements JsonSerializable
{
    public function __construct(
        /** @description The ID of the ProofOfDocumentCategory */
        // @ApiMember(Description="The ID of the ProofOfDocumentCategory", IsRequired=true)
        /** @var int */
        public int $id=0,

        /** @description The category or subject that requires proof (e.g., 'Name', 'Address', 'Right to work') */
        // @ApiMember(Description="The category or subject that requires proof (e.g., 'Name', 'Address', 'Right to work')", IsRequired=true)
        /** @var string */
        public string $proofOf='',

        /** @description The documents that can be used to provide proof for the specified category. */
        // @ApiMember(Description="The documents that can be used to provide proof for the specified category.", IsRequired=true)
        /** @var ArrayOfProofOfDocuments|null */
        public ?ArrayOfProofOfDocuments $proofOfDocuments=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['proofOf'])) $this->proofOf = $o['proofOf'];
        if (isset($o['proofOfDocuments'])) $this->proofOfDocuments = JsonConverters::from('ArrayOfProofOfDocuments', $o['proofOfDocuments']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->proofOf)) $o['proofOf'] = $this->proofOf;
        if (isset($this->proofOfDocuments)) $o['proofOfDocuments'] = JsonConverters::to('ArrayOfProofOfDocuments', $this->proofOfDocuments);
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template array of ProofOfDocumentCategory
 */
class ArrayOfProofOfDocumentCategories extends \ArrayObject implements JsonSerializable
{
    public function __construct(ProofOfDocumentCategory ...$items) {
        parent::__construct($items, \ArrayObject::STD_PROP_LIST);
    }
    
    /** @throws \Exception */
    public function append($value): void {
        if ($value instanceof ProofOfDocumentCategory)
            parent::append($value);
        else
            throw new \Exception("Can only append a ProofOfDocumentCategory to " . __CLASS__);
    }
    
    /** @throws Exception */
    public function fromMap($o): void {
        foreach ($o as $item) {
            $el = new ProofOfDocumentCategory();
            $el->fromMap($item);
            $this->append($el);
        }
    }
    
    /** @throws Exception */
    public function jsonSerialize(): array {
        return parent::getArrayCopy();
    }
}

class Client implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $id=0,
        /** @var DateTime */
        public DateTime $dateCreated=new DateTime(),
        /** @var string|null */
        public ?string $name=null,
        /** @var string|null */
        public ?string $email=null,
        /** @var string|null */
        public ?string $reference=null,
        /** @var ClientState|null */
        public ?ClientState $state=null,
        /** @var string|null */
        public ?string $mobileInternational=null,
        /** @var string|null */
        public ?string $postCode=null,
        /** @var bool|null */
        public ?bool $isValidateMe=null,
        /** @var Face|null */
        public ?Face $face=null,
        /** @var Video|null */
        public ?Video $video=null,
        /** @var Location|null */
        public ?Location $location=null,
        /** @var int */
        public int $numOfDocuments=0,
        /** @var ArrayOfPassports|null */
        public ?ArrayOfPassports $passports=null,
        /** @var ArrayOfDrivingLicences|null */
        public ?ArrayOfDrivingLicences $drivingLicences=null,
        /** @var ArrayOfOtherDocuments|null */
        public ?ArrayOfOtherDocuments $otherDocuments=null,
        /** @var ArrayOfProofOfDocumentCategories|null */
        public ?ArrayOfProofOfDocumentCategories $proofOfDocumentCategories=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['dateCreated'])) $this->dateCreated = JsonConverters::from('DateTime', $o['dateCreated']);
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['email'])) $this->email = $o['email'];
        if (isset($o['reference'])) $this->reference = $o['reference'];
        if (isset($o['state'])) $this->state = JsonConverters::from('ClientState', $o['state']);
        if (isset($o['mobileInternational'])) $this->mobileInternational = $o['mobileInternational'];
        if (isset($o['postCode'])) $this->postCode = $o['postCode'];
        if (isset($o['isValidateMe'])) $this->isValidateMe = $o['isValidateMe'];
        if (isset($o['face'])) $this->face = JsonConverters::from('Face', $o['face']);
        if (isset($o['video'])) $this->video = JsonConverters::from('Video', $o['video']);
        if (isset($o['location'])) $this->location = JsonConverters::from('Location', $o['location']);
        if (isset($o['numOfDocuments'])) $this->numOfDocuments = $o['numOfDocuments'];
        if (isset($o['passports'])) $this->passports = JsonConverters::from('ArrayOfPassports', $o['passports']);
        if (isset($o['drivingLicences'])) $this->drivingLicences = JsonConverters::from('ArrayOfDrivingLicences', $o['drivingLicences']);
        if (isset($o['otherDocuments'])) $this->otherDocuments = JsonConverters::from('ArrayOfOtherDocuments', $o['otherDocuments']);
        if (isset($o['proofOfDocumentCategories'])) $this->proofOfDocumentCategories = JsonConverters::from('ArrayOfProofOfDocumentCategories', $o['proofOfDocumentCategories']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->dateCreated)) $o['dateCreated'] = JsonConverters::to('DateTime', $this->dateCreated);
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->email)) $o['email'] = $this->email;
        if (isset($this->reference)) $o['reference'] = $this->reference;
        if (isset($this->state)) $o['state'] = JsonConverters::to('ClientState', $this->state);
        if (isset($this->mobileInternational)) $o['mobileInternational'] = $this->mobileInternational;
        if (isset($this->postCode)) $o['postCode'] = $this->postCode;
        if (isset($this->isValidateMe)) $o['isValidateMe'] = $this->isValidateMe;
        if (isset($this->face)) $o['face'] = JsonConverters::to('Face', $this->face);
        if (isset($this->video)) $o['video'] = JsonConverters::to('Video', $this->video);
        if (isset($this->location)) $o['location'] = JsonConverters::to('Location', $this->location);
        if (isset($this->numOfDocuments)) $o['numOfDocuments'] = $this->numOfDocuments;
        if (isset($this->passports)) $o['passports'] = JsonConverters::to('ArrayOfPassports', $this->passports);
        if (isset($this->drivingLicences)) $o['drivingLicences'] = JsonConverters::to('ArrayOfDrivingLicences', $this->drivingLicences);
        if (isset($this->otherDocuments)) $o['otherDocuments'] = JsonConverters::to('ArrayOfOtherDocuments', $this->otherDocuments);
        if (isset($this->proofOfDocumentCategories)) $o['proofOfDocumentCategories'] = JsonConverters::to('ArrayOfProofOfDocumentCategories', $this->proofOfDocumentCategories);
        return empty($o) ? new class(){} : $o;
    }
}

class AddClientData extends BaseResponse implements IBaseSearchResponse, JsonSerializable
{
    /**
     * @param ResponseStatus|null $responseStatus
     */
    public function __construct(
        ?ResponseStatus $responseStatus=null,
        /** @var ArrayOfLinkedTo|null */
        public ?ArrayOfLinkedTo $linkedTo=null,
        /** @var Client|null */
        public ?Client $client=null
    ) {
        parent::__construct($responseStatus);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['linkedTo'])) $this->linkedTo = JsonConverters::from('ArrayOfLinkedTo', $o['linkedTo']);
        if (isset($o['client'])) $this->client = JsonConverters::from('Client', $o['client']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->linkedTo)) $o['linkedTo'] = JsonConverters::to('ArrayOfLinkedTo', $this->linkedTo);
        if (isset($this->client)) $o['client'] = JsonConverters::to('Client', $this->client);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class AddClientResponse implements JsonSerializable
{
    public function __construct(
        // @DataMember
        /** @var AddClientData|null */
        public ?AddClientData $data=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['data'])) $this->data = JsonConverters::from('AddClientData', $o['data']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->data)) $o['data'] = JsonConverters::to('AddClientData', $this->data);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="CreateMobileClientType", Namespace="http://schemas.servicestack.net/types")
enum CreateMobileClientType : string
{
    case Undefined = 'Undefined';
    case ValidateMe = 'ValidateMe';
    case PassportChipVerification = 'PassportChipVerification';
}

class AddClientRequest implements JsonSerializable
{
    public function __construct(
        /** @description The full name of the client */
        // @ApiMember(Description="The full name of the client", IsRequired=true)
        /** @var string */
        public string $name='',

        /** @description The email address of the client */
        // @ApiMember(Description="The email address of the client", IsRequired=true)
        /** @var string */
        public string $email='',

        /** @description The client's mobile phone number in international format (e.g. '+447123456789') */
        // @ApiMember(Description="The client's mobile phone number in international format (e.g. '+447123456789')", IsRequired=true)
        /** @var string */
        public string $mobileInternational='',

        /** @description The postal code of the client's address. Used in emails sent to the client to help them recognize the communication as genuine */
        // @ApiMember(Description="The postal code of the client's address. Used in emails sent to the client to help them recognize the communication as genuine", IsRequired=true)
        /** @var string */
        public string $postCode='',

        /** @description Specifies the type of ValidateMe preset. Possible values are 'ValidateMe' for configuring RequiredDocuments, or 'PassportChipVerification' for setting the Passport as Proof of Name */
        // @ApiMember(Description="Specifies the type of ValidateMe preset. Possible values are 'ValidateMe' for configuring RequiredDocuments, or 'PassportChipVerification' for setting the Passport as Proof of Name", IsRequired=true)
        /** @var CreateMobileClientType|null */
        public ?CreateMobileClientType $proofOfPreset=null,

        /** @description The categories of proof and selected documents that the client can use to provide proof. Required if ClientType is set to 'ValidateMe' */
        // @ApiMember(Description="The categories of proof and selected documents that the client can use to provide proof. Required if ClientType is set to 'ValidateMe'")
        /** @var ArrayOfProofOfDocumentCategories|null */
        public ?ArrayOfProofOfDocumentCategories $proofOfDocumentCategories=null,

        /** @description If the client should be linked to other searches, specify the them here */
        // @ApiMember(Description="If the client should be linked to other searches, specify the them here")
        /** @var ArrayOfLinkedTo|null */
        public ?ArrayOfLinkedTo $linkedTo=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['email'])) $this->email = $o['email'];
        if (isset($o['mobileInternational'])) $this->mobileInternational = $o['mobileInternational'];
        if (isset($o['postCode'])) $this->postCode = $o['postCode'];
        if (isset($o['proofOfPreset'])) $this->proofOfPreset = JsonConverters::from('CreateMobileClientType', $o['proofOfPreset']);
        if (isset($o['proofOfDocumentCategories'])) $this->proofOfDocumentCategories = JsonConverters::from('ArrayOfProofOfDocumentCategories', $o['proofOfDocumentCategories']);
        if (isset($o['linkedTo'])) $this->linkedTo = JsonConverters::from('ArrayOfLinkedTo', $o['linkedTo']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->email)) $o['email'] = $this->email;
        if (isset($this->mobileInternational)) $o['mobileInternational'] = $this->mobileInternational;
        if (isset($this->postCode)) $o['postCode'] = $this->postCode;
        if (isset($this->proofOfPreset)) $o['proofOfPreset'] = JsonConverters::to('CreateMobileClientType', $this->proofOfPreset);
        if (isset($this->proofOfDocumentCategories)) $o['proofOfDocumentCategories'] = JsonConverters::to('ArrayOfProofOfDocumentCategories', $this->proofOfDocumentCategories);
        if (isset($this->linkedTo)) $o['linkedTo'] = JsonConverters::to('ArrayOfLinkedTo', $this->linkedTo);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class AddClient extends BaseRequest implements JsonSerializable
{
    /**
     * @param Authentication|null $authentication
     */
    public function __construct(
        ?Authentication $authentication=null,
        // @DataMember
        /** @var AddClientRequest|null */
        public ?AddClientRequest $request=null
    ) {
        parent::__construct($authentication);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['request'])) $this->request = JsonConverters::from('AddClientRequest', $o['request']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->request)) $o['request'] = JsonConverters::to('AddClientRequest', $this->request);
        return empty($o) ? new class(){} : $o;
    }
}

PHP AddClient DTOs

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

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /clients HTTP/1.1 
Host: api.sanctionssearch.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"request":{"name":"String","email":"String","mobileInternational":"String","postCode":"String","proofOfPreset":"Undefined","proofOfDocumentCategories":[{"id":0,"proofOf":"String","proofOfDocuments":[{"id":0,"name":"String"}]}],"linkedTo":[{"clientId":0,"id":0,"type":"String","subtype":"String","status":"String","description":"String","isArchived":false,"name":"String","date":"\/Date(-62135596800000-0000)\/"}]},"authentication":{"apiUserId":"String","apiUserKey":"String"}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"data":{"linkedTo":[{"clientId":0,"id":0,"type":"String","subtype":"String","status":"String","description":"String","isArchived":false,"name":"String","date":"\/Date(-62135596800000-0000)\/"}],"client":{"id":0,"dateCreated":"\/Date(-62135596800000-0000)\/","name":"String","email":"String","reference":"String","state":"Undefined","mobileInternational":"String","postCode":"String","isValidateMe":false,"face":{"age":0,"gender":"String","emotion":"String","smile":0,"hairColour":"String","facialHair":"String","makeup":"String","glasses":"String","accessories":"String"},"video":{"id":0,"videoUrl":"String","imageUrl":"String","videoTimestamps":[{"tagName":"String","milli":0,"imageUrl":"String"}]},"location":{"latitude":0,"longitude":0},"numOfDocuments":0,"passports":[{"clientFileId":0,"firstName":"String","middleName":"String","lastName":"String","dateOfBirth":"String","gender":"String","mrzLineOne":"String","mrzLineTwo1":"String","mrzLineTwo2":"String","mrzLineTwo3":"String","mrzLineTwo4":"String","mrzLineTwo5":"String","mrzLineTwo6":"String","mrzLineTwo7":"String","mrzLineTwo8":"String","images":[{"id":0,"name":"String","ocrId":0,"url":"String"}],"isVerified":false,"isFaceMatch":false,"faceMatchConfidence":0,"hasPcvSearch":false,"hasDfaSearch":false,"isPassportChipVerified":false,"passportChipData":{"isIssuerVerified":false,"issuerCommonName":"String","issuerOrganisationName":"String","issuerCountry":"String","mrzLine1":"String","mrzLine2":"String","isMrzLine1Verified":false,"isMrzLine2Verified":false,"dataGroupsVerified":[0],"dataGroupsFailed":[0],"isFaceMatch":false,"faceMatchConfidence":0},"isEligibleForPcv":false,"isEligibleForDfa":false}],"drivingLicences":[{"clientFileId":0,"firstName":"String","middleName":"String","lastName":"String","dateOfBirth":"String","address":"String","drivingLicenceNumber":"String","images":[{"id":0,"name":"String","ocrId":0,"url":"String"}],"isVerified":false,"isFaceMatch":false,"faceMatchConfidence":0,"hasDfaSearch":false}],"otherDocuments":[{"clientFileId":0,"type":"String","typeOther":"String","description":"String","originalImageUrl":"String","croppedImageUrl":"String","isVerified":false}],"proofOfDocumentCategories":[{"id":0,"proofOf":"String","proofOfDocuments":[{"id":0,"name":"String"}]}]},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}}