Six4Win.WebApi

<back to all web services

ConfigureGame

Requires Authentication
The following routes are available for this service:
POST/cmd/configure/game
import 'package:servicestack/servicestack.dart';

class CountdownConfiguration implements IConvertible
{
    int? lockdownStepFromEnd;
    int? assertLockdownStepFromEnd;

    CountdownConfiguration({this.lockdownStepFromEnd,this.assertLockdownStepFromEnd});
    CountdownConfiguration.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        lockdownStepFromEnd = json['lockdownStepFromEnd'];
        assertLockdownStepFromEnd = json['assertLockdownStepFromEnd'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'lockdownStepFromEnd': lockdownStepFromEnd,
        'assertLockdownStepFromEnd': assertLockdownStepFromEnd
    };

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

class DrawConfiguration implements IConvertible
{
    int? introIntervalInMs;
    int? animationIntervalInMs;
    int? outroIntervalInMs;

    DrawConfiguration({this.introIntervalInMs,this.animationIntervalInMs,this.outroIntervalInMs});
    DrawConfiguration.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        introIntervalInMs = json['introIntervalInMs'];
        animationIntervalInMs = json['animationIntervalInMs'];
        outroIntervalInMs = json['outroIntervalInMs'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'introIntervalInMs': introIntervalInMs,
        'animationIntervalInMs': animationIntervalInMs,
        'outroIntervalInMs': outroIntervalInMs
    };

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

class RTPStrategies
{
    static const RTPStrategies RNG = const RTPStrategies._(0);
    static const RTPStrategies Accumulator = const RTPStrategies._(1);

    final int _value;
    const RTPStrategies._(this._value);
    int get value => _value;
    static List<RTPStrategies> get values => const [RNG,Accumulator];
}

class HappyHourConfiguration implements IConvertible
{
    bool? isHappyHour;
    double? oddsModifier;
    double? roundPoolBonusPct;

    HappyHourConfiguration({this.isHappyHour,this.oddsModifier,this.roundPoolBonusPct});
    HappyHourConfiguration.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'isHappyHour': isHappyHour,
        'oddsModifier': oddsModifier,
        'roundPoolBonusPct': roundPoolBonusPct
    };

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

class RoundConfiguration implements IConvertible
{
    RecordList<double>? coefficients;
    bool? isDoubleTripleActive;
    bool? isJackpot5Active;
    int? countdownDurationInSeconds;
    CountdownConfiguration? countdownConfiguration;
    DrawConfiguration? drawConfiguration;
    int? resultsDurationInSeconds;
    RTPStrategies? rtpStrategy;
    HappyHourConfiguration? happyHourConfiguration;

    RoundConfiguration({this.coefficients,this.isDoubleTripleActive,this.isJackpot5Active,this.countdownDurationInSeconds,this.countdownConfiguration,this.drawConfiguration,this.resultsDurationInSeconds,this.rtpStrategy,this.happyHourConfiguration});
    RoundConfiguration.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        coefficients = JsonConverters.fromJson(json['coefficients'],'RecordList<double>',context!);
        isDoubleTripleActive = json['isDoubleTripleActive'];
        isJackpot5Active = json['isJackpot5Active'];
        countdownDurationInSeconds = json['countdownDurationInSeconds'];
        countdownConfiguration = JsonConverters.fromJson(json['countdownConfiguration'],'CountdownConfiguration',context!);
        drawConfiguration = JsonConverters.fromJson(json['drawConfiguration'],'DrawConfiguration',context!);
        resultsDurationInSeconds = json['resultsDurationInSeconds'];
        rtpStrategy = JsonConverters.fromJson(json['rtpStrategy'],'RTPStrategies',context!);
        happyHourConfiguration = JsonConverters.fromJson(json['happyHourConfiguration'],'HappyHourConfiguration',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'coefficients': JsonConverters.toJson(coefficients,'RecordList<double>',context!),
        'isDoubleTripleActive': isDoubleTripleActive,
        'isJackpot5Active': isJackpot5Active,
        'countdownDurationInSeconds': countdownDurationInSeconds,
        'countdownConfiguration': JsonConverters.toJson(countdownConfiguration,'CountdownConfiguration',context!),
        'drawConfiguration': JsonConverters.toJson(drawConfiguration,'DrawConfiguration',context!),
        'resultsDurationInSeconds': resultsDurationInSeconds,
        'rtpStrategy': JsonConverters.toJson(rtpStrategy,'RTPStrategies',context!),
        'happyHourConfiguration': JsonConverters.toJson(happyHourConfiguration,'HappyHourConfiguration',context!)
    };

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

class TimePoint implements IConvertible
{
    int? hour;
    int? minute;

