POST | /v1/OnlineShowroom/Stock | Search for Online Showroom Stock | Calls Vehicle Data API online showroom stock endpoint and searches for vehicles given a list of retailers. The results are used to populate the Online Showroom Stock datatable grid in OneAdmin |
---|
import 'package:servicestack/servicestack.dart';
class StockDataRow implements IConvertible
{
String? commissionNumber;
String? description;
String? salesDescriptionLong;
String? model;
String? colour;
String? colourGroup;
String? fuelType;
String? transmission;
String? transmissionType;
String? packages;
String? lines;
String? upholstery;
String? upholsteryCode;
String? displayStockAgent;
String? location;
String? vin;
String? vid;
String? vehicleType;
String? vehicleClass;
DateTime? creationDate;
DateTime? lastUpdated;
DateTime? productionDate;
DateTime? portArrivalDate;
double? combinedGrossOfferValue;
String? currentLocation;
bool? notVisibleOnlineShowroom;
String? nvosReason;
bool? nvosReasonOneAdminExcluded;
bool? nvosReasonLinkedToBackOrder;
bool? includedAfterDeduplication;
bool? unique;
bool? duplicate;
int? duplicateGroup;
bool? lowestComm;
String? rule;
String? fin;
String? chassisNumber;
String? modelYear;
String? modelYearCode;
String? halfModelYearCode;
String? fullModelYearCode;
String? bodyStyle;
String? engine;
String? cesarIdShipToParty;
String? vehicleUsageCode;
double? acceleration;
int? bootCapacity;
double? topSpeed;
String? driveConcept;
double? combustionPowerHp;
double? electricPowerKw;
double? electricPowerHp;
double? combinedPowerKw;
double? combinedPowerHP;
bool? underOffer;
bool? isSellable;
bool? mbukSecured;
bool? isDisplayStock;
bool? isSpecialistCar;
String? account;
String? productRange;
bool? isAMG;
double? actualPrice;
double? retailPrice_ExVAT;
double? retailPrice_IncVAT;
double? otr;
String? nst;
String? bm7NST;
double? electricRange;
double? electricConsumption;
double? emission;
String? emissionDirective;
String? emissionCombined;
String? emissionExtraUrban;
String? emissionUrban;
String? energyEfficiencyClass;
String? wltpEmissionCombined;
String? wltpCombined;
String? wltpLow;
String? wltpMedium;
String? wltpHigh;
String? wltpExtraHigh;
double? totalMoneyOffersExclDiscretionary;
double? discretionaryMoneyOffer;
double? totalMoneyOffersInclDiscretionary;
int? nonDiscretionaryNMOCount;
int? nonDiscretionaryMOCount;
int? discretionaryNMOCount;
int? discretionaryMOCount;
double? totalOfferVIPAmount;
String? stockLevelIndicator;
StockDataRow({this.commissionNumber,this.description,this.salesDescriptionLong,this.model,this.colour,this.colourGroup,this.fuelType,this.transmission,this.transmissionType,this.packages,this.lines,this.upholstery,this.upholsteryCode,this.displayStockAgent,this.location,this.vin,this.vid,this.vehicleType,this.vehicleClass,this.creationDate,this.lastUpdated,this.productionDate,this.portArrivalDate,this.combinedGrossOfferValue,this.currentLocation,this.notVisibleOnlineShowroom,this.nvosReason,this.nvosReasonOneAdminExcluded,this.nvosReasonLinkedToBackOrder,this.includedAfterDeduplication,this.unique,this.duplicate,this.duplicateGroup,this.lowestComm,this.rule,this.fin,this.chassisNumber,this.modelYear,this.modelYearCode,this.halfModelYearCode,this.fullModelYearCode,this.bodyStyle,this.engine,this.cesarIdShipToParty,this.vehicleUsageCode,this.acceleration,this.bootCapacity,this.topSpeed,this.driveConcept,this.combustionPowerHp,this.electricPowerKw,this.electricPowerHp,this.combinedPowerKw,this.combinedPowerHP,this.underOffer,this.isSellable,this.mbukSecured,this.isDisplayStock,this.isSpecialistCar,this.account,this.productRange,this.isAMG,this.actualPrice,this.retailPrice_ExVAT,this.retailPrice_IncVAT,this.otr,this.nst,this.bm7NST,this.electricRange,this.electricConsumption,this.emission,this.emissionDirective,this.emissionCombined,this.emissionExtraUrban,this.emissionUrban,this.energyEfficiencyClass,this.wltpEmissionCombined,this.wltpCombined,this.wltpLow,this.wltpMedium,this.wltpHigh,this.wltpExtraHigh,this.totalMoneyOffersExclDiscretionary,this.discretionaryMoneyOffer,this.totalMoneyOffersInclDiscretionary,this.nonDiscretionaryNMOCount,this.nonDiscretionaryMOCount,this.discretionaryNMOCount,this.discretionaryMOCount,this.totalOfferVIPAmount,this.stockLevelIndicator});
StockDataRow.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
commissionNumber = json['commissionNumber'];
description = json['description'];
salesDescriptionLong = json['salesDescriptionLong'];
model = json['model'];
colour = json['colour'];
colourGroup = json['colourGroup'];
fuelType = json['fuelType'];
transmission = json['transmission'];
transmissionType = json['transmissionType'];
packages = json['packages'];
lines = json['lines'];
upholstery = json['upholstery'];
upholsteryCode = json['upholsteryCode'];
displayStockAgent = json['displayStockAgent'];
location = json['location'];
vin = json['vin'];
vid = json['vid'];
vehicleType = json['vehicleType'];
vehicleClass = json['vehicleClass'];
creationDate = JsonConverters.fromJson(json['creationDate'],'DateTime',context!);
lastUpdated = JsonConverters.fromJson(json['lastUpdated'],'DateTime',context!);
productionDate = JsonConverters.fromJson(json['productionDate'],'DateTime',context!);
portArrivalDate = JsonConverters.fromJson(json['portArrivalDate'],'DateTime',context!);
combinedGrossOfferValue = JsonConverters.toDouble(json['combinedGrossOfferValue']);
currentLocation = json['currentLocation'];
notVisibleOnlineShowroom = json['notVisibleOnlineShowroom'];
nvosReason = json['nvosReason'];
nvosReasonOneAdminExcluded = json['nvosReasonOneAdminExcluded'];
nvosReasonLinkedToBackOrder = json['nvosReasonLinkedToBackOrder'];
includedAfterDeduplication = json['includedAfterDeduplication'];
unique = json['unique'];
duplicate = json['duplicate'];
duplicateGroup = json['duplicateGroup'];
lowestComm = json['lowestComm'];
rule = json['rule'];
fin = json['fin'];
chassisNumber = json['chassisNumber'];
modelYear = json['modelYear'];
modelYearCode = json['modelYearCode'];
halfModelYearCode = json['halfModelYearCode'];
fullModelYearCode = json['fullModelYearCode'];
bodyStyle = json['bodyStyle'];
engine = json['engine'];
cesarIdShipToParty = json['cesarIdShipToParty'];
vehicleUsageCode = json['vehicleUsageCode'];
acceleration = JsonConverters.toDouble(json['acceleration']);
bootCapacity = json['bootCapacity'];
topSpeed = JsonConverters.toDouble(json['topSpeed']);
driveConcept = json['driveConcept'];
combustionPowerHp = JsonConverters.toDouble(json['combustionPowerHp']);
electricPowerKw = JsonConverters.toDouble(json['electricPowerKw']);
electricPowerHp = JsonConverters.toDouble(json['electricPowerHp']);
combinedPowerKw = JsonConverters.toDouble(json['combinedPowerKw']);
combinedPowerHP = JsonConverters.toDouble(json['combinedPowerHP']);
underOffer = json['underOffer'];
isSellable = json['isSellable'];
mbukSecured = json['mbukSecured'];
isDisplayStock = json['isDisplayStock'];
isSpecialistCar = json['isSpecialistCar'];
account = json['account'];
productRange = json['productRange'];
isAMG = json['isAMG'];
actualPrice = JsonConverters.toDouble(json['actualPrice']);
retailPrice_ExVAT = JsonConverters.toDouble(json['retailPrice_ExVAT']);
retailPrice_IncVAT = JsonConverters.toDouble(json['retailPrice_IncVAT']);
otr = JsonConverters.toDouble(json['otr']);
nst = json['nst'];
bm7NST = json['bm7NST'];
electricRange = JsonConverters.toDouble(json['electricRange']);
electricConsumption = JsonConverters.toDouble(json['electricConsumption']);
emission = JsonConverters.toDouble(json['emission']);
emissionDirective = json['emissionDirective'];
emissionCombined = json['emissionCombined'];
emissionExtraUrban = json['emissionExtraUrban'];
emissionUrban = json['emissionUrban'];
energyEfficiencyClass = json['energyEfficiencyClass'];
wltpEmissionCombined = json['wltpEmissionCombined'];
wltpCombined = json['wltpCombined'];
wltpLow = json['wltpLow'];
wltpMedium = json['wltpMedium'];
wltpHigh = json['wltpHigh'];
wltpExtraHigh = json['wltpExtraHigh'];
totalMoneyOffersExclDiscretionary = JsonConverters.toDouble(json['totalMoneyOffersExclDiscretionary']);
discretionaryMoneyOffer = JsonConverters.toDouble(json['discretionaryMoneyOffer']);
totalMoneyOffersInclDiscretionary = JsonConverters.toDouble(json['totalMoneyOffersInclDiscretionary']);
nonDiscretionaryNMOCount = json['nonDiscretionaryNMOCount'];
nonDiscretionaryMOCount = json['nonDiscretionaryMOCount'];
discretionaryNMOCount = json['discretionaryNMOCount'];
discretionaryMOCount = json['discretionaryMOCount'];
totalOfferVIPAmount = JsonConverters.toDouble(json['totalOfferVIPAmount']);
stockLevelIndicator = json['stockLevelIndicator'];
return this;
}
Map<String, dynamic> toJson() => {
'commissionNumber': commissionNumber,
'description': description,
'salesDescriptionLong': salesDescriptionLong,
'model': model,
'colour': colour,
'colourGroup': colourGroup,
'fuelType': fuelType,
'transmission': transmission,
'transmissionType': transmissionType,
'packages': packages,
'lines': lines,
'upholstery': upholstery,
'upholsteryCode': upholsteryCode,
'displayStockAgent': displayStockAgent,
'location': location,
'vin': vin,
'vid': vid,
'vehicleType': vehicleType,
'vehicleClass': vehicleClass,
'creationDate': JsonConverters.toJson(creationDate,'DateTime',context!),
'lastUpdated': JsonConverters.toJson(lastUpdated,'DateTime',context!),
'productionDate': JsonConverters.toJson(productionDate,'DateTime',context!),
'portArrivalDate': JsonConverters.toJson(portArrivalDate,'DateTime',context!),
'combinedGrossOfferValue': combinedGrossOfferValue,
'currentLocation': currentLocation,
'notVisibleOnlineShowroom': notVisibleOnlineShowroom,
'nvosReason': nvosReason,
'nvosReasonOneAdminExcluded': nvosReasonOneAdminExcluded,
'nvosReasonLinkedToBackOrder': nvosReasonLinkedToBackOrder,
'includedAfterDeduplication': includedAfterDeduplication,
'unique': unique,
'duplicate': duplicate,
'duplicateGroup': duplicateGroup,
'lowestComm': lowestComm,
'rule': rule,
'fin': fin,
'chassisNumber': chassisNumber,
'modelYear': modelYear,
'modelYearCode': modelYearCode,
'halfModelYearCode': halfModelYearCode,
'fullModelYearCode': fullModelYearCode,
'bodyStyle': bodyStyle,
'engine': engine,
'cesarIdShipToParty': cesarIdShipToParty,
'vehicleUsageCode': vehicleUsageCode,
'acceleration': acceleration,
'bootCapacity': bootCapacity,
'topSpeed': topSpeed,
'driveConcept': driveConcept,
'combustionPowerHp': combustionPowerHp,
'electricPowerKw': electricPowerKw,
'electricPowerHp': electricPowerHp,
'combinedPowerKw': combinedPowerKw,
'combinedPowerHP': combinedPowerHP,
'underOffer': underOffer,
'isSellable': isSellable,
'mbukSecured': mbukSecured,
'isDisplayStock': isDisplayStock,
'isSpecialistCar': isSpecialistCar,
'account': account,
'productRange': productRange,
'isAMG': isAMG,
'actualPrice': actualPrice,
'retailPrice_ExVAT': retailPrice_ExVAT,
'retailPrice_IncVAT': retailPrice_IncVAT,
'otr': otr,
'nst': nst,
'bm7NST': bm7NST,
'electricRange': electricRange,
'electricConsumption': electricConsumption,
'emission': emission,
'emissionDirective': emissionDirective,
'emissionCombined': emissionCombined,
'emissionExtraUrban': emissionExtraUrban,
'emissionUrban': emissionUrban,
'energyEfficiencyClass': energyEfficiencyClass,
'wltpEmissionCombined': wltpEmissionCombined,
'wltpCombined': wltpCombined,
'wltpLow': wltpLow,
'wltpMedium': wltpMedium,
'wltpHigh': wltpHigh,
'wltpExtraHigh': wltpExtraHigh,
'totalMoneyOffersExclDiscretionary': totalMoneyOffersExclDiscretionary,
'discretionaryMoneyOffer': discretionaryMoneyOffer,
'totalMoneyOffersInclDiscretionary': totalMoneyOffersInclDiscretionary,
'nonDiscretionaryNMOCount': nonDiscretionaryNMOCount,
'nonDiscretionaryMOCount': nonDiscretionaryMOCount,
'discretionaryNMOCount': discretionaryNMOCount,
'discretionaryMOCount': discretionaryMOCount,
'totalOfferVIPAmount': totalOfferVIPAmount,
'stockLevelIndicator': stockLevelIndicator
};
getTypeName() => "StockDataRow";
TypeContext? context = _ctx;
}
class OnlineShowroomStockResponse implements IConvertible
{
int? totalVehicles;
List<StockDataRow>? vehicles = [];
OnlineShowroomStockResponse({this.totalVehicles,this.vehicles});
OnlineShowroomStockResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
totalVehicles = json['totalVehicles'];
vehicles = JsonConverters.fromJson(json['vehicles'],'List<StockDataRow>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'totalVehicles': totalVehicles,
'vehicles': JsonConverters.toJson(vehicles,'List<StockDataRow>',context!)
};
getTypeName() => "OnlineShowroomStockResponse";
TypeContext? context = _ctx;
}
class OnlineShowroomStockRequest implements IPost, IConvertible
{
List<String>? gssns = [];
OnlineShowroomStockRequest({this.gssns});
OnlineShowroomStockRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
gssns = JsonConverters.fromJson(json['gssns'],'List<String>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'gssns': JsonConverters.toJson(gssns,'List<String>',context!)
};
getTypeName() => "OnlineShowroomStockRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'uat_api_vehicle_mgt_mb_dhc.rapp_customers.co.uk', types: <String, TypeInfo> {
'StockDataRow': TypeInfo(TypeOf.Class, create:() => StockDataRow()),
'OnlineShowroomStockResponse': TypeInfo(TypeOf.Class, create:() => OnlineShowroomStockResponse()),
'List<StockDataRow>': TypeInfo(TypeOf.Class, create:() => <StockDataRow>[]),
'OnlineShowroomStockRequest': TypeInfo(TypeOf.Class, create:() => OnlineShowroomStockRequest()),
});
Dart OnlineShowroomStockRequest 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 /v1/OnlineShowroom/Stock 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 {"totalVehicles":0,"vehicles":[{"commissionNumber":"String","description":"String","salesDescriptionLong":"String","model":"String","colour":"String","colourGroup":"String","fuelType":"String","transmission":"String","transmissionType":"String","packages":"String","lines":"String","upholstery":"String","upholsteryCode":"String","displayStockAgent":"String","location":"String","vin":"String","vid":"String","vehicleType":"String","vehicleClass":"String","creationDate":"\/Date(-62135596800000-0000)\/","lastUpdated":"\/Date(-62135596800000-0000)\/","productionDate":"\/Date(-62135596800000-0000)\/","portArrivalDate":"\/Date(-62135596800000-0000)\/","combinedGrossOfferValue":0,"currentLocation":"String","notVisibleOnlineShowroom":false,"nvosReason":"String","nvosReasonOneAdminExcluded":false,"nvosReasonLinkedToBackOrder":false,"includedAfterDeduplication":false,"unique":false,"duplicate":false,"duplicateGroup":0,"lowestComm":false,"rule":"String","fin":"String","chassisNumber":"String","modelYear":"String","modelYearCode":"String","halfModelYearCode":"String","fullModelYearCode":"String","bodyStyle":"String","engine":"String","cesarIdShipToParty":"String","vehicleUsageCode":"String","acceleration":0,"bootCapacity":0,"topSpeed":0,"driveConcept":"String","combustionPowerHp":0,"electricPowerKw":0,"electricPowerHp":0,"combinedPowerKw":0,"combinedPowerHP":0,"underOffer":false,"isSellable":false,"mbukSecured":false,"isDisplayStock":false,"isSpecialistCar":false,"account":"String","productRange":"String","isAMG":false,"actualPrice":0,"retailPrice_ExVAT":0,"retailPrice_IncVAT":0,"otr":0,"nst":"String","bm7NST":"String","electricRange":0,"electricConsumption":0,"emission":0,"emissionDirective":"String","emissionCombined":"String","emissionExtraUrban":"String","emissionUrban":"String","energyEfficiencyClass":"String","wltpEmissionCombined":"String","wltpCombined":"String","wltpLow":"String","wltpMedium":"String","wltpHigh":"String","wltpExtraHigh":"String","totalMoneyOffersExclDiscretionary":0,"discretionaryMoneyOffer":0,"totalMoneyOffersInclDiscretionary":0,"nonDiscretionaryNMOCount":0,"nonDiscretionaryMOCount":0,"discretionaryNMOCount":0,"discretionaryMOCount":0,"totalOfferVIPAmount":0,"stockLevelIndicator":"String"}]}