Six4Win.WebApi

<back to all web services

GetLocationFeed

The following routes are available for this service:
All Verbs/qry/feed/locations
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


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CurrentRoundInfo:
    round_id: Optional[str] = None
    amount: Decimal = decimal.Decimal(0)
    inert_code: Optional[str] = None


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


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


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RefEx(Ref):
    data: Optional[RecordDictionary[str, str]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Origin:
    application: Optional[BettingApp] = None
    ip: Optional[str] = None
    organization: Optional[RefEx] = None
    region: Optional[Ref] = None
    location_group: Optional[Ref] = None
    location: Optional[RefEx] = None
    device: Optional[RefEx] = None
    clerk: Optional[Ref] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class WinnerByCode:
    round_id: Optional[str] = None
    drawn_at_utc: datetime.datetime = datetime.datetime(1, 1, 1)
    slip_id: Optional[str] = None
    bet_id: Optional[str] = None
    code: Optional[str] = None
    amount: Decimal = decimal.Decimal(0)
    origin: Optional[Origin] = None
    bettor: Optional[Ref] = None
    location_address_or_bettor_info: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class LocalCodePotInfo:
    is_active: bool = False
    current: Optional[CurrentRoundInfo] = None
    winners: Optional[List[WinnerByCode]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class LocationFeed:
    exists: bool = False
    id: Optional[str] = None
    lcp_info: Optional[LocalCodePotInfo] = None


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


TKey = TypeVar('TKey')
TVal = TypeVar('TVal')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RecordDictionary(Generic[TKey, TVal], Dict[TKey,TVal]):
    pass

Python GetLocationFeed 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/feed/locations HTTP/1.1 
Host: s4w2.api.bettor.cc 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

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

{
	exists: False,
	id: String,
	lcpInfo: 
	{
		isActive: False,
		current: 
		{
			roundId: String,
			amount: 0,
			inertCode: String
		},
		winners: 
		[
			{
				roundId: String,
				drawnAtUtc: 0001-01-01,
				slipId: String,
				betId: String,
				code: String,
				amount: 0,
				origin: 
				{
					application: 
					{
						name: String,
						version: String
					},
					ip: String,
					organization: 
					{
						data: 
						{
							String: String
						},
						id: String,
						val: String
					},
					region: 
					{
						id: String,
						val: String
					},
					locationGroup: 
					{
						id: String,
						val: String
					},
					location: 
					{
						data: 
						{
							String: String
						},
						id: String,
						val: String
					},
					device: 
					{
						data: 
						{
							String: String
						},
						id: String,
						val: String
					},
					clerk: 
					{
						id: String,
						val: String
					}
				},
				bettor: 
				{
					id: String,
					val: String
				},
				locationAddressOrBettorInfo: String
			}
		]
	}
}