/* Options: Date: 2025-12-06 08:56:06 SwiftVersion: 5.0 Version: 8.0 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://cochraneplus-api-dev.happen.zone //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: GetAllMeetings.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/user/meetings", "GET") public class GetAllMeetings : ApiServiceRequest, IReturn { public typealias Return = GetAllMeetingsResponse // @ApiMember(IsRequired=true) public var date:String public var dashboard:Bool required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case date case dashboard } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) date = try container.decodeIfPresent(String.self, forKey: .date) dashboard = try container.decodeIfPresent(Bool.self, forKey: .dashboard) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if date != nil { try container.encode(date, forKey: .date) } if dashboard != nil { try container.encode(dashboard, forKey: .dashboard) } } } public class GetAllMeetingsResponse : ApiServiceResponse { public var startLatitude:Double public var startLongitude:Double public var endLatitude:Double public var endLongitude:Double public var meetingGroups:[MeetingGroupData] = [] public var nextMeeting:MeetingData public var arrivalStatusEnum:ArrivalStatusEnum required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case startLatitude case startLongitude case endLatitude case endLongitude case meetingGroups case nextMeeting case arrivalStatusEnum } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) startLatitude = try container.decodeIfPresent(Double.self, forKey: .startLatitude) startLongitude = try container.decodeIfPresent(Double.self, forKey: .startLongitude) endLatitude = try container.decodeIfPresent(Double.self, forKey: .endLatitude) endLongitude = try container.decodeIfPresent(Double.self, forKey: .endLongitude) meetingGroups = try container.decodeIfPresent([MeetingGroupData].self, forKey: .meetingGroups) ?? [] nextMeeting = try container.decodeIfPresent(MeetingData.self, forKey: .nextMeeting) arrivalStatusEnum = try container.decodeIfPresent(ArrivalStatusEnum.self, forKey: .arrivalStatusEnum) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if startLatitude != nil { try container.encode(startLatitude, forKey: .startLatitude) } if startLongitude != nil { try container.encode(startLongitude, forKey: .startLongitude) } if endLatitude != nil { try container.encode(endLatitude, forKey: .endLatitude) } if endLongitude != nil { try container.encode(endLongitude, forKey: .endLongitude) } if meetingGroups.count > 0 { try container.encode(meetingGroups, forKey: .meetingGroups) } if nextMeeting != nil { try container.encode(nextMeeting, forKey: .nextMeeting) } if arrivalStatusEnum != nil { try container.encode(arrivalStatusEnum, forKey: .arrivalStatusEnum) } } } 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 MeetingData : Codable { public var meetingId:Int public var startTime:String public var arrivalTime:String public var leftTime:String public var duration:String public var showTimeFields:Bool public var arrivalStatus:String public var email:String public var hasEmail:Bool public var contactName:String public var latitude:Double public var longitude:Double public var location:String public var address:String public var subject:String public var Description:String public var endTime:String public var company:String public var contactNumber:String public var hasContactNumber:Bool public var hasLocation:Bool public var setBy:String public var virtualOrInPerson:String required public init(){} } public class MeetingGroupData : Codable { public var time:String public var meetings:[MeetingData] = [] required public init(){} } public enum ArrivalStatusEnum : Int, Codable { case Unknown = 0 case OnTime = 1 case Late = 2 } 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(){} }