GET | /v1/NonOptimalOrderAudit | Get the audit of orders using non-optimal vehicles |
---|
<?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 NonOptimalOrderAuditRequest implements JsonSerializable
{
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
return empty($o) ? new class(){} : $o;
}
}
class OrderNonOptimalAudit implements JsonSerializable
{
public function __construct(
/** @var int */
public int $Id=0,
/** @var string */
public string $OrderReference='',
/** @var DateTime */
public DateTime $AuditDate=new DateTime(),
/** @var string */
public string $Reason='',
/** @var string */
public string $VinOrdered='',
/** @var string */
public string $VinSuggested='',
/** @var string */
public string $GasId='',
/** @var string */
public string $Showroom=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['OrderReference'])) $this->OrderReference = $o['OrderReference'];
if (isset($o['AuditDate'])) $this->AuditDate = JsonConverters::from('DateTime', $o['AuditDate']);
if (isset($o['Reason'])) $this->Reason = $o['Reason'];
if (isset($o['VinOrdered'])) $this->VinOrdered = $o['VinOrdered'];
if (isset($o['VinSuggested'])) $this->VinSuggested = $o['VinSuggested'];
if (isset($o['GasId'])) $this->GasId = $o['GasId'];
if (isset($o['Showroom'])) $this->Showroom = $o['Showroom'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->OrderReference)) $o['OrderReference'] = $this->OrderReference;
if (isset($this->AuditDate)) $o['AuditDate'] = JsonConverters::to('DateTime', $this->AuditDate);
if (isset($this->Reason)) $o['Reason'] = $this->Reason;
if (isset($this->VinOrdered)) $o['VinOrdered'] = $this->VinOrdered;
if (isset($this->VinSuggested)) $o['VinSuggested'] = $this->VinSuggested;
if (isset($this->GasId)) $o['GasId'] = $this->GasId;
if (isset($this->Showroom)) $o['Showroom'] = $this->Showroom;
return empty($o) ? new class(){} : $o;
}
}
class NonOptimalOrderAuditResponse implements JsonSerializable
{
public function __construct(
/** @var array<OrderNonOptimalAudit>|null */
public ?array $Audits=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Audits'])) $this->Audits = JsonConverters::fromArray('OrderNonOptimalAudit', $o['Audits']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Audits)) $o['Audits'] = JsonConverters::toArray('OrderNonOptimalAudit', $this->Audits);
return empty($o) ? new class(){} : $o;
}
}
PHP NonOptimalOrderAuditRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/NonOptimalOrderAudit HTTP/1.1 Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk Accept: text/jsonl
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"Audits":[{"Id":0,"OrderReference":"String","AuditDate":"\/Date(-62135596800000-0000)\/","Reason":"String","VinOrdered":"String","VinSuggested":"String","GasId":"String","Showroom":"String"}]}