| All Verbs | /qry/wins/recent |
|---|
# frozen_string_literal: true
# encoding: utf-8
require 'json'
require 'servicestack'
module BetOutcome
UNKNOWN = 0
LOST = 1
WON = 2
VOID = 3
end
module BetProcessingStatus
OPEN = 0
CLOSED = 1
end
module BetValidity
VALID = 0
CANCELED = 1
VOID = 2
REVERTED = 3
end
class Ref
include ServiceStack::DTO
# @return [String]
attr_accessor :id
# @return [String]
attr_accessor :val
def self.properties
{
id: { name: 'id' },
val: { name: 'val' },
}
end
end
class BettingApp
include ServiceStack::DTO
# @return [String]
attr_accessor :name
# @return [String]
attr_accessor :version
def self.properties
{
name: { name: 'name' },
version: { name: 'version' },
}
end
end
class RefEx < Ref
# @return [RecordDictionary]
attr_accessor :data
def self.properties
{
data: { name: 'data', type: RecordDictionary },
}
end
end
class Origin
include ServiceStack::DTO
# @return [BettingApp]
attr_accessor :application
# @return [String]
attr_accessor :ip
# @return [RefEx]
attr_accessor :organization
# @return [Ref]
attr_accessor :region
# @return [Ref]
attr_accessor :location_group
# @return [RefEx]
attr_accessor :location
# @return [RefEx]
attr_accessor :device
# @return [Ref]
attr_accessor :clerk
def self.properties
{
application: { name: 'application', type: BettingApp },
ip: { name: 'ip' },
organization: { name: 'organization', type: RefEx },
region: { name: 'region', type: Ref },
location_group: { name: 'locationGroup', type: Ref },
location: { name: 'location', type: RefEx },
device: { name: 'device', type: RefEx },
clerk: { name: 'clerk', type: Ref },
}
end
end
class Win
include ServiceStack::DTO
# @return [Integer]
attr_accessor :id
# @return [Integer]
attr_accessor :s_id
# @return [Ref]
attr_accessor :bettor
# @return [Origin]
attr_accessor :origin
# @return [DateTime]
attr_accessor :placed_at
# @return [Integer]
attr_accessor :round_id
# @return [String]
attr_accessor :content
# @return [BigDecimal]
attr_accessor :stake
# @return [BetOutcome]
attr_accessor :outcome
# @return [BigDecimal]
attr_accessor :amount
# @return [BetProcessingStatus]
attr_accessor :processing_status
# @return [BetValidity]
attr_accessor :validity
# @return [Dictionary]
attr_accessor :results
# @return [Dictionary]
attr_accessor :payload
def self.properties
{
id: { name: 'id' },
s_id: { name: 'sId' },
bettor: { name: 'bettor', type: Ref },
origin: { name: 'origin', type: Origin },
placed_at: { name: 'placedAt', type: DateTime },
round_id: { name: 'roundId' },
content: { name: 'content' },
stake: { name: 'stake' },
outcome: { name: 'outcome' },
amount: { name: 'amount' },
processing_status: { name: 'processingStatus' },
validity: { name: 'validity' },
results: { name: 'results' },
payload: { name: 'payload' },
}
end
end
class RecentWins
include ServiceStack::DTO
# @return [String]
attr_accessor :id
# @return [List]
attr_accessor :wins
def self.properties
{
id: { name: 'id' },
wins: { name: 'wins', type: [Win] },
}
end
end
class GetRecentWins
include ServiceStack::DTO
def response_type() = RecentWins
def get_type_name() = 'GetRecentWins'
end
class RecordDictionary < Hash
end
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /qry/wins/recent HTTP/1.1
Host: s4w1.api.bettor.webhop.biz
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
id: String,
wins:
[
{
id: 0,
sId: 0,
bettor:
{
id: String,
val: String
},
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
}
},
placedAt: 0001-01-01,
roundId: 0,
content: String,
stake: 0,
outcome: 0,
amount: 0,
processingStatus: 0,
validity: 0,
results:
{
String: String
},
payload:
{
String: String
}
}
]
}