/* Options: Date: 2024-11-24 14:59:04 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: CheckBookingStatusRequest.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/scheduling/booking-status-check", "GET") public class CheckBookingStatusRequest : CheckClassBookingStatusRequestDto, IReturn, IRestrictedApiRequest { public typealias Return = CheckBookingStatusResponse /** * 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 /** * Chain ID */ // @ApiMember(DataType="integer", Description="Chain ID", Name="ChainId", ParameterType="query") public var chainId:Int? /** * Store ID */ // @ApiMember(DataType="integer", Description="Store ID", Name="StoreId", ParameterType="query") public var storeId:Int? /** * ClubReady Class Schedule ID */ // @ApiMember(DataType="integer", Description="ClubReady Class Schedule ID", IsRequired=true, Name="ClassScheduleId", ParameterType="query") public var classScheduleId:Int /** * ClubReady User ID */ // @ApiMember(DataType="integer", Description="ClubReady User ID", IsRequired=true, Name="UserId", ParameterType="query") public var userId:Int public var restrictedId:Int? public var restrictedResourceType:RestrictedResourceType required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case apiKey case chainId case storeId case classScheduleId case userId 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) chainId = try container.decodeIfPresent(Int.self, forKey: .chainId) storeId = try container.decodeIfPresent(Int.self, forKey: .storeId) classScheduleId = try container.decodeIfPresent(Int.self, forKey: .classScheduleId) userId = try container.decodeIfPresent(Int.self, forKey: .userId) 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 chainId != nil { try container.encode(chainId, forKey: .chainId) } if storeId != nil { try container.encode(storeId, forKey: .storeId) } if classScheduleId != nil { try container.encode(classScheduleId, forKey: .classScheduleId) } if userId != nil { try container.encode(userId, forKey: .userId) } if restrictedId != nil { try container.encode(restrictedId, forKey: .restrictedId) } if restrictedResourceType != nil { try container.encode(restrictedResourceType, forKey: .restrictedResourceType) } } } public class CheckBookingStatusResponse : CheckBookingStatusResponseDto { public var success:Bool public var message:String public var canBook:Bool public var consumesCredit:Bool public var source:String public var availableCredits:Int public var isBooked:Bool public var isWaitListed:Bool public var cancelHours:Int public var leadTime:Int public var maxLeadTime:Int? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case success case message case canBook case consumesCredit case source case availableCredits case isBooked case isWaitListed case cancelHours case leadTime case maxLeadTime } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) success = try container.decodeIfPresent(Bool.self, forKey: .success) message = try container.decodeIfPresent(String.self, forKey: .message) canBook = try container.decodeIfPresent(Bool.self, forKey: .canBook) consumesCredit = try container.decodeIfPresent(Bool.self, forKey: .consumesCredit) source = try container.decodeIfPresent(String.self, forKey: .source) availableCredits = try container.decodeIfPresent(Int.self, forKey: .availableCredits) isBooked = try container.decodeIfPresent(Bool.self, forKey: .isBooked) isWaitListed = try container.decodeIfPresent(Bool.self, forKey: .isWaitListed) cancelHours = try container.decodeIfPresent(Int.self, forKey: .cancelHours) leadTime = try container.decodeIfPresent(Int.self, forKey: .leadTime) maxLeadTime = try container.decodeIfPresent(Int.self, forKey: .maxLeadTime) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if success != nil { try container.encode(success, forKey: .success) } if message != nil { try container.encode(message, forKey: .message) } if canBook != nil { try container.encode(canBook, forKey: .canBook) } if consumesCredit != nil { try container.encode(consumesCredit, forKey: .consumesCredit) } if source != nil { try container.encode(source, forKey: .source) } if availableCredits != nil { try container.encode(availableCredits, forKey: .availableCredits) } if isBooked != nil { try container.encode(isBooked, forKey: .isBooked) } if isWaitListed != nil { try container.encode(isWaitListed, forKey: .isWaitListed) } if cancelHours != nil { try container.encode(cancelHours, forKey: .cancelHours) } if leadTime != nil { try container.encode(leadTime, forKey: .leadTime) } if maxLeadTime != nil { try container.encode(maxLeadTime, forKey: .maxLeadTime) } } } 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 CheckClassBookingStatusRequestDto : ApiDtoBase { public var classScheduleId:Int public var userId:Int required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case classScheduleId case userId } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) classScheduleId = try container.decodeIfPresent(Int.self, forKey: .classScheduleId) userId = try container.decodeIfPresent(Int.self, forKey: .userId) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if classScheduleId != nil { try container.encode(classScheduleId, forKey: .classScheduleId) } if userId != nil { try container.encode(userId, forKey: .userId) } } } public class ApiDtoBase : Codable { public var apiKey:String public var storeId:Int? public var chainId:Int? required public init(){} } public class CheckBookingStatusResponseDto : ApiResponseBase { public var canBook:Bool public var consumesCredit:Bool public var source:String public var availableCredits:Int public var isBooked:Bool public var isWaitListed:Bool public var cancelHours:Int public var leadTime:Int public var maxLeadTime:Int? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case canBook case consumesCredit case source case availableCredits case isBooked case isWaitListed case cancelHours case leadTime case maxLeadTime } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) canBook = try container.decodeIfPresent(Bool.self, forKey: .canBook) consumesCredit = try container.decodeIfPresent(Bool.self, forKey: .consumesCredit) source = try container.decodeIfPresent(String.self, forKey: .source) availableCredits = try container.decodeIfPresent(Int.self, forKey: .availableCredits) isBooked = try container.decodeIfPresent(Bool.self, forKey: .isBooked) isWaitListed = try container.decodeIfPresent(Bool.self, forKey: .isWaitListed) cancelHours = try container.decodeIfPresent(Int.self, forKey: .cancelHours) leadTime = try container.decodeIfPresent(Int.self, forKey: .leadTime) maxLeadTime = try container.decodeIfPresent(Int.self, forKey: .maxLeadTime) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if canBook != nil { try container.encode(canBook, forKey: .canBook) } if consumesCredit != nil { try container.encode(consumesCredit, forKey: .consumesCredit) } if source != nil { try container.encode(source, forKey: .source) } if availableCredits != nil { try container.encode(availableCredits, forKey: .availableCredits) } if isBooked != nil { try container.encode(isBooked, forKey: .isBooked) } if isWaitListed != nil { try container.encode(isWaitListed, forKey: .isWaitListed) } if cancelHours != nil { try container.encode(cancelHours, forKey: .cancelHours) } if leadTime != nil { try container.encode(leadTime, forKey: .leadTime) } if maxLeadTime != nil { try container.encode(maxLeadTime, forKey: .maxLeadTime) } } } public class ApiResponseBase : Codable { public var success:Bool public var message:String required public init(){} }