| 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 .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.
GET /v1/details/{vehicleType}/{Identifier} HTTP/1.1
Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
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":"\/Date(-62135596800000-0000)\/","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"}}