| GET | /v1/{VehicleType}/Vehicle/Motability | Get motability vehicle data |
|---|
# frozen_string_literal: true
# encoding: utf-8
require 'json'
require 'servicestack'
class VehicleDataBase
include ServiceStack::DTO
# @return [String]
attr_accessor :vin
# @return [String]
attr_accessor :description
# @return [String]
attr_accessor :model
# @return [String]
attr_accessor :otr
# @return [String]
attr_accessor :retail_price_ex_v_a_t
# @return [String]
attr_accessor :actual_price
# @return [String]
attr_accessor :p11_d
# @return [String]
attr_accessor :fuel_type
# @return [String]
attr_accessor :transmission
# @return [String]
attr_accessor :transmission_type
# @return [String]
attr_accessor :colour
# @return [String]
attr_accessor :colour_code
# @return [String]
attr_accessor :colour_description
# @return [String]
attr_accessor :commission_number
# @return [TrueClass]
attr_accessor :offer_available
# @return [Integer]
attr_accessor :campaign_discount_offer_total
# @return [Integer]
attr_accessor :campaign_discount_offer_total_current
# @return [Integer]
attr_accessor :campaign_discount_offer_total_pending
# @return [Integer]
attr_accessor :campaign_service_offer_total
# @return [Integer]
attr_accessor :campaign_service_offer_total_current
# @return [Integer]
attr_accessor :campaign_service_offer_total_pending
# @return [Integer]
attr_accessor :campaign_custom_offer_total
# @return [Integer]
attr_accessor :campaign_personalised_offer_total_current
# @return [Integer]
attr_accessor :campaign_personalised_offer_total_pending
# @return [Integer]
attr_accessor :campaign_personalised_offer_total
# @return [Integer]
attr_accessor :campaign_custom_offer_total_current
# @return [Integer]
attr_accessor :campaign_custom_offer_total_pending
# @return [Integer]
attr_accessor :campaign_other_offer_total
# @return [Integer]
attr_accessor :campaign_other_offer_total_current
# @return [Integer]
attr_accessor :campaign_other_offer_total_pending
# @return [Integer]
attr_accessor :retailer_discount_offer_total
# @return [Integer]
attr_accessor :retailer_discount_offer_total_current
# @return [Integer]
attr_accessor :retailer_discount_offer_total_pending
# @return [Integer]
attr_accessor :retailer_service_offer_total
# @return [Integer]
attr_accessor :retailer_service_offer_total_current
# @return [Integer]
attr_accessor :retailer_service_offer_total_pending
# @return [Integer]
attr_accessor :retailer_custom_offer_total
# @return [Integer]
attr_accessor :retailer_custom_offer_total_current
# @return [Integer]
attr_accessor :retailer_custom_offer_total_pending
# @return [Integer]
attr_accessor :retailer_warranty_offer_total
# @return [Integer]
attr_accessor :retailer_warranty_offer_total_current
# @return [Integer]
attr_accessor :retailer_warranty_offer_total_pending
# @return [Integer]
attr_accessor :retailer_offer_total
# @return [Integer]
attr_accessor :retailer_offer_total_current
# @return [Integer]
attr_accessor :retailer_offer_total_pending
# @return [Integer]
attr_accessor :campaign_offer_total
# @return [Integer]
attr_accessor :campaign_offer_total_current
# @return [Integer]
attr_accessor :campaign_offer_total_pending
# @return [Integer]
attr_accessor :campaign_and_offer_total
# @return [Integer]
attr_accessor :campaign_and_offer_total_current
# @return [Integer]
attr_accessor :campaign_and_offer_total_pending
# @return [Integer]
attr_accessor :offer_total
# @return [Integer]
attr_accessor :offer_total_current
# @return [Integer]
attr_accessor :offer_total_pending
# @return [String]
attr_accessor :creation
# @return [String]
attr_accessor :modified
# @return [Integer]
attr_accessor :electric_range
# @return [Integer]
attr_accessor :electric_consumption
# @return [DateTime]
attr_accessor :port_arrival_date
# @return [Integer]
attr_accessor :days_since_port_arrival
# @return [BigDecimal]
attr_accessor :retail_price_inc_v_a_t
# @return [String]
attr_accessor :body_style
# @return [String]
attr_accessor :upholstery
# @return [String]
attr_accessor :upholstery_code
# @return [String]
attr_accessor :upholstery_type
# @return [List]
attr_accessor :package_names
# @return [String]
attr_accessor :line
# @return [String]
attr_accessor :mapped_line
# @return [BigDecimal]
attr_accessor :current_retailer_offer_price
# @return [String]
attr_accessor :retail_price
# @return [TrueClass]
attr_accessor :vat_qualifying
# @return [Integer]
attr_accessor :retailer_id
# @return [String]
attr_accessor :gssn_id
# @return [TrueClass]
attr_accessor :no_image
# @return [String]
attr_accessor :image_url
# @return [TrueClass]
attr_accessor :is_available_online
# @return [TrueClass]
attr_accessor :is_back_ordered
# @return [String]
attr_accessor :creation_date
# @return [String]
attr_accessor :maintenance_date
# @return [String]
attr_accessor :registration_number
# @return [DateTime]
attr_accessor :registration_date
# @return [Integer]
attr_accessor :mileage
# @return [DateTime]
attr_accessor :trade_in_date
# @return [String]
attr_accessor :source
# @return [String]
attr_accessor :vehicle_type
# @return [String]
attr_accessor :offer_amount
# @return [String]
attr_accessor :offer_expiry
# @return [Array]
attr_accessor :active_offers
# @return [Integer]
attr_accessor :campaign_messages_total
# @return [TrueClass]
attr_accessor :under_offer
# @return [TrueClass]
attr_accessor :is_display_stock
# @return [String]
attr_accessor :display_retailer
# @return [String]
attr_accessor :display_retailer_gssn_id
# @return [String]
attr_accessor :location
# @return [String]
attr_accessor :account
# @return [String]
attr_accessor :account_type
# @return [String]
attr_accessor :usage_code
# @return [String]
attr_accessor :bm7_n_s_t
# @return [TrueClass]
attr_accessor :is_sellable
# @return [TrueClass]
attr_accessor :secured
# @return [TrueClass]
attr_accessor :specialist
# @return [TrueClass]
attr_accessor :is_motability_retailer
# @return [String]
attr_accessor :upholstery_description
# @return [TrueClass]
attr_accessor :in_back_order_account
# @return [String]
attr_accessor :full_model_year_code
# @return [String]
attr_accessor :baumuster
# @return [TrueClass]
attr_accessor :is_motability
# @return [BigDecimal]
attr_accessor :pip_advance_rental_gross
# @return [BigDecimal]
attr_accessor :wpms_advance_rental_gross
# @return [List]
attr_accessor :isp_vehicle_customer_descriptions
# @return [TrueClass]
attr_accessor :eligible_for_ma_transfer
# @return [String]
attr_accessor :confirmed_production_date
# @return [String]
attr_accessor :forecasted_arrival_date
def self.properties
{
vin: { name: 'vin' },
description: { name: 'description' },
model: { name: 'model' },
otr: { name: 'otr' },
retail_price_ex_v_a_t: { name: 'retailPriceExVAT' },
actual_price: { name: 'actualPrice' },
p11_d: { name: 'p11D' },
fuel_type: { name: 'fuelType' },
transmission: { name: 'transmission' },
transmission_type: { name: 'transmissionType' },
colour: { name: 'colour' },
colour_code: { name: 'colourCode' },
colour_description: { name: 'colourDescription' },
commission_number: { name: 'commissionNumber' },
offer_available: { name: 'offerAvailable' },
campaign_discount_offer_total: { name: 'campaignDiscountOfferTotal' },
campaign_discount_offer_total_current: { name: 'campaignDiscountOfferTotalCurrent' },
campaign_discount_offer_total_pending: { name: 'campaignDiscountOfferTotalPending' },
campaign_service_offer_total: { name: 'campaignServiceOfferTotal' },
campaign_service_offer_total_current: { name: 'campaignServiceOfferTotalCurrent' },
campaign_service_offer_total_pending: { name: 'campaignServiceOfferTotalPending' },
campaign_custom_offer_total: { name: 'campaignCustomOfferTotal' },
campaign_personalised_offer_total_current: { name: 'campaignPersonalisedOfferTotalCurrent' },
campaign_personalised_offer_total_pending: { name: 'campaignPersonalisedOfferTotalPending' },
campaign_personalised_offer_total: { name: 'campaignPersonalisedOfferTotal' },
campaign_custom_offer_total_current: { name: 'campaignCustomOfferTotalCurrent' },
campaign_custom_offer_total_pending: { name: 'campaignCustomOfferTotalPending' },
campaign_other_offer_total: { name: 'campaignOtherOfferTotal' },
campaign_other_offer_total_current: { name: 'campaignOtherOfferTotalCurrent' },
campaign_other_offer_total_pending: { name: 'campaignOtherOfferTotalPending' },
retailer_discount_offer_total: { name: 'retailerDiscountOfferTotal' },
retailer_discount_offer_total_current: { name: 'retailerDiscountOfferTotalCurrent' },
retailer_discount_offer_total_pending: { name: 'retailerDiscountOfferTotalPending' },
retailer_service_offer_total: { name: 'retailerServiceOfferTotal' },
retailer_service_offer_total_current: { name: 'retailerServiceOfferTotalCurrent' },
retailer_service_offer_total_pending: { name: 'retailerServiceOfferTotalPending' },
retailer_custom_offer_total: { name: 'retailerCustomOfferTotal' },
retailer_custom_offer_total_current: { name: 'retailerCustomOfferTotalCurrent' },
retailer_custom_offer_total_pending: { name: 'retailerCustomOfferTotalPending' },
retailer_warranty_offer_total: { name: 'retailerWarrantyOfferTotal' },
retailer_warranty_offer_total_current: { name: 'retailerWarrantyOfferTotalCurrent' },
retailer_warranty_offer_total_pending: { name: 'retailerWarrantyOfferTotalPending' },
retailer_offer_total: { name: 'retailerOfferTotal' },
retailer_offer_total_current: { name: 'retailerOfferTotalCurrent' },
retailer_offer_total_pending: { name: 'retailerOfferTotalPending' },
campaign_offer_total: { name: 'campaignOfferTotal' },
campaign_offer_total_current: { name: 'campaignOfferTotalCurrent' },
campaign_offer_total_pending: { name: 'campaignOfferTotalPending' },
campaign_and_offer_total: { name: 'campaignAndOfferTotal' },
campaign_and_offer_total_current: { name: 'campaignAndOfferTotalCurrent' },
campaign_and_offer_total_pending: { name: 'campaignAndOfferTotalPending' },
offer_total: { name: 'offerTotal' },
offer_total_current: { name: 'offerTotalCurrent' },
offer_total_pending: { name: 'offerTotalPending' },
creation: { name: 'creation' },
modified: { name: 'modified' },
electric_range: { name: 'electricRange' },
electric_consumption: { name: 'electricConsumption' },
port_arrival_date: { name: 'portArrivalDate', type: DateTime },
days_since_port_arrival: { name: 'daysSincePortArrival' },
retail_price_inc_v_a_t: { name: 'retailPriceIncVAT' },
body_style: { name: 'bodyStyle' },
upholstery: { name: 'upholstery' },
upholstery_code: { name: 'upholsteryCode' },
upholstery_type: { name: 'upholsteryType' },
package_names: { name: 'packageNames' },
line: { name: 'line' },
mapped_line: { name: 'mappedLine' },
current_retailer_offer_price: { name: 'currentRetailerOfferPrice' },
retail_price: { name: 'retailPrice' },
vat_qualifying: { name: 'vatQualifying' },
retailer_id: { name: 'retailerId' },
gssn_id: { name: 'gssnId' },
no_image: { name: 'noImage' },
image_url: { name: 'imageUrl' },
is_available_online: { name: 'isAvailableOnline' },
is_back_ordered: { name: 'isBackOrdered' },
creation_date: { name: 'creationDate' },
maintenance_date: { name: 'maintenanceDate' },
registration_number: { name: 'registrationNumber' },
registration_date: { name: 'registrationDate', type: DateTime },
mileage: { name: 'mileage' },
trade_in_date: { name: 'tradeInDate', type: DateTime },
source: { name: 'source' },
vehicle_type: { name: 'vehicleType' },
offer_amount: { name: 'offerAmount' },
offer_expiry: { name: 'offerExpiry' },
active_offers: { name: 'activeOffers' },
campaign_messages_total: { name: 'campaignMessagesTotal' },
under_offer: { name: 'underOffer' },
is_display_stock: { name: 'isDisplayStock' },
display_retailer: { name: 'displayRetailer' },
display_retailer_gssn_id: { name: 'displayRetailerGssnId' },
location: { name: 'location' },
account: { name: 'account' },
account_type: { name: 'accountType' },
usage_code: { name: 'usageCode' },
bm7_n_s_t: { name: 'bm7NST' },
is_sellable: { name: 'isSellable' },
secured: { name: 'secured' },
specialist: { name: 'specialist' },
is_motability_retailer: { name: 'isMotabilityRetailer' },
upholstery_description: { name: 'upholsteryDescription' },
in_back_order_account: { name: 'inBackOrderAccount' },
full_model_year_code: { name: 'fullModelYearCode' },
baumuster: { name: 'baumuster' },
is_motability: { name: 'isMotability' },
pip_advance_rental_gross: { name: 'pipAdvanceRentalGross' },
wpms_advance_rental_gross: { name: 'wpmsAdvanceRentalGross' },
isp_vehicle_customer_descriptions: { name: 'ispVehicleCustomerDescriptions' },
eligible_for_ma_transfer: { name: 'eligibleForMaTransfer' },
confirmed_production_date: { name: 'confirmedProductionDate' },
forecasted_arrival_date: { name: 'forecastedArrivalDate' },
}
end
end
class VehicleData < VehicleDataBase
# @return [String]
attr_accessor :engine
def self.properties
{
engine: { name: 'engine' },
}
end
end
class Equipment
include ServiceStack::DTO
# @return [Integer]
attr_accessor :id
# @return [String]
attr_accessor :code
# @return [String]
attr_accessor :description
def self.properties
{
id: { name: 'id' },
code: { name: 'code' },
description: { name: 'description' },
}
end
end
class VehicleIdentifierData < VehicleData
# @return [String]
attr_accessor :retailer
# @return [TrueClass]
attr_accessor :has_motability_error
# @return [List]
attr_accessor :equipment
# @return [String]
attr_accessor :vehicle_class
def self.properties
{
retailer: { name: 'retailer' },
has_motability_error: { name: 'hasMotabilityError' },
equipment: { name: 'equipment', type: [Equipment] },
vehicle_class: { name: 'vehicleClass' },
}
end
end
class VehiclesByRetailerResponse
include ServiceStack::DTO
# @return [List]
attr_accessor :vehicles
def self.properties
{
vehicles: { name: 'vehicles', type: [VehicleIdentifierData] },
}
end
end
class MotabilityVehiclesRequest
include ServiceStack::DTO
# @return [String]
attr_accessor :vehicle_type
def self.properties
{
vehicle_type: { name: 'vehicleType' },
}
end
def response_type() = VehiclesByRetailerResponse
def get_type_name() = 'MotabilityVehiclesRequest'
end
Ruby MotabilityVehiclesRequest 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/{VehicleType}/Vehicle/Motability 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
<VehiclesByRetailerResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Mercedes.VehicleManagement.API.Shared.POCO">
<Vehicles>
<VehicleIdentifierData>
<Account>String</Account>
<AccountType>String</AccountType>
<ActiveOffers xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:int>0</d4p1:int>
</ActiveOffers>
<ActualPrice>String</ActualPrice>
<Baumuster>String</Baumuster>
<Bm7NST>String</Bm7NST>
<BodyStyle>String</BodyStyle>
<CampaignAndOfferTotal>0</CampaignAndOfferTotal>
<CampaignAndOfferTotalCurrent>0</CampaignAndOfferTotalCurrent>
<CampaignAndOfferTotalPending>0</CampaignAndOfferTotalPending>
<CampaignCustomOfferTotal>0</CampaignCustomOfferTotal>
<CampaignCustomOfferTotalCurrent>0</CampaignCustomOfferTotalCurrent>
<CampaignCustomOfferTotalPending>0</CampaignCustomOfferTotalPending>
<CampaignDiscountOfferTotal>0</CampaignDiscountOfferTotal>
<CampaignDiscountOfferTotalCurrent>0</CampaignDiscountOfferTotalCurrent>
<CampaignDiscountOfferTotalPending>0</CampaignDiscountOfferTotalPending>
<CampaignMessagesTotal>0</CampaignMessagesTotal>
<CampaignOfferTotal>0</CampaignOfferTotal>
<CampaignOfferTotalCurrent>0</CampaignOfferTotalCurrent>
<CampaignOfferTotalPending>0</CampaignOfferTotalPending>
<CampaignOtherOfferTotal>0</CampaignOtherOfferTotal>
<CampaignOtherOfferTotalCurrent>0</CampaignOtherOfferTotalCurrent>
<CampaignOtherOfferTotalPending>0</CampaignOtherOfferTotalPending>
<CampaignPersonalisedOfferTotal>0</CampaignPersonalisedOfferTotal>
<CampaignPersonalisedOfferTotalCurrent>0</CampaignPersonalisedOfferTotalCurrent>
<CampaignPersonalisedOfferTotalPending>0</CampaignPersonalisedOfferTotalPending>
<CampaignServiceOfferTotal>0</CampaignServiceOfferTotal>
<CampaignServiceOfferTotalCurrent>0</CampaignServiceOfferTotalCurrent>
<CampaignServiceOfferTotalPending>0</CampaignServiceOfferTotalPending>
<Colour>String</Colour>
<ColourCode>String</ColourCode>
<ColourDescription>String</ColourDescription>
<CommissionNumber>String</CommissionNumber>
<ConfirmedProductionDate>String</ConfirmedProductionDate>
<Creation>String</Creation>
<CreationDate>String</CreationDate>
<CurrentRetailerOfferPrice>0</CurrentRetailerOfferPrice>
<DaysSincePortArrival>0</DaysSincePortArrival>
<Description>String</Description>
<DisplayRetailer>String</DisplayRetailer>
<DisplayRetailerGssnId>String</DisplayRetailerGssnId>
<ElectricConsumption>0</ElectricConsumption>
<ElectricRange>0</ElectricRange>
<EligibleForMaTransfer>false</EligibleForMaTransfer>
<ForecastedArrivalDate>String</ForecastedArrivalDate>
<FuelType>String</FuelType>
<FullModelYearCode>String</FullModelYearCode>
<GssnId>String</GssnId>
<ImageUrl>String</ImageUrl>
<InBackOrderAccount>false</InBackOrderAccount>
<IsAvailableOnline>false</IsAvailableOnline>
<IsBackOrdered>false</IsBackOrdered>
<IsDisplayStock>false</IsDisplayStock>
<IsMotability>false</IsMotability>
<IsMotabilityRetailer>false</IsMotabilityRetailer>
<IsSellable>false</IsSellable>
<IspVehicleCustomerDescriptions xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string>String</d4p1:string>
</IspVehicleCustomerDescriptions>
<Line>String</Line>
<Location>String</Location>
<MaintenanceDate>String</MaintenanceDate>
<MappedLine>String</MappedLine>
<Mileage>0</Mileage>
<Model>String</Model>
<Modified>String</Modified>
<NoImage>false</NoImage>
<OfferAmount>String</OfferAmount>
<OfferAvailable>false</OfferAvailable>
<OfferExpiry>String</OfferExpiry>
<OfferTotal>0</OfferTotal>
<OfferTotalCurrent>0</OfferTotalCurrent>
<OfferTotalPending>0</OfferTotalPending>
<Otr>String</Otr>
<P11D>String</P11D>
<PackageNames xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string>String</d4p1:string>
</PackageNames>
<PipAdvanceRentalGross>0</PipAdvanceRentalGross>
<PortArrivalDate>0001-01-01T00:00:00</PortArrivalDate>
<RegistrationDate>0001-01-01T00:00:00</RegistrationDate>
<RegistrationNumber>String</RegistrationNumber>
<RetailPrice>String</RetailPrice>
<RetailPriceExVAT>String</RetailPriceExVAT>
<RetailPriceIncVAT>0</RetailPriceIncVAT>
<RetailerCustomOfferTotal>0</RetailerCustomOfferTotal>
<RetailerCustomOfferTotalCurrent>0</RetailerCustomOfferTotalCurrent>
<RetailerCustomOfferTotalPending>0</RetailerCustomOfferTotalPending>
<RetailerDiscountOfferTotal>0</RetailerDiscountOfferTotal>
<RetailerDiscountOfferTotalCurrent>0</RetailerDiscountOfferTotalCurrent>
<RetailerDiscountOfferTotalPending>0</RetailerDiscountOfferTotalPending>
<RetailerId>0</RetailerId>
<RetailerOfferTotal>0</RetailerOfferTotal>
<RetailerOfferTotalCurrent>0</RetailerOfferTotalCurrent>
<RetailerOfferTotalPending>0</RetailerOfferTotalPending>
<RetailerServiceOfferTotal>0</RetailerServiceOfferTotal>
<RetailerServiceOfferTotalCurrent>0</RetailerServiceOfferTotalCurrent>
<RetailerServiceOfferTotalPending>0</RetailerServiceOfferTotalPending>
<RetailerWarrantyOfferTotal>0</RetailerWarrantyOfferTotal>
<RetailerWarrantyOfferTotalCurrent>0</RetailerWarrantyOfferTotalCurrent>
<RetailerWarrantyOfferTotalPending>0</RetailerWarrantyOfferTotalPending>
<Secured>false</Secured>
<Source>String</Source>
<Specialist>false</Specialist>
<TradeInDate>0001-01-01T00:00:00</TradeInDate>
<Transmission>String</Transmission>
<TransmissionType>String</TransmissionType>
<UnderOffer>false</UnderOffer>
<Upholstery>String</Upholstery>
<UpholsteryCode>String</UpholsteryCode>
<UpholsteryDescription>String</UpholsteryDescription>
<UpholsteryType>String</UpholsteryType>
<UsageCode>String</UsageCode>
<VATQualifying>false</VATQualifying>
<VehicleType>String</VehicleType>
<Vin>String</Vin>
<WpmsAdvanceRentalGross>0</WpmsAdvanceRentalGross>
<Engine>String</Engine>
<Equipment xmlns:d4p1="http://schemas.datacontract.org/2004/07/Mercedes.OS.Vehicle.Shared.POCO">
<d4p1:Equipment>
<d4p1:Code>String</d4p1:Code>
<d4p1:Description>String</d4p1:Description>
<d4p1:Id>0</d4p1:Id>
</d4p1:Equipment>
</Equipment>
<HasMotabilityError>false</HasMotabilityError>
<Retailer>String</Retailer>
<VehicleClass>String</VehicleClass>
</VehicleIdentifierData>
</Vehicles>
</VehiclesByRetailerResponse>