/* Options: Date: 2025-12-06 05:23:52 SwiftVersion: 6.0 Version: 8.70 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://api.sbbet.ath.cx //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True //MakePropertiesOptional: True IncludeTypes: FindResponseMetrics.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: False //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/qry//metrics/e2e/slips/responses") public class FindResponseMetrics : PaginatedQuery, IReturn { public typealias Return = PaginatedResult public var resolution:TimeResolution? public var timepointFrom:Int? public var timepointTo:Int? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case resolution case timepointFrom case timepointTo } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) resolution = try container.decodeIfPresent(TimeResolution.self, forKey: .resolution) timepointFrom = try container.decodeIfPresent(Int.self, forKey: .timepointFrom) timepointTo = try container.decodeIfPresent(Int.self, forKey: .timepointTo) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if resolution != nil { try container.encode(resolution, forKey: .resolution) } if timepointFrom != nil { try container.encode(timepointFrom, forKey: .timepointFrom) } if timepointTo != nil { try container.encode(timepointTo, forKey: .timepointTo) } } } public class PaginatedResult : IPaginatedResult, Codable { public var data:[ResponseMetrics] = [] public var currentPage:Int? public var pageSize:Int? public var totalItems:Int? public var totalPages:Int? required public init(){} } public enum TimeResolution : Int, Codable { case Second = 1 case Minute = 2 case Hour = 5 case Day = 10 } public class PaginatedQuery : Codable { public var currentPage:Int? public var pageSize:Int? required public init(){} } public protocol IPaginatedResult { var currentPage:Int? { get set } var pageSize:Int? { get set } var totalItems:Int? { get set } var totalPages:Int? { get set } }