/* Options: Date: 2025-12-11 09:29:02 SwiftVersion: 5.0 Version: 8.0 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://reservation.api.dev.86degrees.com //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: GetFacilitySchedule.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack public class GetFacilitySchedule : ApiServiceRequest, IReturn { public typealias Return = GetFacilityScheduleResponse public var facilityId:Int public var start:Date public var end:Date required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case facilityId case start case end } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) facilityId = try container.decodeIfPresent(Int.self, forKey: .facilityId) start = try container.decodeIfPresent(Date.self, forKey: .start) end = try container.decodeIfPresent(Date.self, forKey: .end) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if facilityId != nil { try container.encode(facilityId, forKey: .facilityId) } if start != nil { try container.encode(start, forKey: .start) } if end != nil { try container.encode(end, forKey: .end) } } } public class GetFacilityScheduleResponse : ApiServiceResponse { public var schedule:[ScheduleDayData] = [] public var bookAheadMaxDate:String public var openHour:Int public var closeHour:Int public var duration:Int public var isCoordinator:Bool public var facilityTimeOffset:Int public var facility:FacilityData public var venueName:String public var allowGuests:Bool public var allowExtraRequirements:Bool public var allowBookingInProgress:Bool required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case schedule case bookAheadMaxDate case openHour case closeHour case duration case isCoordinator case facilityTimeOffset case facility case venueName case allowGuests case allowExtraRequirements case allowBookingInProgress } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) schedule = try container.decodeIfPresent([ScheduleDayData].self, forKey: .schedule) ?? [] bookAheadMaxDate = try container.decodeIfPresent(String.self, forKey: .bookAheadMaxDate) openHour = try container.decodeIfPresent(Int.self, forKey: .openHour) closeHour = try container.decodeIfPresent(Int.self, forKey: .closeHour) duration = try container.decodeIfPresent(Int.self, forKey: .duration) isCoordinator = try container.decodeIfPresent(Bool.self, forKey: .isCoordinator) facilityTimeOffset = try container.decodeIfPresent(Int.self, forKey: .facilityTimeOffset) facility = try container.decodeIfPresent(FacilityData.self, forKey: .facility) venueName = try container.decodeIfPresent(String.self, forKey: .venueName) allowGuests = try container.decodeIfPresent(Bool.self, forKey: .allowGuests) allowExtraRequirements = try container.decodeIfPresent(Bool.self, forKey: .allowExtraRequirements) allowBookingInProgress = try container.decodeIfPresent(Bool.self, forKey: .allowBookingInProgress) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if schedule.count > 0 { try container.encode(schedule, forKey: .schedule) } if bookAheadMaxDate != nil { try container.encode(bookAheadMaxDate, forKey: .bookAheadMaxDate) } if openHour != nil { try container.encode(openHour, forKey: .openHour) } if closeHour != nil { try container.encode(closeHour, forKey: .closeHour) } if duration != nil { try container.encode(duration, forKey: .duration) } if isCoordinator != nil { try container.encode(isCoordinator, forKey: .isCoordinator) } if facilityTimeOffset != nil { try container.encode(facilityTimeOffset, forKey: .facilityTimeOffset) } if facility != nil { try container.encode(facility, forKey: .facility) } if venueName != nil { try container.encode(venueName, forKey: .venueName) } if allowGuests != nil { try container.encode(allowGuests, forKey: .allowGuests) } if allowExtraRequirements != nil { try container.encode(allowExtraRequirements, forKey: .allowExtraRequirements) } if allowBookingInProgress != nil { try container.encode(allowBookingInProgress, forKey: .allowBookingInProgress) } } } public class SlotData : Codable { public var start:String public var end:String public var status:SlotStatus public var bookingId:Int public var remindStart:Bool public var remind30Mins:Bool public var remind1Hour:Bool public var remind6Hours:Bool public var remind12Hours:Bool public var remind1Day:Bool public var remind1Week:Bool public var billableAmount:Double public var bookedByName:String public var billableHours:Double public var slotLength:Double public var userData:GuestData public var extraRequirements:String required public init(){} } public class GuestData : Codable { public var name:String public var emailAddress:String public var mobileNumber:String public var userCustomFields:[UserCustomFieldData] = [] public var isAlreadyUser:Bool public var systemUserId:Int required public init(){} } public class ApiServiceRequest : IServiceRequest, IHasApiKey, IHasDeviceInfo, Codable { /** * The API Key required for authentication */ // @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true) public var apiKey:String /** * Latitude of the user making this request */ // @ApiMember(DataType="double", Description="Latitude of the user making this request") public var latitude:Double /** * Longitude of the user making this request */ // @ApiMember(DataType="double", Description="Longitude of the user making this request") public var longitude:Double required public init(){} } public protocol IServiceRequest { } public protocol IHasApiKey { var apiKey:String { get set } } public protocol IHasDeviceInfo { } public class UserCustomFieldData : Codable { public var id:String public var value:String public var name:String public var optional:Bool required public init(){} } public class FacilityData : Codable { public var facilityId:Int public var facilityGuid:String public var name:String public var Description:String public var nextAvailable:String public var hasNextAvailable:Bool public var rates:[RatesItem] = [] public var themeColor:String public var bookingNotes:String public var leadTime:Int public var venueId:Int public var allowExtraRequirements:Bool required public init(){} } public class ScheduleDayData : Codable { public var date:String public var slots:[SlotData] = [] required public init(){} } public enum SlotStatus : Int, Codable { case Available = 0 case Closed = 1 case Booked = 2 case UserBooked = 3 case GroupBooked = 4 case ToBook = 5 } public class RatesItem : Codable { public var rate:Double public var minutes:Int required public init(){} } public class ApiServiceResponse : IServiceResponse, Codable { public var Description:String public var heading:String public var wasSuccessful:Bool //modelState:Object ignored. Type could not be extended in Swift required public init(){} }