/* Options: Date: 2026-10-01 12:31:12 SwiftVersion: 5.0 Version: 6.10 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://stubbur-app.azurewebsites.net //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: OwnerCardsUpgradeQuoteRequest.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/OrderOwnerCards/upgrade/quote", "POST") public class OwnerCardsUpgradeQuoteRequest : IReturn, Codable { public typealias Return = OwnerCardsUpgradeQuoteResult public var buyerPhone:String? public var sourceOwnerCardId:Int? public var targetOwnerCardTypeId:Int? public var tenders:[OrderTender] = [] required public init(){} } public class OwnerCardsUpgradeQuoteResult : OwnerCardUpgradeResultBase { public var sourceOwnerCardId:Int? public var sourceOwnerCardTypeId:Int? public var sourceTypeName:String? public var targetOwnerCardTypeId:Int? public var targetTypeName:String? public var pricePaidOriginal:Int? public var targetPrice:Int? public var priceTotal:Int? public var discountAmount:Int? public var giftCardAmount:Int? public var donationAmount:Int? public var transactionFee:Int? public var chargedAmount:Int? public var chargedAmountMinor:Int? public var fullyCovered:Bool? public var validFromUTC:Date? public var validToUTC:Date? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case sourceOwnerCardId case sourceOwnerCardTypeId case sourceTypeName case targetOwnerCardTypeId case targetTypeName case pricePaidOriginal case targetPrice case priceTotal case discountAmount case giftCardAmount case donationAmount case transactionFee case chargedAmount case chargedAmountMinor case fullyCovered case validFromUTC case validToUTC } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) sourceOwnerCardId = try container.decodeIfPresent(Int.self, forKey: .sourceOwnerCardId) sourceOwnerCardTypeId = try container.decodeIfPresent(Int.self, forKey: .sourceOwnerCardTypeId) sourceTypeName = try container.decodeIfPresent(String.self, forKey: .sourceTypeName) targetOwnerCardTypeId = try container.decodeIfPresent(Int.self, forKey: .targetOwnerCardTypeId) targetTypeName = try container.decodeIfPresent(String.self, forKey: .targetTypeName) pricePaidOriginal = try container.decodeIfPresent(Int.self, forKey: .pricePaidOriginal) targetPrice = try container.decodeIfPresent(Int.self, forKey: .targetPrice) priceTotal = try container.decodeIfPresent(Int.self, forKey: .priceTotal) discountAmount = try container.decodeIfPresent(Int.self, forKey: .discountAmount) giftCardAmount = try container.decodeIfPresent(Int.self, forKey: .giftCardAmount) donationAmount = try container.decodeIfPresent(Int.self, forKey: .donationAmount) transactionFee = try container.decodeIfPresent(Int.self, forKey: .transactionFee) chargedAmount = try container.decodeIfPresent(Int.self, forKey: .chargedAmount) chargedAmountMinor = try container.decodeIfPresent(Int.self, forKey: .chargedAmountMinor) fullyCovered = try container.decodeIfPresent(Bool.self, forKey: .fullyCovered) validFromUTC = try container.decodeIfPresent(Date.self, forKey: .validFromUTC) validToUTC = try container.decodeIfPresent(Date.self, forKey: .validToUTC) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if sourceOwnerCardId != nil { try container.encode(sourceOwnerCardId, forKey: .sourceOwnerCardId) } if sourceOwnerCardTypeId != nil { try container.encode(sourceOwnerCardTypeId, forKey: .sourceOwnerCardTypeId) } if sourceTypeName != nil { try container.encode(sourceTypeName, forKey: .sourceTypeName) } if targetOwnerCardTypeId != nil { try container.encode(targetOwnerCardTypeId, forKey: .targetOwnerCardTypeId) } if targetTypeName != nil { try container.encode(targetTypeName, forKey: .targetTypeName) } if pricePaidOriginal != nil { try container.encode(pricePaidOriginal, forKey: .pricePaidOriginal) } if targetPrice != nil { try container.encode(targetPrice, forKey: .targetPrice) } if priceTotal != nil { try container.encode(priceTotal, forKey: .priceTotal) } if discountAmount != nil { try container.encode(discountAmount, forKey: .discountAmount) } if giftCardAmount != nil { try container.encode(giftCardAmount, forKey: .giftCardAmount) } if donationAmount != nil { try container.encode(donationAmount, forKey: .donationAmount) } if transactionFee != nil { try container.encode(transactionFee, forKey: .transactionFee) } if chargedAmount != nil { try container.encode(chargedAmount, forKey: .chargedAmount) } if chargedAmountMinor != nil { try container.encode(chargedAmountMinor, forKey: .chargedAmountMinor) } if fullyCovered != nil { try container.encode(fullyCovered, forKey: .fullyCovered) } if validFromUTC != nil { try container.encode(validFromUTC, forKey: .validFromUTC) } if validToUTC != nil { try container.encode(validToUTC, forKey: .validToUTC) } } } public class OrderTender : Codable { public var kind:String? public var code:String? public var amountMinor:Int? public var idempotencyKey:String? public var holdId:Int? public var appliedMinor:Int? required public init(){} } public class OwnerCardUpgradeResultBase : Codable { public var statusCode:Int? public var message:String? public var reason:String? required public init(){} }