| All Verbs | /config/game |
|---|
import 'package:servicestack/servicestack.dart';
class RTPStrategies
{
static const RTPStrategies RNG = const RTPStrategies._(0);
static const RTPStrategies Default = const RTPStrategies._(1);
final int _value;
const RTPStrategies._(this._value);
int get value => _value;
static List<RTPStrategies> get values => const [RNG,Default];
}
class RoundConfiguration implements IConvertible
{
int countdownDurationInSeconds = 0;
int raceDurationInSeconds = 0;
int resultsDurationInSeconds = 0;
RTPStrategies rtpStrategy;
RoundConfiguration({this.countdownDurationInSeconds,this.raceDurationInSeconds,this.resultsDurationInSeconds,this.rtpStrategy});
RoundConfiguration.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
countdownDurationInSeconds = json['countdownDurationInSeconds'];
raceDurationInSeconds = json['raceDurationInSeconds'];
resultsDurationInSeconds = json['resultsDurationInSeconds'];
rtpStrategy = JsonConverters.fromJson(json['rtpStrategy'],'RTPStrategies',context!);
return this;
}
Map<String, dynamic> toJson() => {
'countdownDurationInSeconds': countdownDurationInSeconds,
'raceDurationInSeconds': raceDurationInSeconds,
'resultsDurationInSeconds': resultsDurationInSeconds,
'rtpStrategy': JsonConverters.toJson(rtpStrategy,'RTPStrategies',context!)
};
getTypeName() => "RoundConfiguration";
TypeContext? context = _ctx;
}
class GameConfiguration implements IConvertible
{
String? id;
int queueSize = 0;
RoundConfiguration? roundConfiguration;
GameConfiguration({this.id,this.queueSize,this.roundConfiguration});
GameConfiguration.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
queueSize = json['queueSize'];
roundConfiguration = JsonConverters.fromJson(json['roundConfiguration'],'RoundConfiguration',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'queueSize': queueSize,
'roundConfiguration': JsonConverters.toJson(roundConfiguration,'RoundConfiguration',context!)
};
getTypeName() => "GameConfiguration";
TypeContext? context = _ctx;
}
class GetGameConfig implements IConvertible
{
GetGameConfig();
GetGameConfig.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "GetGameConfig";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'grh1.api.bettor.webhop.biz', types: <String, TypeInfo> {
'RTPStrategies': TypeInfo(TypeOf.Enum, enumValues:RTPStrategies.values),
'RoundConfiguration': TypeInfo(TypeOf.Class, create:() => RoundConfiguration()),
'GameConfiguration': TypeInfo(TypeOf.Class, create:() => GameConfiguration()),
'GetGameConfig': TypeInfo(TypeOf.Class, create:() => GetGameConfig()),
});
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 /config/game HTTP/1.1
Host: grh1.api.bettor.webhop.biz
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"id":"String","queueSize":0,"roundConfiguration":{"countdownDurationInSeconds":0,"raceDurationInSeconds":0,"resultsDurationInSeconds":0,"rtpStrategy":0}}