Betting.WebApi

<back to all web services

FindProductInstances

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

class QueryRequest implements IConvertible
{
    Map<String,String?>? qry = {};

    QueryRequest({this.qry});
    QueryRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class PaginatedQueryRequest extends QueryRequest implements IConvertible
{
    int? currentPage;
    int? pageSize;

    PaginatedQueryRequest({this.currentPage,this.pageSize});
    PaginatedQueryRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        currentPage = json['currentPage'];
        pageSize = json['pageSize'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'currentPage': currentPage,
        'pageSize': pageSize
    });

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

class FindProductInstances extends PaginatedQueryRequest implements IConvertible
{
    FindProductInstances();
    FindProductInstances.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() => "FindProductInstances";
    TypeContext? context = _ctx;
}

class ResponseMetrics implements IConvertible
{
    int? id;
    int? rqc;
    int? oc;
    int? sc;
    int? tc;
    int? adr;

    ResponseMetrics({this.id,this.rqc,this.oc,this.sc,this.tc,this.adr});
    ResponseMetrics.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        rqc = json['rqc'];
        oc = json['oc'];
        sc = json['sc'];
        tc = json['tc'];
        adr = json['adr'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'rqc': rqc,
        'oc': oc,
        'sc': sc,
        'tc': tc,
        'adr': adr
    };

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

class PaginatedResult<T> implements IPaginatedResult, IConvertible
{
    List<ResponseMetrics>? data = [];
    int? currentPage;
    int? pageSize;
    int? totalItems;
    int? totalPages;

    PaginatedResult({this.data,this.currentPage,this.pageSize,this.totalItems,this.totalPages});
    PaginatedResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        data = JsonConverters.fromJson(json['data'],'List<ResponseMetrics>',context!);
        currentPage = json['currentPage'];
        pageSize = json['pageSize'];
        totalItems = json['totalItems'];
        totalPages = json['totalPages'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'data': JsonConverters.toJson(data,'List<ResponseMetrics>',context!),
        'currentPage': currentPage,
        'pageSize': pageSize,
        'totalItems': totalItems,
        'totalPages': totalPages
    };

    getTypeName() => "PaginatedResult<$T>";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.sbbet.ath.cx', types: <String, TypeInfo> {
    'QueryRequest': TypeInfo(TypeOf.Class, create:() => QueryRequest()),
    'PaginatedQueryRequest': TypeInfo(TypeOf.Class, create:() => PaginatedQueryRequest()),
    'FindProductInstances': TypeInfo(TypeOf.Class, create:() => FindProductInstances()),
    'ResponseMetrics': TypeInfo(TypeOf.Class, create:() => ResponseMetrics()),
    'PaginatedResult<T>': TypeInfo(TypeOf.Class, create:() => PaginatedResult<T>()),
    'List<ResponseMetrics>': TypeInfo(TypeOf.Class, create:() => <ResponseMetrics>[]),
});

Dart FindProductInstances 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 /qry/productInstances HTTP/1.1 
Host: api.sbbet.ath.cx 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"currentPage":0,"pageSize":0,"qry":{"String":"String"}}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"data":[{"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"}],"currentPage":0,"pageSize":0,"totalItems":0,"totalPages":0}