/* Options: Date: 2025-05-05 18:05:28 SwiftVersion: 6.0 Version: 8.61 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://prod-api-agency-orch-mb-dhc.rapp-customers.co.uk //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True //MakePropertiesOptional: True IncludeTypes: GetBackOrderMatchAllRequest.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: False //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/v1/backorder/match/all/{Guid}", "GET") // @Route("/v1/backorder/match/all", "GET") public class GetBackOrderMatchAllRequest : GetBackOrderMatchRequest, IReturn, IGet { public typealias Return = GetBackOrderMatchResponse 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 GetBackOrderMatchResponse : Codable { public var vehicles:[BackOrderVehicle] = [] public var closestMatchVehicles:[BackOrderVehicle] = [] public var otherMatchVehicles:[BackOrderVehicle] = [] public var modelMatchVehicles:[BackOrderVehicle] = [] required public init(){} } public class GetBackOrderMatchRequest : Codable { public var guid:String? required public init(){} } public class Vehicle : Codable { public var vin:String? required public init(){} } public class VehicleDetail : VehicleBaseDetail { public var retailPrice_ExVAT:String? public var otr:String? public var actualPrice:String? public var totalOfferValue:String? public var isHOBackOrderAccountVehicle:Bool? public var consumptionCombined:VehicleConsumption? public var consumptionExtraUrban:VehicleConsumption? public var consumptionUrban:VehicleConsumption? public var wltpFuelConsumptionCombined:VehicleConsumption? public var wltpFuelConsumptionExtraHigh:VehicleConsumption? public var wltpFuelConsumptionHigh:VehicleConsumption? public var wltpFuelConsumptionLow:VehicleConsumption? public var wltpFuelConsumptionMedium:VehicleConsumption? public var equipmentCategories:[VehicleEquipmentCategory]? public var vehicleEnergyEfficiencyClass:VehicleEmissionClass? public var vehicleData:[VehicleAttribute]? public var integratedProducts:[VehicleIntegratedServiceCareOption] = [] public var ispVehicleCustomerDescriptions:[String]? public var colourCode:String? public var upholsteryCode:String? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case retailPrice_ExVAT case otr case actualPrice case totalOfferValue case isHOBackOrderAccountVehicle case consumptionCombined case consumptionExtraUrban case consumptionUrban case wltpFuelConsumptionCombined case wltpFuelConsumptionExtraHigh case wltpFuelConsumptionHigh case wltpFuelConsumptionLow case wltpFuelConsumptionMedium case equipmentCategories case vehicleEnergyEfficiencyClass case vehicleData case integratedProducts case ispVehicleCustomerDescriptions case colourCode case upholsteryCode } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) retailPrice_ExVAT = try container.decodeIfPresent(String.self, forKey: .retailPrice_ExVAT) otr = try container.decodeIfPresent(String.self, forKey: .otr) actualPrice = try container.decodeIfPresent(String.self, forKey: .actualPrice) totalOfferValue = try container.decodeIfPresent(String.self, forKey: .totalOfferValue) isHOBackOrderAccountVehicle = try container.decodeIfPresent(Bool.self, forKey: .isHOBackOrderAccountVehicle) consumptionCombined = try container.decodeIfPresent(VehicleConsumption.self, forKey: .consumptionCombined) consumptionExtraUrban = try container.decodeIfPresent(VehicleConsumption.self, forKey: .consumptionExtraUrban) consumptionUrban = try container.decodeIfPresent(VehicleConsumption.self, forKey: .consumptionUrban) wltpFuelConsumptionCombined = try container.decodeIfPresent(VehicleConsumption.self, forKey: .wltpFuelConsumptionCombined) wltpFuelConsumptionExtraHigh = try container.decodeIfPresent(VehicleConsumption.self, forKey: .wltpFuelConsumptionExtraHigh) wltpFuelConsumptionHigh = try container.decodeIfPresent(VehicleConsumption.self, forKey: .wltpFuelConsumptionHigh) wltpFuelConsumptionLow = try container.decodeIfPresent(VehicleConsumption.self, forKey: .wltpFuelConsumptionLow) wltpFuelConsumptionMedium = try container.decodeIfPresent(VehicleConsumption.self, forKey: .wltpFuelConsumptionMedium) equipmentCategories = try container.decodeIfPresent([VehicleEquipmentCategory].self, forKey: .equipmentCategories) ?? [] vehicleEnergyEfficiencyClass = try container.decodeIfPresent(VehicleEmissionClass.self, forKey: .vehicleEnergyEfficiencyClass) vehicleData = try container.decodeIfPresent([VehicleAttribute].self, forKey: .vehicleData) ?? [] integratedProducts = try container.decodeIfPresent([VehicleIntegratedServiceCareOption].self, forKey: .integratedProducts) ?? [] ispVehicleCustomerDescriptions = try container.decodeIfPresent([String].self, forKey: .ispVehicleCustomerDescriptions) ?? [] colourCode = try container.decodeIfPresent(String.self, forKey: .colourCode) upholsteryCode = try container.decodeIfPresent(String.self, forKey: .upholsteryCode) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if retailPrice_ExVAT != nil { try container.encode(retailPrice_ExVAT, forKey: .retailPrice_ExVAT) } if otr != nil { try container.encode(otr, forKey: .otr) } if actualPrice != nil { try container.encode(actualPrice, forKey: .actualPrice) } if totalOfferValue != nil { try container.encode(totalOfferValue, forKey: .totalOfferValue) } if isHOBackOrderAccountVehicle != nil { try container.encode(isHOBackOrderAccountVehicle, forKey: .isHOBackOrderAccountVehicle) } if consumptionCombined != nil { try container.encode(consumptionCombined, forKey: .consumptionCombined) } if consumptionExtraUrban != nil { try container.encode(consumptionExtraUrban, forKey: .consumptionExtraUrban) } if consumptionUrban != nil { try container.encode(consumptionUrban, forKey: .consumptionUrban) } if wltpFuelConsumptionCombined != nil { try container.encode(wltpFuelConsumptionCombined, forKey: .wltpFuelConsumptionCombined) } if wltpFuelConsumptionExtraHigh != nil { try container.encode(wltpFuelConsumptionExtraHigh, forKey: .wltpFuelConsumptionExtraHigh) } if wltpFuelConsumptionHigh != nil { try container.encode(wltpFuelConsumptionHigh, forKey: .wltpFuelConsumptionHigh) } if wltpFuelConsumptionLow != nil { try container.encode(wltpFuelConsumptionLow, forKey: .wltpFuelConsumptionLow) } if wltpFuelConsumptionMedium != nil { try container.encode(wltpFuelConsumptionMedium, forKey: .wltpFuelConsumptionMedium) } if equipmentCategories != nil { try container.encode(equipmentCategories, forKey: .equipmentCategories) } if vehicleEnergyEfficiencyClass != nil { try container.encode(vehicleEnergyEfficiencyClass, forKey: .vehicleEnergyEfficiencyClass) } if vehicleData != nil { try container.encode(vehicleData, forKey: .vehicleData) } if integratedProducts.count > 0 { try container.encode(integratedProducts, forKey: .integratedProducts) } if ispVehicleCustomerDescriptions != nil { try container.encode(ispVehicleCustomerDescriptions, forKey: .ispVehicleCustomerDescriptions) } if colourCode != nil { try container.encode(colourCode, forKey: .colourCode) } if upholsteryCode != nil { try container.encode(upholsteryCode, forKey: .upholsteryCode) } } } public class BackOrderVehicle : VehicleDetail { public var vehicleUsage:String? public var underOffer:Bool? public var vid:String? public var fin:String? public var modelYear:String? public var retailPrice_IncVAT:Double? public var isAMG:Bool? public var nst:String? public var bM7NST:String? public var acceleration:Double? public var bootCapacity:Double? 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 emissionCombined:String? public var emissionExtraUrban:String? public var emissionUrban:String? public var emissionDirective:String? public var energyEfficiencyClass:String? public var wltpCombined:Double? public var wltpLow:Double? public var wltpMedium:Double? public var wltpHigh:Double? public var wltpExtraHigh:Double? public var wltpEmissionCombined:Double? public var creationDate:Date? public var lastUpdated:Date? public var displayStockAgent:String? public var isSpecialistCar:Bool? public var account:String? public var location:String? public var cesarIdShipToParty:String? public var vehicleUsageCode:String? public var mbukSecured:Bool? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case vehicleUsage case underOffer case vid case fin case modelYear case retailPrice_IncVAT case isAMG case nst case bM7NST case acceleration case bootCapacity case topSpeed case driveConcept case combustionPowerHp case electricPowerKw case electricPowerHp case combinedPowerKw case combinedPowerHP case emissionCombined case emissionExtraUrban case emissionUrban case emissionDirective case energyEfficiencyClass case wltpCombined case wltpLow case wltpMedium case wltpHigh case wltpExtraHigh case wltpEmissionCombined case creationDate case lastUpdated case displayStockAgent case isSpecialistCar case account case location case cesarIdShipToParty case vehicleUsageCode case mbukSecured } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) vehicleUsage = try container.decodeIfPresent(String.self, forKey: .vehicleUsage) underOffer = try container.decodeIfPresent(Bool.self, forKey: .underOffer) vid = try container.decodeIfPresent(String.self, forKey: .vid) fin = try container.decodeIfPresent(String.self, forKey: .fin) modelYear = try container.decodeIfPresent(String.self, forKey: .modelYear) retailPrice_IncVAT = try container.decodeIfPresent(Double.self, forKey: .retailPrice_IncVAT) isAMG = try container.decodeIfPresent(Bool.self, forKey: .isAMG) 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(Double.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) emissionCombined = try container.decodeIfPresent(String.self, forKey: .emissionCombined) emissionExtraUrban = try container.decodeIfPresent(String.self, forKey: .emissionExtraUrban) emissionUrban = try container.decodeIfPresent(String.self, forKey: .emissionUrban) emissionDirective = try container.decodeIfPresent(String.self, forKey: .emissionDirective) energyEfficiencyClass = try container.decodeIfPresent(String.self, forKey: .energyEfficiencyClass) wltpCombined = try container.decodeIfPresent(Double.self, forKey: .wltpCombined) wltpLow = try container.decodeIfPresent(Double.self, forKey: .wltpLow) wltpMedium = try container.decodeIfPresent(Double.self, forKey: .wltpMedium) wltpHigh = try container.decodeIfPresent(Double.self, forKey: .wltpHigh) wltpExtraHigh = try container.decodeIfPresent(Double.self, forKey: .wltpExtraHigh) wltpEmissionCombined = try container.decodeIfPresent(Double.self, forKey: .wltpEmissionCombined) creationDate = try container.decodeIfPresent(Date.self, forKey: .creationDate) lastUpdated = try container.decodeIfPresent(Date.self, forKey: .lastUpdated) displayStockAgent = try container.decodeIfPresent(String.self, forKey: .displayStockAgent) isSpecialistCar = try container.decodeIfPresent(Bool.self, forKey: .isSpecialistCar) account = try container.decodeIfPresent(String.self, forKey: .account) location = try container.decodeIfPresent(String.self, forKey: .location) cesarIdShipToParty = try container.decodeIfPresent(String.self, forKey: .cesarIdShipToParty) vehicleUsageCode = try container.decodeIfPresent(String.self, forKey: .vehicleUsageCode) mbukSecured = try container.decodeIfPresent(Bool.self, forKey: .mbukSecured) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if vehicleUsage != nil { try container.encode(vehicleUsage, forKey: .vehicleUsage) } if underOffer != nil { try container.encode(underOffer, forKey: .underOffer) } if vid != nil { try container.encode(vid, forKey: .vid) } if fin != nil { try container.encode(fin, forKey: .fin) } if modelYear != nil { try container.encode(modelYear, forKey: .modelYear) } if retailPrice_IncVAT != nil { try container.encode(retailPrice_IncVAT, forKey: .retailPrice_IncVAT) } if isAMG != nil { try container.encode(isAMG, forKey: .isAMG) } 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 emissionCombined != nil { try container.encode(emissionCombined, forKey: .emissionCombined) } if emissionExtraUrban != nil { try container.encode(emissionExtraUrban, forKey: .emissionExtraUrban) } if emissionUrban != nil { try container.encode(emissionUrban, forKey: .emissionUrban) } if emissionDirective != nil { try container.encode(emissionDirective, forKey: .emissionDirective) } if energyEfficiencyClass != nil { try container.encode(energyEfficiencyClass, forKey: .energyEfficiencyClass) } 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 wltpEmissionCombined != nil { try container.encode(wltpEmissionCombined, forKey: .wltpEmissionCombined) } if creationDate != nil { try container.encode(creationDate, forKey: .creationDate) } if lastUpdated != nil { try container.encode(lastUpdated, forKey: .lastUpdated) } if displayStockAgent != nil { try container.encode(displayStockAgent, forKey: .displayStockAgent) } if isSpecialistCar != nil { try container.encode(isSpecialistCar, forKey: .isSpecialistCar) } if account != nil { try container.encode(account, forKey: .account) } if location != nil { try container.encode(location, forKey: .location) } if cesarIdShipToParty != nil { try container.encode(cesarIdShipToParty, forKey: .cesarIdShipToParty) } if vehicleUsageCode != nil { try container.encode(vehicleUsageCode, forKey: .vehicleUsageCode) } if mbukSecured != nil { try container.encode(mbukSecured, forKey: .mbukSecured) } } } public class Retailer : Codable { public var id:Int? public var gssnId:String? public var Description:String? public var street:String? public var city:String? public var postcode:String? public var googleMapPostcode:String? public var phone:String? public var fax:String? public var email:String? public var website:String? public var retailerGroupId:String? public var retailerGroupName:String? public var isOnline:Bool? public var isNewCarRetailer:Bool? public var isUsedCarRetailer:Bool? public var isCentralRetailer:Bool? public var chatEnabled:Bool? public var tradeInEnabled:Bool? public var smart:Bool? public var displayPhoneNumberNew:String? public var displayPhoneNumberUsed:String? public var latitude:Double? public var longitude:Double? public var smartDescription:String? public var smartWebsite:String? public var smartPhone:String? public var legacyId:String? public var agent:Bool? public var marketAreaId:Int? public var digitalLoungeParentGssnId:String? public var sendLeadsToDigitalLoungeParent:Bool? public var openingTimes:RetailerOpeningTimes? required public init(){} } public class VehicleConsumption : Codable { public var id:Int? public var lkm:Double? public var mpg:Double? required public init(){} } public class VehicleEquipmentCategory : Codable { public var order:Int? public var code:String? public var Description:String? public var equipment:[Equipmentv2]? required public init(){} } public class VehicleEmissionClass : Codable { public var colour:String? public var rating:String? required public init(){} } public class VehicleAttribute : Codable { public var Description:String? public var value:String? required public init(){} } public class VehicleIntegratedServiceCareOption : Codable { public var optionCode:String? public var bM7NST:String? public var fullModelYear:String? public var integratedProductType:String? public var customerDescription:String? public var oneAgentProductType:String? required public init(){} } public class VehicleCriteriaMatch : Codable { public var fuel:Bool? public var transmission:Bool? public var colour:Bool? public var upholstery:Bool? public var line:Bool? public var engine:Bool? public var bodyStyle:Bool? public var packages:Bool? required public init(){} } public class Price : Codable { public var id:String? public var Description:String? public var net:Double? public var vat:Double? public var gross:Double? public var product:OfferPriceProductType? required public init(){} } public class VehicleBaseDetail : Vehicle, ICommissionNumber { public var Description:String? public var commissionNumber:String? public var portArrivalDate:String? public var offerExpiryDate:String? public var fuel:String? public var transmission:String? public var transmissionType:String? public var colour:String? public var colourDescription:String? public var imageUrl:String? public var specialist:Bool? public var vehicleCriteriaMatch:VehicleCriteriaMatch? public var colourGroup:String? public var model:String? public var bodyStyle:String? public var brand:String? public var engine:String? public var engineDescription:String? public var line:String? public var upholstery:String? public var upholsteryDescription:String? public var packages:[String] = [] public var p11D:Double? public var prices:[Price] = [] public var vehicleClass:String? public var productRange:String? public var vehicleType:String? public var emission:Double? public var baumuster:String? public var isSellable:Bool? public var bm7NST:String? public var electricRange:Double? public var electricConsumption:Double? public var isDisplayStock:Bool? public var displayRetailer_Id:Int? public var displayRetailer:String? public var displayRetailerGssnId:String? public var retailer:Retailer? public var age:Int? public var modelYearCode:String? public var halfModelYearCode:String? public var fullModelYearCode:String? public var productionDate:String? public var chassisNumber:String? public var eligibleForIntegratedServiceCare:Bool? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case Description case commissionNumber case portArrivalDate case offerExpiryDate case fuel case transmission case transmissionType case colour case colourDescription case imageUrl case specialist case vehicleCriteriaMatch case colourGroup case model case bodyStyle case brand case engine case engineDescription case line case upholstery case upholsteryDescription case packages case p11D case prices case vehicleClass case productRange case vehicleType case emission case baumuster case isSellable case bm7NST case electricRange case electricConsumption case isDisplayStock case displayRetailer_Id case displayRetailer case displayRetailerGssnId case retailer case age case modelYearCode case halfModelYearCode case fullModelYearCode case productionDate case chassisNumber case eligibleForIntegratedServiceCare } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) Description = try container.decodeIfPresent(String.self, forKey: .Description) commissionNumber = try container.decodeIfPresent(String.self, forKey: .commissionNumber) portArrivalDate = try container.decodeIfPresent(String.self, forKey: .portArrivalDate) offerExpiryDate = try container.decodeIfPresent(String.self, forKey: .offerExpiryDate) fuel = try container.decodeIfPresent(String.self, forKey: .fuel) transmission = try container.decodeIfPresent(String.self, forKey: .transmission) transmissionType = try container.decodeIfPresent(String.self, forKey: .transmissionType) colour = try container.decodeIfPresent(String.self, forKey: .colour) colourDescription = try container.decodeIfPresent(String.self, forKey: .colourDescription) imageUrl = try container.decodeIfPresent(String.self, forKey: .imageUrl) specialist = try container.decodeIfPresent(Bool.self, forKey: .specialist) vehicleCriteriaMatch = try container.decodeIfPresent(VehicleCriteriaMatch.self, forKey: .vehicleCriteriaMatch) colourGroup = try container.decodeIfPresent(String.self, forKey: .colourGroup) model = try container.decodeIfPresent(String.self, forKey: .model) bodyStyle = try container.decodeIfPresent(String.self, forKey: .bodyStyle) brand = try container.decodeIfPresent(String.self, forKey: .brand) engine = try container.decodeIfPresent(String.self, forKey: .engine) engineDescription = try container.decodeIfPresent(String.self, forKey: .engineDescription) line = try container.decodeIfPresent(String.self, forKey: .line) upholstery = try container.decodeIfPresent(String.self, forKey: .upholstery) upholsteryDescription = try container.decodeIfPresent(String.self, forKey: .upholsteryDescription) packages = try container.decodeIfPresent([String].self, forKey: .packages) ?? [] p11D = try container.decodeIfPresent(Double.self, forKey: .p11D) prices = try container.decodeIfPresent([Price].self, forKey: .prices) ?? [] vehicleClass = try container.decodeIfPresent(String.self, forKey: .vehicleClass) productRange = try container.decodeIfPresent(String.self, forKey: .productRange) vehicleType = try container.decodeIfPresent(String.self, forKey: .vehicleType) emission = try container.decodeIfPresent(Double.self, forKey: .emission) baumuster = try container.decodeIfPresent(String.self, forKey: .baumuster) isSellable = try container.decodeIfPresent(Bool.self, forKey: .isSellable) bm7NST = try container.decodeIfPresent(String.self, forKey: .bm7NST) electricRange = try container.decodeIfPresent(Double.self, forKey: .electricRange) electricConsumption = try container.decodeIfPresent(Double.self, forKey: .electricConsumption) isDisplayStock = try container.decodeIfPresent(Bool.self, forKey: .isDisplayStock) displayRetailer_Id = try container.decodeIfPresent(Int.self, forKey: .displayRetailer_Id) displayRetailer = try container.decodeIfPresent(String.self, forKey: .displayRetailer) displayRetailerGssnId = try container.decodeIfPresent(String.self, forKey: .displayRetailerGssnId) retailer = try container.decodeIfPresent(Retailer.self, forKey: .retailer) age = try container.decodeIfPresent(Int.self, forKey: .age) modelYearCode = try container.decodeIfPresent(String.self, forKey: .modelYearCode) halfModelYearCode = try container.decodeIfPresent(String.self, forKey: .halfModelYearCode) fullModelYearCode = try container.decodeIfPresent(String.self, forKey: .fullModelYearCode) productionDate = try container.decodeIfPresent(String.self, forKey: .productionDate) chassisNumber = try container.decodeIfPresent(String.self, forKey: .chassisNumber) eligibleForIntegratedServiceCare = try container.decodeIfPresent(Bool.self, forKey: .eligibleForIntegratedServiceCare) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if Description != nil { try container.encode(Description, forKey: .Description) } if commissionNumber != nil { try container.encode(commissionNumber, forKey: .commissionNumber) } if portArrivalDate != nil { try container.encode(portArrivalDate, forKey: .portArrivalDate) } if offerExpiryDate != nil { try container.encode(offerExpiryDate, forKey: .offerExpiryDate) } if fuel != nil { try container.encode(fuel, forKey: .fuel) } if transmission != nil { try container.encode(transmission, forKey: .transmission) } if transmissionType != nil { try container.encode(transmissionType, forKey: .transmissionType) } if colour != nil { try container.encode(colour, forKey: .colour) } if colourDescription != nil { try container.encode(colourDescription, forKey: .colourDescription) } if imageUrl != nil { try container.encode(imageUrl, forKey: .imageUrl) } if specialist != nil { try container.encode(specialist, forKey: .specialist) } if vehicleCriteriaMatch != nil { try container.encode(vehicleCriteriaMatch, forKey: .vehicleCriteriaMatch) } if colourGroup != nil { try container.encode(colourGroup, forKey: .colourGroup) } if model != nil { try container.encode(model, forKey: .model) } if bodyStyle != nil { try container.encode(bodyStyle, forKey: .bodyStyle) } if brand != nil { try container.encode(brand, forKey: .brand) } if engine != nil { try container.encode(engine, forKey: .engine) } if engineDescription != nil { try container.encode(engineDescription, forKey: .engineDescription) } if line != nil { try container.encode(line, forKey: .line) } if upholstery != nil { try container.encode(upholstery, forKey: .upholstery) } if upholsteryDescription != nil { try container.encode(upholsteryDescription, forKey: .upholsteryDescription) } if packages.count > 0 { try container.encode(packages, forKey: .packages) } if p11D != nil { try container.encode(p11D, forKey: .p11D) } if prices.count > 0 { try container.encode(prices, forKey: .prices) } if vehicleClass != nil { try container.encode(vehicleClass, forKey: .vehicleClass) } if productRange != nil { try container.encode(productRange, forKey: .productRange) } if vehicleType != nil { try container.encode(vehicleType, forKey: .vehicleType) } if emission != nil { try container.encode(emission, forKey: .emission) } if baumuster != nil { try container.encode(baumuster, forKey: .baumuster) } if isSellable != nil { try container.encode(isSellable, forKey: .isSellable) } if bm7NST != nil { try container.encode(bm7NST, forKey: .bm7NST) } if electricRange != nil { try container.encode(electricRange, forKey: .electricRange) } if electricConsumption != nil { try container.encode(electricConsumption, forKey: .electricConsumption) } if isDisplayStock != nil { try container.encode(isDisplayStock, forKey: .isDisplayStock) } if displayRetailer_Id != nil { try container.encode(displayRetailer_Id, forKey: .displayRetailer_Id) } if displayRetailer != nil { try container.encode(displayRetailer, forKey: .displayRetailer) } if displayRetailerGssnId != nil { try container.encode(displayRetailerGssnId, forKey: .displayRetailerGssnId) } if retailer != nil { try container.encode(retailer, forKey: .retailer) } if age != nil { try container.encode(age, forKey: .age) } 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 productionDate != nil { try container.encode(productionDate, forKey: .productionDate) } if chassisNumber != nil { try container.encode(chassisNumber, forKey: .chassisNumber) } if eligibleForIntegratedServiceCare != nil { try container.encode(eligibleForIntegratedServiceCare, forKey: .eligibleForIntegratedServiceCare) } } } public protocol ICommissionNumber { var commissionNumber:String? { get set } } public class Retailer : Codable { public var gssn:String? public var Description:String? public var campaignExcluded:Bool? required public init(){} } public class Equipmentv2 : Equipment { public var importance:Int? public var isAdditional:Bool? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case importance case isAdditional } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) importance = try container.decodeIfPresent(Int.self, forKey: .importance) isAdditional = try container.decodeIfPresent(Bool.self, forKey: .isAdditional) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if importance != nil { try container.encode(importance, forKey: .importance) } if isAdditional != nil { try container.encode(isAdditional, forKey: .isAdditional) } } } public enum OfferPriceProductType : String, Codable { case LIST_PRICE case NUMBER_PLATE_FEE case DELIVERY_CHARGE case FUEL_CHARGE case MANUFACTURER_OFFER case PERSONALISED_MONEYOFFER case PERSONALISED_NONMONEYOFFER case PERSONALISED_NONMONEYOFFER_NEG case SERVICE case SERVICE_NEG case GOVERNMENT_GRANT case OUTRIGHT_PURCHASE_DISCOUNT case VIP_OFFER case WALLBOX_OFFER case WALLBOX_OFFER_NEG case ROAD_FUND_LICENCE case FIRST_REGISTRATION_FEE case NOT_FOUND case ACCESSORY_OFFER case ACCESSORY_OFFER_NEG case MOTABILITY_DISCOUNT } public class Equipment : Codable { public var id:Int? public var code:String? public var Description:String? required public init(){} }