POST | /v1/DisplayStock | Retailer/s display stock |
---|
<?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 DisplayStock implements JsonSerializable
{
public function __construct(
/** @var string */
public string $vehicleDescription='',
/** @var string */
public string $commissionNumber='',
/** @var string */
public string $vin='',
/** @var string */
public string $retailer='',
/** @var string */
public string $model='',
/** @var string */
public string $fuelType='',
/** @var string */
public string $transmission='',
/** @var string */
public string $colour='',
/** @var string */
public string $actualPrice='',
/** @var int[] */
public array $activeOffers=[],
/** @var string */
public string $daysAtSite='',
/** @var string */
public string $offerTotalCurrent='',
/** @var string */
public string $offerExpiry='',
/** @var string */
public string $vehicleUsage='',
/** @var bool|null */
public ?bool $underOffer=null,
/** @var bool|null */
public ?bool $isSellable=null,
/** @var string */
public string $vehicleType='',
/** @var string */
public string $vid='',
/** @var string */
public string $fin='',
/** @var string */
public string $chassisNumber='',
/** @var string */
public string $line='',
/** @var string */
public string $modelYear='',
/** @var string */
public string $modelYearCode='',
/** @var string */
public string $vehicleClass='',
/** @var string */
public string $retailPrice_ExVAT='',
/** @var string */
public string $retailPrice_IncVAT='',
/** @var string */
public string $otr='',
/** @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 $upholstery='',
/** @var string */
public string $packages='',
/** @var string */
public string $nst='',
/** @var string */
public string $bM7NST='',
/** @var string */
public string $acceleration='',
/** @var string */
public string $bootCapacity='',
/** @var string */
public string $topSpeed='',
/** @var string */
public string $driveConcept='',
/** @var string */
public string $combustionPowerHp='',
/** @var string */
public string $electricPowerKw='',
/** @var string */
public string $electricPowerHp='',
/** @var string */
public string $combinedPowerKw='',
/** @var string */
public string $combinedPowerHP='',
/** @var string */
public string $electricRange='',
/** @var string */
public string $electricConsumption='',
/** @var string */
public string $emissionCombined='',
/** @var string */
public string $emissionExtraUrban='',
/** @var string */
public string $emissionUrban='',
/** @var string */
public string $emission='',
/** @var string */
public string $emissionDirective='',
/** @var string */
public string $energyEfficiencyClass='',
/** @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 string */
public string $wltpEmissionCombined='',
/** @var DateTime|null */
public ?DateTime $portArrivalDate=null,
/** @var DateTime|null */
public ?DateTime $creationDate=null,
/** @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 $account='',
/** @var string */
public string $location='',
/** @var string */
public string $cesarIdShipToParty='',
/** @var string */
public string $vehicleUsageCode='',
/** @var bool|null */
public ?bool $mbukSecured=null,
/** @var bool|null */
public ?bool $isAllocatedToBackOrder=null,
/** @var string|null */
public ?string $backOrderReference=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['vehicleDescription'])) $this->vehicleDescription = $o['vehicleDescription'];
if (isset($o['commissionNumber'])) $this->commissionNumber = $o['commissionNumber'];
if (isset($o['vin'])) $this->vin = $o['vin'];
if (isset($o['retailer'])) $this->retailer = $o['retailer'];
if (isset($o['model'])) $this->model = $o['model'];
if (isset($o['fuelType'])) $this->fuelType = $o['fuelType'];
if (isset($o['transmission'])) $this->transmission = $o['transmission'];
if (isset($o['colour'])) $this->colour = $o['colour'];
if (isset($o['actualPrice'])) $this->actualPrice = $o['actualPrice'];
if (isset($o['activeOffers'])) $this->activeOffers = JsonConverters::fromArray('int', $o['activeOffers']);
if (isset($o['daysAtSite'])) $this->daysAtSite = $o['daysAtSite'];
if (isset($o['offerTotalCurrent'])) $this->offerTotalCurrent = $o['offerTotalCurrent'];
if (isset($o['offerExpiry'])) $this->offerExpiry = $o['offerExpiry'];
if (isset($o['vehicleUsage'])) $this->vehicleUsage = $o['vehicleUsage'];
if (isset($o['underOffer'])) $this->underOffer = $o['underOffer'];
if (isset($o['isSellable'])) $this->isSellable = $o['isSellable'];
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['line'])) $this->line = $o['line'];
if (isset($o['modelYear'])) $this->modelYear = $o['modelYear'];
if (isset($o['modelYearCode'])) $this->modelYearCode = $o['modelYearCode'];
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['upholstery'])) $this->upholstery = $o['upholstery'];
if (isset($o['packages'])) $this->packages = $o['packages'];
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['emissionCombined'])) $this->emissionCombined = $o['emissionCombined'];
if (isset($o['emissionExtraUrban'])) $this->emissionExtraUrban = $o['emissionExtraUrban'];
if (isset($o['emissionUrban'])) $this->emissionUrban = $o['emissionUrban'];
if (isset($o['emission'])) $this->emission = $o['emission'];
if (isset($o['emissionDirective'])) $this->emissionDirective = $o['emissionDirective'];
if (isset($o['energyEfficiencyClass'])) $this->energyEfficiencyClass = $o['energyEfficiencyClass'];
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['wltpEmissionCombined'])) $this->wltpEmissionCombined = $o['wltpEmissionCombined'];
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['account'])) $this->account = $o['account'];
if (isset($o['location'])) $this->location = $o['location'];
if (isset($o['cesarIdShipToParty'])) $this->cesarIdShipToParty = $o['cesarIdShipToParty'];
if (isset($o['vehicleUsageCode'])) $this->vehicleUsageCode = $o['vehicleUsageCode'];
if (isset($o['mbukSecured'])) $this->mbukSecured = $o['mbukSecured'];
if (isset($o['isAllocatedToBackOrder'])) $this->isAllocatedToBackOrder = $o['isAllocatedToBackOrder'];
if (isset($o['backOrderReference'])) $this->backOrderReference = $o['backOrderReference'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->vehicleDescription)) $o['vehicleDescription'] = $this->vehicleDescription;
if (isset($this->commissionNumber)) $o['commissionNumber'] = $this->commissionNumber;
if (isset($this->vin)) $o['vin'] = $this->vin;
if (isset($this->retailer)) $o['retailer'] = $this->retailer;
if (isset($this->model)) $o['model'] = $this->model;
if (isset($this->fuelType)) $o['fuelType'] = $this->fuelType;
if (isset($this->transmission)) $o['transmission'] = $this->transmission;
if (isset($this->colour)) $o['colour'] = $this->colour;
if (isset($this->actualPrice)) $o['actualPrice'] = $this->actualPrice;
if (isset($this->activeOffers)) $o['activeOffers'] = JsonConverters::toArray('int', $this->activeOffers);
if (isset($this->daysAtSite)) $o['daysAtSite'] = $this->daysAtSite;
if (isset($this->offerTotalCurrent)) $o['offerTotalCurrent'] = $this->offerTotalCurrent;
if (isset($this->offerExpiry)) $o['offerExpiry'] = $this->offerExpiry;
if (isset($this->vehicleUsage)) $o['vehicleUsage'] = $this->vehicleUsage;
if (isset($this->underOffer)) $o['underOffer'] = $this->underOffer;
if (isset($this->isSellable)) $o['isSellable'] = $this->isSellable;
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->line)) $o['line'] = $this->line;
if (isset($this->modelYear)) $o['modelYear'] = $this->modelYear;
if (isset($this->modelYearCode)) $o['modelYearCode'] = $this->modelYearCode;
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->upholstery)) $o['upholstery'] = $this->upholstery;
if (isset($this->packages)) $o['packages'] = $this->packages;
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->emissionCombined)) $o['emissionCombined'] = $this->emissionCombined;
if (isset($this->emissionExtraUrban)) $o['emissionExtraUrban'] = $this->emissionExtraUrban;
if (isset($this->emissionUrban)) $o['emissionUrban'] = $this->emissionUrban;
if (isset($this->emission)) $o['emission'] = $this->emission;
if (isset($this->emissionDirective)) $o['emissionDirective'] = $this->emissionDirective;
if (isset($this->energyEfficiencyClass)) $o['energyEfficiencyClass'] = $this->energyEfficiencyClass;
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->wltpEmissionCombined)) $o['wltpEmissionCombined'] = $this->wltpEmissionCombined;
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->account)) $o['account'] = $this->account;
if (isset($this->location)) $o['location'] = $this->location;
if (isset($this->cesarIdShipToParty)) $o['cesarIdShipToParty'] = $this->cesarIdShipToParty;
if (isset($this->vehicleUsageCode)) $o['vehicleUsageCode'] = $this->vehicleUsageCode;
if (isset($this->mbukSecured)) $o['mbukSecured'] = $this->mbukSecured;
if (isset($this->isAllocatedToBackOrder)) $o['isAllocatedToBackOrder'] = $this->isAllocatedToBackOrder;
if (isset($this->backOrderReference)) $o['backOrderReference'] = $this->backOrderReference;
return empty($o) ? new class(){} : $o;
}
}
class DisplayStockResponse implements JsonSerializable
{
public function __construct(
/** @var array<DisplayStock>|null */
public ?array $vehicles=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['vehicles'])) $this->vehicles = JsonConverters::fromArray('DisplayStock', $o['vehicles']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->vehicles)) $o['vehicles'] = JsonConverters::toArray('DisplayStock', $this->vehicles);
return empty($o) ? new class(){} : $o;
}
}
class DisplayStockRequest implements IPost, JsonSerializable
{
public function __construct(
/** @description Gssns */
// @ApiMember(Description="Gssns", IsRequired=true)
/** @var array<string>|null */
public ?array $gssns=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['gssns'])) $this->gssns = JsonConverters::fromArray('string', $o['gssns']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->gssns)) $o['gssns'] = JsonConverters::toArray('string', $this->gssns);
return empty($o) ? new class(){} : $o;
}
}
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 /v1/DisplayStock HTTP/1.1
Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"gssns":["String"]}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"vehicles":[{"vehicleDescription":"String","commissionNumber":"String","vin":"String","retailer":"String","model":"String","fuelType":"String","transmission":"String","colour":"String","actualPrice":"String","activeOffers":[0],"daysAtSite":"String","offerTotalCurrent":"String","offerExpiry":"String","vehicleUsage":"String","underOffer":false,"isSellable":false,"vehicleType":"String","vid":"String","fin":"String","chassisNumber":"String","line":"String","modelYear":"String","modelYearCode":"String","vehicleClass":"String","retailPrice_ExVAT":"String","retailPrice_IncVAT":"String","otr":"String","bodyStyle":"String","productRange":"String","engine":"String","isAMG":false,"colourGroup":"String","upholstery":"String","packages":"String","nst":"String","bM7NST":"String","acceleration":"String","bootCapacity":"String","topSpeed":"String","driveConcept":"String","combustionPowerHp":"String","electricPowerKw":"String","electricPowerHp":"String","combinedPowerKw":"String","combinedPowerHP":"String","electricRange":"String","electricConsumption":"String","emissionCombined":"String","emissionExtraUrban":"String","emissionUrban":"String","emission":"String","emissionDirective":"String","energyEfficiencyClass":"String","wltpCombined":"String","wltpLow":"String","wltpMedium":"String","wltpHigh":"String","wltpExtraHigh":"String","wltpEmissionCombined":"String","portArrivalDate":"\/Date(-62135596800000-0000)\/","creationDate":"\/Date(-62135596800000-0000)\/","lastUpdated":"\/Date(-62135596800000-0000)\/","isDisplayStock":false,"displayStockAgent":"String","isSpecialistCar":false,"account":"String","location":"String","cesarIdShipToParty":"String","vehicleUsageCode":"String","mbukSecured":false,"isAllocatedToBackOrder":false,"backOrderReference":"String"}]}