Six4Win.WebApi

<back to all web services

GetCustomThresholds

The following routes are available for this service:
GET/qry/configurations/thresholds/custom
<?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 Pool implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $id=0,
        /** @var string|null */
        public ?string $name=null,
        /** @var float */
        public float $coefficient=0.0,
        /** @var float */
        public float $rtp=0.0,
        /** @var float */
        public float $threshold=0.0,
        /** @var float */
        public float $balance=0.0,
        /** @var float */
        public float $rrtp=0.0,
        /** @var float */
        public float $rBalance=0.0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['coefficient'])) $this->coefficient = $o['coefficient'];
        if (isset($o['rtp'])) $this->rtp = $o['rtp'];
        if (isset($o['threshold'])) $this->threshold = $o['threshold'];
        if (isset($o['balance'])) $this->balance = $o['balance'];
        if (isset($o['rrtp'])) $this->rrtp = $o['rrtp'];
        if (isset($o['rBalance'])) $this->rBalance = $o['rBalance'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->coefficient)) $o['coefficient'] = $this->coefficient;
        if (isset($this->rtp)) $o['rtp'] = $this->rtp;
        if (isset($this->threshold)) $o['threshold'] = $this->threshold;
        if (isset($this->balance)) $o['balance'] = $this->balance;
        if (isset($this->rrtp)) $o['rrtp'] = $this->rrtp;
        if (isset($this->rBalance)) $o['rBalance'] = $this->rBalance;
        return empty($o) ? new class(){} : $o;
    }
}

class CustomThresholds implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id=null,
        /** @var array<Pool>|null */
        public ?array $pools=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['pools'])) $this->pools = JsonConverters::fromArray('Pool', $o['pools']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->pools)) $o['pools'] = JsonConverters::toArray('Pool', $this->pools);
        return empty($o) ? new class(){} : $o;
    }
}

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

PHP GetCustomThresholds 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.

GET /qry/configurations/thresholds/custom HTTP/1.1 
Host: s4w2.api.bettor.cc 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	id: String,
	pools: 
	[
		{
			id: 0,
			name: String,
			treshold: 0
		}
	]
}