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
import Foundation
import ServiceStack

public class AllAvailableVehiclesCsvRequest : BaseAllAvailableVehiclesRequest, IGet
{
    required public init(){ super.init() }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
    }
}

public class BaseAllAvailableVehiclesRequest : Codable
{
    public var vehicleType:String
    public var includeBackOrderAccounts:Bool

    required public init(){}
}

public class StockManagementResponse : Codable
{
    public var totalVehicles:Int
    public var vehicles:[BackOrderVehicle]

    required public init(){}
}

public class BackOrderVehicle : BasicBackOrderVehicle
{
    public var id:Int
    public var vin:String
    public var vehicleType:String
    public var vid:String
    public var fin:String
    public var chassisNumber:String
    public var modelYear:String
    public var modelYearCode:String
    public var halfModelYearCode:String
    public var fullModelYearCode:String
    public var salesDescriptionLong:String
    public var vehicleClass:String
    public var retailPrice_ExVAT:Double
    public var retailPrice_IncVAT:Double
    public var otr:Double
    public var bodyStyle:String
    public var productRange:String
    public var engine:String
    public var isAMG:Bool
    public var colourGroup:String
    public var upholsteryCode:String
    public var nst:String
    public var bm7NST:String
    public var acceleration:Double?
    public var bootCapacity:Int?
    public var topSpeed:Double?
    public var driveConcept:String
    public var combustionPowerHp:Double?
    public var electricPowerKw:Double?
    public var electricPowerHp:Double?
    public var combinedPowerKw:Double?
    public var combinedPowerHP:Double?
    public var electricRange:Double?
    public var electricConsumption:Double?
    public var emission:Double?
    public var emissionDirective:String
    public var emissionExtraUrban:String
    public var emissionUrban:String
    public var energyEfficiencyClass:String
    public var wltpEmissionCombined:String
    public var wltpCombined:String
    public var wltpLow:String
    public var wltpMedium:String
    public var wltpHigh:String
    public var wltpExtraHigh:String
    public var productionDate:Date?
    public var portArrivalDate:Date?
    public var creationDate:Date
    public var lastUpdated:Date?
    public var isDisplayStock:Bool
    public var displayStockAgent:String
    public var isSpecialistCar:Bool
    public var location:String
    public var cesarIdShipToParty:String
    public var isSellable:Bool
    public var underOffer:Bool
    public var baumuster:String

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case id
        case vin
        case vehicleType
        case vid
        case fin
        case chassisNumber
        case modelYear
        case modelYearCode
        case halfModelYearCode
        case fullModelYearCode
        case salesDescriptionLong
        case vehicleClass
        case retailPrice_ExVAT
        case retailPrice_IncVAT
        case otr
        case bodyStyle
        case productRange
        case engine
        case isAMG
        case colourGroup
        case upholsteryCode
        case nst
        case bm7NST
        case acceleration
        case bootCapacity
        case topSpeed
        case driveConcept
        case combustionPowerHp
        case electricPowerKw
        case electricPowerHp
        case combinedPowerKw
        case combinedPowerHP
        case electricRange
        case electricConsumption
        case emission
        case emissionDirective
        case emissionExtraUrban
        case emissionUrban
        case energyEfficiencyClass
        case wltpEmissionCombined
        case wltpCombined
        case wltpLow
        case wltpMedium
        case wltpHigh
        case wltpExtraHigh
        case productionDate
        case portArrivalDate
        case creationDate
        case lastUpdated
        case isDisplayStock
        case displayStockAgent
        case isSpecialistCar
        case location
        case cesarIdShipToParty
        case isSellable
        case underOffer
        case baumuster
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        id = try container.decodeIfPresent(Int.self, forKey: .id)
        vin = try container.decodeIfPresent(String.self, forKey: .vin)
        vehicleType = try container.decodeIfPresent(String.self, forKey: .vehicleType)
        vid = try container.decodeIfPresent(String.self, forKey: .vid)
        fin = try container.decodeIfPresent(String.self, forKey: .fin)
        chassisNumber = try container.decodeIfPresent(String.self, forKey: .chassisNumber)
        modelYear = try container.decodeIfPresent(String.self, forKey: .modelYear)
        modelYearCode = try container.decodeIfPresent(String.self, forKey: .modelYearCode)
        halfModelYearCode = try container.decodeIfPresent(String.self, forKey: .halfModelYearCode)
        fullModelYearCode = try container.decodeIfPresent(String.self, forKey: .fullModelYearCode)
        salesDescriptionLong = try container.decodeIfPresent(String.self, forKey: .salesDescriptionLong)
        vehicleClass = try container.decodeIfPresent(String.self, forKey: .vehicleClass)
        retailPrice_ExVAT = try container.decodeIfPresent(Double.self, forKey: .retailPrice_ExVAT)
        retailPrice_IncVAT = try container.decodeIfPresent(Double.self, forKey: .retailPrice_IncVAT)
        otr = try container.decodeIfPresent(Double.self, forKey: .otr)
        bodyStyle = try container.decodeIfPresent(String.self, forKey: .bodyStyle)
        productRange = try container.decodeIfPresent(String.self, forKey: .productRange)
        engine = try container.decodeIfPresent(String.self, forKey: .engine)
        isAMG = try container.decodeIfPresent(Bool.self, forKey: .isAMG)
        colourGroup = try container.decodeIfPresent(String.self, forKey: .colourGroup)
        upholsteryCode = try container.decodeIfPresent(String.self, forKey: .upholsteryCode)
        nst = try container.decodeIfPresent(String.self, forKey: .nst)
        bm7NST = try container.decodeIfPresent(String.self, forKey: .bm7NST)
        acceleration = try container.decodeIfPresent(Double.self, forKey: .acceleration)
        bootCapacity = try container.decodeIfPresent(Int.self, forKey: .bootCapacity)
        topSpeed = try container.decodeIfPresent(Double.self, forKey: .topSpeed)
        driveConcept = try container.decodeIfPresent(String.self, forKey: .driveConcept)
        combustionPowerHp = try container.decodeIfPresent(Double.self, forKey: .combustionPowerHp)
        electricPowerKw = try container.decodeIfPresent(Double.self, forKey: .electricPowerKw)
        electricPowerHp = try container.decodeIfPresent(Double.self, forKey: .electricPowerHp)
        combinedPowerKw = try container.decodeIfPresent(Double.self, forKey: .combinedPowerKw)
        combinedPowerHP = try container.decodeIfPresent(Double.self, forKey: .combinedPowerHP)
        electricRange = try container.decodeIfPresent(Double.self, forKey: .electricRange)
        electricConsumption = try container.decodeIfPresent(Double.self, forKey: .electricConsumption)
        emission = try container.decodeIfPresent(Double.self, forKey: .emission)
        emissionDirective = try container.decodeIfPresent(String.self, forKey: .emissionDirective)
        emissionExtraUrban = try container.decodeIfPresent(String.self, forKey: .emissionExtraUrban)
        emissionUrban = try container.decodeIfPresent(String.self, forKey: .emissionUrban)
        energyEfficiencyClass = try container.decodeIfPresent(String.self, forKey: .energyEfficiencyClass)
        wltpEmissionCombined = try container.decodeIfPresent(String.self, forKey: .wltpEmissionCombined)
        wltpCombined = try container.decodeIfPresent(String.self, forKey: .wltpCombined)
        wltpLow = try container.decodeIfPresent(String.self, forKey: .wltpLow)
        wltpMedium = try container.decodeIfPresent(String.self, forKey: .wltpMedium)
        wltpHigh = try container.decodeIfPresent(String.self, forKey: .wltpHigh)
        wltpExtraHigh = try container.decodeIfPresent(String.self, forKey: .wltpExtraHigh)
        productionDate = try container.decodeIfPresent(Date.self, forKey: .productionDate)
        portArrivalDate = try container.decodeIfPresent(Date.self, forKey: .portArrivalDate)
        creationDate = try container.decodeIfPresent(Date.self, forKey: .creationDate)
        lastUpdated = try container.decodeIfPresent(Date.self, forKey: .lastUpdated)
        isDisplayStock = try container.decodeIfPresent(Bool.self, forKey: .isDisplayStock)
        displayStockAgent = try container.decodeIfPresent(String.self, forKey: .displayStockAgent)
        isSpecialistCar = try container.decodeIfPresent(Bool.self, forKey: .isSpecialistCar)
        location = try container.decodeIfPresent(String.self, forKey: .location)
        cesarIdShipToParty = try container.decodeIfPresent(String.self, forKey: .cesarIdShipToParty)
        isSellable = try container.decodeIfPresent(Bool.self, forKey: .isSellable)
        underOffer = try container.decodeIfPresent(Bool.self, forKey: .underOffer)
        baumuster = try container.decodeIfPresent(String.self, forKey: .baumuster)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if id != nil { try container.encode(id, forKey: .id) }
        if vin != nil { try container.encode(vin, forKey: .vin) }
        if vehicleType != nil { try container.encode(vehicleType, forKey: .vehicleType) }
        if vid != nil { try container.encode(vid, forKey: .vid) }
        if fin != nil { try container.encode(fin, forKey: .fin) }
        if chassisNumber != nil { try container.encode(chassisNumber, forKey: .chassisNumber) }
        if modelYear != nil { try container.encode(modelYear, forKey: .modelYear) }
        if modelYearCode != nil { try container.encode(modelYearCode, forKey: .modelYearCode) }
        if halfModelYearCode != nil { try container.encode(halfModelYearCode, forKey: .halfModelYearCode) }
        if fullModelYearCode != nil { try container.encode(fullModelYearCode, forKey: .fullModelYearCode) }
        if salesDescriptionLong != nil { try container.encode(salesDescriptionLong, forKey: .salesDescriptionLong) }
        if vehicleClass != nil { try container.encode(vehicleClass, forKey: .vehicleClass) }
        if retailPrice_ExVAT != nil { try container.encode(retailPrice_ExVAT, forKey: .retailPrice_ExVAT) }
        if retailPrice_IncVAT != nil { try container.encode(retailPrice_IncVAT, forKey: .retailPrice_IncVAT) }
        if otr != nil { try container.encode(otr, forKey: .otr) }
        if bodyStyle != nil { try container.encode(bodyStyle, forKey: .bodyStyle) }
        if productRange != nil { try container.encode(productRange, forKey: .productRange) }
        if engine != nil { try container.encode(engine, forKey: .engine) }
        if isAMG != nil { try container.encode(isAMG, forKey: .isAMG) }
        if colourGroup != nil { try container.encode(colourGroup, forKey: .colourGroup) }
        if upholsteryCode != nil { try container.encode(upholsteryCode, forKey: .upholsteryCode) }
        if nst != nil { try container.encode(nst, forKey: .nst) }
        if bm7NST != nil { try container.encode(bm7NST, forKey: .bm7NST) }
        if acceleration != nil { try container.encode(acceleration, forKey: .acceleration) }
        if bootCapacity != nil { try container.encode(bootCapacity, forKey: .bootCapacity) }
        if topSpeed != nil { try container.encode(topSpeed, forKey: .topSpeed) }
        if driveConcept != nil { try container.encode(driveConcept, forKey: .driveConcept) }
        if combustionPowerHp != nil { try container.encode(combustionPowerHp, forKey: .combustionPowerHp) }
        if electricPowerKw != nil { try container.encode(electricPowerKw, forKey: .electricPowerKw) }
        if electricPowerHp != nil { try container.encode(electricPowerHp, forKey: .electricPowerHp) }
        if combinedPowerKw != nil { try container.encode(combinedPowerKw, forKey: .combinedPowerKw) }
        if combinedPowerHP != nil { try container.encode(combinedPowerHP, forKey: .combinedPowerHP) }
        if electricRange != nil { try container.encode(electricRange, forKey: .electricRange) }
        if electricConsumption != nil { try container.encode(electricConsumption, forKey: .electricConsumption) }
        if emission != nil { try container.encode(emission, forKey: .emission) }
        if emissionDirective != nil { try container.encode(emissionDirective, forKey: .emissionDirective) }
        if emissionExtraUrban != nil { try container.encode(emissionExtraUrban, forKey: .emissionExtraUrban) }
        if emissionUrban != nil { try container.encode(emissionUrban, forKey: .emissionUrban) }
        if energyEfficiencyClass != nil { try container.encode(energyEfficiencyClass, forKey: .energyEfficiencyClass) }
        if wltpEmissionCombined != nil { try container.encode(wltpEmissionCombined, forKey: .wltpEmissionCombined) }
        if wltpCombined != nil { try container.encode(wltpCombined, forKey: .wltpCombined) }
        if wltpLow != nil { try container.encode(wltpLow, forKey: .wltpLow) }
        if wltpMedium != nil { try container.encode(wltpMedium, forKey: .wltpMedium) }
        if wltpHigh != nil { try container.encode(wltpHigh, forKey: .wltpHigh) }
        if wltpExtraHigh != nil { try container.encode(wltpExtraHigh, forKey: .wltpExtraHigh) }
        if productionDate != nil { try container.encode(productionDate, forKey: .productionDate) }
        if portArrivalDate != nil { try container.encode(portArrivalDate, forKey: .portArrivalDate) }
        if creationDate != nil { try container.encode(creationDate, forKey: .creationDate) }
        if lastUpdated != nil { try container.encode(lastUpdated, forKey: .lastUpdated) }
        if isDisplayStock != nil { try container.encode(isDisplayStock, forKey: .isDisplayStock) }
        if displayStockAgent != nil { try container.encode(displayStockAgent, forKey: .displayStockAgent) }
        if isSpecialistCar != nil { try container.encode(isSpecialistCar, forKey: .isSpecialistCar) }
        if location != nil { try container.encode(location, forKey: .location) }
        if cesarIdShipToParty != nil { try container.encode(cesarIdShipToParty, forKey: .cesarIdShipToParty) }
        if isSellable != nil { try container.encode(isSellable, forKey: .isSellable) }
        if underOffer != nil { try container.encode(underOffer, forKey: .underOffer) }
        if baumuster != nil { try container.encode(baumuster, forKey: .baumuster) }
    }
}

public class BasicBackOrderVehicle : Codable
{
    public var commissionNumber:String
    public var Description:String
    public var model:String
    public var colour:String
    public var fuelType:String
    public var transmission:String
    public var packages:String
    public var lines:String
    public var upholstery:String
    public var emissionCombined:String
    public var actualPrice:Double
    public var usageCode:String
    public var secured:Bool
    public var account:String
    public var securedTime:String
    public var securedReason:String
    public var securedByGasId:String
    public var securedDate:Date?

    required public init(){}
}


Swift AllAvailableVehiclesCsvRequest DTOs

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

HTTP + JSV

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/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	"totalVehicles": 0,
	"vehicles": null
}