Mercedes.VehicleManagement.API

<back to all web services

AllAvailableVehiclesCsvRequest

Vehicle
Requires Authentication
The following routes are available for this service:
GET/v1/AllAvailableVehiclesCsv/{vehicleType}/{includeBackOrderAccounts}Get all available vehicles
#![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 BaseAllAvailableVehiclesRequest {
    #[serde(rename = "vehicleType")]
    pub vehicle_type: String,
    #[serde(rename = "includeBackOrderAccounts")]
    pub include_back_order_accounts: bool,
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct BasicBackOrderVehicle {
    #[serde(rename = "commissionNumber")]
    pub commission_number: String,
    pub description: String,
    pub model: String,
    pub colour: String,
    #[serde(rename = "fuelType")]
    pub fuel_type: String,
    pub transmission: String,
    pub packages: String,
    pub lines: String,
    pub upholstery: String,
    #[serde(rename = "emissionCombined")]
    pub emission_combined: String,
    #[serde(rename = "actualPrice")]
    pub actual_price: f64,
    #[serde(rename = "usageCode")]
    pub usage_code: String,
    pub secured: bool,
    pub account: String,
    #[serde(rename = "securedTime")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub secured_time: Option<String>,
    #[serde(rename = "securedReason")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub secured_reason: Option<String>,
    #[serde(rename = "securedByGasId")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub secured_by_gas_id: Option<String>,
    #[serde(rename = "securedDate")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub secured_date: Option<String>,
    #[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 BackOrderVehicle {
    #[serde(flatten)]
    pub basic_back_order_vehicle: BasicBackOrderVehicle,
    pub id: i32,
    pub vin: String,
    #[serde(rename = "vehicleType")]
    pub vehicle_type: String,
    pub vid: String,
    pub fin: String,
    #[serde(rename = "chassisNumber")]
    pub chassis_number: String,
    #[serde(rename = "modelYear")]
    pub model_year: String,
    #[serde(rename = "modelYearCode")]
    pub model_year_code: String,
    #[serde(rename = "halfModelYearCode")]
    pub half_model_year_code: String,
    #[serde(rename = "fullModelYearCode")]
    pub full_model_year_code: String,
    #[serde(rename = "salesDescriptionLong")]
    pub sales_description_long: String,
    #[serde(rename = "vehicleClass")]
    pub vehicle_class: String,
    #[serde(rename = "retailPrice_ExVAT")]
    pub retail_price__ex_v_a_t: f64,
    #[serde(rename = "retailPrice_IncVAT")]
    pub retail_price__inc_v_a_t: f64,
    pub otr: f64,
    #[serde(rename = "bodyStyle")]
    pub body_style: String,
    #[serde(rename = "productRange")]
    pub product_range: String,
    pub engine: String,
    #[serde(rename = "isAMG")]
    pub is_a_m_g: bool,
    #[serde(rename = "colourGroup")]
    pub colour_group: String,
    #[serde(rename = "upholsteryCode")]
    pub upholstery_code: String,
    pub nst: String,
    #[serde(rename = "bm7NST")]
    pub bm7_n_s_t: String,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub acceleration: Option<f64>,
    #[serde(rename = "bootCapacity")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub boot_capacity: Option<i32>,
    #[serde(rename = "topSpeed")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub top_speed: Option<f64>,
    #[serde(rename = "driveConcept")]
    pub drive_concept: String,
    #[serde(rename = "combustionPowerHp")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub combustion_power_hp: Option<f64>,
    #[serde(rename = "electricPowerKw")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub electric_power_kw: Option<f64>,
    #[serde(rename = "electricPowerHp")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub electric_power_hp: Option<f64>,
    #[serde(rename = "combinedPowerKw")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub combined_power_kw: Option<f64>,
    #[serde(rename = "combinedPowerHP")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub combined_power_h_p: Option<f64>,
    #[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(default, skip_serializing_if = "Option::is_none")]
    pub emission: Option<f64>,
    #[serde(rename = "emissionDirective")]
    pub emission_directive: String,
    #[serde(rename = "emissionExtraUrban")]
    pub emission_extra_urban: String,
    #[serde(rename = "emissionUrban")]
    pub emission_urban: String,
    #[serde(rename = "energyEfficiencyClass")]
    pub energy_efficiency_class: String,
    #[serde(rename = "wltpEmissionCombined")]
    pub wltp_emission_combined: String,
    #[serde(rename = "wltpCombined")]
    pub wltp_combined: String,
    #[serde(rename = "wltpLow")]
    pub wltp_low: String,
    #[serde(rename = "wltpMedium")]
    pub wltp_medium: String,
    #[serde(rename = "wltpHigh")]
    pub wltp_high: String,
    #[serde(rename = "wltpExtraHigh")]
    pub wltp_extra_high: String,
    #[serde(rename = "portArrivalDate")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub port_arrival_date: Option<String>,
    #[serde(rename = "creationDate")]
    pub creation_date: String,
    #[serde(rename = "lastUpdated")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub last_updated: Option<String>,
    #[serde(rename = "isDisplayStock")]
    pub is_display_stock: bool,
    #[serde(rename = "displayStockAgent")]
    pub display_stock_agent: String,
    #[serde(rename = "isSpecialistCar")]
    pub is_specialist_car: bool,
    pub location: String,
    #[serde(rename = "cesarIdShipToParty")]
    pub cesar_id_ship_to_party: String,
    #[serde(rename = "isSellable")]
    pub is_sellable: bool,
    #[serde(rename = "underOffer")]
    pub under_offer: bool,
    pub baumuster: String,
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct StockManagementResponse {
    #[serde(rename = "totalVehicles")]
    pub total_vehicles: i32,
    pub vehicles: Vec<BackOrderVehicle>,
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct AllAvailableVehiclesCsvRequest {
    #[serde(flatten)]
    pub base_all_available_vehicles_request: BaseAllAvailableVehiclesRequest,
}

Rust AllAvailableVehiclesCsvRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /v1/AllAvailableVehiclesCsv/{vehicleType}/{includeBackOrderAccounts} HTTP/1.1 
Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"totalVehicles":0}