POST | /v1/OnlineShowroomCsv/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 full detail CSV export in OneAdmin |
---|
import 'package:servicestack/servicestack.dart';
class CsvVehicle implements IConvertible
{
// @DataMember(Name="Vehicle Type")
String? Vehicle_Type;
String? vid;
String? vin;
String? fin;
// @DataMember(Name="Comm")
String? Comm;
// @DataMember(Name="Chassis Number")
String? Chassis_Number;
// @DataMember(Name="Model Year")
String? Model_Year;
// @DataMember(Name="Model Year Code")
String? Model_Year_Code;
// @DataMember(Name="Half Model Year Code")
String? Half_Model_Year_Code;
// @DataMember(Name="Full Model Year Code")
String? Full_Model_Year_Code;
// @DataMember(Name="Description")
String? Description;
// @DataMember(Name="Vehicle Class")
String? Vehicle_Class;
// @DataMember(Name="Body Style")
String? Body_Style;
String? model;
String? colour;
// @DataMember(Name="Colour Group")
String? Colour_Group;
// @DataMember(Name="Fuel Type")
String? Fuel_Type;
String? transmission;
String? packages;
String? lines;
// @DataMember(Name="Product Range")
String? Product_Range;
String? engine;
bool? isAMG;
String? upholstery;
String? nst;
String? baumuster;
String? bm7NST;
double? acceleration;
// @DataMember(Name="Boot Capacity")
int? Boot_Capacity;
// @DataMember(Name="Top Speed")
double? Top_Speed;
// @DataMember(Name="Drive Concept")
String? Drive_Concept;
// @DataMember(Name="Combustion Power HP")
double? Combustion_Power_HP;
// @DataMember(Name="Electric Power KW")
double? Electric_Power_KW;
// @DataMember(Name="Electric Power HP")
double? Electric_Power_HP;
// @DataMember(Name="Combined Power KW")
double? Combined_Power_KW;
// @DataMember(Name="Combined Power HP")
double? Combined_Power_HP;
// @DataMember(Name="Electric Range")
double? Electric_Range;
// @DataMember(Name="Electric Consumption")
double? Electric_Consumption;
// @DataMember(Name="Emission Combined")
String? Emission_Combined;
// @DataMember(Name="Emission Directive")
String? Emission_Directive;
// @DataMember(Name="Emission Extra Urban")
String? Emission_Extra_Urban;
// @DataMember(Name="Emission Urban")
String? Emission_Urban;
double? emission;
// @DataMember(Name="Test Standard")
String? Test_Standard;
// @DataMember(Name="Energy Efficiency Class")
String? Energy_Efficiency_Class;
// @DataMember(Name="WLTP Combined")
String? WLTP_Combined;
// @DataMember(Name="WLTP Low")
String? WLTP_Low;
// @DataMember(Name="WLTP Medium")
String? WLTP_Medium;
// @DataMember(Name="WLTP High")
String? WLTP_High;
// @DataMember(Name="WLTP Extra High")
String? WLTP_Extra_High;
// @DataMember(Name="WLTP CO2 Emissions")
String? WLTP_CO2_Emissions;
// @DataMember(Name="Production Date")
DateTime? Production_Date;
// @DataMember(Name="Port Arrival Date")
DateTime? Port_Arrival_Date;
// @DataMember(Name="Creation Date")
DateTime? Creation_Date;
// @DataMember(Name="Maintenance Date")
DateTime? Maintenance_Date;
// @DataMember(Name="Net Price")
double? Net_Price;
// @DataMember(Name="Retail Price")
double? Retail_Price;
// @DataMember(Name="OTR Price")
double? OTR_Price;
// @DataMember(Name="Actual Price")
double? Actual_Price;
// @DataMember(Name="Usage Code")
String? Usage_Code;
String? secured;
String? account;
String? isDisplayStock;
// @DataMember(Name="Display Agent")
String? Display_Agent;
String? isSpecialistCar;
String? cesarIdShipToParty;
String? isSellable;
// @DataMember(Name="Under Offer")
String? Under_Offer;
// @DataMember(Name="Secured Date")
String? Secured_Date;
// @DataMember(Name="Secured Reason")
String? Secured_Reason;
// @DataMember(Name="Secured By Gas Id")
String? Secured_By_Gas_Id;
CsvVehicle({this.Vehicle_Type,this.vid,this.vin,this.fin,this.Comm,this.Chassis_Number,this.Model_Year,this.Model_Year_Code,this.Half_Model_Year_Code,this.Full_Model_Year_Code,this.Description,this.Vehicle_Class,this.Body_Style,this.model,this.colour,this.Colour_Group,this.Fuel_Type,this.transmission,this.packages,this.lines,this.Product_Range,this.engine,this.isAMG,this.upholstery,this.nst,this.baumuster,this.bm7NST,this.acceleration,this.Boot_Capacity,this.Top_Speed,this.Drive_Concept,this.Combustion_Power_HP,this.Electric_Power_KW,this.Electric_Power_HP,this.Combined_Power_KW,this.Combined_Power_HP,this.Electric_Range,this.Electric_Consumption,this.Emission_Combined,this.Emission_Directive,this.Emission_Extra_Urban,this.Emission_Urban,this.emission,this.Test_Standard,this.Energy_Efficiency_Class,this.WLTP_Combined,this.WLTP_Low,this.WLTP_Medium,this.WLTP_High,this.WLTP_Extra_High,this.WLTP_CO2_Emissions,this.Production_Date,this.Port_Arrival_Date,this.Creation_Date,this.Maintenance_Date,this.Net_Price,this.Retail_Price,this.OTR_Price,this.Actual_Price,this.Usage_Code,this.secured,this.account,this.isDisplayStock,this.Display_Agent,this.isSpecialistCar,this.cesarIdShipToParty,this.isSellable,this.Under_Offer,this.Secured_Date,this.Secured_Reason,this.Secured_By_Gas_Id});
CsvVehicle.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Vehicle_Type = json['vehicleType'];
vid = json['vid'];
vin = json['vin'];
fin = json['fin'];
Comm = json['commissionNumber'];
Chassis_Number = json['chassisNumber'];
Model_Year = json['modelYear'];
Model_Year_Code = json['modelYearCode'];
Half_Model_Year_Code = json['halfModelYearCode'];
Full_Model_Year_Code = json['fullModelYearCode'];
Description = json['salesDescriptionLong'];
Vehicle_Class = json['vehicleClass'];
Body_Style = json['bodyStyle'];
model = json['model'];
colour = json['colour'];
Colour_Group = json['colourGroup'];
Fuel_Type = json['fuelType'];
transmission = json['transmission'];
packages = json['packages'];
lines = json['lines'];
Product_Range = json['productRange'];
engine = json['engine'];
isAMG = json['isAMG'];
upholstery = json['upholstery'];
nst = json['nst'];
baumuster = json['baumuster'];
bm7NST = json['bm7NST'];
acceleration = JsonConverters.toDouble(json['acceleration']);
Boot_Capacity = json['bootCapacity'];
Top_Speed = JsonConverters.toDouble(json['topSpeed']);
Drive_Concept = json['driveConcept'];
Combustion_Power_HP = JsonConverters.toDouble(json['combustionPowerHp']);
Electric_Power_KW = JsonConverters.toDouble(json['electricPowerKw']);
Electric_Power_HP = JsonConverters.toDouble(json['electricPowerHp']);
Combined_Power_KW = JsonConverters.toDouble(json['combinedPowerKw']);
Combined_Power_HP = JsonConverters.toDouble(json['combinedPowerHP']);
Electric_Range = JsonConverters.toDouble(json['electricRange']);
Electric_Consumption = JsonConverters.toDouble(json['electricConsumption']);
Emission_Combined = json['emissionCombined'];
Emission_Directive = json['emissionDirective'];
Emission_Extra_Urban = json['emissionExtraUrban'];
Emission_Urban = json['emissionUrban'];
emission = JsonConverters.toDouble(json['emission']);
Test_Standard = json['testStandard'];
Energy_Efficiency_Class = json['energyEfficiencyClass'];
WLTP_Combined = json['wltpCombined'];
WLTP_Low = json['wltpLow'];
WLTP_Medium = json['wltpMedium'];
WLTP_High = json['wltpHigh'];
WLTP_Extra_High = json['wltpExtraHigh'];
WLTP_CO2_Emissions = json['wltpEmissionCombined'];
Production_Date = JsonConverters.fromJson(json['productionDate'],'DateTime',context!);
Port_Arrival_Date = JsonConverters.fromJson(json['portArrivalDate'],'DateTime',context!);
Creation_Date = JsonConverters.fromJson(json['creationDate'],'DateTime',context!);
Maintenance_Date = JsonConverters.fromJson(json['lastUpdated'],'DateTime',context!);
Net_Price = JsonConverters.toDouble(json['retailPrice_ExVAT']);
Retail_Price = JsonConverters.toDouble(json['retailPrice_IncVAT']);
OTR_Price = JsonConverters.toDouble(json['otr']);
Actual_Price = JsonConverters.toDouble(json['actualPrice']);
Usage_Code = json['usageCode'];
secured = json['secured'];
account = json['account'];
isDisplayStock = json['isDisplayStock'];
Display_Agent = json['displayStockAgent'];
isSpecialistCar = json['isSpecialistCar'];
cesarIdShipToParty = json['cesarIdShipToParty'];
isSellable = json['isSellable'];
Under_Offer = json['underOffer'];
Secured_Date = json['securedDate'];
Secured_Reason = json['securedReason'];
Secured_By_Gas_Id = json['securedByGasId'];
return this;
}
Map<String, dynamic> toJson() => {
'vehicle_Type': Vehicle_Type,
'vid': vid,
'vin': vin,
'fin': fin,
'comm': Comm,
'chassis_Number': Chassis_Number,
'model_Year': Model_Year,
'model_Year_Code': Model_Year_Code,
'half_Model_Year_Code': Half_Model_Year_Code,
'full_Model_Year_Code': Full_Model_Year_Code,
'description': Description,
'vehicle_Class': Vehicle_Class,
'body_Style': Body_Style,
'model': model,
'colour': colour,
'colour_Group': Colour_Group,
'fuel_Type': Fuel_Type,
'transmission': transmission,
'packages': packages,
'lines': lines,
'product_Range': Product_Range,
'engine': engine,
'isAMG': isAMG,
'upholstery': upholstery,
'nst': nst,
'baumuster': baumuster,
'bm7NST': bm7NST,
'acceleration': acceleration,
'boot_Capacity': Boot_Capacity,
'top_Speed': Top_Speed,
'drive_Concept': Drive_Concept,
'combustion_Power_HP': Combustion_Power_HP,
'electric_Power_KW': Electric_Power_KW,
'electric_Power_HP': Electric_Power_HP,
'combined_Power_KW': Combined_Power_KW,
'combined_Power_HP': Combined_Power_HP,
'electric_Range': Electric_Range,
'electric_Consumption': Electric_Consumption,
'emission_Combined': Emission_Combined,
'emission_Directive': Emission_Directive,
'emission_Extra_Urban': Emission_Extra_Urban,
'emission_Urban': Emission_Urban,
'emission': emission,
'test_Standard': Test_Standard,
'energy_Efficiency_Class': Energy_Efficiency_Class,
'wltP_Combined': WLTP_Combined,
'wltP_Low': WLTP_Low,
'wltP_Medium': WLTP_Medium,
'wltP_High': WLTP_High,
'wltP_Extra_High': WLTP_Extra_High,
'wltP_CO2_Emissions': WLTP_CO2_Emissions,
'production_Date': JsonConverters.toJson(Production_Date,'DateTime',context!),
'port_Arrival_Date': JsonConverters.toJson(Port_Arrival_Date,'DateTime',context!),
'creation_Date': JsonConverters.toJson(Creation_Date,'DateTime',context!),
'maintenance_Date': JsonConverters.toJson(Maintenance_Date,'DateTime',context!),
'net_Price': Net_Price,
'retail_Price': Retail_Price,
'otR_Price': OTR_Price,
'actual_Price': Actual_Price,
'usage_Code': Usage_Code,
'secured': secured,
'account': account,
'isDisplayStock': isDisplayStock,
'display_Agent': Display_Agent,
'isSpecialistCar': isSpecialistCar,
'cesarIdShipToParty': cesarIdShipToParty,
'isSellable': isSellable,
'under_Offer': Under_Offer,
'secured_Date': Secured_Date,
'secured_Reason': Secured_Reason,
'secured_By_Gas_Id': Secured_By_Gas_Id
};
getTypeName() => "CsvVehicle";
TypeContext? context = _ctx;
}
class InternalAvailableStockResponse implements IConvertible
{
int? totalVehicles;
List<CsvVehicle>? vehicles;
InternalAvailableStockResponse({this.totalVehicles,this.vehicles});
InternalAvailableStockResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
totalVehicles = json['totalVehicles'];
vehicles = JsonConverters.fromJson(json['vehicles'],'List<CsvVehicle>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'totalVehicles': totalVehicles,
'vehicles': JsonConverters.toJson(vehicles,'List<CsvVehicle>',context!)
};
getTypeName() => "InternalAvailableStockResponse";
TypeContext? context = _ctx;
}
class OnlineShowroomStockCsvRequest implements IPost, IConvertible
{
List<String>? gssns = [];
OnlineShowroomStockCsvRequest({this.gssns});
OnlineShowroomStockCsvRequest.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() => "OnlineShowroomStockCsvRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'uat_api_vehicle_mgt_mb_dhc.rapp_customers.co.uk', types: <String, TypeInfo> {
'CsvVehicle': TypeInfo(TypeOf.Class, create:() => CsvVehicle()),
'InternalAvailableStockResponse': TypeInfo(TypeOf.Class, create:() => InternalAvailableStockResponse()),
'List<CsvVehicle>': TypeInfo(TypeOf.Class, create:() => <CsvVehicle>[]),
'OnlineShowroomStockCsvRequest': TypeInfo(TypeOf.Class, create:() => OnlineShowroomStockCsvRequest()),
});
Dart OnlineShowroomStockCsvRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/OnlineShowroomCsv/Stock HTTP/1.1
Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<OnlineShowroomStockCsvRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Mercedes.VehicleManagement.API.ServiceModel">
<Gssns xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</Gssns>
</OnlineShowroomStockCsvRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <InternalAvailableStockResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Mercedes.VehicleManagement.API.Shared.POCO.V3"> <TotalVehicles>0</TotalVehicles> <Vehicles i:nil="true" /> </InternalAvailableStockResponse>