    TimePoint({this.hour,this.minute});
    TimePoint.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        hour = json['hour'];
        minute = json['minute'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'hour': hour,
        'minute': minute
    };

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

class TimeInterval implements IConvertible
{
    TimePoint? start;
    TimePoint? end;

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

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

    Map<String, dynamic> toJson() => {
        'start': JsonConverters.toJson(start,'TimePoint',context!),
        'end': JsonConverters.toJson(end,'TimePoint',context!)
    };

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

class HappyHourItem implements IConvertible
{
    int? id;
    TimeInterval? interval;
    double? oddsModifier;
    double? roundPoolBonusPct;

    HappyHourItem({this.id,this.interval,this.oddsModifier,this.roundPoolBonusPct});
    HappyHourItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        interval = JsonConverters.fromJson(json['interval'],'TimeInterval',context!);
        oddsModifier = JsonConverters.toDouble(json['oddsModifier']);
        roundPoolBonusPct = JsonConverters.toDouble(json['roundPoolBonusPct']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'interval': JsonConverters.toJson(interval,'TimeInterval',context!),
        'oddsModifier': oddsModifier,
        'roundPoolBonusPct': roundPoolBonusPct
    };

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

class HappyHourConfig implements IConvertible
{
    bool? isActive;
    List<HappyHourItem>? items;

    HappyHourConfig({this.isActive,this.items});
    HappyHourConfig.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        isActive = json['isActive'];
        items = JsonConverters.fromJson(json['items'],'List<HappyHourItem>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'isActive': isActive,
        'items': JsonConverters.toJson(items,'List<HappyHourItem>',context!)
    };

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

class GameConfiguration implements IConvertible
{
    String? id;
    int? queueSize;
    RoundConfiguration? roundConfiguration;
    HappyHourConfig? happyHourConfig;

    GameConfiguration({this.id,this.queueSize,this.roundConfiguration,this.happyHourConfig});
    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!);
        happyHourConfig = JsonConverters.fromJson(json['happyHourConfig'],'HappyHourConfig',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'queueSize': queueSize,
        'roundConfiguration': JsonConverters.toJson(roundConfiguration,'RoundConfiguration',context!),
        'happyHourConfig': JsonConverters.toJson(happyHourConfig,'HappyHourConfig',context!)
    };

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

class ConfigureGame implements IConvertible
{
    String? id;
    GameConfiguration? configuration;

