Betting.WebApi

<back to all web services

InstallProductInstance

Requires Authentication
The following routes are available for this service:
POST/cmd/products/instances
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 ProductReference implements IConvertible
{
    String? id;
    String? value;
    String? category;
    Ref? productProvider;

    ProductReference({this.id,this.value,this.category,this.productProvider});
    ProductReference.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'id': id,
        'value': value,
        'category': category,
        'productProvider': JsonConverters.toJson(productProvider,'Ref',context!)
    };

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

class PayinConstraintType
{
    static const PayinConstraintType SingleBet = const PayinConstraintType._(0);
    static const PayinConstraintType MultiBet = const PayinConstraintType._(1);
    static const PayinConstraintType SystemBet = const PayinConstraintType._(2);

    final int _value;
    const PayinConstraintType._(this._value);
    int get value => _value;
    static List<PayinConstraintType> get values => const [SingleBet,MultiBet,SystemBet];
}

class Money implements IConvertible
{
    double? amount;
    String? currency;

    Money({this.amount,this.currency});
    Money.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'amount': amount,
        'currency': currency
    };

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

class PayinConstraint implements IConvertible
{
    PayinConstraintType? type;
    Money? min;
    Money? Default;
    Money? warningThreshold;
    Money? max;

    PayinConstraint({this.type,this.min,this.Default,this.warningThreshold,this.max});
    PayinConstraint.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        type = JsonConverters.fromJson(json['type'],'PayinConstraintType',context!);
        min = JsonConverters.fromJson(json['min'],'Money',context!);
        Default = JsonConverters.fromJson(json['default'],'Money',context!);
        warningThreshold = JsonConverters.fromJson(json['warningThreshold'],'Money',context!);
        max = JsonConverters.fromJson(json['max'],'Money',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'type': JsonConverters.toJson(type,'PayinConstraintType',context!),
        'min': JsonConverters.toJson(min,'Money',context!),
        'default': JsonConverters.toJson(Default,'Money',context!),
        'warningThreshold': JsonConverters.toJson(warningThreshold,'Money',context!),
        'max': JsonConverters.toJson(max,'Money',context!)
    };

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

class WinningsCapType
{
    static const WinningsCapType SingleBet = const WinningsCapType._(0);
    static const WinningsCapType MultiBet = const WinningsCapType._(1);
    static const WinningsCapType SystemBet = const WinningsCapType._(2);

    final int _value;
    const WinningsCapType._(this._value);
    int get value => _value;
    static List<WinningsCapType> get values => const [SingleBet,MultiBet,SystemBet];
}

class WinningsCap implements IConvertible
{
    WinningsCapType? type;
    Money? cap;

    WinningsCap({this.type,this.cap});
    WinningsCap.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        type = JsonConverters.fromJson(json['type'],'WinningsCapType',context!);
        cap = JsonConverters.fromJson(json['cap'],'Money',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'type': JsonConverters.toJson(type,'WinningsCapType',context!),
        'cap': JsonConverters.toJson(cap,'Money',context!)
    };

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

class BettingPolicies implements IConvertible
{
    RecordList<PayinConstraint>? payinConstraints;
    String? payinTaxationPolicyId;
    RecordList<WinningsCap>? winningsCaps;
    String? winningsTaxationPolicyId;

    BettingPolicies({this.payinConstraints,this.payinTaxationPolicyId,this.winningsCaps,this.winningsTaxationPolicyId});
    BettingPolicies.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        payinConstraints = JsonConverters.fromJson(json['payinConstraints'],'RecordList<PayinConstraint>',context!);
        payinTaxationPolicyId = json['payinTaxationPolicyId'];
        winningsCaps = JsonConverters.fromJson(json['winningsCaps'],'RecordList<WinningsCap>',context!);
        winningsTaxationPolicyId = json['winningsTaxationPolicyId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'payinConstraints': JsonConverters.toJson(payinConstraints,'RecordList<PayinConstraint>',context!),
        'payinTaxationPolicyId': payinTaxationPolicyId,
        'winningsCaps': JsonConverters.toJson(winningsCaps,'RecordList<WinningsCap>',context!),
        'winningsTaxationPolicyId': winningsTaxationPolicyId
    };

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

class InstallProductInstance implements IConvertible
{
    String? id;
    String? name;
    String? title;
    ProductReference? product;
    Ref? currency;
    BettingPolicies? bettingPolicies;
    String? apiUrl;
    String? backOfficeUrl;
    String? instanceUrl;
    String? feedPlayerUrl;

