/* Options: Date: 2025-12-06 08:56:03 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: DebriefReviewListRequest.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/debriefreview/list", "POST") public class DebriefReviewListRequest : ApiSkipTakePagedTableRequest, IReturn { public typealias Return = DebriefReviewListResponse public var all:Bool public var dateCaptured:DateFilter public var readStatus:DebriefReadStatusType required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case all case dateCaptured case readStatus } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) all = try container.decodeIfPresent(Bool.self, forKey: .all) dateCaptured = try container.decodeIfPresent(DateFilter.self, forKey: .dateCaptured) readStatus = try container.decodeIfPresent(DebriefReadStatusType.self, forKey: .readStatus) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if all != nil { try container.encode(all, forKey: .all) } if dateCaptured != nil { try container.encode(dateCaptured, forKey: .dateCaptured) } if readStatus != nil { try container.encode(readStatus, forKey: .readStatus) } } } public class DebriefReviewListResponse : SkipTakePagedTableListResponse { public var readStatuses:[EnumOption] = [] required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case readStatuses } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) readStatuses = try container.decodeIfPresent([EnumOption].self, forKey: .readStatuses) ?? [] } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if readStatuses.count > 0 { try container.encode(readStatuses, forKey: .readStatuses) } } } public class DateFilter : Codable { public var filterType:DateFilterType public var dates:[Date] = [] required public init(){} } public enum DebriefReadStatusType : Int, Codable { case All = 0 case Unread = 1 case Read = 2 } public class ApiSkipTakePagedTableRequest : ApiSkipTakePagedServiceRequest, IOrderKey { public var requestNumber:Int public var searchQuery:String public var orderKey:String public var orderAscending:Bool required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case requestNumber case searchQuery case orderKey case orderAscending } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) requestNumber = try container.decodeIfPresent(Int.self, forKey: .requestNumber) searchQuery = try container.decodeIfPresent(String.self, forKey: .searchQuery) orderKey = try container.decodeIfPresent(String.self, forKey: .orderKey) orderAscending = try container.decodeIfPresent(Bool.self, forKey: .orderAscending) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if requestNumber != nil { try container.encode(requestNumber, forKey: .requestNumber) } if searchQuery != nil { try container.encode(searchQuery, forKey: .searchQuery) } if orderKey != nil { try container.encode(orderKey, forKey: .orderKey) } if orderAscending != nil { try container.encode(orderAscending, forKey: .orderAscending) } } } public protocol ISkipTakePagedServiceRequest { var skip:Int { get set } var take:Int { get set } } public protocol IOrderKey { var orderKey:String { get set } var orderAscending:Bool { get set } } public class EnumOption : Codable { public var value:Int public var label:String required public init(){} } public class DebriefReviewListItem : Codable { public var id:Int public var submittedBy:String public var companyName:String public var meetingSubject:String public var dateSubmitted:String public var overallScore:String public var generalManagerId:Int public var generalManagerReviewed:Bool public var generalManagerRating:Int public var seniorManagerId:Int public var seniorManagerReviewed:Bool public var seniorManagerRating:Int public var divisionalManagerId:Int public var divisionalManagerReviewed:Bool public var divisionalManagerRating:Int public var departmentManagerId:Int public var departmentManagerReviewed:Bool public var departmentManagerRating:Int public var managerId:Int public var managerReviewed:Bool public var managerRating:Int public var campaignManagerId:Int public var campaignManagerReviewed:Bool public var campaignManagerRating:Int public var portfolioManagerId:Int public var portfolioManagerReviewed:Bool public var portfolioManagerRating:Int public var age:Double public var ageColour:String public var markedAsRead:Bool required public init(){} } public class SkipTakePagedTableListResponse : ApiSkipTakePagedTableResponse { public var listItems:[T] = [] required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case listItems } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) listItems = try container.decodeIfPresent([T].self, forKey: .listItems) ?? [] } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if listItems.count > 0 { try container.encode(listItems, forKey: .listItems) } } } public protocol ISkipTakePagedServiceResponse { var total:Int { get set } } public enum DateFilterType : Int, Codable { case All = 0 case Before = 1 case After = 2 case Range = 3 } public class ApiSkipTakePagedServiceRequest : ISkipTakePagedServiceRequest, Codable { public var skip:Int public var take:Int required public init(){} } public class ApiSkipTakePagedTableResponse : SkipTakePagedServiceResponse { public var requestNumber:Int required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case requestNumber } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) requestNumber = try container.decodeIfPresent(Int.self, forKey: .requestNumber) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if requestNumber != nil { try container.encode(requestNumber, forKey: .requestNumber) } } } public class SkipTakePagedServiceResponse : ApiServiceResponse, ISkipTakePagedServiceResponse, ISkipTakePagedServiceRequest { public var total:Int public var skip:Int public var take:Int required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case total case skip case take } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) total = try container.decodeIfPresent(Int.self, forKey: .total) skip = try container.decodeIfPresent(Int.self, forKey: .skip) take = try container.decodeIfPresent(Int.self, forKey: .take) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if total != nil { try container.encode(total, forKey: .total) } if skip != nil { try container.encode(skip, forKey: .skip) } if take != nil { try container.encode(take, forKey: .take) } } } 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(){} }