| All Verbs | /qry/wins/recent |
|---|
import 'package:servicestack/servicestack.dart';
class Ref implements IConvertible
{
String? id;
String? val;
Ref({this.id,this.val});
Ref.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
val = json['val'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'val': val
};
getTypeName() => "Ref";
TypeContext? context = _ctx;
}
class BettingApp implements IConvertible
{
String? name;
String? version;
BettingApp({this.name,this.version});
BettingApp.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
name = json['name'];
version = json['version'];
return this;
}
Map<String, dynamic> toJson() => {
'name': name,
'version': version
};
getTypeName() => "BettingApp";
TypeContext? context = _ctx;
}
class RefEx extends Ref implements IConvertible
{
RecordDictionary<String,String>? data;
RefEx({this.data});
RefEx.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
data = JsonConverters.fromJson(json['data'],'RecordDictionary<String,String>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'data': JsonConverters.toJson(data,'RecordDictionary<String,String>',context!)
});
getTypeName() => "RefEx";
TypeContext? context = _ctx;
}
class Origin implements IConvertible
{
BettingApp? application;
String? ip;
RefEx? organization;
Ref? region;
Ref? locationGroup;
RefEx? location;
RefEx? device;
Ref? clerk;
Origin({this.application,this.ip,this.organization,this.region,this.locationGroup,this.location,this.device,this.clerk});
Origin.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
application = JsonConverters.fromJson(json['application'],'BettingApp',context!);
ip = json['ip'];
organization = JsonConverters.fromJson(json['organization'],'RefEx',context!);
region = JsonConverters.fromJson(json['region'],'Ref',context!);
locationGroup = JsonConverters.fromJson(json['locationGroup'],'Ref',context!);
location = JsonConverters.fromJson(json['location'],'RefEx',context!);
device = JsonConverters.fromJson(json['device'],'RefEx',context!);
clerk = JsonConverters.fromJson(json['clerk'],'Ref',context!);
return this;
}
Map<String, dynamic> toJson() => {
'application': JsonConverters.toJson(application,'BettingApp',context!),
'ip': ip,
'organization': JsonConverters.toJson(organization,'RefEx',context!),
'region': JsonConverters.toJson(region,'Ref',context!),
'locationGroup': JsonConverters.toJson(locationGroup,'Ref',context!),
'location': JsonConverters.toJson(location,'RefEx',context!),
'device': JsonConverters.toJson(device,'RefEx',context!),
'clerk': JsonConverters.toJson(clerk,'Ref',context!)
};
getTypeName() => "Origin";
TypeContext? context = _ctx;
}
class BetOutcome
{
static const BetOutcome Unknown = const BetOutcome._(0);
static const BetOutcome Lost = const BetOutcome._(1);
static const BetOutcome Won = const BetOutcome._(2);
static const BetOutcome Void = const BetOutcome._(3);
final int _value;
const BetOutcome._(this._value);
int get value => _value;
static List<BetOutcome> get values => const [Unknown,Lost,Won,Void];
}
class BetProcessingStatus
{
static const BetProcessingStatus Open = const BetProcessingStatus._(0);
static const BetProcessingStatus Closed = const BetProcessingStatus._(1);
final int _value;
const BetProcessingStatus._(this._value);
int get value => _value;
static List<BetProcessingStatus> get values => const [Open,Closed];
}
class BetValidity
{
static const BetValidity Valid = const BetValidity._(0);
static const BetValidity Canceled = const BetValidity._(1);
static const BetValidity Void = const BetValidity._(2);
static const BetValidity Reverted = const BetValidity._(3);
final int _value;
const BetValidity._(this._value);
int get value => _value;
static List<BetValidity> get values => const [Valid,Canceled,Void,Reverted];
}
class Win implements IConvertible
{
int? id;
int? sId;
Ref? bettor;
Origin? origin;
DateTime? placedAt;
int? roundId;
String? content;
double? stake;
BetOutcome? outcome;
double? amount;
BetProcessingStatus? processingStatus;
BetValidity? validity;
Map<String,String?>? results;
Map<String,String?>? payload;
Win({this.id,this.sId,this.bettor,this.origin,this.placedAt,this.roundId,this.content,this.stake,this.outcome,this.amount,this.processingStatus,this.validity,this.results,this.payload});
Win.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
sId = json['sId'];
bettor = JsonConverters.fromJson(json['bettor'],'Ref',context!);
origin = JsonConverters.fromJson(json['origin'],'Origin',context!);
placedAt = JsonConverters.fromJson(json['placedAt'],'DateTime',context!);
roundId = json['roundId'];
content = json['content'];
stake = JsonConverters.toDouble(json['stake']);
outcome = JsonConverters.fromJson(json['outcome'],'BetOutcome',context!);
amount = JsonConverters.toDouble(json['amount']);
processingStatus = JsonConverters.fromJson(json['processingStatus'],'BetProcessingStatus',context!);
validity = JsonConverters.fromJson(json['validity'],'BetValidity',context!);
results = JsonConverters.toStringMap(json['results']);
payload = JsonConverters.toStringMap(json['payload']);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'sId': sId,
'bettor': JsonConverters.toJson(bettor,'Ref',context!),
'origin': JsonConverters.toJson(origin,'Origin',context!),
'placedAt': JsonConverters.toJson(placedAt,'DateTime',context!),
'roundId': roundId,
'content': content,
'stake': stake,
'outcome': JsonConverters.toJson(outcome,'BetOutcome',context!),
'amount': amount,
'processingStatus': JsonConverters.toJson(processingStatus,'BetProcessingStatus',context!),
'validity': JsonConverters.toJson(validity,'BetValidity',context!),
'results': results,
'payload': payload
};
getTypeName() => "Win";
TypeContext? context = _ctx;
}
class RecentWins implements IConvertible
{
String? id;
List<Win>? wins;
int? maxSize;
double? threshold;
RecentWins({this.id,this.wins,this.maxSize,this.threshold});
RecentWins.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
wins = JsonConverters.fromJson(json['wins'],'List<Win>',context!);
maxSize = json['maxSize'];
threshold = JsonConverters.toDouble(json['threshold']);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'wins': JsonConverters.toJson(wins,'List<Win>',context!),
'maxSize': maxSize,
'threshold': threshold
};
getTypeName() => "RecentWins";
TypeContext? context = _ctx;
}
class GetRecentWins implements IConvertible
{
GetRecentWins();
GetRecentWins.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "GetRecentWins";
TypeContext? context = _ctx;
}
class RecordDictionary<TKey,TVal> extends Map<TKey,TVal?> implements IConvertible
{
RecordDictionary();
RecordDictionary.fromJson(Map<String, dynamic> json) : super.fromJson(json);
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
return this;
}
Map<String, dynamic> toJson() => super.toJson();
getTypeName() => "RecordDictionary<$TKey,$TVal>";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 's4w2.api.bettor.cc', types: <String, TypeInfo> {
'Ref': TypeInfo(TypeOf.Class, create:() => Ref()),
'BettingApp': TypeInfo(TypeOf.Class, create:() => BettingApp()),
'RefEx': TypeInfo(TypeOf.Class, create:() => RefEx()),
'RecordDictionary<String,String>': TypeInfo(TypeOf.Class, create:() => RecordDictionary<String,String>()),
'Origin': TypeInfo(TypeOf.Class, create:() => Origin()),
'BetOutcome': TypeInfo(TypeOf.Enum, enumValues:BetOutcome.values),
'BetProcessingStatus': TypeInfo(TypeOf.Enum, enumValues:BetProcessingStatus.values),
'BetValidity': TypeInfo(TypeOf.Enum, enumValues:BetValidity.values),
'Win': TypeInfo(TypeOf.Class, create:() => Win()),
'RecentWins': TypeInfo(TypeOf.Class, create:() => RecentWins()),
'List<Win>': TypeInfo(TypeOf.Class, create:() => <Win>[]),
'GetRecentWins': TypeInfo(TypeOf.Class, create:() => GetRecentWins()),
'RecordDictionary<TKey,TVal>': TypeInfo(TypeOf.GenericDef,create:() => RecordDictionary()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /qry/wins/recent HTTP/1.1
Host: s4w2.api.bettor.cc
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"id":"String","wins":[{"id":0,"sId":0,"bettor":{"id":"String","val":"String"},"origin":{"application":{"name":"String","version":"String"},"ip":"String","organization":{"data":{"String":"String"},"id":"String","val":"String"},"region":{"id":"String","val":"String"},"locationGroup":{"id":"String","val":"String"},"location":{"data":{"String":"String"},"id":"String","val":"String"},"device":{"data":{"String":"String"},"id":"String","val":"String"},"clerk":{"id":"String","val":"String"}},"placedAt":"0001-01-01T00:00:00.0000000Z","roundId":0,"content":"String","stake":0,"outcome":0,"amount":0,"processingStatus":0,"validity":0,"results":{"String":"String"},"payload":{"String":"String"}}],"maxSize":0,"threshold":0}