| GET | /v1/{VehicleType}/Vehicle/Motability | Get motability vehicle data |
|---|
import Foundation
import ServiceStack
public class MotabilityVehiclesRequest : IGet, Codable
{
public var vehicleType:String
required public init(){}
}
public class VehiclesByRetailerResponse : Codable
{
public var vehicles:[VehicleIdentifierData] = []
required public init(){}
}
public class VehicleIdentifierData : VehicleData
{
public var retailer:String
public var hasMotabilityError:Bool
public var equipment:[Equipment] = []
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case retailer
case hasMotabilityError
case equipment
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
retailer = try container.decodeIfPresent(String.self, forKey: .retailer)
hasMotabilityError = try container.decodeIfPresent(Bool.self, forKey: .hasMotabilityError)
equipment = try container.decodeIfPresent([Equipment].self, forKey: .equipment) ?? []
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if retailer != nil { try container.encode(retailer, forKey: .retailer) }
if hasMotabilityError != nil { try container.encode(hasMotabilityError, forKey: .hasMotabilityError) }
if equipment.count > 0 { try container.encode(equipment, forKey: .equipment) }
}
}
public class VehicleData : VehicleDataBase
{
public var engine:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case engine
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
engine = try container.decodeIfPresent(String.self, forKey: .engine)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if engine != nil { try container.encode(engine, forKey: .engine) }
}
}
public class VehicleDataBase : Codable
{
public var vin:String
public var Description:String
public var model:String
public var otr:String
public var retailPriceExVAT:String
public var actualPrice:String
public var fuelType:String
public var transmission:String
public var transmissionType:String
public var colour:String
public var colourCode:String
public var colourDescription:String
public var commissionNumber:String
public var offerAvailable:Bool
public var campaignDiscountOfferTotal:Int
public var campaignDiscountOfferTotalCurrent:Int
public var campaignDiscountOfferTotalPending:Int
public var campaignServiceOfferTotal:Int
public var campaignServiceOfferTotalCurrent:Int
public var campaignServiceOfferTotalPending:Int
public var campaignCustomOfferTotal:Int
public var campaignPersonalisedOfferTotalCurrent:Int
public var campaignPersonalisedOfferTotalPending:Int
public var campaignPersonalisedOfferTotal:Int
public var campaignCustomOfferTotalCurrent:Int
public var campaignCustomOfferTotalPending:Int
public var campaignOtherOfferTotal:Int
public var campaignOtherOfferTotalCurrent:Int
public var campaignOtherOfferTotalPending:Int
public var retailerDiscountOfferTotal:Int
public var retailerDiscountOfferTotalCurrent:Int
public var retailerDiscountOfferTotalPending:Int
public var retailerServiceOfferTotal:Int
public var retailerServiceOfferTotalCurrent:Int
public var retailerServiceOfferTotalPending:Int
public var retailerCustomOfferTotal:Int
public var retailerCustomOfferTotalCurrent:Int
public var retailerCustomOfferTotalPending:Int
public var retailerWarrantyOfferTotal:Int
public var retailerWarrantyOfferTotalCurrent:Int
public var retailerWarrantyOfferTotalPending:Int
public var retailerOfferTotal:Int
public var retailerOfferTotalCurrent:Int
public var retailerOfferTotalPending:Int
public var campaignOfferTotal:Int
public var campaignOfferTotalCurrent:Int
public var campaignOfferTotalPending:Int
public var campaignAndOfferTotal:Int
public var campaignAndOfferTotalCurrent:Int
public var campaignAndOfferTotalPending:Int
public var offerTotal:Int
public var offerTotalCurrent:Int
public var offerTotalPending:Int
public var creation:String
public var modified:String
public var electricRange:Int
public var electricConsumption:Int
public var portArrivalDate:Date?
public var daysSincePortArrival:Int?
public var retailPriceIncVAT:Double
public var bodyStyle:String
public var upholstery:String
public var upholsteryCode:String
public var upholsteryType:String
public var packageNames:[String] = []
public var line:String
public var currentRetailerOfferPrice:Double
public var retailPrice:String
public var vatQualifying:Bool
public var retailerId:Int
public var gssnId:String
public var noImage:Bool
public var imageUrl:String
public var isAvailableOnline:Bool
public var isBackOrdered:Bool
public var creationDate:String
public var maintenanceDate:String
public var registrationNumber:String
public var registrationDate:Date?
public var mileage:Int?
public var tradeInDate:Date?
public var source:String
public var vehicleType:String
public var offerAmount:String
public var offerExpiry:String
public var activeOffers:[Int] = []
public var campaignMessagesTotal:Int
public var underOffer:Bool
public var isDisplayStock:Bool
public var displayRetailer:String
public var displayRetailerGssnId:String
public var location:String
public var account:String
public var accountType:String
public var usageCode:String
public var bm7NST:String
public var isSellable:Bool
public var secured:Bool
public var specialist:Bool
public var isMotabilityRetailer:Bool
public var upholsteryDescription:String
public var inBackOrderAccount:Bool
public var fullModelYearCode:String
public var productionDate:Date?
public var baumuster:String
public var isMotability:Bool
public var pipAdvanceRentalGross:Double?
public var wpmsAdvanceRentalGross:Double?
public var ispVehicleCustomerDescriptions:[String]
public var eligibleForMaTransfer:Bool
public var confirmedProductionDate:String
public var forecastedArrivalDate:String
required public init(){}
}
public class Equipment : Codable
{
public var id:Int?
public var code:String
public var Description:String
required public init(){}
}
Swift MotabilityVehiclesRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
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: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
vehicles:
[
{
retailer: String,
hasMotabilityError: False,
equipment:
[
{
id: 0,
code: String,
description: String
}
],
engine: String,
vin: String,
description: String,
model: String,
otr: String,
retailPriceExVAT: String,
actualPrice: 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: 0001-01-01,
daysSincePortArrival: 0,
retailPriceIncVAT: 0,
bodyStyle: String,
upholstery: String,
upholsteryCode: String,
upholsteryType: String,
packageNames:
[
String
],
line: 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: 0001-01-01,
mileage: 0,
tradeInDate: 0001-01-01,
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,
productionDate: 0001-01-01,
baumuster: String,
isMotability: False,
pipAdvanceRentalGross: 0,
wpmsAdvanceRentalGross: 0,
ispVehicleCustomerDescriptions:
[
String
],
eligibleForMaTransfer: False,
confirmedProductionDate: String,
forecastedArrivalDate: String
}
]
}