| POST | /v1/{VehicleType}/Vehicle/Motability | Filter motability vehicle data |
|---|
#![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 VehicleDataBase {
pub vin: String,
pub description: String,
pub model: String,
pub otr: String,
#[serde(rename = "retailPriceExVAT")]
pub retail_price_ex_v_a_t: String,
#[serde(rename = "actualPrice")]
pub actual_price: String,
#[serde(rename = "p11D")]
pub p11_d: String,
#[serde(rename = "fuelType")]
pub fuel_type: String,
pub transmission: String,
#[serde(rename = "transmissionType")]
pub transmission_type: String,
pub colour: String,
#[serde(rename = "colourCode")]
pub colour_code: String,
#[serde(rename = "colourDescription")]
pub colour_description: String,
#[serde(rename = "commissionNumber")]
pub commission_number: String,
#[serde(rename = "offerAvailable")]
pub offer_available: bool,
#[serde(rename = "campaignDiscountOfferTotal")]
pub campaign_discount_offer_total: i32,
#[serde(rename = "campaignDiscountOfferTotalCurrent")]
pub campaign_discount_offer_total_current: i32,
#[serde(rename = "campaignDiscountOfferTotalPending")]
pub campaign_discount_offer_total_pending: i32,
#[serde(rename = "campaignServiceOfferTotal")]
pub campaign_service_offer_total: i32,
#[serde(rename = "campaignServiceOfferTotalCurrent")]
pub campaign_service_offer_total_current: i32,
#[serde(rename = "campaignServiceOfferTotalPending")]
pub campaign_service_offer_total_pending: i32,
#[serde(rename = "campaignCustomOfferTotal")]
pub campaign_custom_offer_total: i32,
#[serde(rename = "campaignPersonalisedOfferTotalCurrent")]
pub campaign_personalised_offer_total_current: i32,
#[serde(rename = "campaignPersonalisedOfferTotalPending")]
pub campaign_personalised_offer_total_pending: i32,
#[serde(rename = "campaignPersonalisedOfferTotal")]
pub campaign_personalised_offer_total: i32,
#[serde(rename = "campaignCustomOfferTotalCurrent")]
pub campaign_custom_offer_total_current: i32,
#[serde(rename = "campaignCustomOfferTotalPending")]
pub campaign_custom_offer_total_pending: i32,
#[serde(rename = "campaignOtherOfferTotal")]
pub campaign_other_offer_total: i32,
#[serde(rename = "campaignOtherOfferTotalCurrent")]
pub campaign_other_offer_total_current: i32,
#[serde(rename = "campaignOtherOfferTotalPending")]
pub campaign_other_offer_total_pending: i32,
#[serde(rename = "retailerDiscountOfferTotal")]
pub retailer_discount_offer_total: i32,
#[serde(rename = "retailerDiscountOfferTotalCurrent")]
pub retailer_discount_offer_total_current: i32,
#[serde(rename = "retailerDiscountOfferTotalPending")]
pub retailer_discount_offer_total_pending: i32,
#[serde(rename = "retailerServiceOfferTotal")]
pub retailer_service_offer_total: i32,
#[serde(rename = "retailerServiceOfferTotalCurrent")]
pub retailer_service_offer_total_current: i32,
#[serde(rename = "retailerServiceOfferTotalPending")]
pub retailer_service_offer_total_pending: i32,
#[serde(rename = "retailerCustomOfferTotal")]
pub retailer_custom_offer_total: i32,
#[serde(rename = "retailerCustomOfferTotalCurrent")]
pub retailer_custom_offer_total_current: i32,
#[serde(rename = "retailerCustomOfferTotalPending")]
pub retailer_custom_offer_total_pending: i32,
#[serde(rename = "retailerWarrantyOfferTotal")]
pub retailer_warranty_offer_total: i32,
#[serde(rename = "retailerWarrantyOfferTotalCurrent")]
pub retailer_warranty_offer_total_current: i32,
#[serde(rename = "retailerWarrantyOfferTotalPending")]
pub retailer_warranty_offer_total_pending: i32,
#[serde(rename = "retailerOfferTotal")]
pub retailer_offer_total: i32,
#[serde(rename = "retailerOfferTotalCurrent")]
pub retailer_offer_total_current: i32,
#[serde(rename = "retailerOfferTotalPending")]
pub retailer_offer_total_pending: i32,
#[serde(rename = "campaignOfferTotal")]
pub campaign_offer_total: i32,
#[serde(rename = "campaignOfferTotalCurrent")]
pub campaign_offer_total_current: i32,
#[serde(rename = "campaignOfferTotalPending")]
pub campaign_offer_total_pending: i32,
#[serde(rename = "campaignAndOfferTotal")]
pub campaign_and_offer_total: i32,
#[serde(rename = "campaignAndOfferTotalCurrent")]
pub campaign_and_offer_total_current: i32,
#[serde(rename = "campaignAndOfferTotalPending")]
pub campaign_and_offer_total_pending: i32,
#[serde(rename = "offerTotal")]
pub offer_total: i32,
#[serde(rename = "offerTotalCurrent")]
pub offer_total_current: i32,
#[serde(rename = "offerTotalPending")]
pub offer_total_pending: i32,
pub creation: String,
pub modified: String,
#[serde(rename = "electricRange")]
pub electric_range: i32,
#[serde(rename = "electricConsumption")]
pub electric_consumption: i32,
#[serde(rename = "portArrivalDate")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub port_arrival_date: Option<String>,
#[serde(rename = "daysSincePortArrival")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub days_since_port_arrival: Option<i32>,
#[serde(rename = "retailPriceIncVAT")]
pub retail_price_inc_v_a_t: f64,
#[serde(rename = "bodyStyle")]
pub body_style: String,
pub upholstery: String,
#[serde(rename = "upholsteryCode")]
pub upholstery_code: String,
#[serde(rename = "upholsteryType")]
pub upholstery_type: String,
#[serde(rename = "packageNames")]
pub package_names: Vec<String>,
pub line: String,
#[serde(rename = "mappedLine")]
pub mapped_line: String,
#[serde(rename = "currentRetailerOfferPrice")]
pub current_retailer_offer_price: f64,
#[serde(rename = "retailPrice")]
pub retail_price: String,
#[serde(rename = "vatQualifying")]
pub vat_qualifying: bool,
#[serde(rename = "retailerId")]
pub retailer_id: i32,
#[serde(rename = "gssnId")]
pub gssn_id: String,
#[serde(rename = "noImage")]
pub no_image: bool,
#[serde(rename = "imageUrl")]
pub image_url: String,
#[serde(rename = "isAvailableOnline")]
pub is_available_online: bool,
#[serde(rename = "isBackOrdered")]
pub is_back_ordered: bool,
#[serde(rename = "creationDate")]
pub creation_date: String,
#[serde(rename = "maintenanceDate")]
pub maintenance_date: String,
#[serde(rename = "registrationNumber")]
pub registration_number: String,
#[serde(rename = "registrationDate")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub registration_date: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mileage: Option<i32>,
#[serde(rename = "tradeInDate")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub trade_in_date: Option<String>,
pub source: String,
#[serde(rename = "vehicleType")]
pub vehicle_type: String,
#[serde(rename = "offerAmount")]
pub offer_amount: String,
#[serde(rename = "offerExpiry")]
pub offer_expiry: String,
#[serde(rename = "activeOffers")]
pub active_offers: Vec<i32>,
#[serde(rename = "campaignMessagesTotal")]
pub campaign_messages_total: i32,
#[serde(rename = "underOffer")]
pub under_offer: bool,
#[serde(rename = "isDisplayStock")]
pub is_display_stock: bool,
#[serde(rename = "displayRetailer")]
pub display_retailer: String,
#[serde(rename = "displayRetailerGssnId")]
pub display_retailer_gssn_id: String,
pub location: String,
pub account: String,
#[serde(rename = "accountType")]
pub account_type: String,
#[serde(rename = "usageCode")]
pub usage_code: String,
#[serde(rename = "bm7NST")]
pub bm7_n_s_t: String,
#[serde(rename = "isSellable")]
pub is_sellable: bool,
pub secured: bool,
pub specialist: bool,
#[serde(rename = "isMotabilityRetailer")]
pub is_motability_retailer: bool,
#[serde(rename = "upholsteryDescription")]
pub upholstery_description: String,
#[serde(rename = "inBackOrderAccount")]
pub in_back_order_account: bool,
#[serde(rename = "fullModelYearCode")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub full_model_year_code: Option<String>,
pub baumuster: String,
#[serde(rename = "isMotability")]
pub is_motability: bool,
#[serde(rename = "pipAdvanceRentalGross")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pip_advance_rental_gross: Option<f64>,
#[serde(rename = "wpmsAdvanceRentalGross")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub wpms_advance_rental_gross: Option<f64>,
#[serde(rename = "ispVehicleCustomerDescriptions")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub isp_vehicle_customer_descriptions: Option<Vec<String>>,
#[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 VehicleData {
#[serde(flatten)]
pub vehicle_data_base: VehicleDataBase,
pub engine: String,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct Equipment {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct VehicleIdentifierData {
#[serde(flatten)]
pub vehicle_data: VehicleData,
pub retailer: String,
#[serde(rename = "hasMotabilityError")]
pub has_motability_error: bool,
pub equipment: Vec<Equipment>,
#[serde(rename = "vehicleClass")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub vehicle_class: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct VehiclesByRetailerResponse {
pub vehicles: Vec<VehicleIdentifierData>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct MotabilityVehiclesFilterRequest {
pub min: i32,
pub max: i32,
#[serde(rename = "noPortArrivalDate")]
pub no_port_arrival_date: bool,
#[serde(rename = "vehicleType")]
pub vehicle_type: String,
}
Rust MotabilityVehiclesFilterRequest 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.
POST /v1/{VehicleType}/Vehicle/Motability HTTP/1.1
Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk
Accept: application/json
Content-Type: application/json
Content-Length: length
{"min":0,"max":0,"noPortArrivalDate":false,"vehicleType":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"vehicles":[{"retailer":"String","hasMotabilityError":false,"equipment":[{"id":0,"code":"String","description":"String"}],"vehicleClass":"String","engine":"String","vin":"String","description":"String","model":"String","otr":"String","retailPriceExVAT":"String","actualPrice":"String","p11D":"String","fuelType":"String","transmission":"String","transmissionType":"String","colour":"String","colourCode":"String","colourDescription":"String","commissionNumber":"String","offerAvailable":false,"campaignDiscountOfferTotal":0,"campaignDiscountOfferTotalCurrent":0,"campaignDiscountOfferTotalPending":0,"campaignServiceOfferTotal":0,"campaignServiceOfferTotalCurrent":0,"campaignServiceOfferTotalPending":0,"campaignCustomOfferTotal":0,"campaignPersonalisedOfferTotalCurrent":0,"campaignPersonalisedOfferTotalPending":0,"campaignPersonalisedOfferTotal":0,"campaignCustomOfferTotalCurrent":0,"campaignCustomOfferTotalPending":0,"campaignOtherOfferTotal":0,"campaignOtherOfferTotalCurrent":0,"campaignOtherOfferTotalPending":0,"retailerDiscountOfferTotal":0,"retailerDiscountOfferTotalCurrent":0,"retailerDiscountOfferTotalPending":0,"retailerServiceOfferTotal":0,"retailerServiceOfferTotalCurrent":0,"retailerServiceOfferTotalPending":0,"retailerCustomOfferTotal":0,"retailerCustomOfferTotalCurrent":0,"retailerCustomOfferTotalPending":0,"retailerWarrantyOfferTotal":0,"retailerWarrantyOfferTotalCurrent":0,"retailerWarrantyOfferTotalPending":0,"retailerOfferTotal":0,"retailerOfferTotalCurrent":0,"retailerOfferTotalPending":0,"campaignOfferTotal":0,"campaignOfferTotalCurrent":0,"campaignOfferTotalPending":0,"campaignAndOfferTotal":0,"campaignAndOfferTotalCurrent":0,"campaignAndOfferTotalPending":0,"offerTotal":0,"offerTotalCurrent":0,"offerTotalPending":0,"creation":"String","modified":"String","electricRange":0,"electricConsumption":0,"portArrivalDate":"\/Date(-62135596800000-0000)\/","daysSincePortArrival":0,"retailPriceIncVAT":0,"bodyStyle":"String","upholstery":"String","upholsteryCode":"String","upholsteryType":"String","packageNames":["String"],"line":"String","mappedLine":"String","currentRetailerOfferPrice":0,"retailPrice":"String","vatQualifying":false,"retailerId":0,"gssnId":"String","noImage":false,"imageUrl":"String","isAvailableOnline":false,"isBackOrdered":false,"creationDate":"String","maintenanceDate":"String","registrationNumber":"String","registrationDate":"\/Date(-62135596800000-0000)\/","mileage":0,"tradeInDate":"\/Date(-62135596800000-0000)\/","source":"String","vehicleType":"String","offerAmount":"String","offerExpiry":"String","activeOffers":[0],"campaignMessagesTotal":0,"underOffer":false,"isDisplayStock":false,"displayRetailer":"String","displayRetailerGssnId":"String","location":"String","account":"String","accountType":"String","usageCode":"String","bm7NST":"String","isSellable":false,"secured":false,"specialist":false,"isMotabilityRetailer":false,"upholsteryDescription":"String","inBackOrderAccount":false,"fullModelYearCode":"String","baumuster":"String","isMotability":false,"pipAdvanceRentalGross":0,"wpmsAdvanceRentalGross":0,"ispVehicleCustomerDescriptions":["String"],"eligibleForMaTransfer":false,"confirmedProductionDate":"String","forecastedArrivalDate":"String"}]}