POST | /v1/BackOrderLinkedComms | Get the audit for back orders linked comms |
---|
<?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 BackOrderLinkedCommsAuditDateCriteria implements JsonSerializable
{
public function __construct(
/** @var DateTime|null */
public ?DateTime $From=null,
/** @var DateTime|null */
public ?DateTime $To=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['From'])) $this->From = JsonConverters::from('DateTime', $o['From']);
if (isset($o['To'])) $this->To = JsonConverters::from('DateTime', $o['To']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->From)) $o['From'] = JsonConverters::to('DateTime', $this->From);
if (isset($this->To)) $o['To'] = JsonConverters::to('DateTime', $this->To);
return empty($o) ? new class(){} : $o;
}
}
class LinkedBackOrderCommAudit implements JsonSerializable
{
public function __construct(
/** @var array<string>|null */
public ?array $GssnIds=null,
/** @var BackOrderLinkedCommsAuditDateCriteria|null */
public ?BackOrderLinkedCommsAuditDateCriteria $DateCriteria=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['GssnIds'])) $this->GssnIds = JsonConverters::fromArray('string', $o['GssnIds']);
if (isset($o['DateCriteria'])) $this->DateCriteria = JsonConverters::from('BackOrderLinkedCommsAuditDateCriteria', $o['DateCriteria']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->GssnIds)) $o['GssnIds'] = JsonConverters::toArray('string', $this->GssnIds);
if (isset($this->DateCriteria)) $o['DateCriteria'] = JsonConverters::to('BackOrderLinkedCommsAuditDateCriteria', $this->DateCriteria);
return empty($o) ? new class(){} : $o;
}
}
enum BackOrderStatus : int
{
case Submitted = 1;
case Acknowledged = 2;
case Cancelled = 3;
case Completed = 4;
case Confirmed = 5;
}
class BackOrderLinkedCommsAudit implements JsonSerializable
{
public function __construct(
/** @var string */
public string $Guid='',
/** @var string */
public string $BackOrderReference='',
/** @var string */
public string $UserId='',
/** @var string */
public string $Showroom='',
/** @var string */
public string $CommLinked='',
/** @var string */
public string $SalesDescription='',
/** @var string */
public string $Colour='',
/** @var string */
public string $Upholstery='',
/** @var bool|null */
public ?bool $Sellable=null,
/** @var string */
public string $LinkedDate='',
/** @var BackOrderStatus|null */
public ?BackOrderStatus $Status=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Guid'])) $this->Guid = $o['Guid'];
if (isset($o['BackOrderReference'])) $this->BackOrderReference = $o['BackOrderReference'];
if (isset($o['UserId'])) $this->UserId = $o['UserId'];
if (isset($o['Showroom'])) $this->Showroom = $o['Showroom'];
if (isset($o['CommLinked'])) $this->CommLinked = $o['CommLinked'];
if (isset($o['SalesDescription'])) $this->SalesDescription = $o['SalesDescription'];
if (isset($o['Colour'])) $this->Colour = $o['Colour'];
if (isset($o['Upholstery'])) $this->Upholstery = $o['Upholstery'];
if (isset($o['Sellable'])) $this->Sellable = $o['Sellable'];
if (isset($o['LinkedDate'])) $this->LinkedDate = $o['LinkedDate'];
if (isset($o['Status'])) $this->Status = JsonConverters::from('BackOrderStatus', $o['Status']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Guid)) $o['Guid'] = $this->Guid;
if (isset($this->BackOrderReference)) $o['BackOrderReference'] = $this->BackOrderReference;
if (isset($this->UserId)) $o['UserId'] = $this->UserId;
if (isset($this->Showroom)) $o['Showroom'] = $this->Showroom;
if (isset($this->CommLinked)) $o['CommLinked'] = $this->CommLinked;
if (isset($this->SalesDescription)) $o['SalesDescription'] = $this->SalesDescription;
if (isset($this->Colour)) $o['Colour'] = $this->Colour;
if (isset($this->Upholstery)) $o['Upholstery'] = $this->Upholstery;
if (isset($this->Sellable)) $o['Sellable'] = $this->Sellable;
if (isset($this->LinkedDate)) $o['LinkedDate'] = $this->LinkedDate;
if (isset($this->Status)) $o['Status'] = JsonConverters::to('BackOrderStatus', $this->Status);
return empty($o) ? new class(){} : $o;
}
}
class LinkedBackOrderCommAuditResponse implements JsonSerializable
{
public function __construct(
/** @var array<BackOrderLinkedCommsAudit>|null */
public ?array $Audits=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Audits'])) $this->Audits = JsonConverters::fromArray('BackOrderLinkedCommsAudit', $o['Audits']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Audits)) $o['Audits'] = JsonConverters::toArray('BackOrderLinkedCommsAudit', $this->Audits);
return empty($o) ? new class(){} : $o;
}
}
PHP LinkedBackOrderCommAudit 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
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/BackOrderLinkedComms HTTP/1.1
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk
Accept: application/json
Content-Type: application/json
Content-Length: length
{"GssnIds":["String"],"DateCriteria":{"From":"\/Date(-62135596800000-0000)\/","To":"\/Date(-62135596800000-0000)\/"}}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"Audits":[{"Guid":"String","BackOrderReference":"String","UserId":"String","Showroom":"String","CommLinked":"String","SalesDescription":"String","Colour":"String","Upholstery":"String","Sellable":false,"LinkedDate":"String","Status":"Submitted"}]}