/* Options: Date: 2026-06-14 21:57:39 SwiftVersion: 5.0 Version: 8.80 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://qp-microservices-booster.richemont.com //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: CreateWarrantyCardRequest.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/warranty/v1/site/{siteId}/card", "POST") public class CreateWarrantyCardRequest : BaseRequest, IReturn { public typealias Return = CreateWarrantyCardResponse public var siteId:Int public var force:Bool? public var ref:String public var serial:String public var invoiceNumber:String public var activationDate:Date? public var note:String public var promoterTypeId:String public var issuedBy:String public var nfcCardUID:String public var appVersion:String public var searchMethod:String public var deviceOS:String required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case siteId case force case ref case serial case invoiceNumber case activationDate case note case promoterTypeId case issuedBy case nfcCardUID case appVersion case searchMethod case deviceOS } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) siteId = try container.decodeIfPresent(Int.self, forKey: .siteId) force = try container.decodeIfPresent(Bool.self, forKey: .force) ref = try container.decodeIfPresent(String.self, forKey: .ref) serial = try container.decodeIfPresent(String.self, forKey: .serial) invoiceNumber = try container.decodeIfPresent(String.self, forKey: .invoiceNumber) activationDate = try container.decodeIfPresent(Date.self, forKey: .activationDate) note = try container.decodeIfPresent(String.self, forKey: .note) promoterTypeId = try container.decodeIfPresent(String.self, forKey: .promoterTypeId) issuedBy = try container.decodeIfPresent(String.self, forKey: .issuedBy) nfcCardUID = try container.decodeIfPresent(String.self, forKey: .nfcCardUID) appVersion = try container.decodeIfPresent(String.self, forKey: .appVersion) searchMethod = try container.decodeIfPresent(String.self, forKey: .searchMethod) deviceOS = try container.decodeIfPresent(String.self, forKey: .deviceOS) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if siteId != nil { try container.encode(siteId, forKey: .siteId) } if force != nil { try container.encode(force, forKey: .force) } if ref != nil { try container.encode(ref, forKey: .ref) } if serial != nil { try container.encode(serial, forKey: .serial) } if invoiceNumber != nil { try container.encode(invoiceNumber, forKey: .invoiceNumber) } if activationDate != nil { try container.encode(activationDate, forKey: .activationDate) } if note != nil { try container.encode(note, forKey: .note) } if promoterTypeId != nil { try container.encode(promoterTypeId, forKey: .promoterTypeId) } if issuedBy != nil { try container.encode(issuedBy, forKey: .issuedBy) } if nfcCardUID != nil { try container.encode(nfcCardUID, forKey: .nfcCardUID) } if appVersion != nil { try container.encode(appVersion, forKey: .appVersion) } if searchMethod != nil { try container.encode(searchMethod, forKey: .searchMethod) } if deviceOS != nil { try container.encode(deviceOS, forKey: .deviceOS) } } } public class CreateWarrantyCardResponse : BaseResponse { 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 BaseRequest : IRequest, Codable { public var sid:String public var app:String public var _os:String public var _appVersion:String public var _searchMethod:String required public init(){} } public protocol IRequest { var sid:String { get set } var app:String { get set } } public class BaseResponse : IRespose, Codable { public var _xmlns:String public var _type:String public var _source:String public var _tstamp:String public var _user:String public var _env:String public var _uri:String public var _query:String required public init(){} } public protocol IRespose { var _xmlns:String { get set } var _type:String { get set } var _source:String { get set } var _tstamp:String { get set } var _user:String { get set } var _env:String { get set } var _uri:String { get set } var _query:String { get set } }