/* Options: Date: 2025-05-10 03:03:16 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: MobileRegistrationRequest.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack /** * MobileRegistrationRequires active-e AIMMobile */ // @Route("/MobileRegistration", "POST") // @DataContract public class MobileRegistrationRequest : BaseRequest, IReturn { public typealias Return = MobileRegistrationResponse // @DataMember public var name:String // @DataMember public var phone:String // @DataMember public var company:String // @DataMember public var address1:String // @DataMember public var address2:String // @DataMember public var city:String // @DataMember public var state:String // @DataMember public var email:String // @DataMember public var zip:String // @DataMember public var password:String /** * Should be Register or Confirm */ // @DataMember // @ApiMember(DataType="string", Description="Should be Register or Confirm", IsRequired=true, Name="Action", ParameterType="query") public var action:String // @DataMember public var passwordToken:String // @DataMember public var optIn1:Bool // @DataMember public var optIn2:Bool // @DataMember public var optIn3:Bool required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case name case phone case company case address1 case address2 case city case state case email case zip case password case action case passwordToken case optIn1 case optIn2 case optIn3 } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) name = try container.decodeIfPresent(String.self, forKey: .name) phone = try container.decodeIfPresent(String.self, forKey: .phone) company = try container.decodeIfPresent(String.self, forKey: .company) 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) email = try container.decodeIfPresent(String.self, forKey: .email) zip = try container.decodeIfPresent(String.self, forKey: .zip) password = try container.decodeIfPresent(String.self, forKey: .password) action = try container.decodeIfPresent(String.self, forKey: .action) passwordToken = try container.decodeIfPresent(String.self, forKey: .passwordToken) optIn1 = try container.decodeIfPresent(Bool.self, forKey: .optIn1) optIn2 = try container.decodeIfPresent(Bool.self, forKey: .optIn2) optIn3 = try container.decodeIfPresent(Bool.self, forKey: .optIn3) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if name != nil { try container.encode(name, forKey: .name) } if phone != nil { try container.encode(phone, forKey: .phone) } if company != nil { try container.encode(company, forKey: .company) } 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 email != nil { try container.encode(email, forKey: .email) } if zip != nil { try container.encode(zip, forKey: .zip) } if password != nil { try container.encode(password, forKey: .password) } if action != nil { try container.encode(action, forKey: .action) } if passwordToken != nil { try container.encode(passwordToken, forKey: .passwordToken) } if optIn1 != nil { try container.encode(optIn1, forKey: .optIn1) } if optIn2 != nil { try container.encode(optIn2, forKey: .optIn2) } if optIn3 != nil { try container.encode(optIn3, forKey: .optIn3) } } } // @DataContract public class MobileRegistrationResponse : 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 BaseResponse : Codable { /** * */ // @DataMember // @ApiMember(DataType="BaseResponseResult", Description="", Name="Status", ParameterType="body") public var status:BaseResponseResult required public init(){} }