| POST | /ValidateDetails/ |
|---|
<?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};
class ValidateDetailsResponse implements JsonSerializable
{
public function __construct(
/** @var int */
public int $BPID=0,
/** @var bool|null */
public ?bool $IsValid=null,
/** @var bool|null */
public ?bool $IsLocked=null,
/** @var int */
public int $AttemptsRemaining=0,
/** @var string|null */
public ?string $Error=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['BPID'])) $this->BPID = $o['BPID'];
if (isset($o['IsValid'])) $this->IsValid = $o['IsValid'];
if (isset($o['IsLocked'])) $this->IsLocked = $o['IsLocked'];
if (isset($o['AttemptsRemaining'])) $this->AttemptsRemaining = $o['AttemptsRemaining'];
if (isset($o['Error'])) $this->Error = $o['Error'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->BPID)) $o['BPID'] = $this->BPID;
if (isset($this->IsValid)) $o['IsValid'] = $this->IsValid;
if (isset($this->IsLocked)) $o['IsLocked'] = $this->IsLocked;
if (isset($this->AttemptsRemaining)) $o['AttemptsRemaining'] = $this->AttemptsRemaining;
if (isset($this->Error)) $o['Error'] = $this->Error;
return empty($o) ? new class(){} : $o;
}
}
class ValidateDetailsRequest implements JsonSerializable
{
public function __construct(
/** @var string */
public string $GUID='',
/** @var string|null */
public ?string $Postcode=null,
/** @var string|null */
public ?string $Number4=null,
/** @var string|null */
public ?string $Email=null,
/** @var string|null */
public ?string $EmailConfirm=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['GUID'])) $this->GUID = $o['GUID'];
if (isset($o['Postcode'])) $this->Postcode = $o['Postcode'];
if (isset($o['Number4'])) $this->Number4 = $o['Number4'];
if (isset($o['Email'])) $this->Email = $o['Email'];
if (isset($o['EmailConfirm'])) $this->EmailConfirm = $o['EmailConfirm'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->GUID)) $o['GUID'] = $this->GUID;
if (isset($this->Postcode)) $o['Postcode'] = $this->Postcode;
if (isset($this->Number4)) $o['Number4'] = $this->Number4;
if (isset($this->Email)) $o['Email'] = $this->Email;
if (isset($this->EmailConfirm)) $o['EmailConfirm'] = $this->EmailConfirm;
return empty($o) ? new class(){} : $o;
}
}
PHP ValidateDetailsRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /ValidateDetails/ HTTP/1.1
Host: webservices.mbukdatabase.co.uk
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"GUID":"00000000000000000000000000000000","Postcode":"String","Number4":"String","Email":"String","EmailConfirm":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"BPID":0,"IsValid":false,"IsLocked":false,"AttemptsRemaining":0,"Error":"String"}