Mercedes.Agency.Orchestration.API

<back to all web services

GetMotabilityPricingRequest

Motability
Requires Authentication
The following routes are available for this service:
POST/v1/motability/pricingGets the motability pricing information for the current user roleGets the motability pricing information for the current user role
import Foundation
import ServiceStack

public class GetMotabilityPricingRequest : Codable
{
    required public init(){}
}

public class GetMotabilityPricingResponse : Codable
{
    public var motabilityPricing:[MotabilityPricing] = []

    required public init(){}
}

public class MotabilityPricing : MotabilityPricingCsv
{
    public var motabilityPricingStatus:MotabilityPricingStatus

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

    private enum CodingKeys : String, CodingKey {
        case motabilityPricingStatus
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        motabilityPricingStatus = try container.decodeIfPresent(MotabilityPricingStatus.self, forKey: .motabilityPricingStatus)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if motabilityPricingStatus != nil { try container.encode(motabilityPricingStatus, forKey: .motabilityPricingStatus) }
    }
}

public class MotabilityPricingCsv : Codable
{
    // @DataMember(Order=0)
    public var id:Int

    // @DataMember(Order=1)
    public var criteriaBM7NST:String

    // @DataMember(Order=2)
    public var vtn:String

    // @DataMember(Order=3)
    public var backOrderDropDown:String

    // @DataMember(Order=4)
    public var criteriaFullModelYearCode:String

    // @DataMember(Order=5)
    public var criteriaValidOptionCodes:String

    // @DataMember(Order=6)
    public var criteriaInvalidOptionCodes:String

    // @DataMember(Order=7)
    public var pipNet:Double

    // @DataMember(Order=8)
    public var pipVat:Double

    // @DataMember(Order=9)
    public var pipGross:Double

    // @DataMember(Order=10)
    public var wpmsNet:Double

    // @DataMember(Order=11)
    public var wpmsVat:Double

    // @DataMember(Order=12)
    public var wpmsGross:Double

    // @DataMember(Order=13)
    public var discountNet:Double

    // @DataMember(Order=14)
    public var discountVat:Double

    // @DataMember(Order=15)
    public var discountGross:Double

    // @DataMember(Order=16)
    public var listPriceNet:Double

    // @DataMember(Order=17)
    public var listPriceVat:Double

    // @DataMember(Order=18)
    public var listPriceGross:Double

    // @DataMember(Order=19)
    public var deliveryChargeNet:Double

    // @DataMember(Order=20)
    public var deliveryChargeVat:Double

    // @DataMember(Order=21)
    public var deliveryChargeGross:Double

    // @DataMember(Order=22)
    public var fuelChargeNet:Double

    // @DataMember(Order=23)
    public var fuelChargeVat:Double

    // @DataMember(Order=24)
    public var fuelChargeGross:Double

    // @DataMember(Order=25)
    public var numberPlateFeeNet:Double

    // @DataMember(Order=26)
    public var numberPlateFeeVat:Double

    // @DataMember(Order=27)
    public var numberPlateFeeGross:Double

    // @DataMember(Order=28)
    public var firstRegistrationFeeNet:Double

    // @DataMember(Order=29)
    public var firstRegistrationFeeVat:Double

    // @DataMember(Order=30)
    public var firstRegistrationFeeGross:Double

    // @DataMember(Order=31)
    public var roadFundLicenceNet:Double

    // @DataMember(Order=32)
    public var roadFundLicenceVat:Double

    // @DataMember(Order=33)
    public var roadFundLicenceGross:Double

    // @DataMember(Order=34)
    public var validFrom:Date

    // @DataMember(Order=35)
    public var validTo:Date

    required public init(){}
}

public enum MotabilityPricingStatus : String, Codable
{
    case Pending
    case Current
    case RecentlyExpired
    case Expired
}


Swift GetMotabilityPricingRequest DTOs

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

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/motability/pricing HTTP/1.1 
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{Unable to show example output for type 'GetMotabilityPricingResponse' using the custom 'other' filter}Cannot dynamically create an instance of type 'Mercedes.Agency.API.Shared.POCO.Motability.Responses.GetMotabilityPricingResponse'. Reason: No parameterless constructor defined.