/* Options: Date: 2026-06-14 22:00:35 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: GetCustomerSuggestion.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/warranty/v1/GetCustomerSuggestion", "POST") public class GetCustomerSuggestion : BaseRequest, IReturn { public typealias Return = GetCustomerSuggestionResponse public var emailAddress:String public var posId:Int public var brandTrigram:String public var phoneNumber:String public var prefixCountryId:String public var countryId:String required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case emailAddress case posId case brandTrigram case phoneNumber case prefixCountryId case countryId } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) emailAddress = try container.decodeIfPresent(String.self, forKey: .emailAddress) posId = try container.decodeIfPresent(Int.self, forKey: .posId) brandTrigram = try container.decodeIfPresent(String.self, forKey: .brandTrigram) phoneNumber = try container.decodeIfPresent(String.self, forKey: .phoneNumber) prefixCountryId = try container.decodeIfPresent(String.self, forKey: .prefixCountryId) countryId = try container.decodeIfPresent(String.self, forKey: .countryId) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if emailAddress != nil { try container.encode(emailAddress, forKey: .emailAddress) } if posId != nil { try container.encode(posId, forKey: .posId) } if brandTrigram != nil { try container.encode(brandTrigram, forKey: .brandTrigram) } if phoneNumber != nil { try container.encode(phoneNumber, forKey: .phoneNumber) } if prefixCountryId != nil { try container.encode(prefixCountryId, forKey: .prefixCountryId) } if countryId != nil { try container.encode(countryId, forKey: .countryId) } } } public class GetCustomerSuggestionResponse : BaseResponse { public var customerType:String public var customerRef:String public var title:Int? public var titleDs:String public var firstName:String public var lastName:String public var firstNameNotLatin:String public var lastNameNotLatin:String public var birthday:String public var birthDayEventId:String? public var weddingDate:String public var canBeContacted:Bool? public var seller:String? public var language:String public var languageDs:String public var nameSuffix:String public var gender:String public var companyName:String public var middleName:String public var customerId:String? public var personId:String? public var boosterCustomerId:Int? public var posOwnerId:Int? public var brandOwnerId:String public var businessUnitId:Int? public var sapGenderId:String public var allowStoreDataAbroad:Bool? public var privacyPolicyAcceptanceStorage:Bool? public var tvAllowStoreDataAbroad:Bool? public var tvPrivacyPolicyAcceptanceStorage:Bool? public var contactByMail:Bool? public var contactByEmail:Bool? public var contactByPhone:Bool? public var contactBySMS:Bool? public var contactBySocialMedia:Bool? public var addresses:[CustomerAddress] = [] public var emails:[CustomerEmail] = [] public var phones:[CustomerPhone] = [] public var responseStatus:ResponseStatus required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case customerType case customerRef case title case titleDs case firstName case lastName case firstNameNotLatin case lastNameNotLatin case birthday case birthDayEventId case weddingDate case canBeContacted case seller case language case languageDs case nameSuffix case gender case companyName case middleName case customerId case personId case boosterCustomerId case posOwnerId case brandOwnerId case businessUnitId case sapGenderId case allowStoreDataAbroad case privacyPolicyAcceptanceStorage case tvAllowStoreDataAbroad case tvPrivacyPolicyAcceptanceStorage case contactByMail case contactByEmail case contactByPhone case contactBySMS case contactBySocialMedia case addresses case emails case phones case responseStatus } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) customerType = try container.decodeIfPresent(String.self, forKey: .customerType) customerRef = try container.decodeIfPresent(String.self, forKey: .customerRef) title = try container.decodeIfPresent(Int.self, forKey: .title) titleDs = try container.decodeIfPresent(String.self, forKey: .titleDs) firstName = try container.decodeIfPresent(String.self, forKey: .firstName) lastName = try container.decodeIfPresent(String.self, forKey: .lastName) firstNameNotLatin = try container.decodeIfPresent(String.self, forKey: .firstNameNotLatin) lastNameNotLatin = try container.decodeIfPresent(String.self, forKey: .lastNameNotLatin) birthday = try container.decodeIfPresent(String.self, forKey: .birthday) birthDayEventId = try container.decodeIfPresent(String.self, forKey: .birthDayEventId) weddingDate = try container.decodeIfPresent(String.self, forKey: .weddingDate) canBeContacted = try container.decodeIfPresent(Bool.self, forKey: .canBeContacted) seller = try container.decodeIfPresent(String.self, forKey: .seller) language = try container.decodeIfPresent(String.self, forKey: .language) languageDs = try container.decodeIfPresent(String.self, forKey: .languageDs) nameSuffix = try container.decodeIfPresent(String.self, forKey: .nameSuffix) gender = try container.decodeIfPresent(String.self, forKey: .gender) companyName = try container.decodeIfPresent(String.self, forKey: .companyName) middleName = try container.decodeIfPresent(String.self, forKey: .middleName) customerId = try container.decodeIfPresent(String.self, forKey: .customerId) personId = try container.decodeIfPresent(String.self, forKey: .personId) boosterCustomerId = try container.decodeIfPresent(Int.self, forKey: .boosterCustomerId) posOwnerId = try container.decodeIfPresent(Int.self, forKey: .posOwnerId) brandOwnerId = try container.decodeIfPresent(String.self, forKey: .brandOwnerId) businessUnitId = try container.decodeIfPresent(Int.self, forKey: .businessUnitId) sapGenderId = try container.decodeIfPresent(String.self, forKey: .sapGenderId) allowStoreDataAbroad = try container.decodeIfPresent(Bool.self, forKey: .allowStoreDataAbroad) privacyPolicyAcceptanceStorage = try container.decodeIfPresent(Bool.self, forKey: .privacyPolicyAcceptanceStorage) tvAllowStoreDataAbroad = try container.decodeIfPresent(Bool.self, forKey: .tvAllowStoreDataAbroad) tvPrivacyPolicyAcceptanceStorage = try container.decodeIfPresent(Bool.self, forKey: .tvPrivacyPolicyAcceptanceStorage) contactByMail = try container.decodeIfPresent(Bool.self, forKey: .contactByMail) contactByEmail = try container.decodeIfPresent(Bool.self, forKey: .contactByEmail) contactByPhone = try container.decodeIfPresent(Bool.self, forKey: .contactByPhone) contactBySMS = try container.decodeIfPresent(Bool.self, forKey: .contactBySMS) contactBySocialMedia = try container.decodeIfPresent(Bool.self, forKey: .contactBySocialMedia) addresses = try container.decodeIfPresent([CustomerAddress].self, forKey: .addresses) ?? [] emails = try container.decodeIfPresent([CustomerEmail].self, forKey: .emails) ?? [] phones = try container.decodeIfPresent([CustomerPhone].self, forKey: .phones) ?? [] responseStatus = try container.decodeIfPresent(ResponseStatus.self, forKey: .responseStatus) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if customerType != nil { try container.encode(customerType, forKey: .customerType) } if customerRef != nil { try container.encode(customerRef, forKey: .customerRef) } if title != nil { try container.encode(title, forKey: .title) } if titleDs != nil { try container.encode(titleDs, forKey: .titleDs) } if firstName != nil { try container.encode(firstName, forKey: .firstName) } if lastName != nil { try container.encode(lastName, forKey: .lastName) } if firstNameNotLatin != nil { try container.encode(firstNameNotLatin, forKey: .firstNameNotLatin) } if lastNameNotLatin != nil { try container.encode(lastNameNotLatin, forKey: .lastNameNotLatin) } if birthday != nil { try container.encode(birthday, forKey: .birthday) } if birthDayEventId != nil { try container.encode(birthDayEventId, forKey: .birthDayEventId) } if weddingDate != nil { try container.encode(weddingDate, forKey: .weddingDate) } if canBeContacted != nil { try container.encode(canBeContacted, forKey: .canBeContacted) } if seller != nil { try container.encode(seller, forKey: .seller) } if language != nil { try container.encode(language, forKey: .language) } if languageDs != nil { try container.encode(languageDs, forKey: .languageDs) } if nameSuffix != nil { try container.encode(nameSuffix, forKey: .nameSuffix) } if gender != nil { try container.encode(gender, forKey: .gender) } if companyName != nil { try container.encode(companyName, forKey: .companyName) } if middleName != nil { try container.encode(middleName, forKey: .middleName) } if customerId != nil { try container.encode(customerId, forKey: .customerId) } if personId != nil { try container.encode(personId, forKey: .personId) } if boosterCustomerId != nil { try container.encode(boosterCustomerId, forKey: .boosterCustomerId) } if posOwnerId != nil { try container.encode(posOwnerId, forKey: .posOwnerId) } if brandOwnerId != nil { try container.encode(brandOwnerId, forKey: .brandOwnerId) } if businessUnitId != nil { try container.encode(businessUnitId, forKey: .businessUnitId) } if sapGenderId != nil { try container.encode(sapGenderId, forKey: .sapGenderId) } if allowStoreDataAbroad != nil { try container.encode(allowStoreDataAbroad, forKey: .allowStoreDataAbroad) } if privacyPolicyAcceptanceStorage != nil { try container.encode(privacyPolicyAcceptanceStorage, forKey: .privacyPolicyAcceptanceStorage) } if tvAllowStoreDataAbroad != nil { try container.encode(tvAllowStoreDataAbroad, forKey: .tvAllowStoreDataAbroad) } if tvPrivacyPolicyAcceptanceStorage != nil { try container.encode(tvPrivacyPolicyAcceptanceStorage, forKey: .tvPrivacyPolicyAcceptanceStorage) } if contactByMail != nil { try container.encode(contactByMail, forKey: .contactByMail) } if contactByEmail != nil { try container.encode(contactByEmail, forKey: .contactByEmail) } if contactByPhone != nil { try container.encode(contactByPhone, forKey: .contactByPhone) } if contactBySMS != nil { try container.encode(contactBySMS, forKey: .contactBySMS) } if contactBySocialMedia != nil { try container.encode(contactBySocialMedia, forKey: .contactBySocialMedia) } if addresses.count > 0 { try container.encode(addresses, forKey: .addresses) } if emails.count > 0 { try container.encode(emails, forKey: .emails) } if phones.count > 0 { try container.encode(phones, forKey: .phones) } if responseStatus != nil { try container.encode(responseStatus, forKey: .responseStatus) } } } 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 } } public class CustomerAddress : Codable { public var addressId:String public var Description:String public var addressLine1:String public var addressLine2:String public var addressLine3:String public var addressLine4:String public var addressLine5:String public var houseNumber:String public var city:String public var region:String public var county:String public var stateOrProvinceId:String public var countryId:String public var countryDs:String public var zipCode:String public var addressTypeId:String public var isMailingAddress:Bool public var isMainAddress:Bool required public init(){} } public class CustomerEmail : Codable { public var emailId:String public var Description:String public var email:String public var isMainEmail:Bool public var type:Lookup required public init(){} } public class CustomerPhone : Codable { public var phoneId:String public var Description:String public var phone:String public var isMainPhone:Bool public var prefixCountryId:String public var telephonePrefix:String public var type:Lookup required public init(){} } public class Lookup : Codable { public var id:T public var Description:String required public init(){} }