Greyhounds.WebApi

<back to all web services

GetRace

The following routes are available for this service:
All Verbs/rounds/race
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
Object = TypeVar('Object')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Pool:
    id: int = 0
    name: Optional[str] = None
    coefficient: Decimal = decimal.Decimal(0)
    rtp: Decimal = decimal.Decimal(0)
    threshold: Decimal = decimal.Decimal(0)
    balance: Decimal = decimal.Decimal(0)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RaceOutcomeRecap:
    id: int = 0
    coef: float = 0.0
    win_count: int = 0
    win: Decimal = decimal.Decimal(0)
    is_win: bool = False
    results: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RoundOutcome:
    race_outcome_recaps: Optional[List[RaceOutcomeRecap]] = None
    stake: Decimal = decimal.Decimal(0)
    winnings: Decimal = decimal.Decimal(0)
    balance: Decimal = decimal.Decimal(0)
    return_to_player: Decimal = decimal.Decimal(0)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class JackpotInfo:
    is_given: bool = False
    id: Optional[str] = None
    slip_id: Optional[str] = None
    jp_id: Optional[str] = None
    amount: Decimal = decimal.Decimal(0)
    location_id: Optional[str] = None
    location_name: Optional[str] = None
    address_line: Optional[str] = None
    amount_accumulated: Decimal = decimal.Decimal(0)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Race:
    id: Optional[str] = None
    sequence: Optional[str] = None
    input_accumulation: Optional[List[Pool]] = None
    output_accumulation: Optional[List[Pool]] = None
    outcome: Optional[RoundOutcome] = None
    jackpot_info: Optional[JackpotInfo] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetRace:
    id: Optional[str] = None

Python GetRace 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 /rounds/race HTTP/1.1 
Host: grh1.api.bettor.webhop.biz 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	id: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	id: String,
	sequence: String,
	inputAccumulation: 
	[
		{
			id: 0,
			name: String,
			amount: 0
		}
	],
	outputAccumulation: 
	[
		{
			id: 0,
			name: String,
			amount: 0
		}
	],
	outcome: 
	{
		raceOutcomeRecaps: 
		[
			{
				id: 0,
				coef: 0,
				winCount: 0,
				win: 0,
				isWin: False,
				results: String
			}
		],
		stake: 0,
		winnings: 0,
		balance: 0,
		returnToPlayer: 0
	},
	jackpotInfo: 
	{
		isGiven: False,
		id: String,
		slipId: String,
		jpId: String,
		amount: 0,
		locationId: String,
		locationName: String,
		addressLine: String,
		amountAccumulated: 0
	}
}