| 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 .xml suffix or ?format=xml
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/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<VehicleDetailsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Mercedes.VehicleManagement.API.Shared.POCO.V3">
<Vehicle>
<Account>String</Account>
<ActualPrice>0</ActualPrice>
<Baumuster>String</Baumuster>
<Bm7NST>String</Bm7NST>
<BodyStyle>String</BodyStyle>
<Colour>String</Colour>
<ColourDescription>String</ColourDescription>
<CommissionNumber>String</CommissionNumber>
<ConfirmedProductionDate>String</ConfirmedProductionDate>
<Description>String</Description>
<DisplayRetailer>String</DisplayRetailer>
<ElectricConsumption>0</ElectricConsumption>
<ElectricRange>0</ElectricRange>
<EligibleForMaTransfer>false</EligibleForMaTransfer>
<ForecastedArrivalDate>String</ForecastedArrivalDate>
<FuelType>String</FuelType>
<FullModelYearCode>String</FullModelYearCode>
<ImageUrl>String</ImageUrl>
<InBackOrderAccount>false</InBackOrderAccount>
<IsAllocatedToBackOrder>false</IsAllocatedToBackOrder>
<IsAvailableOnline>false</IsAvailableOnline>
<IsSellable>false</IsSellable>
<IsSpecialistCar>false</IsSpecialistCar>
<IspVehicleCustomerDescriptions xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:string>String</d3p1:string>
</IspVehicleCustomerDescriptions>
<Line>String</Line>
<Location>String</Location>
<MappedLine>String</MappedLine>
<Model>String</Model>
<NST>String</NST>
<OTRPrice>0</OTRPrice>
<P11D>0</P11D>
<Package>String</Package>
<Packages xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:string>String</d3p1:string>
</Packages>
<PortArrivalDate>0001-01-01T00:00:00</PortArrivalDate>
<RetailPrice_ExVAT>0</RetailPrice_ExVAT>
<RetailerId>0</RetailerId>
<Secured>false</Secured>
<Transmission>String</Transmission>
<TransmissionType>String</TransmissionType>
<UnderOffer>false</UnderOffer>
<Upholstery>String</Upholstery>
<UpholsteryDescription>String</UpholsteryDescription>
<UsageCode>String</UsageCode>
<VehicleAuditDetails>
<VehicleAuditDetails>
<CreationDate>String</CreationDate>
<Notes>String</Notes>
<Status>false</Status>
<UserId>String</UserId>
</VehicleAuditDetails>
</VehicleAuditDetails>
<VehicleType>String</VehicleType>
<Vin>String</Vin>
<Engine>String</Engine>
</Vehicle>
</VehicleDetailsResponse>