/* Options: Date: 2025-05-10 01:27:48 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: GetTimeSlotsRequest.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack /** * GetTimeSlotsRequires active-e Contracts Service, active-e Service Ticket Service, active-e Lesson Scheduling Service, active-e Vortx E-Commerce Service, or active-e 3rd Party E-Commerce Service */ // @Route("/GetTimeSlots", "POST, GET") // @DataContract public class GetTimeSlotsRequest : BaseRequest, IReturn { public typealias Return = GetTimeSlotsResponse // @DataMember public var dateFrom:Date // @DataMember public var dateTo:Date // @DataMember public var timeFrom:Date? // @DataMember public var timeTo:Date? // @DataMember public var location:String // @DataMember public var showOpenSlots:Bool? // @DataMember public var showReservedSlots:Bool? /** * If sent, only Time Slots of the sent type are returned. Valid options are STORE and DELIVERY. */ // @DataMember // @ApiMember(DataType="string", Description="If sent, only Time Slots of the sent type are returned. Valid options are STORE and DELIVERY.", Name="Type", ParameterType="query") public var type:String required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case dateFrom case dateTo case timeFrom case timeTo case location case showOpenSlots case showReservedSlots case type } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) dateFrom = try container.decodeIfPresent(Date.self, forKey: .dateFrom) dateTo = try container.decodeIfPresent(Date.self, forKey: .dateTo) timeFrom = try container.decodeIfPresent(Date.self, forKey: .timeFrom) timeTo = try container.decodeIfPresent(Date.self, forKey: .timeTo) location = try container.decodeIfPresent(String.self, forKey: .location) showOpenSlots = try container.decodeIfPresent(Bool.self, forKey: .showOpenSlots) showReservedSlots = try container.decodeIfPresent(Bool.self, forKey: .showReservedSlots) type = try container.decodeIfPresent(String.self, forKey: .type) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if dateFrom != nil { try container.encode(dateFrom, forKey: .dateFrom) } if dateTo != nil { try container.encode(dateTo, forKey: .dateTo) } if timeFrom != nil { try container.encode(timeFrom, forKey: .timeFrom) } if timeTo != nil { try container.encode(timeTo, forKey: .timeTo) } if location != nil { try container.encode(location, forKey: .location) } if showOpenSlots != nil { try container.encode(showOpenSlots, forKey: .showOpenSlots) } if showReservedSlots != nil { try container.encode(showReservedSlots, forKey: .showReservedSlots) } if type != nil { try container.encode(type, forKey: .type) } } } // @DataContract public class GetTimeSlotsResponse : BaseResponse { // @DataMember public var timeSlots:[TimeSlotGeneric] = [] required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case timeSlots } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) timeSlots = try container.decodeIfPresent([TimeSlotGeneric].self, forKey: .timeSlots) ?? [] } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if timeSlots.count > 0 { try container.encode(timeSlots, forKey: .timeSlots) } } } // @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 TimeSlotGeneric : Codable { // @DataMember public var id:Int // @DataMember public var dateTime:Date // @DataMember public var slotsOpen:Int // @DataMember public var location:String // @DataMember public var type: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(){} }