/* Options: Date: 2026-01-12 04:58:45 SwiftVersion: 6.0 Version: 8.52 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://p4.smartdatasolutions.eu //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True //MakePropertiesOptional: True IncludeTypes: ReadingsBulk.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: False //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/v8/readings-bulk", "GET") // @Route("/v8/readings-bulk/{from}", "GET") public class ReadingsBulk : Generic, IReturn, IGet { public typealias Return = P4ReadingsBulk /** * If not given, the first object is given after the last request, otherwise gives the first ... data objects received from EDSN/Grid operator received after the given time stamp. Keep in mind, the time stamp is related to when SDS received the data from EDSN, not the date of the data itself! */ // @ApiMember(DataType="Time stamp with format: yyyyMMdd-HHmmss-ffffff", Description="If not given, the first object is given after the last request, otherwise gives the first ... data objects received from EDSN/Grid operator received after the given time stamp. Keep in mind, the time stamp is related to when SDS received the data from EDSN, not the date of the data itself!", Name="From") public var from:String? /** * Include received interval objects in the result */ // @ApiMember(DataType="Boolean, default: true", Description="Include received interval objects in the result", Name="IncludeIntervalObjects") public var includeIntervalObjects:Bool? /** * Include received day objects in the result */ // @ApiMember(DataType="Boolean, default: false", Description="Include received day objects in the result", Name="IncludeDayObjects") public var includeDayObjects:Bool? /** * Gives option to filter return objects, for example to get always only hour records or day records */ // @ApiMember(DataType="Enum: None, Hour, Day, LastDayOnly, Month", Description="Gives option to filter return objects, for example to get always only hour records or day records", Name="ObjectFilter") public var objectFilter:Filter? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case from case includeIntervalObjects case includeDayObjects case objectFilter } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) from = try container.decodeIfPresent(String.self, forKey: .from) includeIntervalObjects = try container.decodeIfPresent(Bool.self, forKey: .includeIntervalObjects) includeDayObjects = try container.decodeIfPresent(Bool.self, forKey: .includeDayObjects) objectFilter = try container.decodeIfPresent(Filter.self, forKey: .objectFilter) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if from != nil { try container.encode(from, forKey: .from) } if includeIntervalObjects != nil { try container.encode(includeIntervalObjects, forKey: .includeIntervalObjects) } if includeDayObjects != nil { try container.encode(includeDayObjects, forKey: .includeDayObjects) } if objectFilter != nil { try container.encode(objectFilter, forKey: .objectFilter) } } } public class P4ReadingsBulk : Codable { public var message:String? public var timeStamp:String? public var dayObjectCount:Int? public var intervalObjectCount:Int? public var rejectionObjectCount:Int? public var dayObjects:[P4ReadingDay]? public var intervalObjects:[P4ReadingInterval]? public var rejectionObjects:[P4Rejection]? required public init(){} } public enum Filter : String, Codable { case None case Hour case Day case LastDayOnly case Month } public class Generic : Codable { /** * Api-key. Used to provide credentials to the api. Can also be provided through the request headers with key: X-API-KEY */ // @ApiMember(DataType="String", Description="Api-key. Used to provide credentials to the api. Can also be provided through the request headers with key: X-API-KEY", IsRequired=true, Name="ApiKey") public var apiKey:String? required public init(){} } public class P4ReadingDay : Codable { public var ean:String? public var meterId:String? public var queryDate:Date? public var measureUnit:String? public var r180:Double? public var r181:Double? public var r182:Double? public var r280:Double? public var r281:Double? public var r282:Double? required public init(){} } public class P4ReadingInterval : Codable { public var ean:String? public var meterId:String? public var queryDate:Date? public var measureUnit:String? public var items:[P4ReadingIntervalItem]? required public init(){} } public class P4Rejection : Codable { public var ean:String? public var queryDate:Date? public var queryReason:String? public var rejectionCode:String? public var rejectionText:String? required public init(){} } public class P4ReadingIntervalItem : Codable { public var dateTimeOffset:Date? public var r180:Double? public var r280:Double? required public init(){} }