Betting.WebApi

<back to all web services

GetLocationTotalsReport

The following routes are available for this service:
All Verbs/qry/reports/locationTotals
<?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};


enum WinningsKind : int
{
    case All = 0;
    case PaidOut = 1;
    case PendingPayout = 2;
}

enum DeviceType : int
{
    case ClerkServicedKiosk = 0;
    case PersonalOnline = 1;
    case SelfServiceKiosk = 2;
    case Unknown = -1;
}

class GetLocationTotalsReport implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $format=null,
        /** @var DateTime */
        public DateTime $periodFrom=new DateTime(),
        /** @var DateTime */
        public DateTime $periodTo=new DateTime(),
        /** @var WinningsKind|null */
        public ?WinningsKind $winningsKind=null,
        /** @var DeviceType|null */
        public ?DeviceType $deviceType=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['format'])) $this->format = $o['format'];
        if (isset($o['periodFrom'])) $this->periodFrom = JsonConverters::from('DateTime', $o['periodFrom']);
        if (isset($o['periodTo'])) $this->periodTo = JsonConverters::from('DateTime', $o['periodTo']);
        if (isset($o['winningsKind'])) $this->winningsKind = JsonConverters::from('WinningsKind', $o['winningsKind']);
        if (isset($o['deviceType'])) $this->deviceType = JsonConverters::from('DeviceType', $o['deviceType']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->format)) $o['format'] = $this->format;
        if (isset($this->periodFrom)) $o['periodFrom'] = JsonConverters::to('DateTime', $this->periodFrom);
        if (isset($this->periodTo)) $o['periodTo'] = JsonConverters::to('DateTime', $this->periodTo);
        if (isset($this->winningsKind)) $o['winningsKind'] = JsonConverters::to('WinningsKind', $this->winningsKind);
        if (isset($this->deviceType)) $o['deviceType'] = JsonConverters::to('DeviceType', $this->deviceType);
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetLocationTotalsReport 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/reports/locationTotals HTTP/1.1 
Host: api.sbbet.ath.cx 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"format":"String","periodFrom":"0001-01-01T00:00:00.0000000Z","periodTo":"0001-01-01T00:00:00.0000000Z","winningsKind":0,"deviceType":0}