<back to all web services

ReadingsBulk

The following routes are available for this service:
GET/v8/readings-bulk
GET/v8/readings-bulk/{from}
import 'package:servicestack/servicestack.dart';

class Generic implements IConvertible
{
    /**
    * 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")
    String? apiKey;

    Generic({this.apiKey});
    Generic.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        apiKey = json['apiKey'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'apiKey': apiKey
    };

    getTypeName() => "Generic";
    TypeContext? context = _ctx;
}

class P4ReadingDay implements IConvertible
{
    String? ean;
    String? meterId;
    DateTime? queryDate;
    String? measureUnit;
    double? r180;
    double? r181;
    double? r182;
    double? r280;
    double? r281;
    double? r282;

    P4ReadingDay({this.ean,this.meterId,this.queryDate,this.measureUnit,this.r180,this.r181,this.r182,this.r280,this.r281,this.r282});
    P4ReadingDay.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ean = json['ean'];
        meterId = json['meterId'];
        queryDate = JsonConverters.fromJson(json['queryDate'],'DateTime',context!);
        measureUnit = json['measureUnit'];
        r180 = JsonConverters.toDouble(json['r180']);
        r181 = JsonConverters.toDouble(json['r181']);
        r182 = JsonConverters.toDouble(json['r182']);
        r280 = JsonConverters.toDouble(json['r280']);
        r281 = JsonConverters.toDouble(json['r281']);
        r282 = JsonConverters.toDouble(json['r282']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ean': ean,
        'meterId': meterId,
        'queryDate': JsonConverters.toJson(queryDate,'DateTime',context!),
        'measureUnit': measureUnit,
        'r180': r180,
        'r181': r181,
        'r182': r182,
        'r280': r280,
        'r281': r281,
        'r282': r282
    };

    getTypeName() => "P4ReadingDay";
    TypeContext? context = _ctx;
}

class P4ReadingIntervalItem implements IConvertible
{
    DateTime? dateTimeOffset;
    double? r180;
    double? r280;

    P4ReadingIntervalItem({this.dateTimeOffset,this.r180,this.r280});
    P4ReadingIntervalItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        dateTimeOffset = JsonConverters.fromJson(json['dateTimeOffset'],'DateTime',context!);
        r180 = JsonConverters.toDouble(json['r180']);
        r280 = JsonConverters.toDouble(json['r280']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'dateTimeOffset': JsonConverters.toJson(dateTimeOffset,'DateTime',context!),
        'r180': r180,
        'r280': r280
    };

    getTypeName() => "P4ReadingIntervalItem";
    TypeContext? context = _ctx;
}

class P4ReadingInterval implements IConvertible
{
    String? ean;
    String? meterId;
    DateTime? queryDate;
    String? measureUnit;
    List<P4ReadingIntervalItem>? items;

    P4ReadingInterval({this.ean,this.meterId,this.queryDate,this.measureUnit,this.items});
    P4ReadingInterval.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ean = json['ean'];
        meterId = json['meterId'];
        queryDate = JsonConverters.fromJson(json['queryDate'],'DateTime',context!);
        measureUnit = json['measureUnit'];
        items = JsonConverters.fromJson(json['items'],'List<P4ReadingIntervalItem>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ean': ean,
        'meterId': meterId,
        'queryDate': JsonConverters.toJson(queryDate,'DateTime',context!),
        'measureUnit': measureUnit,
        'items': JsonConverters.toJson(items,'List<P4ReadingIntervalItem>',context!)
    };

    getTypeName() => "P4ReadingInterval";
    TypeContext? context = _ctx;
}

class P4Rejection implements IConvertible
{
    String? ean;
    DateTime? queryDate;
    String? queryReason;
    String? rejectionCode;
    String? rejectionText;

    P4Rejection({this.ean,this.queryDate,this.queryReason,this.rejectionCode,this.rejectionText});
    P4Rejection.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ean = json['ean'];
        queryDate = JsonConverters.fromJson(json['queryDate'],'DateTime',context!);
        queryReason = json['queryReason'];
        rejectionCode = json['rejectionCode'];
        rejectionText = json['rejectionText'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ean': ean,
        'queryDate': JsonConverters.toJson(queryDate,'DateTime',context!),
        'queryReason': queryReason,
        'rejectionCode': rejectionCode,
        'rejectionText': rejectionText
    };

    getTypeName() => "P4Rejection";
    TypeContext? context = _ctx;
}

class P4ReadingsBulk implements IConvertible
{
    String? message;
    String? timeStamp;
    int? dayObjectCount;
    int? intervalObjectCount;
    int? rejectionObjectCount;
    List<P4ReadingDay>? dayObjects;
    List<P4ReadingInterval>? intervalObjects;
    List<P4Rejection>? rejectionObjects;

    P4ReadingsBulk({this.message,this.timeStamp,this.dayObjectCount,this.intervalObjectCount,this.rejectionObjectCount,this.dayObjects,this.intervalObjects,this.rejectionObjects});
    P4ReadingsBulk.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        message = json['message'];
        timeStamp = json['timeStamp'];
        dayObjectCount = json['dayObjectCount'];
        intervalObjectCount = json['intervalObjectCount'];
        rejectionObjectCount = json['rejectionObjectCount'];
        dayObjects = JsonConverters.fromJson(json['dayObjects'],'List<P4ReadingDay>',context!);
        intervalObjects = JsonConverters.fromJson(json['intervalObjects'],'List<P4ReadingInterval>',context!);
        rejectionObjects = JsonConverters.fromJson(json['rejectionObjects'],'List<P4Rejection>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'message': message,
        'timeStamp': timeStamp,
        'dayObjectCount': dayObjectCount,
        'intervalObjectCount': intervalObjectCount,
        'rejectionObjectCount': rejectionObjectCount,
        'dayObjects': JsonConverters.toJson(dayObjects,'List<P4ReadingDay>',context!),
        'intervalObjects': JsonConverters.toJson(intervalObjects,'List<P4ReadingInterval>',context!),
        'rejectionObjects': JsonConverters.toJson(rejectionObjects,'List<P4Rejection>',context!)
    };

    getTypeName() => "P4ReadingsBulk";
    TypeContext? context = _ctx;
}

enum Filter
{
    None,
    Hour,
    Day,
    LastDayOnly,
    Month,
}

class ReadingsBulk extends Generic implements IGet, IConvertible
{
    /**
    * 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")
    String? from;

    /**
    * Include received interval objects in the result
    */
    // @ApiMember(DataType="Boolean, default: true", Description="Include received interval objects in the result", Name="IncludeIntervalObjects")
    bool? includeIntervalObjects;

