| All Verbs | /qry//metrics/e2e/slips/responses |
|---|
import 'package:servicestack/servicestack.dart';
class PaginatedQuery implements IConvertible
{
int currentPage = 0;
int pageSize = 0;
PaginatedQuery({this.currentPage=0,this.pageSize=0});
PaginatedQuery.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
currentPage = json['currentPage'] ?? 0;
pageSize = json['pageSize'] ?? 0;
return this;
}
Map<String, dynamic> toJson() => {
'currentPage': currentPage,
'pageSize': pageSize
};
getTypeName() => "PaginatedQuery";
TypeContext? context = _ctx;
}
class ResponseMetrics implements IConvertible
{
int id = 0;
int rqc = 0;
int oc = 0;
int sc = 0;
int tc = 0;
int adr = 0;
ResponseMetrics({this.id=0,this.rqc=0,this.oc=0,this.sc=0,this.tc=0,this.adr=0});
ResponseMetrics.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'] ?? 0;
rqc = json['rqc'] ?? 0;
oc = json['oc'] ?? 0;
sc = json['sc'] ?? 0;
tc = json['tc'] ?? 0;
adr = json['adr'] ?? 0;
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'rqc': rqc,
'oc': oc,
'sc': sc,
'tc': tc,
'adr': adr
};
getTypeName() => "ResponseMetrics";
TypeContext? context = _ctx;
}
class TimeResolution
{
static const TimeResolution Second = const TimeResolution._(1);
static const TimeResolution Minute = const TimeResolution._(2);
static const TimeResolution Hour = const TimeResolution._(5);
static const TimeResolution Day = const TimeResolution._(10);
final int _value;
const TimeResolution._(this._value);
int get value => _value;
static List<TimeResolution> get values => const [Second,Minute,Hour,Day];
}
class FindResponseMetrics extends PaginatedQuery implements IConvertible
{
TimeResolution? resolution;
int timepointFrom = 0;
int timepointTo = 0;
FindResponseMetrics({this.resolution,this.timepointFrom=0,this.timepointTo=0});
FindResponseMetrics.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
resolution = JsonConverters.fromJson(json['resolution'],'TimeResolution',context!);
timepointFrom = json['timepointFrom'] ?? 0;
timepointTo = json['timepointTo'] ?? 0;
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'resolution': JsonConverters.toJson(resolution,'TimeResolution',context!),
'timepointFrom': timepointFrom,
'timepointTo': timepointTo
});
getTypeName() => "FindResponseMetrics";
TypeContext? context = _ctx;
}
class PaginatedResult<T> implements IPaginatedResult, IConvertible
{
List<ResponseMetrics> data = [];
int currentPage = 0;
int pageSize = 0;
int totalItems = 0;
int totalPages = 0;
PaginatedResult({this.data=const [],this.currentPage=0,this.pageSize=0,this.totalItems=0,this.totalPages=0});
PaginatedResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
data = JsonConverters.fromJson(json['data'],'List<ResponseMetrics>',context!) ?? [];
currentPage = json['currentPage'] ?? 0;
pageSize = json['pageSize'] ?? 0;
totalItems = json['totalItems'] ?? 0;
totalPages = json['totalPages'] ?? 0;
return this;
}
Map<String, dynamic> toJson() => {
'data': JsonConverters.toJson(data,'List<ResponseMetrics>',context!),
'currentPage': currentPage,
'pageSize': pageSize,
'totalItems': totalItems,
'totalPages': totalPages
};
getTypeName() => "PaginatedResult<$T>";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.bettor.webhop.biz', types: <String, TypeInfo> {
'PaginatedQuery': TypeInfo(TypeOf.Class, create:() => PaginatedQuery()),
'ResponseMetrics': TypeInfo(TypeOf.Class, create:() => ResponseMetrics()),
'TimeResolution': TypeInfo(TypeOf.Enum, enumValues:TimeResolution.values),
'FindResponseMetrics': TypeInfo(TypeOf.Class, create:() => FindResponseMetrics()),
'PaginatedResult<T>': TypeInfo(TypeOf.Class, create:() => PaginatedResult<T>()),
'List<ResponseMetrics>': TypeInfo(TypeOf.Class, create:() => <ResponseMetrics>[]),
});
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
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /qry//metrics/e2e/slips/responses HTTP/1.1
Host: api.bettor.webhop.biz
Accept: application/json
Content-Type: application/json
Content-Length: length
{"resolution":1,"timepointFrom":0,"timepointTo":0,"currentPage":0,"pageSize":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"data":[{"id":0,"rqc":0,"oc":0,"sc":0,"tc":0,"adr":0}],"currentPage":0,"pageSize":0,"totalItems":0,"totalPages":0}