POST | /v1/StockManagement | Gets vehicles for stock management |
---|
<?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 BasicBackOrderVehicle implements JsonSerializable
{
public function __construct(
/** @var string */
public string $commissionNumber='',
/** @var string */
public string $description='',
/** @var string */
public string $model='',
/** @var string */
public string $colour='',
/** @var string */
public string $fuelType='',
/** @var string */
public string $transmission='',
/** @var string */
public string $packages='',
/** @var string */
public string $lines='',
/** @var string */
public string $upholstery='',
/** @var string */
public string $emissionCombined='',
/** @var float */
public float $actualPrice=0.0,
/** @var string */
public string $usageCode='',
/** @var bool|null */
public ?bool $secured=null,
/** @var string */
public string $account='',
/** @var string|null */
public ?string $securedTime=null,
/** @var string|null */
public ?string $securedReason=null,
/** @var string|null */
public ?string $securedByGasId=null,
/** @var DateTime|null */
public ?DateTime $securedDate=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['commissionNumber'])) $this->commissionNumber = $o['commissionNumber'];
if (isset($o['description'])) $this->description = $o['description'];
if (isset($o['model'])) $this->model = $o['model'];
if (isset($o['colour'])) $this->colour = $o['colour'];
if (isset($o['fuelType'])) $this->fuelType = $o['fuelType'];
if (isset($o['transmission'])) $this->transmission = $o['transmission'];
if (isset($o['packages'])) $this->packages = $o['packages'];
if (isset($o['lines'])) $this->lines = $o['lines'];
if (isset($o['upholstery'])) $this->upholstery = $o['upholstery'];
if (isset($o['emissionCombined'])) $this->emissionCombined = $o['emissionCombined'];
if (isset($o['actualPrice'])) $this->actualPrice = $o['actualPrice'];
if (isset($o['usageCode'])) $this->usageCode = $o['usageCode'];
if (isset($o['secured'])) $this->secured = $o['secured'];
if (isset($o['account'])) $this->account = $o['account'];
if (isset($o['securedTime'])) $this->securedTime = $o['securedTime'];
if (isset($o['securedReason'])) $this->securedReason = $o['securedReason'];
if (isset($o['securedByGasId'])) $this->securedByGasId = $o['securedByGasId'];
if (isset($o['securedDate'])) $this->securedDate = JsonConverters::from('DateTime', $o['securedDate']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->commissionNumber)) $o['commissionNumber'] = $this->commissionNumber;
if (isset($this->description)) $o['description'] = $this->description;
if (isset($this->model)) $o['model'] = $this->model;
if (isset($this->colour)) $o['colour'] = $this->colour;
if (isset($this->fuelType)) $o['fuelType'] = $this->fuelType;
if (isset($this->transmission)) $o['transmission'] = $this->transmission;
if (isset($this->packages)) $o['packages'] = $this->packages;
if (isset($this->lines)) $o['lines'] = $this->lines;
if (isset($this->upholstery)) $o['upholstery'] = $this->upholstery;
if (isset($this->emissionCombined)) $o['emissionCombined'] = $this->emissionCombined;
if (isset($this->actualPrice)) $o['actualPrice'] = $this->actualPrice;
if (isset($this->usageCode)) $o['usageCode'] = $this->usageCode;
if (isset($this->secured)) $o['secured'] = $this->secured;
if (isset($this->account)) $o['account'] = $this->account;
if (isset($this->securedTime)) $o['securedTime'] = $this->securedTime;
if (isset($this->securedReason)) $o['securedReason'] = $this->securedReason;
if (isset($this->securedByGasId)) $o['securedByGasId'] = $this->securedByGasId;
if (isset($this->securedDate)) $o['securedDate'] = JsonConverters::to('DateTime', $this->securedDate);
return empty($o) ? new class(){} : $o;
}
}
class BackOrderVehicle extends BasicBackOrderVehicle implements JsonSerializable
{
/**
* @param string $commissionNumber
* @param string $description
* @param string $model
* @param string $colour
* @param string $fuelType
* @param string $transmission
* @param string $packages
* @param string $lines
* @param string $upholstery
* @param string $emissionCombined
* @param float $actualPrice
* @param string $usageCode
* @param bool|null $secured
* @param string $account
* @param string|null $securedTime
* @param string|null $securedReason
* @param string|null $securedByGasId
* @param DateTime|null $securedDate
*/
public function __construct(
string $commissionNumber='',
string $description='',
string $model='',
string $colour='',
string $fuelType='',
string $transmission='',
string $packages='',
string $lines='',
string $upholstery='',
string $emissionCombined='',
float $actualPrice=0.0,
string $usageCode='',
?bool $secured=null,
string $account='',
?string $securedTime=null,
?string $securedReason=null,
?string $securedByGasId=null,
?DateTime $securedDate=null,
/** @var int */
public int $id=0,
/** @var string */
public string $vin='',
/** @var string */
public string $vehicleType='',
/** @var string */
public string $vid='',
/** @var string */
public string $fin='',
/** @var string */
public string $chassisNumber='',
/** @var string */
public string $modelYear='',
/** @var string */
public string $modelYearCode='',
/** @var string */
public string $halfModelYearCode='',
/** @var string */
public string $fullModelYearCode='',
/** @var string */
public string $salesDescriptionLong='',
/** @var string */
public string $vehicleClass='',
/** @var float */
public float $retailPrice_ExVAT=0.0,
/** @var float */
public float $retailPrice_IncVAT=0.0,
/** @var float */
public float $otr=0.0,
/** @var string */
public string $bodyStyle='',
/** @var string */
public string $productRange='',
/** @var string */
public string $engine='',
/** @var bool|null */
public ?bool $isAMG=null,
/** @var string */
public string $colourGroup='',
/** @var string */
public string $upholsteryCode='',
/** @var string */
public string $nst='',
/** @var string */
public string $bm7NST='',
/** @var float|null */
public ?float $acceleration=null,
/** @var int|null */
public ?int $bootCapacity=null,
/** @var float|null */
public ?float $topSpeed=null,
/** @var string */
public string $driveConcept='',
/** @var float|null */
public ?float $combustionPowerHp=null,
/** @var float|null */
public ?float $electricPowerKw=null,
/** @var float|null */
public ?float $electricPowerHp=null,
/** @var float|null */
public ?float $combinedPowerKw=null,
/** @var float|null */
public ?float $combinedPowerHP=null,
/** @var float|null */
public ?float $electricRange=null,
/** @var float|null */
public ?float $electricConsumption=null,
/** @var float|null */
public ?float $emission=null,
/** @var string */
public string $emissionDirective='',
/** @var string */
public string $emissionExtraUrban='',
/** @var string */
public string $emissionUrban='',
/** @var string */
public string $energyEfficiencyClass='',
/** @var string */
public string $wltpEmissionCombined='',
/** @var string */
public string $wltpCombined='',
/** @var string */
public string $wltpLow='',
/** @var string */
public string $wltpMedium='',
/** @var string */
public string $wltpHigh='',
/** @var string */
public string $wltpExtraHigh='',
/** @var DateTime|null */
public ?DateTime $productionDate=null,
/** @var DateTime|null */
public ?DateTime $portArrivalDate=null,
/** @var DateTime */
public DateTime $creationDate=new DateTime(),
/** @var DateTime|null */
public ?DateTime $lastUpdated=null,
/** @var bool|null */
public ?bool $isDisplayStock=null,
/** @var string */
public string $displayStockAgent='',
/** @var bool|null */
public ?bool $isSpecialistCar=null,
/** @var string */
public string $location='',
/** @var string */
public string $cesarIdShipToParty='',
/** @var bool|null */
public ?bool $isSellable=null,
/** @var bool|null */
public ?bool $underOffer=null,
/** @var string */
public string $baumuster=''
) {
parent::__construct($commissionNumber,$description,$model,$colour,$fuelType,$transmission,$packages,$lines,$upholstery,$emissionCombined,$actualPrice,$usageCode,$secured,$account,$securedTime,$securedReason,$securedByGasId,$securedDate);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['vin'])) $this->vin = $o['vin'];
if (isset($o['vehicleType'])) $this->vehicleType = $o['vehicleType'];
if (isset($o['vid'])) $this->vid = $o['vid'];
if (isset($o['fin'])) $this->fin = $o['fin'];
if (isset($o['chassisNumber'])) $this->chassisNumber = $o['chassisNumber'];
if (isset($o['modelYear'])) $this->modelYear = $o['modelYear'];
if (isset($o['modelYearCode'])) $this->modelYearCode = $o['modelYearCode'];
if (isset($o['halfModelYearCode'])) $this->halfModelYearCode = $o['halfModelYearCode'];
if (isset($o['fullModelYearCode'])) $this->fullModelYearCode = $o['fullModelYearCode'];
if (isset($o['salesDescriptionLong'])) $this->salesDescriptionLong = $o['salesDescriptionLong'];
if (isset($o['vehicleClass'])) $this->vehicleClass = $o['vehicleClass'];
if (isset($o['retailPrice_ExVAT'])) $this->retailPrice_ExVAT = $o['retailPrice_ExVAT'];
if (isset($o['retailPrice_IncVAT'])) $this->retailPrice_IncVAT = $o['retailPrice_IncVAT'];
if (isset($o['otr'])) $this->otr = $o['otr'];
if (isset($o['bodyStyle'])) $this->bodyStyle = $o['bodyStyle'];
if (isset($o['productRange'])) $this->productRange = $o['productRange'];
if (isset($o['engine'])) $this->engine = $o['engine'];
if (isset($o['isAMG'])) $this->isAMG = $o['isAMG'];
if (isset($o['colourGroup'])) $this->colourGroup = $o['colourGroup'];
if (isset($o['upholsteryCode'])) $this->upholsteryCode = $o['upholsteryCode'];
if (isset($o['nst'])) $this->nst = $o['nst'];
if (isset($o['bm7NST'])) $this->bm7NST = $o['bm7NST'];
if (isset($o['acceleration'])) $this->acceleration = $o['acceleration'];
if (isset($o['bootCapacity'])) $this->bootCapacity = $o['bootCapacity'];
if (isset($o['topSpeed'])) $this->topSpeed = $o['topSpeed'];
if (isset($o['driveConcept'])) $this->driveConcept = $o['driveConcept'];
if (isset($o['combustionPowerHp'])) $this->combustionPowerHp = $o['combustionPowerHp'];
if (isset($o['electricPowerKw'])) $this->electricPowerKw = $o['electricPowerKw'];
if (isset($o['electricPowerHp'])) $this->electricPowerHp = $o['electricPowerHp'];
if (isset($o['combinedPowerKw'])) $this->combinedPowerKw = $o['combinedPowerKw'];
if (isset($o['combinedPowerHP'])) $this->combinedPowerHP = $o['combinedPowerHP'];
if (isset($o['electricRange'])) $this->electricRange = $o['electricRange'];
if (isset($o['electricConsumption'])) $this->electricConsumption = $o['electricConsumption'];
if (isset($o['emission'])) $this->emission = $o['emission'];
if (isset($o['emissionDirective'])) $this->emissionDirective = $o['emissionDirective'];
if (isset($o['emissionExtraUrban'])) $this->emissionExtraUrban = $o['emissionExtraUrban'];
if (isset($o['emissionUrban'])) $this->emissionUrban = $o['emissionUrban'];
if (isset($o['energyEfficiencyClass'])) $this->energyEfficiencyClass = $o['energyEfficiencyClass'];
if (isset($o['wltpEmissionCombined'])) $this->wltpEmissionCombined = $o['wltpEmissionCombined'];
if (isset($o['wltpCombined'])) $this->wltpCombined = $o['wltpCombined'];
if (isset($o['wltpLow'])) $this->wltpLow = $o['wltpLow'];
if (isset($o['wltpMedium'])) $this->wltpMedium = $o['wltpMedium'];
if (isset($o['wltpHigh'])) $this->wltpHigh = $o['wltpHigh'];
if (isset($o['wltpExtraHigh'])) $this->wltpExtraHigh = $o['wltpExtraHigh'];
if (isset($o['productionDate'])) $this->productionDate = JsonConverters::from('DateTime', $o['productionDate']);
if (isset($o['portArrivalDate'])) $this->portArrivalDate = JsonConverters::from('DateTime', $o['portArrivalDate']);
if (isset($o['creationDate'])) $this->creationDate = JsonConverters::from('DateTime', $o['creationDate']);
if (isset($o['lastUpdated'])) $this->lastUpdated = JsonConverters::from('DateTime', $o['lastUpdated']);
if (isset($o['isDisplayStock'])) $this->isDisplayStock = $o['isDisplayStock'];
if (isset($o['displayStockAgent'])) $this->displayStockAgent = $o['displayStockAgent'];
if (isset($o['isSpecialistCar'])) $this->isSpecialistCar = $o['isSpecialistCar'];
if (isset($o['location'])) $this->location = $o['location'];
if (isset($o['cesarIdShipToParty'])) $this->cesarIdShipToParty = $o['cesarIdShipToParty'];
if (isset($o['isSellable'])) $this->isSellable = $o['isSellable'];
if (isset($o['underOffer'])) $this->underOffer = $o['underOffer'];
if (isset($o['baumuster'])) $this->baumuster = $o['baumuster'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->vin)) $o['vin'] = $this->vin;
if (isset($this->vehicleType)) $o['vehicleType'] = $this->vehicleType;
if (isset($this->vid)) $o['vid'] = $this->vid;
if (isset($this->fin)) $o['fin'] = $this->fin;
if (isset($this->chassisNumber)) $o['chassisNumber'] = $this->chassisNumber;
if (isset($this->modelYear)) $o['modelYear'] = $this->modelYear;
if (isset($this->modelYearCode)) $o['modelYearCode'] = $this->modelYearCode;
if (isset($this->halfModelYearCode)) $o['halfModelYearCode'] = $this->halfModelYearCode;
if (isset($this->fullModelYearCode)) $o['fullModelYearCode'] = $this->fullModelYearCode;
if (isset($this->salesDescriptionLong)) $o['salesDescriptionLong'] = $this->salesDescriptionLong;
if (isset($this->vehicleClass)) $o['vehicleClass'] = $this->vehicleClass;
if (isset($this->retailPrice_ExVAT)) $o['retailPrice_ExVAT'] = $this->retailPrice_ExVAT;
if (isset($this->retailPrice_IncVAT)) $o['retailPrice_IncVAT'] = $this->retailPrice_IncVAT;
if (isset($this->otr)) $o['otr'] = $this->otr;
if (isset($this->bodyStyle)) $o['bodyStyle'] = $this->bodyStyle;
if (isset($this->productRange)) $o['productRange'] = $this->productRange;
if (isset($this->engine)) $o['engine'] = $this->engine;
if (isset($this->isAMG)) $o['isAMG'] = $this->isAMG;
if (isset($this->colourGroup)) $o['colourGroup'] = $this->colourGroup;
if (isset($this->upholsteryCode)) $o['upholsteryCode'] = $this->upholsteryCode;
if (isset($this->nst)) $o['nst'] = $this->nst;
if (isset($this->bm7NST)) $o['bm7NST'] = $this->bm7NST;
if (isset($this->acceleration)) $o['acceleration'] = $this->acceleration;
if (isset($this->bootCapacity)) $o['bootCapacity'] = $this->bootCapacity;
if (isset($this->topSpeed)) $o['topSpeed'] = $this->topSpeed;
if (isset($this->driveConcept)) $o['driveConcept'] = $this->driveConcept;
if (isset($this->combustionPowerHp)) $o['combustionPowerHp'] = $this->combustionPowerHp;
if (isset($this->electricPowerKw)) $o['electricPowerKw'] = $this->electricPowerKw;
if (isset($this->electricPowerHp)) $o['electricPowerHp'] = $this->electricPowerHp;
if (isset($this->combinedPowerKw)) $o['combinedPowerKw'] = $this->combinedPowerKw;
if (isset($this->combinedPowerHP)) $o['combinedPowerHP'] = $this->combinedPowerHP;
if (isset($this->electricRange)) $o['electricRange'] = $this->electricRange;
if (isset($this->electricConsumption)) $o['electricConsumption'] = $this->electricConsumption;
if (isset($this->emission)) $o['emission'] = $this->emission;
if (isset($this->emissionDirective)) $o['emissionDirective'] = $this->emissionDirective;
if (isset($this->emissionExtraUrban)) $o['emissionExtraUrban'] = $this->emissionExtraUrban;
if (isset($this->emissionUrban)) $o['emissionUrban'] = $this->emissionUrban;
if (isset($this->energyEfficiencyClass)) $o['energyEfficiencyClass'] = $this->energyEfficiencyClass;
if (isset($this->wltpEmissionCombined)) $o['wltpEmissionCombined'] = $this->wltpEmissionCombined;
if (isset($this->wltpCombined)) $o['wltpCombined'] = $this->wltpCombined;
if (isset($this->wltpLow)) $o['wltpLow'] = $this->wltpLow;
if (isset($this->wltpMedium)) $o['wltpMedium'] = $this->wltpMedium;
if (isset($this->wltpHigh)) $o['wltpHigh'] = $this->wltpHigh;
if (isset($this->wltpExtraHigh)) $o['wltpExtraHigh'] = $this->wltpExtraHigh;
if (isset($this->productionDate)) $o['productionDate'] = JsonConverters::to('DateTime', $this->productionDate);
if (isset($this->portArrivalDate)) $o['portArrivalDate'] = JsonConverters::to('DateTime', $this->portArrivalDate);
if (isset($this->creationDate)) $o['creationDate'] = JsonConverters::to('DateTime', $this->creationDate);
if (isset($this->lastUpdated)) $o['lastUpdated'] = JsonConverters::to('DateTime', $this->lastUpdated);
if (isset($this->isDisplayStock)) $o['isDisplayStock'] = $this->isDisplayStock;
if (isset($this->displayStockAgent)) $o['displayStockAgent'] = $this->displayStockAgent;
if (isset($this->isSpecialistCar)) $o['isSpecialistCar'] = $this->isSpecialistCar;
if (isset($this->location)) $o['location'] = $this->location;
if (isset($this->cesarIdShipToParty)) $o['cesarIdShipToParty'] = $this->cesarIdShipToParty;
if (isset($this->isSellable)) $o['isSellable'] = $this->isSellable;
if (isset($this->underOffer)) $o['underOffer'] = $this->underOffer;
if (isset($this->baumuster)) $o['baumuster'] = $this->baumuster;
return empty($o) ? new class(){} : $o;
}
}
class StockManagementResponse implements JsonSerializable
{
public function __construct(
/** @var int */
public int $totalVehicles=0,
/** @var array<BackOrderVehicle>|null */
public ?array $vehicles=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['totalVehicles'])) $this->totalVehicles = $o['totalVehicles'];
if (isset($o['vehicles'])) $this->vehicles = JsonConverters::fromArray('BackOrderVehicle', $o['vehicles']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->totalVehicles)) $o['totalVehicles'] = $this->totalVehicles;
if (isset($this->vehicles)) $o['vehicles'] = JsonConverters::toArray('BackOrderVehicle', $this->vehicles);
return empty($o) ? new class(){} : $o;
}
}
class Sort implements JsonSerializable
{
public function __construct(
/** @var int */
public int $id=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
return empty($o) ? new class(){} : $o;
}
}
class Paging implements JsonSerializable
{
public function __construct(
/** @var int */
public int $resultsPerPage=0,
/** @var int */
public int $pageIndex=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['resultsPerPage'])) $this->resultsPerPage = $o['resultsPerPage'];
if (isset($o['pageIndex'])) $this->pageIndex = $o['pageIndex'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->resultsPerPage)) $o['resultsPerPage'] = $this->resultsPerPage;
if (isset($this->pageIndex)) $o['pageIndex'] = $this->pageIndex;
return empty($o) ? new class(){} : $o;
}
}
class CampaignExclusion implements JsonSerializable
{
public function __construct(
/** @var string[] */
public array $vin=[],
/** @var string[] */
public array $commissionNumber=[],
/** @var string */
public string $modelYearCode='',
/** @var string */
public string $equipmentCode='',
/** @var string[] */
public array $gssn=[]
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['vin'])) $this->vin = JsonConverters::fromArray('string', $o['vin']);
if (isset($o['commissionNumber'])) $this->commissionNumber = JsonConverters::fromArray('string', $o['commissionNumber']);
if (isset($o['modelYearCode'])) $this->modelYearCode = $o['modelYearCode'];
if (isset($o['equipmentCode'])) $this->equipmentCode = $o['equipmentCode'];
if (isset($o['gssn'])) $this->gssn = JsonConverters::fromArray('string', $o['gssn']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->vin)) $o['vin'] = JsonConverters::toArray('string', $this->vin);
if (isset($this->commissionNumber)) $o['commissionNumber'] = JsonConverters::toArray('string', $this->commissionNumber);
if (isset($this->modelYearCode)) $o['modelYearCode'] = $this->modelYearCode;
if (isset($this->equipmentCode)) $o['equipmentCode'] = $this->equipmentCode;
if (isset($this->gssn)) $o['gssn'] = JsonConverters::toArray('string', $this->gssn);
return empty($o) ? new class(){} : $o;
}
}
class RegistrationDate implements JsonSerializable
{
public function __construct(
/** @var DateTime */
public DateTime $from=new DateTime(),
/** @var DateTime */
public DateTime $to=new DateTime()
) {
}
/** @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 Age implements JsonSerializable
{
public function __construct(
/** @var DateTime */
public DateTime $date=new DateTime(),
/** @var int */
public int $min=0,
/** @var int */
public int $max=0,
/** @var bool|null */
public ?bool $includePipelineStock=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['date'])) $this->date = JsonConverters::from('DateTime', $o['date']);
if (isset($o['min'])) $this->min = $o['min'];
if (isset($o['max'])) $this->max = $o['max'];
if (isset($o['includePipelineStock'])) $this->includePipelineStock = $o['includePipelineStock'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->date)) $o['date'] = JsonConverters::to('DateTime', $this->date);
if (isset($this->min)) $o['min'] = $this->min;
if (isset($this->max)) $o['max'] = $this->max;
if (isset($this->includePipelineStock)) $o['includePipelineStock'] = $this->includePipelineStock;
return empty($o) ? new class(){} : $o;
}
}
class PortArrivalDate implements JsonSerializable
{
public function __construct(
/** @var bool|null */
public ?bool $pipelineStock=null,
/** @var DateTime */
public DateTime $from=new DateTime(),
/** @var DateTime */
public DateTime $to=new DateTime()
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['pipelineStock'])) $this->pipelineStock = $o['pipelineStock'];
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->pipelineStock)) $o['pipelineStock'] = $this->pipelineStock;
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 VehicleSearchV3Criteria implements JsonSerializable
{
public function __construct(
/** @var string[] */
public array $vin=[],
/** @var int[] */
public array $model=[],
/** @var int[] */
public array $fuel=[],
/** @var int[] */
public array $transmission=[],
/** @var int[] */
public array $engine=[],
/** @var string[] */
public array $line=[],
/** @var int[] */
public array $mappedLine=[],
/** @var string[] */
public array $commissionNumber=[],
/** @var string */
public string $vehicleType='',
/** @var CampaignExclusion|null */
public ?CampaignExclusion $exclusion=null,
/** @var string */
public string $regNo='',
/** @var bool|null */
public ?bool $includeOffline=null,
/** @var RegistrationDate|null */
public ?RegistrationDate $registrationDate=null,
/** @var Age|null */
public ?Age $age=null,
/** @var PortArrivalDate|null */
public ?PortArrivalDate $portArrivalDate=null,
/** @var bool|null */
public ?bool $isAvailableOnline=null,
/** @var bool|null */
public ?bool $isBackOrdered=null,
/** @var bool|null */
public ?bool $isSellable=null,
/** @var bool|null */
public ?bool $isUnderOffer=null,
/** @var bool|null */
public ?bool $mbukSecured=null,
/** @var string[] */
public array $account=[],
/** @var string[] */
public array $baumuster=[],
/** @var int[] */
public array $colours=[],
/** @var int[] */
public array $upholstery=[],
/** @var int[] */
public array $package=[],
/** @var string[] */
public array $nst=[],
/** @var string[] */
public array $usageCode=[]
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['vin'])) $this->vin = JsonConverters::fromArray('string', $o['vin']);
if (isset($o['model'])) $this->model = JsonConverters::fromArray('int', $o['model']);
if (isset($o['fuel'])) $this->fuel = JsonConverters::fromArray('int', $o['fuel']);
if (isset($o['transmission'])) $this->transmission = JsonConverters::fromArray('int', $o['transmission']);
if (isset($o['engine'])) $this->engine = JsonConverters::fromArray('int', $o['engine']);
if (isset($o['line'])) $this->line = JsonConverters::fromArray('string', $o['line']);
if (isset($o['mappedLine'])) $this->mappedLine = JsonConverters::fromArray('int', $o['mappedLine']);
if (isset($o['commissionNumber'])) $this->commissionNumber = JsonConverters::fromArray('string', $o['commissionNumber']);
if (isset($o['vehicleType'])) $this->vehicleType = $o['vehicleType'];
if (isset($o['exclusion'])) $this->exclusion = JsonConverters::from('CampaignExclusion', $o['exclusion']);
if (isset($o['regNo'])) $this->regNo = $o['regNo'];
if (isset($o['includeOffline'])) $this->includeOffline = $o['includeOffline'];
if (isset($o['registrationDate'])) $this->registrationDate = JsonConverters::from('RegistrationDate', $o['registrationDate']);
if (isset($o['age'])) $this->age = JsonConverters::from('Age', $o['age']);
if (isset($o['portArrivalDate'])) $this->portArrivalDate = JsonConverters::from('PortArrivalDate', $o['portArrivalDate']);
if (isset($o['isAvailableOnline'])) $this->isAvailableOnline = $o['isAvailableOnline'];
if (isset($o['isBackOrdered'])) $this->isBackOrdered = $o['isBackOrdered'];
if (isset($o['isSellable'])) $this->isSellable = $o['isSellable'];
if (isset($o['isUnderOffer'])) $this->isUnderOffer = $o['isUnderOffer'];
if (isset($o['mbukSecured'])) $this->mbukSecured = $o['mbukSecured'];
if (isset($o['account'])) $this->account = JsonConverters::fromArray('string', $o['account']);
if (isset($o['baumuster'])) $this->baumuster = JsonConverters::fromArray('string', $o['baumuster']);
if (isset($o['colours'])) $this->colours = JsonConverters::fromArray('int', $o['colours']);
if (isset($o['upholstery'])) $this->upholstery = JsonConverters::fromArray('int', $o['upholstery']);
if (isset($o['package'])) $this->package = JsonConverters::fromArray('int', $o['package']);
if (isset($o['nst'])) $this->nst = JsonConverters::fromArray('string', $o['nst']);
if (isset($o['usageCode'])) $this->usageCode = JsonConverters::fromArray('string', $o['usageCode']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->vin)) $o['vin'] = JsonConverters::toArray('string', $this->vin);
if (isset($this->model)) $o['model'] = JsonConverters::toArray('int', $this->model);
if (isset($this->fuel)) $o['fuel'] = JsonConverters::toArray('int', $this->fuel);
if (isset($this->transmission)) $o['transmission'] = JsonConverters::toArray('int', $this->transmission);
if (isset($this->engine)) $o['engine'] = JsonConverters::toArray('int', $this->engine);
if (isset($this->line)) $o['line'] = JsonConverters::toArray('string', $this->line);
if (isset($this->mappedLine)) $o['mappedLine'] = JsonConverters::toArray('int', $this->mappedLine);
if (isset($this->commissionNumber)) $o['commissionNumber'] = JsonConverters::toArray('string', $this->commissionNumber);
if (isset($this->vehicleType)) $o['vehicleType'] = $this->vehicleType;
if (isset($this->exclusion)) $o['exclusion'] = JsonConverters::to('CampaignExclusion', $this->exclusion);
if (isset($this->regNo)) $o['regNo'] = $this->regNo;
if (isset($this->includeOffline)) $o['includeOffline'] = $this->includeOffline;
if (isset($this->registrationDate)) $o['registrationDate'] = JsonConverters::to('RegistrationDate', $this->registrationDate);
if (isset($this->age)) $o['age'] = JsonConverters::to('Age', $this->age);
if (isset($this->portArrivalDate)) $o['portArrivalDate'] = JsonConverters::to('PortArrivalDate', $this->portArrivalDate);
if (isset($this->isAvailableOnline)) $o['isAvailableOnline'] = $this->isAvailableOnline;
if (isset($this->isBackOrdered)) $o['isBackOrdered'] = $this->isBackOrdered;
if (isset($this->isSellable)) $o['isSellable'] = $this->isSellable;
if (isset($this->isUnderOffer)) $o['isUnderOffer'] = $this->isUnderOffer;
if (isset($this->mbukSecured)) $o['mbukSecured'] = $this->mbukSecured;
if (isset($this->account)) $o['account'] = JsonConverters::toArray('string', $this->account);
if (isset($this->baumuster)) $o['baumuster'] = JsonConverters::toArray('string', $this->baumuster);
if (isset($this->colours)) $o['colours'] = JsonConverters::toArray('int', $this->colours);
if (isset($this->upholstery)) $o['upholstery'] = JsonConverters::toArray('int', $this->upholstery);
if (isset($this->package)) $o['package'] = JsonConverters::toArray('int', $this->package);
if (isset($this->nst)) $o['nst'] = JsonConverters::toArray('string', $this->nst);
if (isset($this->usageCode)) $o['usageCode'] = JsonConverters::toArray('string', $this->usageCode);
return empty($o) ? new class(){} : $o;
}
}
class StockManagementRequest implements IPost, JsonSerializable
{
public function __construct(
/** @var Sort|null */
public ?Sort $sort=null,
/** @var Paging|null */
public ?Paging $paging=null,
/** @var VehicleSearchV3Criteria|null */
public ?VehicleSearchV3Criteria $criteria=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['sort'])) $this->sort = JsonConverters::from('Sort', $o['sort']);
if (isset($o['paging'])) $this->paging = JsonConverters::from('Paging', $o['paging']);
if (isset($o['criteria'])) $this->criteria = JsonConverters::from('VehicleSearchV3Criteria', $o['criteria']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->sort)) $o['sort'] = JsonConverters::to('Sort', $this->sort);
if (isset($this->paging)) $o['paging'] = JsonConverters::to('Paging', $this->paging);
if (isset($this->criteria)) $o['criteria'] = JsonConverters::to('VehicleSearchV3Criteria', $this->criteria);
return empty($o) ? new class(){} : $o;
}
}
PHP StockManagementRequest 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/StockManagement HTTP/1.1
Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk
Accept: application/json
Content-Type: application/json
Content-Length: length
{"sort":{"id":0},"paging":{"resultsPerPage":0,"pageIndex":0},"criteria":{"vin":["String"],"model":[0],"fuel":[0],"transmission":[0],"engine":[0],"line":["String"],"mappedLine":[0],"commissionNumber":["String"],"vehicleType":"String","exclusion":{"vin":["String"],"commissionNumber":["String"],"modelYearCode":"String","equipmentCode":"String","gssn":["String"]},"regNo":"String","includeOffline":false,"registrationDate":{"from":"\/Date(-62135596800000-0000)\/","to":"\/Date(-62135596800000-0000)\/"},"age":{"date":"\/Date(-62135596800000-0000)\/","min":0,"max":0,"includePipelineStock":false},"portArrivalDate":{"pipelineStock":false,"from":"\/Date(-62135596800000-0000)\/","to":"\/Date(-62135596800000-0000)\/"},"isAvailableOnline":false,"isBackOrdered":false,"isSellable":false,"isUnderOffer":false,"mbukSecured":false,"account":["String"],"baumuster":["String"],"colours":[0],"upholstery":[0],"package":[0],"nst":["String"],"usageCode":["String"]}}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"totalVehicles":0,"vehicles":null}