    /**
    * Include received day objects in the result
    */
    // @ApiMember(DataType="Boolean, default: false", Description="Include received day objects in the result", Name="IncludeDayObjects")
    bool? includeDayObjects;

    /**
    * 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")
    Filter? objectFilter;

    ReadingsBulk({this.from,this.includeIntervalObjects,this.includeDayObjects,this.objectFilter});
    ReadingsBulk.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        from = json['from'];
        includeIntervalObjects = json['includeIntervalObjects'];
        includeDayObjects = json['includeDayObjects'];
        objectFilter = JsonConverters.fromJson(json['objectFilter'],'Filter',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'from': from,
        'includeIntervalObjects': includeIntervalObjects,
        'includeDayObjects': includeDayObjects,
        'objectFilter': JsonConverters.toJson(objectFilter,'Filter',context!)
    });

    getTypeName() => "ReadingsBulk";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'p4.smartdatasolutions.eu', types: <String, TypeInfo> {
    'Generic': TypeInfo(TypeOf.Class, create:() => Generic()),
    'P4ReadingDay': TypeInfo(TypeOf.Class, create:() => P4ReadingDay()),
    'P4ReadingIntervalItem': TypeInfo(TypeOf.Class, create:() => P4ReadingIntervalItem()),
    'P4ReadingInterval': TypeInfo(TypeOf.Class, create:() => P4ReadingInterval()),
    'List<P4ReadingIntervalItem>': TypeInfo(TypeOf.Class, create:() => <P4ReadingIntervalItem>[]),
    'P4Rejection': TypeInfo(TypeOf.Class, create:() => P4Rejection()),
    'P4ReadingsBulk': TypeInfo(TypeOf.Class, create:() => P4ReadingsBulk()),
    'List<P4ReadingDay>': TypeInfo(TypeOf.Class, create:() => <P4ReadingDay>[]),
    'List<P4ReadingInterval>': TypeInfo(TypeOf.Class, create:() => <P4ReadingInterval>[]),
    'List<P4Rejection>': TypeInfo(TypeOf.Class, create:() => <P4Rejection>[]),
    'Filter': TypeInfo(TypeOf.Enum, enumValues:Filter.values),
    'ReadingsBulk': TypeInfo(TypeOf.Class, create:() => ReadingsBulk()),
});

Dart ReadingsBulk DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /v8/readings-bulk HTTP/1.1 
Host: p4.smartdatasolutions.eu 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"message":"String","timeStamp":"String","dayObjectCount":0,"intervalObjectCount":0,"rejectionObjectCount":0,"dayObjects":[{"ean":"String","meterId":"String","queryDate":"0001-01-01","measureUnit":"String","r180":0,"r181":0,"r182":0,"r280":0,"r281":0,"r282":0}],"intervalObjects":[{"ean":"String","meterId":"String","queryDate":"0001-01-01","measureUnit":"String","items":[{"dateTimeOffset":"0001-01-01T00:00:00+00:00","r180":0,"r280":0}]}],"rejectionObjects":[{"ean":"String","queryDate":"0001-01-01","queryReason":"String","rejectionCode":"String","rejectionText":"String"}]}