    InstallProductInstance({this.id,this.name,this.title,this.product,this.currency,this.bettingPolicies,this.apiUrl,this.backOfficeUrl,this.instanceUrl,this.feedPlayerUrl});
    InstallProductInstance.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        name = json['name'];
        title = json['title'];
        product = JsonConverters.fromJson(json['product'],'ProductReference',context!);
        currency = JsonConverters.fromJson(json['currency'],'Ref',context!);
        bettingPolicies = JsonConverters.fromJson(json['bettingPolicies'],'BettingPolicies',context!);
        apiUrl = json['apiUrl'];
        backOfficeUrl = json['backOfficeUrl'];
        instanceUrl = json['instanceUrl'];
        feedPlayerUrl = json['feedPlayerUrl'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'name': name,
        'title': title,
        'product': JsonConverters.toJson(product,'ProductReference',context!),
        'currency': JsonConverters.toJson(currency,'Ref',context!),
        'bettingPolicies': JsonConverters.toJson(bettingPolicies,'BettingPolicies',context!),
        'apiUrl': apiUrl,
        'backOfficeUrl': backOfficeUrl,
        'instanceUrl': instanceUrl,
        'feedPlayerUrl': feedPlayerUrl
    };

    getTypeName() => "InstallProductInstance";
    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: 'api.sbbet.ath.cx', types: <String, TypeInfo> {
    'Ref': TypeInfo(TypeOf.Class, create:() => Ref()),
    'ProductReference': TypeInfo(TypeOf.Class, create:() => ProductReference()),
    'PayinConstraintType': TypeInfo(TypeOf.Enum, enumValues:PayinConstraintType.values),
    'Money': TypeInfo(TypeOf.Class, create:() => Money()),
    'PayinConstraint': TypeInfo(TypeOf.Class, create:() => PayinConstraint()),
    'WinningsCapType': TypeInfo(TypeOf.Enum, enumValues:WinningsCapType.values),
    'WinningsCap': TypeInfo(TypeOf.Class, create:() => WinningsCap()),
    'BettingPolicies': TypeInfo(TypeOf.Class, create:() => BettingPolicies()),
    'RecordList<PayinConstraint>': TypeInfo(TypeOf.Class, create:() => RecordList<PayinConstraint>()),
    'RecordList<WinningsCap>': TypeInfo(TypeOf.Class, create:() => RecordList<WinningsCap>()),
    'InstallProductInstance': TypeInfo(TypeOf.Class, create:() => InstallProductInstance()),
    'RecordList<T>': TypeInfo(TypeOf.GenericDef,create:() => RecordList()),
});

Dart InstallProductInstance 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 /cmd/products/instances HTTP/1.1 
Host: api.sbbet.ath.cx 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"id":"String","name":"String","title":"String","product":{"id":"String","value":"String","category":"String","productProvider":{"id":"String","val":"String"}},"currency":{"id":"String","val":"String"},"bettingPolicies":{"payinConstraints":[{"type":0,"min":{"amount":0,"currency":"String"},"default":{"amount":0,"currency":"String"},"warningThreshold":{"amount":0,"currency":"String"},"max":{"amount":0,"currency":"String"}}],"payinTaxationPolicyId":"String","winningsCaps":[{"type":0,"cap":{"amount":0,"currency":"String"}}],"winningsTaxationPolicyId":"String"},"apiUrl":"String","backOfficeUrl":"String","instanceUrl":"String","feedPlayerUrl":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}