/* Options: Date: 2024-11-24 13:44:16 SwiftVersion: 5.0 Version: 6.50 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://clubready.com/api/current //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: CreateProspectRequestV2.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/v2/{ApiKey}/club/{StoreId}/prospect", "POST") public class CreateProspectRequestV2 : CreateProspectRequestV2Dto, IRestrictedApiRequest { /** * Api Key - grants access to resources */ // @ApiMember(DataType="string", Description="Api Key - grants access to resources", IsRequired=true, Name="ApiKey", ParameterType="query") public var apiKey:String /** * ClubReady Club ID (StoreID internally) */ // @ApiMember(DataType="integer", Description="ClubReady Club ID (StoreID internally)", IsRequired=true, Name="StoreId", ParameterType="query") public var storeId:Int? /** * First Name */ // @ApiMember(DataType="string", Description="First Name", IsRequired=true, Name="FirstName", ParameterType="query") public var firstName:String /** * Last Name */ // @ApiMember(DataType="string", Description="Last Name", IsRequired=true, Name="LastName", ParameterType="query") public var lastName:String /** * Email Address */ // @ApiMember(DataType="string", Description="Email Address", IsRequired=true, Name="Email", ParameterType="query") public var email:String /** * Gender */ // @ApiMember(DataType="string", Description="Gender", Name="Gender", ParameterType="query") public var gender:String /** * Address */ // @ApiMember(DataType="string", Description="Address", Name="Address", ParameterType="query") public var address:String /** * City */ // @ApiMember(DataType="string", Description="City", Name="City", ParameterType="query") public var city:String // @ApiMember(DataType="string", Name="State", ParameterType="query") public var state:String // @ApiMember(DataType="string", Name="Zip", ParameterType="query") public var zip:String public var phone:String public var workPhone:String public var dateOfBirth:Date? public var cellPhone:String /** * Specify a Package to apply to the new prospect */ // @ApiMember(DataType="integer", Description="Specify a Package to apply to the new prospect", Name="AddPackageId", ParameterType="query") public var addPackageId:Int? /** * Specify a specific Prospect Type for the new prospect */ // @ApiMember(DataType="integer", Description="Specify a specific Prospect Type for the new prospect", Name="ProspectTypeId", ParameterType="query") public var prospectTypeId:Int? /** * Specify a specific Referral Type for the new prospect */ // @ApiMember(DataType="integer", Description="Specify a specific Referral Type for the new prospect", Name="ReferralTypeId", ParameterType="query") public var referralTypeId:Int? /** * Send a Welcome email to the new prospect */ // @ApiMember(DataType="boolean", Description="Send a Welcome email to the new prospect", IsRequired=true, Name="SendEmail", ParameterType="query") public var sendEmail:Bool /** * Only used if SendEmail = True */ // @ApiMember(DataType="integer", Description="Only used if SendEmail = True", Name="EmailTemplateId", ParameterType="query") public var emailTemplateId:Int? /** * */ // @ApiMember(DataType="string", Description="", Name="Coupon", ParameterType="query") public var coupon:String /** * Add an internal note for the new prospect */ // @ApiMember(DataType="string", Description="Add an internal note for the new prospect", Name="Note", ParameterType="query") public var note:String public var restrictedId:Int? public var restrictedResourceType:RestrictedResourceType required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case apiKey case storeId case firstName case lastName case email case gender case address case city case state case zip case phone case workPhone case dateOfBirth case cellPhone case addPackageId case prospectTypeId case referralTypeId case sendEmail case emailTemplateId case coupon case note case restrictedId case restrictedResourceType } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) apiKey = try container.decodeIfPresent(String.self, forKey: .apiKey) storeId = try container.decodeIfPresent(Int.self, forKey: .storeId) firstName = try container.decodeIfPresent(String.self, forKey: .firstName) lastName = try container.decodeIfPresent(String.self, forKey: .lastName) email = try container.decodeIfPresent(String.self, forKey: .email) gender = try container.decodeIfPresent(String.self, forKey: .gender) address = try container.decodeIfPresent(String.self, forKey: .address) city = try container.decodeIfPresent(String.self, forKey: .city) state = try container.decodeIfPresent(String.self, forKey: .state) zip = try container.decodeIfPresent(String.self, forKey: .zip) phone = try container.decodeIfPresent(String.self, forKey: .phone) workPhone = try container.decodeIfPresent(String.self, forKey: .workPhone) dateOfBirth = try container.decodeIfPresent(Date.self, forKey: .dateOfBirth) cellPhone = try container.decodeIfPresent(String.self, forKey: .cellPhone) addPackageId = try container.decodeIfPresent(Int.self, forKey: .addPackageId) prospectTypeId = try container.decodeIfPresent(Int.self, forKey: .prospectTypeId) referralTypeId = try container.decodeIfPresent(Int.self, forKey: .referralTypeId) sendEmail = try container.decodeIfPresent(Bool.self, forKey: .sendEmail) emailTemplateId = try container.decodeIfPresent(Int.self, forKey: .emailTemplateId) coupon = try container.decodeIfPresent(String.self, forKey: .coupon) note = try container.decodeIfPresent(String.self, forKey: .note) restrictedId = try container.decodeIfPresent(Int.self, forKey: .restrictedId) restrictedResourceType = try container.decodeIfPresent(RestrictedResourceType.self, forKey: .restrictedResourceType) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if apiKey != nil { try container.encode(apiKey, forKey: .apiKey) } if storeId != nil { try container.encode(storeId, forKey: .storeId) } if firstName != nil { try container.encode(firstName, forKey: .firstName) } if lastName != nil { try container.encode(lastName, forKey: .lastName) } if email != nil { try container.encode(email, forKey: .email) } if gender != nil { try container.encode(gender, forKey: .gender) } if address != nil { try container.encode(address, forKey: .address) } 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 phone != nil { try container.encode(phone, forKey: .phone) } if workPhone != nil { try container.encode(workPhone, forKey: .workPhone) } if dateOfBirth != nil { try container.encode(dateOfBirth, forKey: .dateOfBirth) } if cellPhone != nil { try container.encode(cellPhone, forKey: .cellPhone) } if addPackageId != nil { try container.encode(addPackageId, forKey: .addPackageId) } if prospectTypeId != nil { try container.encode(prospectTypeId, forKey: .prospectTypeId) } if referralTypeId != nil { try container.encode(referralTypeId, forKey: .referralTypeId) } if sendEmail != nil { try container.encode(sendEmail, forKey: .sendEmail) } if emailTemplateId != nil { try container.encode(emailTemplateId, forKey: .emailTemplateId) } if coupon != nil { try container.encode(coupon, forKey: .coupon) } if note != nil { try container.encode(note, forKey: .note) } if restrictedId != nil { try container.encode(restrictedId, forKey: .restrictedId) } if restrictedResourceType != nil { try container.encode(restrictedResourceType, forKey: .restrictedResourceType) } } } public enum RestrictedResourceType : String, Codable { case Store case Chain case User case Undefined } public protocol IRestrictedApiRequest : IApiKeyEndpoint { var restrictedId:Int? { get set } var restrictedResourceType:RestrictedResourceType { get set } } public protocol IApiKeyEndpoint { var apiKey:String { get set } } public class ApiDtoBase : Codable { public var apiKey:String public var storeId:Int? public var chainId:Int? required public init(){} } public class CreateProspectRequestV2Dto : ApiDtoBase { public var firstName:String public var lastName:String public var address:String public var city:String public var state:String public var zip:String public var email:String public var gender:String public var addPackageId:Int? public var prospectTypeId:Int? public var referralTypeId:Int? public var sendEmail:Bool public var phone:String public var workPhone:String public var dateOfBirth:Date? public var cellPhone:String public var coupon:String public var note:String public var emailTemplateId:Int? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case firstName case lastName case address case city case state case zip case email case gender case addPackageId case prospectTypeId case referralTypeId case sendEmail case phone case workPhone case dateOfBirth case cellPhone case coupon case note case emailTemplateId } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) firstName = try container.decodeIfPresent(String.self, forKey: .firstName) lastName = try container.decodeIfPresent(String.self, forKey: .lastName) address = try container.decodeIfPresent(String.self, forKey: .address) city = try container.decodeIfPresent(String.self, forKey: .city) state = try container.decodeIfPresent(String.self, forKey: .state) zip = try container.decodeIfPresent(String.self, forKey: .zip) email = try container.decodeIfPresent(String.self, forKey: .email) gender = try container.decodeIfPresent(String.self, forKey: .gender) addPackageId = try container.decodeIfPresent(Int.self, forKey: .addPackageId) prospectTypeId = try container.decodeIfPresent(Int.self, forKey: .prospectTypeId) referralTypeId = try container.decodeIfPresent(Int.self, forKey: .referralTypeId) sendEmail = try container.decodeIfPresent(Bool.self, forKey: .sendEmail) phone = try container.decodeIfPresent(String.self, forKey: .phone) workPhone = try container.decodeIfPresent(String.self, forKey: .workPhone) dateOfBirth = try container.decodeIfPresent(Date.self, forKey: .dateOfBirth) cellPhone = try container.decodeIfPresent(String.self, forKey: .cellPhone) coupon = try container.decodeIfPresent(String.self, forKey: .coupon) note = try container.decodeIfPresent(String.self, forKey: .note) emailTemplateId = try container.decodeIfPresent(Int.self, forKey: .emailTemplateId) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if firstName != nil { try container.encode(firstName, forKey: .firstName) } if lastName != nil { try container.encode(lastName, forKey: .lastName) } if address != nil { try container.encode(address, forKey: .address) } 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 email != nil { try container.encode(email, forKey: .email) } if gender != nil { try container.encode(gender, forKey: .gender) } if addPackageId != nil { try container.encode(addPackageId, forKey: .addPackageId) } if prospectTypeId != nil { try container.encode(prospectTypeId, forKey: .prospectTypeId) } if referralTypeId != nil { try container.encode(referralTypeId, forKey: .referralTypeId) } if sendEmail != nil { try container.encode(sendEmail, forKey: .sendEmail) } if phone != nil { try container.encode(phone, forKey: .phone) } if workPhone != nil { try container.encode(workPhone, forKey: .workPhone) } if dateOfBirth != nil { try container.encode(dateOfBirth, forKey: .dateOfBirth) } if cellPhone != nil { try container.encode(cellPhone, forKey: .cellPhone) } if coupon != nil { try container.encode(coupon, forKey: .coupon) } if note != nil { try container.encode(note, forKey: .note) } if emailTemplateId != nil { try container.encode(emailTemplateId, forKey: .emailTemplateId) } } }