Betting.WebApi

<back to all web services

FindGroupTotalsByPeriod

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

class QueryRequest implements IConvertible
{
    RecordDictionary<String,String> qry;

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

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

    Map<String, dynamic> toJson() => {
        'qry': JsonConverters.toJson(qry,'RecordDictionary<String,String>',context!)
    };

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

class PaginatedQueryRequest extends QueryRequest implements IConvertible
{
    int currentPage = 0;
    int pageSize = 0;

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

class RecordDictionary<TKey,TVal> extends Map<TKey,TVal?> implements IConvertible
{
    RecordDictionary();
    RecordDictionary.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() => "RecordDictionary<$TKey,$TVal>";
    TypeContext? context = _ctx;
}

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

    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 = 0;
    int pageSize = 0;
    int totalItems = 0;
    int totalPages = 0;

    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.bettor.webhop.biz', types: <String, TypeInfo> {
    'QueryRequest': TypeInfo(TypeOf.Class, create:() => QueryRequest()),
    'RecordDictionary<String,String>': TypeInfo(TypeOf.Class, create:() => RecordDictionary<String,String>()),
    'PaginatedQueryRequest': TypeInfo(TypeOf.Class, create:() => PaginatedQueryRequest()),
    'FindGroupTotalsByPeriod': TypeInfo(TypeOf.Class, create:() => FindGroupTotalsByPeriod()),
    'RecordDictionary<TKey,TVal>': TypeInfo(TypeOf.GenericDef,create:() => RecordDictionary()),
    'ResponseMetrics': TypeInfo(TypeOf.Class, create:() => ResponseMetrics()),
    'PaginatedResult<T>': TypeInfo(TypeOf.Class, create:() => PaginatedResult<T>()),
    'List<ResponseMetrics>': TypeInfo(TypeOf.Class, create:() => <ResponseMetrics>[]),
});

Dart FindGroupTotalsByPeriod DTOs

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

HTTP + JSV

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

POST /qry/totals/group/period HTTP/1.1 
Host: api.bettor.webhop.biz 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

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

{
	data: 
	[
		{
			id: String,
			name: String,
			cancelationInfo: 
			{
				count: 0,
				amount: 0
			},
			reversionInfo: 
			{
				count: 0,
				amount: 0
			},
			voidInfo: 
			{
				count: 0,
				amount: 0
			},
			payinInfo: 
			{
				betCount: 0,
				payin: 0,
				tax: 0,
				stake: 0
			},
			payoutSummary: 
			{
				realized: 
				{
					betCount: 0,
					winnings: 0,
					tax: 0,
					payout: 0
				},
				paidOut: 
				{
					betCount: 0,
					winnings: 0,
					tax: 0,
					payout: 0
				},
				expired: 
				{
					betCount: 0,
					winnings: 0,
					tax: 0,
					payout: 0
				},
				pending: 
				{
					betCount: 0,
					winnings: 0,
					tax: 0,
					payout: 0
				}
			},
			balanceSummary: 
			{
				realized: 
				{
					balance: 0,
					profitPct: 0
				},
				paidOut: 
				{
					balance: 0,
					profitPct: 0
				}
			}
		}
	],
	currentPage: 0,
	pageSize: 0,
	totalItems: 0,
	totalPages: 0
}