Six4Win.WebApi

<back to all web services

GetLastRoundsStats

The following routes are available for this service:
All Verbs/qry/stats/last10
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


class Rating implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $val=0,
        /** @var int */
        public int $count=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['val'])) $this->val = $o['val'];
        if (isset($o['count'])) $this->count = $o['count'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->val)) $o['val'] = $this->val;
        if (isset($this->count)) $o['count'] = $this->count;
        return empty($o) ? new class(){} : $o;
    }
}

class Comparison implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $v1=0,
        /** @var int */
        public int $v2=0,
        /** @var float */
        public float $p1=0.0,
        /** @var float */
        public float $p2=0.0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['v1'])) $this->v1 = $o['v1'];
        if (isset($o['v2'])) $this->v2 = $o['v2'];
        if (isset($o['p1'])) $this->p1 = $o['p1'];
        if (isset($o['p2'])) $this->p2 = $o['p2'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->v1)) $o['v1'] = $this->v1;
        if (isset($this->v2)) $o['v2'] = $this->v2;
        if (isset($this->p1)) $o['p1'] = $this->p1;
        if (isset($this->p2)) $o['p2'] = $this->p2;
        return empty($o) ? new class(){} : $o;
    }
}

class LastRoundsStats implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id=null,
        /** @var int[]|null */
        public ?array $topSix=null,
        /** @var int[]|null */
        public ?array $bottomSix=null,
        /** @var array<Rating>|null */
        public ?array $topFirstColors=null,
        /** @var array<Rating>|null */
        public ?array $topColors=null,
        /** @var Comparison|null */
        public ?Comparison $firstNrEvenVsOdd=null,
        /** @var Comparison|null */
        public ?Comparison $firstNrLessVsGreater24_5=null,
        /** @var Comparison|null */
        public ?Comparison $sumOfFirstFiveLessVsGreaterThan122_5=null,
        /** @var Comparison|null */
        public ?Comparison $totalEvenVsOdd=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['topSix'])) $this->topSix = JsonConverters::fromArray('int', $o['topSix']);
        if (isset($o['bottomSix'])) $this->bottomSix = JsonConverters::fromArray('int', $o['bottomSix']);
        if (isset($o['topFirstColors'])) $this->topFirstColors = JsonConverters::fromArray('Rating', $o['topFirstColors']);
        if (isset($o['topColors'])) $this->topColors = JsonConverters::fromArray('Rating', $o['topColors']);
        if (isset($o['firstNrEvenVsOdd'])) $this->firstNrEvenVsOdd = JsonConverters::from('Comparison', $o['firstNrEvenVsOdd']);
        if (isset($o['firstNrLessVsGreater24_5'])) $this->firstNrLessVsGreater24_5 = JsonConverters::from('Comparison', $o['firstNrLessVsGreater24_5']);
        if (isset($o['sumOfFirstFiveLessVsGreaterThan122_5'])) $this->sumOfFirstFiveLessVsGreaterThan122_5 = JsonConverters::from('Comparison', $o['sumOfFirstFiveLessVsGreaterThan122_5']);
        if (isset($o['totalEvenVsOdd'])) $this->totalEvenVsOdd = JsonConverters::from('Comparison', $o['totalEvenVsOdd']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->topSix)) $o['topSix'] = JsonConverters::toArray('int', $this->topSix);
        if (isset($this->bottomSix)) $o['bottomSix'] = JsonConverters::toArray('int', $this->bottomSix);
        if (isset($this->topFirstColors)) $o['topFirstColors'] = JsonConverters::toArray('Rating', $this->topFirstColors);
        if (isset($this->topColors)) $o['topColors'] = JsonConverters::toArray('Rating', $this->topColors);
        if (isset($this->firstNrEvenVsOdd)) $o['firstNrEvenVsOdd'] = JsonConverters::to('Comparison', $this->firstNrEvenVsOdd);
        if (isset($this->firstNrLessVsGreater24_5)) $o['firstNrLessVsGreater24_5'] = JsonConverters::to('Comparison', $this->firstNrLessVsGreater24_5);
        if (isset($this->sumOfFirstFiveLessVsGreaterThan122_5)) $o['sumOfFirstFiveLessVsGreaterThan122_5'] = JsonConverters::to('Comparison', $this->sumOfFirstFiveLessVsGreaterThan122_5);
        if (isset($this->totalEvenVsOdd)) $o['totalEvenVsOdd'] = JsonConverters::to('Comparison', $this->totalEvenVsOdd);
        return empty($o) ? new class(){} : $o;
    }
}

class GetLastRoundsStats implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetLastRoundsStats DTOs

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

HTTP + CSV

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

POST /qry/stats/last10 HTTP/1.1 
Host: s4w2.api.bettor.cc 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"id":"String","topSix":[0],"bottomSix":[0],"topFirstColors":[{"val":0,"count":0}],"topColors":[{"val":0,"count":0}],"firstNrEvenVsOdd":{"v1":0,"v2":0,"p1":0,"p2":0},"firstNrLessVsGreater24_5":{"v1":0,"v2":0,"p1":0,"p2":0},"sumOfFirstFiveLessVsGreaterThan122_5":{"v1":0,"v2":0,"p1":0,"p2":0},"totalEvenVsOdd":{"v1":0,"v2":0,"p1":0,"p2":0}}