| All Verbs | /rounds/stats |
|---|
import 'package:servicestack/servicestack.dart';
class RoundStatus
{
static const RoundStatus Pending = const RoundStatus._(0);
static const RoundStatus InProgress = const RoundStatus._(1);
static const RoundStatus Ended = const RoundStatus._(2);
final int _value;
const RoundStatus._(this._value);
int get value => _value;
static List<RoundStatus> get values => const [Pending,InProgress,Ended];
}
class RoundStats implements IConvertible
{
String? id;
DateTime createdAt = DateTime(0);
RoundStatus status;
int canceledCount = 0;
double canceledAmount = 0;
int betCount = 0;
double stakeAmount = 0;
double winningsAmount = 0;
double balanceAmount = 0;
double balancePct = 0;
RoundStats({this.id,this.createdAt,this.status,this.canceledCount,this.canceledAmount,this.betCount,this.stakeAmount,this.winningsAmount,this.balanceAmount,this.balancePct});
RoundStats.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
createdAt = JsonConverters.fromJson(json['createdAt'],'DateTime',context!);
status = JsonConverters.fromJson(json['status'],'RoundStatus',context!);
canceledCount = json['canceledCount'];
canceledAmount = JsonConverters.toDouble(json['canceledAmount']);
betCount = json['betCount'];
stakeAmount = JsonConverters.toDouble(json['stakeAmount']);
winningsAmount = JsonConverters.toDouble(json['winningsAmount']);
balanceAmount = JsonConverters.toDouble(json['balanceAmount']);
balancePct = JsonConverters.toDouble(json['balancePct']);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'createdAt': JsonConverters.toJson(createdAt,'DateTime',context!),
'status': JsonConverters.toJson(status,'RoundStatus',context!),
'canceledCount': canceledCount,
'canceledAmount': canceledAmount,
'betCount': betCount,
'stakeAmount': stakeAmount,
'winningsAmount': winningsAmount,
'balanceAmount': balanceAmount,
'balancePct': balancePct
};
getTypeName() => "RoundStats";
TypeContext? context = _ctx;
}
class FindRoundStats implements IConvertible
{
DateTime periodFrom = DateTime(0);
DateTime periodTo = DateTime(0);
int currentPage = 0;
int pageSize = 0;
FindRoundStats({this.periodFrom,this.periodTo,this.currentPage,this.pageSize});
FindRoundStats.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
periodFrom = JsonConverters.fromJson(json['periodFrom'],'DateTime',context!);
periodTo = JsonConverters.fromJson(json['periodTo'],'DateTime',context!);
currentPage = json['currentPage'];
pageSize = json['pageSize'];
return this;
}
Map<String, dynamic> toJson() => {
'periodFrom': JsonConverters.toJson(periodFrom,'DateTime',context!),
'periodTo': JsonConverters.toJson(periodTo,'DateTime',context!),
'currentPage': currentPage,
'pageSize': pageSize
};
getTypeName() => "FindRoundStats";
TypeContext? context = _ctx;
}
class PaginatedResult<T> implements IConvertible
{
List<RoundStats>? data;
int currentPage = 0;
int pageSize = 0;
int totalItems = 0;
int totalPages = 0;
PaginatedResult({this.data,this.currentPage,this.pageSize,this.totalItems,this.totalPages});
PaginatedResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
data = JsonConverters.fromJson(json['data'],'List<RoundStats>',context!);
currentPage = json['currentPage'];
pageSize = json['pageSize'];
totalItems = json['totalItems'];
totalPages = json['totalPages'];
return this;
}
Map<String, dynamic> toJson() => {
'data': JsonConverters.toJson(data,'List<RoundStats>',context!),
'currentPage': currentPage,
'pageSize': pageSize,
'totalItems': totalItems,
'totalPages': totalPages
};
getTypeName() => "PaginatedResult<$T>";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'grh1.api.bettor.webhop.biz', types: <String, TypeInfo> {
'RoundStatus': TypeInfo(TypeOf.Enum, enumValues:RoundStatus.values),
'RoundStats': TypeInfo(TypeOf.Class, create:() => RoundStats()),
'FindRoundStats': TypeInfo(TypeOf.Class, create:() => FindRoundStats()),
'PaginatedResult<T>': TypeInfo(TypeOf.Class, create:() => PaginatedResult<T>()),
'List<RoundStats>': TypeInfo(TypeOf.Class, create:() => <RoundStats>[]),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /rounds/stats HTTP/1.1
Host: grh1.api.bettor.webhop.biz
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
periodFrom: 0001-01-01,
periodTo: 0001-01-01,
currentPage: 0,
pageSize: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
data:
[
{
id: String,
createdAt: 0001-01-01,
status: 0,
canceledCount: 0,
canceledAmount: 0,
betCount: 0,
stakeAmount: 0,
winningsAmount: 0,
balanceAmount: 0,
balancePct: 0
}
],
currentPage: 0,
pageSize: 0,
totalItems: 0,
totalPages: 0
}