/* Options: Date: 2025-05-10 01:42:11 SwiftVersion: 5.0 Version: 8.40 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://active-ewebservice.biz/aeservices30/api //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: UpdateCustomerRequest.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack /** * UpdateCustomerRequires active-e Customer Service. */ // @Route("/UpdateCustomer", "POST") // @DataContract public class UpdateCustomerRequest : BaseSecureRequest, IReturn { public typealias Return = UpdateCustomerResponse /** * Customer Acct # */ // @DataMember // @ApiMember(DataType="integer", Description="Customer Acct #", Format="int32", IsRequired=true, Name="Acct", ParameterType="query") public var acct:Int /** * Location ID */ // @DataMember // @ApiMember(DataType="integer", Description="Location ID", Format="int64", Name="LocationId", ParameterType="query") public var locationId:Int? /** * Customer Default Id */ // @DataMember // @ApiMember(DataType="integer", Description="Customer Default Id", Format="int64", Name="CustomerDefaultId", ParameterType="query") public var customerDefaultId:Int? /** * Tax Authority Id */ // @DataMember // @ApiMember(DataType="integer", Description="Tax Authority Id", Format="int64", Name="TaxAuthorityId", ParameterType="query") public var taxAuthorityId:Int? // @DataMember public var name:String // @DataMember public var attn:String // @DataMember public var address1:String // @DataMember public var address2:String // @DataMember public var city:String // @DataMember public var state:String // @DataMember public var zip:String // @DataMember public var country:String // @DataMember public var homePhone:String // @DataMember public var workPhone:String // @DataMember public var cellPhone:String // @DataMember public var employer:String // @DataMember public var ss:String // @DataMember public var email:String /** * Email Method. Set this to Word, PDF, HTML, or None */ // @DataMember // @ApiMember(DataType="string", Description="Email Method. Set this to Word, PDF, HTML, or None", Name="EmailMethod", ParameterType="query") public var emailMethod:String // @DataMember public var notes:String // @DataMember public var driversLicenseInfo:LicenseInfo /** * If TRUE, all applicable settings from the customer default will be copied over to the customer. Generally only used when changing the customer default. */ // @DataMember // @ApiMember(DataType="bool", Description="If TRUE, all applicable settings from the customer default will be copied over to the customer. Generally only used when changing the customer default.", Name="RefreshCustomerDefaults", ParameterType="query") public var refreshCustomerDefaults:Bool /** * */ // @DataMember // @ApiMember(DataType="array", Description="", Name="FormInputList", ParameterType="query") public var formInputList:[FormInput] = [] required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case acct case locationId case customerDefaultId case taxAuthorityId case name case attn case address1 case address2 case city case state case zip case country case homePhone case workPhone case cellPhone case employer case ss case email case emailMethod case notes case driversLicenseInfo case refreshCustomerDefaults case formInputList } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) acct = try container.decodeIfPresent(Int.self, forKey: .acct) locationId = try container.decodeIfPresent(Int.self, forKey: .locationId) customerDefaultId = try container.decodeIfPresent(Int.self, forKey: .customerDefaultId) taxAuthorityId = try container.decodeIfPresent(Int.self, forKey: .taxAuthorityId) name = try container.decodeIfPresent(String.self, forKey: .name) attn = try container.decodeIfPresent(String.self, forKey: .attn) address1 = try container.decodeIfPresent(String.self, forKey: .address1) address2 = try container.decodeIfPresent(String.self, forKey: .address2) city = try container.decodeIfPresent(String.self, forKey: .city) state = try container.decodeIfPresent(String.self, forKey: .state) zip = try container.decodeIfPresent(String.self, forKey: .zip) country = try container.decodeIfPresent(String.self, forKey: .country) homePhone = try container.decodeIfPresent(String.self, forKey: .homePhone) workPhone = try container.decodeIfPresent(String.self, forKey: .workPhone) cellPhone = try container.decodeIfPresent(String.self, forKey: .cellPhone) employer = try container.decodeIfPresent(String.self, forKey: .employer) ss = try container.decodeIfPresent(String.self, forKey: .ss) email = try container.decodeIfPresent(String.self, forKey: .email) emailMethod = try container.decodeIfPresent(String.self, forKey: .emailMethod) notes = try container.decodeIfPresent(String.self, forKey: .notes) driversLicenseInfo = try container.decodeIfPresent(LicenseInfo.self, forKey: .driversLicenseInfo) refreshCustomerDefaults = try container.decodeIfPresent(Bool.self, forKey: .refreshCustomerDefaults) formInputList = try container.decodeIfPresent([FormInput].self, forKey: .formInputList) ?? [] } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if acct != nil { try container.encode(acct, forKey: .acct) } if locationId != nil { try container.encode(locationId, forKey: .locationId) } if customerDefaultId != nil { try container.encode(customerDefaultId, forKey: .customerDefaultId) } if taxAuthorityId != nil { try container.encode(taxAuthorityId, forKey: .taxAuthorityId) } if name != nil { try container.encode(name, forKey: .name) } if attn != nil { try container.encode(attn, forKey: .attn) } if address1 != nil { try container.encode(address1, forKey: .address1) } if address2 != nil { try container.encode(address2, forKey: .address2) } if city != nil { try container.encode(city, forKey: .city) } if state != nil { try container.encode(state, forKey: .state) } if zip != nil { try container.encode(zip, forKey: .zip) } if country != nil { try container.encode(country, forKey: .country) } if homePhone != nil { try container.encode(homePhone, forKey: .homePhone) } if workPhone != nil { try container.encode(workPhone, forKey: .workPhone) } if cellPhone != nil { try container.encode(cellPhone, forKey: .cellPhone) } if employer != nil { try container.encode(employer, forKey: .employer) } if ss != nil { try container.encode(ss, forKey: .ss) } if email != nil { try container.encode(email, forKey: .email) } if emailMethod != nil { try container.encode(emailMethod, forKey: .emailMethod) } if notes != nil { try container.encode(notes, forKey: .notes) } if driversLicenseInfo != nil { try container.encode(driversLicenseInfo, forKey: .driversLicenseInfo) } if refreshCustomerDefaults != nil { try container.encode(refreshCustomerDefaults, forKey: .refreshCustomerDefaults) } if formInputList.count > 0 { try container.encode(formInputList, forKey: .formInputList) } } } // @DataContract public class UpdateCustomerResponse : 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) } } // @DataContract public class BaseRequest : Codable { /** * This is your AIM API Key provided by Tri-Tech */ // @DataMember // @ApiMember(DataType="string", Description="This is your AIM API Key provided by Tri-Tech", IsRequired=true, Name="ApiKey", ParameterType="header") public var apiKey:String // @DataMember // @ApiMember(DataType="string", Name="OAuthToken", ParameterType="header") public var oAuthToken:String required public init(){} } // @DataContract public class BaseSecureRequest : BaseRequest { /** * */ // @DataMember // @ApiMember(DataType="string", Description="", Name="Token", ParameterType="Header") public var token:String /** * */ // @DataMember // @ApiMember(DataType="string", Description="", Name="DeviceId", ParameterType="Header") public var deviceId:String /** * */ // @DataMember // @ApiMember(DataType="string", Description="", IsRequired=true, Name="AppId", ParameterType="Header") public var appId:String required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case token case deviceId case appId } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) token = try container.decodeIfPresent(String.self, forKey: .token) deviceId = try container.decodeIfPresent(String.self, forKey: .deviceId) appId = try container.decodeIfPresent(String.self, forKey: .appId) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if token != nil { try container.encode(token, forKey: .token) } if deviceId != nil { try container.encode(deviceId, forKey: .deviceId) } if appId != nil { try container.encode(appId, forKey: .appId) } } } // @DataContract(Name="FormInput") public class FormInput : Codable { /** * Field Name of the Input Field */ // @DataMember // @ApiMember(DataType="string", Description="Field Name of the Input Field", IsRequired=true, Name="Key", ParameterType="query") public var key:String /** * Value of the Input Field. */ // @DataMember // @ApiMember(DataType="string", Description="Value of the Input Field.", IsRequired=true, Name="Value", ParameterType="query") public var value:String /** * Whether or not the field is encryped with the C2B encryption key. */ // @DataMember // @ApiMember(DataType="boolean", Description="Whether or not the field is encryped with the C2B encryption key.", IsRequired=true, Name="Encrypted", ParameterType="query") public var encrypted:Bool required public init(){} } // @DataContract public class LicenseInfo : Codable { // @DataMember public var number:String // @DataMember public var height:String // @DataMember public var weight:String // @DataMember public var hair:String // @DataMember public var eyes:String // @DataMember public var expiration:String // @DataMember public var birthday:String // @DataMember public var ethnicity:String // @DataMember public var gender:String // @DataMember public var state:String required public init(){} } // @DataContract public class BaseResponse : Codable { /** * */ // @DataMember // @ApiMember(DataType="BaseResponseResult", Description="", Name="Status", ParameterType="body") public var status:BaseResponseResult required public init(){} }