/* Options: Date: 2025-05-10 02:07:52 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: AddContactRecordRequest.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack /** * AddContactRecord web service. */ // @Route("/AddContactRecord", "POST") // @DataContract public class AddContactRecordRequest : BaseSecureRequest, IReturn { public typealias Return = AddContactRecordResponse // @DataMember public var contact:String // @DataMember public var customerAcct:Int // @DataMember public var actionId:Int // @DataMember public var actionDate:Date? // @DataMember public var popUp:Bool // @DataMember public var topicId:Int? // @DataMember public var closed:Bool // @DataMember public var closedDate:Date? // @DataMember public var colorValue:Int // @DataMember public var overrideLanID:String // @DataMember public var formattedNotes:Bool // @DataMember public var note1:String // @DataMember public var note2:String // @DataMember public var note3:String // @DataMember public var attributes:[AttributeValuePair] = [] // @DataMember public var attachments:[FileAttachment] = [] required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case contact case customerAcct case actionId case actionDate case popUp case topicId case closed case closedDate case colorValue case overrideLanID case formattedNotes case note1 case note2 case note3 case attributes case attachments } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) contact = try container.decodeIfPresent(String.self, forKey: .contact) customerAcct = try container.decodeIfPresent(Int.self, forKey: .customerAcct) actionId = try container.decodeIfPresent(Int.self, forKey: .actionId) actionDate = try container.decodeIfPresent(Date.self, forKey: .actionDate) popUp = try container.decodeIfPresent(Bool.self, forKey: .popUp) topicId = try container.decodeIfPresent(Int.self, forKey: .topicId) closed = try container.decodeIfPresent(Bool.self, forKey: .closed) closedDate = try container.decodeIfPresent(Date.self, forKey: .closedDate) colorValue = try container.decodeIfPresent(Int.self, forKey: .colorValue) overrideLanID = try container.decodeIfPresent(String.self, forKey: .overrideLanID) formattedNotes = try container.decodeIfPresent(Bool.self, forKey: .formattedNotes) note1 = try container.decodeIfPresent(String.self, forKey: .note1) note2 = try container.decodeIfPresent(String.self, forKey: .note2) note3 = try container.decodeIfPresent(String.self, forKey: .note3) attributes = try container.decodeIfPresent([AttributeValuePair].self, forKey: .attributes) ?? [] attachments = try container.decodeIfPresent([FileAttachment].self, forKey: .attachments) ?? [] } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if contact != nil { try container.encode(contact, forKey: .contact) } if customerAcct != nil { try container.encode(customerAcct, forKey: .customerAcct) } if actionId != nil { try container.encode(actionId, forKey: .actionId) } if actionDate != nil { try container.encode(actionDate, forKey: .actionDate) } if popUp != nil { try container.encode(popUp, forKey: .popUp) } if topicId != nil { try container.encode(topicId, forKey: .topicId) } if closed != nil { try container.encode(closed, forKey: .closed) } if closedDate != nil { try container.encode(closedDate, forKey: .closedDate) } if colorValue != nil { try container.encode(colorValue, forKey: .colorValue) } if overrideLanID != nil { try container.encode(overrideLanID, forKey: .overrideLanID) } if formattedNotes != nil { try container.encode(formattedNotes, forKey: .formattedNotes) } if note1 != nil { try container.encode(note1, forKey: .note1) } if note2 != nil { try container.encode(note2, forKey: .note2) } if note3 != nil { try container.encode(note3, forKey: .note3) } if attributes.count > 0 { try container.encode(attributes, forKey: .attributes) } if attachments.count > 0 { try container.encode(attachments, forKey: .attachments) } } } // @DataContract public class AddContactRecordResponse : BaseResponse { // @DataMember public var refNumber:String required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case refNumber } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) refNumber = try container.decodeIfPresent(String.self, forKey: .refNumber) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if refNumber != nil { try container.encode(refNumber, forKey: .refNumber) } } } // @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 public class AttributeValuePair : Codable { // @DataMember public var name:String // @DataMember public var value:String required public init(){} } // @DataContract public class FileAttachment : Codable { // @DataMember public var fileName:String // @DataMember public var base64Contents: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(){} }