Greyhounds.WebApi

<back to all web services

GetAccumulatorConfig

The following routes are available for this service:
All Verbs/config/accumulator
import 'package:servicestack/servicestack.dart';

class Pool implements IConvertible
{
    int id = 0;
    String? name;
    double coefficient = 0;
    double rtp = 0;
    double threshold = 0;
    double balance = 0;

    Pool({this.id,this.name,this.coefficient,this.rtp,this.threshold,this.balance});
    Pool.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        name = json['name'];
        coefficient = JsonConverters.toDouble(json['coefficient']);
        rtp = JsonConverters.toDouble(json['rtp']);
        threshold = JsonConverters.toDouble(json['threshold']);
        balance = JsonConverters.toDouble(json['balance']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'name': name,
        'coefficient': coefficient,
        'rtp': rtp,
        'threshold': threshold,
        'balance': balance
    };

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

class LocationOptimizationLevel
{
    static const LocationOptimizationLevel None = const LocationOptimizationLevel._(0);
    static const LocationOptimizationLevel Low = const LocationOptimizationLevel._(1);
    static const LocationOptimizationLevel Medium = const LocationOptimizationLevel._(2);
    static const LocationOptimizationLevel High = const LocationOptimizationLevel._(3);

    final int _value;
    const LocationOptimizationLevel._(this._value);
    int get value => _value;
    static List<LocationOptimizationLevel> get values => const [None,Low,Medium,High];
}

class ThresholdInterval implements IConvertible
{
    double start = 0;
    double end = 0;

    ThresholdInterval({this.start,this.end});
    ThresholdInterval.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        start = JsonConverters.toDouble(json['start']);
        end = JsonConverters.toDouble(json['end']);
        return this;
    }

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

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

class AccumulatorConfiguration implements IConvertible
{
    String? id;
    List<Pool>? pools;
    double prevalentStake = 0;
    LocationOptimizationLevel locationOptimizationLevel;
    ThresholdInterval? jackPotThresholdInterval;

    AccumulatorConfiguration({this.id,this.pools,this.prevalentStake,this.locationOptimizationLevel,this.jackPotThresholdInterval});
    AccumulatorConfiguration.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        pools = JsonConverters.fromJson(json['pools'],'List<Pool>',context!);
        prevalentStake = JsonConverters.toDouble(json['prevalentStake']);
        locationOptimizationLevel = JsonConverters.fromJson(json['locationOptimizationLevel'],'LocationOptimizationLevel',context!);
        jackPotThresholdInterval = JsonConverters.fromJson(json['jackPotThresholdInterval'],'ThresholdInterval',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'pools': JsonConverters.toJson(pools,'List<Pool>',context!),
        'prevalentStake': prevalentStake,
        'locationOptimizationLevel': JsonConverters.toJson(locationOptimizationLevel,'LocationOptimizationLevel',context!),
        'jackPotThresholdInterval': JsonConverters.toJson(jackPotThresholdInterval,'ThresholdInterval',context!)
    };

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

class GetAccumulatorConfig implements IConvertible
{
    GetAccumulatorConfig();
    GetAccumulatorConfig.fromJson(Map<String, dynamic> json) : super();
    fromMap(Map<String, dynamic> json) {
        return this;
    }

    Map<String, dynamic> toJson() => {};
    getTypeName() => "GetAccumulatorConfig";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'grh1.api.bettor.webhop.biz', types: <String, TypeInfo> {
    'Pool': TypeInfo(TypeOf.Class, create:() => Pool()),
    'LocationOptimizationLevel': TypeInfo(TypeOf.Enum, enumValues:LocationOptimizationLevel.values),
    'ThresholdInterval': TypeInfo(TypeOf.Class, create:() => ThresholdInterval()),
    'AccumulatorConfiguration': TypeInfo(TypeOf.Class, create:() => AccumulatorConfiguration()),
    'List<Pool>': TypeInfo(TypeOf.Class, create:() => <Pool>[]),
    'GetAccumulatorConfig': TypeInfo(TypeOf.Class, create:() => GetAccumulatorConfig()),
});

Dart GetAccumulatorConfig DTOs

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

HTTP + OTHER

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

POST /config/accumulator 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","pools":[{"id":0,"name":"String","rtp":0}],"prevalentStake":0,"locationOptimizationLevel":0,"jackPotThresholdInterval":{"start":0,"end":0}}