| GET | /v1/details/{vehicleType}/{Identifier} | Get Vehicle Details | |
|---|---|---|---|
| GET | /details/{vehicleType}/{Identifier} | Get Vehicle Details |
#![allow(
dead_code,
non_camel_case_types,
non_snake_case,
clippy::upper_case_acronyms
)]
use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::collections::HashMap;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct VehicleAuditDetails {
#[serde(rename = "userId")]
pub user_id: String,
pub status: bool,
pub notes: String,
#[serde(rename = "creationDate")]
pub creation_date: String,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct BackOrderVehicleDetailsBase {
pub vin: String,
#[serde(rename = "commissionNumber")]
pub commission_number: String,
pub description: String,
pub model: String,
#[serde(rename = "fullModelYearCode")]
pub full_model_year_code: String,
#[serde(rename = "retailerId")]
pub retailer_id: i32,
#[serde(rename = "imageUrl")]
pub image_url: String,
pub colour: String,
#[serde(rename = "colourDescription")]
pub colour_description: String,
#[serde(rename = "bodyStyle")]
pub body_style: String,
#[serde(rename = "fuelType")]
pub fuel_type: String,
pub transmission: String,
#[serde(rename = "transmissionType")]
pub transmission_type: String,
pub package: String,
pub packages: Vec<String>,
pub line: String,
#[serde(rename = "mappedLine")]
pub mapped_line: String,
pub upholstery: String,
#[serde(rename = "upholsteryDescription")]
pub upholstery_description: String,
#[serde(rename = "usageCode")]
pub usage_code: String,
pub account: String,
pub nst: String,
pub baumuster: String,
#[serde(rename = "electricRange")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub electric_range: Option<f64>,
#[serde(rename = "electricConsumption")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub electric_consumption: Option<f64>,
#[serde(rename = "retailPrice_ExVAT")]
pub retail_price__ex_v_a_t: f64,
#[serde(rename = "actualPrice")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub actual_price: Option<f64>,
#[serde(rename = "otrPrice")]
pub otr_price: f64,
#[serde(rename = "p11D")]
pub p11_d: f64,
#[serde(rename = "vehicleType")]
pub vehicle_type: String,
pub secured: bool,
#[serde(rename = "portArrivalDate")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub port_arrival_date: Option<String>,
#[serde(rename = "displayRetailer")]
pub display_retailer: String,
pub location: String,
#[serde(rename = "bm7NST")]
pub bm7_n_s_t: String,
#[serde(rename = "isAvailableOnline")]
pub is_available_online: bool,
#[serde(rename = "isSpecialistCar")]
pub is_specialist_car: bool,
#[serde(rename = "isSellable")]
pub is_sellable: bool,
#[serde(rename = "inBackOrderAccount")]
pub in_back_order_account: bool,
#[serde(rename = "vehicleAuditDetails")]
pub vehicle_audit_details: Vec<VehicleAuditDetails>,
#[serde(rename = "ispVehicleCustomerDescriptions")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub isp_vehicle_customer_descriptions: Option<Vec<String>>,
#[serde(rename = "underOffer")]
pub under_offer: bool,
#[serde(rename = "isAllocatedToBackOrder")]
pub is_allocated_to_back_order: bool,
#[serde(rename = "eligibleForMaTransfer")]
pub eligible_for_ma_transfer: bool,
#[serde(rename = "confirmedProductionDate")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub confirmed_production_date: Option<String>,
#[serde(rename = "forecastedArrivalDate")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub forecasted_arrival_date: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct BackOrderVehicleDetails {
#[serde(flatten)]
pub back_order_vehicle_details_base: BackOrderVehicleDetailsBase,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub engine: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct VehicleDetailsResponse {
pub vehicle: BackOrderVehicleDetails,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct VehicleDetailsRequest {
pub identifier: String,
#[serde(rename = "vehicleType")]
pub vehicle_type: String,
}
Rust VehicleDetailsRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/details/{vehicleType}/{Identifier} HTTP/1.1
Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
vehicle:
{
engine: String,
vin: String,
commissionNumber: String,
description: String,
model: String,
fullModelYearCode: String,
retailerId: 0,
imageUrl: String,
colour: String,
colourDescription: String,
bodyStyle: String,
fuelType: String,
transmission: String,
transmissionType: String,
package: String,
packages:
[
String
],
line: String,
mappedLine: String,
upholstery: String,
upholsteryDescription: String,
usageCode: String,
account: String,
nst: String,
baumuster: String,
electricRange: 0,
electricConsumption: 0,
retailPrice_ExVAT: 0,
actualPrice: 0,
otrPrice: 0,
p11D: 0,
vehicleType: String,
secured: False,
portArrivalDate: 0001-01-01,
displayRetailer: String,
location: String,
bm7NST: String,
isAvailableOnline: False,
isSpecialistCar: False,
isSellable: False,
inBackOrderAccount: False,
vehicleAuditDetails:
[
{
userId: String,
status: False,
notes: String,
creationDate: String
}
],
ispVehicleCustomerDescriptions:
[
String
],
underOffer: False,
isAllocatedToBackOrder: False,
eligibleForMaTransfer: False,
confirmedProductionDate: String,
forecastedArrivalDate: String
}
}