    ConfigureGame({this.id,this.configuration});
    ConfigureGame.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        configuration = JsonConverters.fromJson(json['configuration'],'GameConfiguration',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'configuration': JsonConverters.toJson(configuration,'GameConfiguration',context!)
    };

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

class RecordList<T> extends ListBase<T> implements IConvertible
{
    final List<T> l = [];
    set length(int newLength) { l.length = newLength; }
    int get length => l.length;
    T operator [](int index) => l[index];
    void operator []=(int index, T value) { l[index] = value; }
    RecordList();
    RecordList.fromJson(Map<String, dynamic> json) : super();
    fromMap(Map<String, dynamic> json) {
        return this;
    }

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

TypeContext _ctx = TypeContext(library: 's4w2.api.bettor.cc', types: <String, TypeInfo> {
    'CountdownConfiguration': TypeInfo(TypeOf.Class, create:() => CountdownConfiguration()),
    'DrawConfiguration': TypeInfo(TypeOf.Class, create:() => DrawConfiguration()),
    'RTPStrategies': TypeInfo(TypeOf.Enum, enumValues:RTPStrategies.values),
    'HappyHourConfiguration': TypeInfo(TypeOf.Class, create:() => HappyHourConfiguration()),
    'RoundConfiguration': TypeInfo(TypeOf.Class, create:() => RoundConfiguration()),
    'RecordList<double>': TypeInfo(TypeOf.Class, create:() => RecordList<double>()),
    'TimePoint': TypeInfo(TypeOf.Class, create:() => TimePoint()),
    'TimeInterval': TypeInfo(TypeOf.Class, create:() => TimeInterval()),
    'HappyHourItem': TypeInfo(TypeOf.Class, create:() => HappyHourItem()),
    'HappyHourConfig': TypeInfo(TypeOf.Class, create:() => HappyHourConfig()),
    'List<HappyHourItem>': TypeInfo(TypeOf.Class, create:() => <HappyHourItem>[]),
    'GameConfiguration': TypeInfo(TypeOf.Class, create:() => GameConfiguration()),
    'ConfigureGame': TypeInfo(TypeOf.Class, create:() => ConfigureGame()),
    'RecordList<T>': TypeInfo(TypeOf.GenericDef,create:() => RecordList()),
});

Dart ConfigureGame DTOs

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

HTTP + XML

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

POST /cmd/configure/game HTTP/1.1 
Host: s4w2.api.bettor.cc 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<ConfigureGame xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Six4Win.WebApi.ServiceModel">
  <Configuration xmlns:d2p1="http://schemas.datacontract.org/2004/07/Six4Win">
    <d2p1:HappyHourConfig>
      <d2p1:IsActive>false</d2p1:IsActive>
      <d2p1:Items>
        <d2p1:HappyHourConfig.HappyHourItem>
          <d2p1:Id>0</d2p1:Id>
          <d2p1:Interval>
            <d2p1:End>
              <d2p1:Hour>0</d2p1:Hour>
              <d2p1:Minute>0</d2p1:Minute>
            </d2p1:End>
            <d2p1:Start>
              <d2p1:Hour>0</d2p1:Hour>
              <d2p1:Minute>0</d2p1:Minute>
            </d2p1:Start>
          </d2p1:Interval>
          <d2p1:OddsModifier>0</d2p1:OddsModifier>
          <d2p1:RoundPoolBonusPct>0</d2p1:RoundPoolBonusPct>
        </d2p1:HappyHourConfig.HappyHourItem>
      </d2p1:Items>
    </d2p1:HappyHourConfig>
    <d2p1:QueueSize>0</d2p1:QueueSize>
    <d2p1:RoundConfiguration>
      <d2p1:Coefficients xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:float>0</d4p1:float>
      </d2p1:Coefficients>
      <d2p1:CountdownConfiguration>
        <d2p1:AssertLockdownStepFromEnd>0</d2p1:AssertLockdownStepFromEnd>
        <d2p1:LockdownStepFromEnd>0</d2p1:LockdownStepFromEnd>
      </d2p1:CountdownConfiguration>
      <d2p1:CountdownDurationInSeconds>0</d2p1:CountdownDurationInSeconds>
      <d2p1:DrawConfiguration>
        <d2p1:AnimationIntervalInMs>0</d2p1:AnimationIntervalInMs>
        <d2p1:IntroIntervalInMs>0</d2p1:IntroIntervalInMs>
        <d2p1:OutroIntervalInMs>0</d2p1:OutroIntervalInMs>
      </d2p1:DrawConfiguration>
      <d2p1:HappyHourConfiguration>
        <d2p1:IsHappyHour>false</d2p1:IsHappyHour>
        <d2p1:OddsModifier>0</d2p1:OddsModifier>
        <d2p1:RoundPoolBonusPct>0</d2p1:RoundPoolBonusPct>
      </d2p1:HappyHourConfiguration>
      <d2p1:IsDoubleTripleActive>false</d2p1:IsDoubleTripleActive>
      <d2p1:IsJackpot5Active>false</d2p1:IsJackpot5Active>
      <d2p1:RTPStrategy>RNG</d2p1:RTPStrategy>
      <d2p1:ResultsDurationInSeconds>0</d2p1:ResultsDurationInSeconds>
    </d2p1:RoundConfiguration>
  </Configuration>
  <Id>String</Id>
</ConfigureGame>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ResponseStatus xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
  <ErrorCode>String</ErrorCode>
  <Message>String</Message>
  <StackTrace>String</StackTrace>
  <Errors>
    <ResponseError>
      <ErrorCode>String</ErrorCode>
      <FieldName>String</FieldName>
      <Message>String</Message>
      <Meta xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:KeyValueOfstringstring>
          <d4p1:Key>String</d4p1:Key>
          <d4p1:Value>String</d4p1:Value>
        </d4p1:KeyValueOfstringstring>
      </Meta>
    </ResponseError>
  </Errors>
  <Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value>String</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
  </Meta>
</ResponseStatus>