Six4Win.WebApi

<back to all web services

GetDraw

The following routes are available for this service:
All Verbs/qry/rounds/draw
# frozen_string_literal: true
# encoding: utf-8


require 'json'
require 'servicestack'


module CustomBetType
    FIRST_NUMBER_ODD = 4
    FIRST_NUMBER_EVEN = 5
    FIRSTNUMBERLESSTHAN24_5 = 6
    FIRSTNUMBERGREATERTHAN24_5 = 7
    SUMOFFIRSTFIVELESSTHAN122_5 = 8
    SUMOFFIRSTFIVEGREATERTHAN122_5 = 9
    FIRST_COLOR1 = 10
    FIRST_COLOR2 = 11
    FIRST_COLOR3 = 12
    FIRST_COLOR4 = 13
    FIRST_COLOR5 = 14
    FIRST_COLOR6 = 15
    FIRST_COLOR7 = 16
    FIRST_COLOR8 = 17
    MORE_ODD_NUMBERS = 18
    MORE_EVEN_NUMBERS = 19
end

class Pool
    include ServiceStack::DTO

    # @return [Integer]
    attr_accessor :id
    # @return [String]
    attr_accessor :name
    # @return [BigDecimal]
    attr_accessor :coefficient
    # @return [BigDecimal]
    attr_accessor :rtp
    # @return [BigDecimal]
    attr_accessor :threshold
    # @return [BigDecimal]
    attr_accessor :balance
    # @return [BigDecimal]
    attr_accessor :rrtp
    # @return [BigDecimal]
    attr_accessor :r_balance

    def self.properties
        {
            id: { name: 'id' },
            name: { name: 'name' },
            coefficient: { name: 'coefficient' },
            rtp: { name: 'rtp' },
            threshold: { name: 'threshold' },
            balance: { name: 'balance' },
            rrtp: { name: 'rrtp' },
            r_balance: { name: 'rBalance' },
        }
    end

end

class DrawItem
    include ServiceStack::DTO

    # @return [Integer]
    attr_accessor :ordinal
    # @return [Integer]
    attr_accessor :number
    # @return [Float]
    attr_accessor :coefficient
    # @return [TrueClass]
    attr_accessor :is_double_triple
    # @return [TrueClass]
    attr_accessor :constitutes_jackpot
    # @return [Integer]
    attr_accessor :hits
    # @return [BigDecimal]
    attr_accessor :win

    def self.properties
        {
            ordinal: { name: 'ordinal' },
            number: { name: 'number' },
            coefficient: { name: 'coefficient' },
            is_double_triple: { name: 'isDoubleTriple' },
            constitutes_jackpot: { name: 'constitutesJackpot' },
            hits: { name: 'hits' },
            win: { name: 'win' },
        }
    end

end

class CustomBetOutcome
    include ServiceStack::DTO

    # @return [CustomBetType]
    attr_accessor :type
    # @return [Float]
    attr_accessor :coef
    # @return [Integer]
    attr_accessor :win_count
    # @return [BigDecimal]
    attr_accessor :win
    # @return [TrueClass]
    attr_accessor :is_win
    # @return [String]
    attr_accessor :results

    def self.properties
        {
            type: { name: 'type' },
            coef: { name: 'coef' },
            win_count: { name: 'winCount' },
            win: { name: 'win' },
            is_win: { name: 'isWin' },
            results: { name: 'results' },
        }
    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 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 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 WinnerByCode
    include ServiceStack::DTO

    # @return [String]
    attr_accessor :round_id
    # @return [DateTime]
    attr_accessor :drawn_at_utc
    # @return [String]
    attr_accessor :slip_id
    # @return [String]
    attr_accessor :bet_id
    # @return [String]
    attr_accessor :code
    # @return [BigDecimal]
    attr_accessor :amount
    # @return [Origin]
    attr_accessor :origin
    # @return [Ref]
    attr_accessor :bettor
    # @return [String]
    attr_accessor :location_address_or_bettor_info

    def self.properties
        {
            round_id: { name: 'roundId' },
            drawn_at_utc: { name: 'drawnAtUtc', type: DateTime },
            slip_id: { name: 'slipId' },
            bet_id: { name: 'betId' },
            code: { name: 'code' },
            amount: { name: 'amount' },
            origin: { name: 'origin', type: Origin },
            bettor: { name: 'bettor', type: Ref },
            location_address_or_bettor_info: { name: 'locationAddressOrBettorInfo' },
        }
    end

end

class SuperWinWinner
    include ServiceStack::DTO

    # @return [TrueClass]
    attr_accessor :is_drawn
    # @return [DateTime]
    attr_accessor :drawn_at_utc
    # @return [String]
    attr_accessor :round_id
    # @return [String]
    attr_accessor :bet_id
    # @return [String]
    attr_accessor :slip_id
    # @return [Origin]
    attr_accessor :origin
    # @return [Ref]
    attr_accessor :bettor
    # @return [String]
    attr_accessor :code
    # @return [BigDecimal]
    attr_accessor :amount
    # @return [String]
    attr_accessor :location_address_or_bettor_info

    def self.properties
        {
            is_drawn: { name: 'isDrawn' },
            drawn_at_utc: { name: 'drawnAtUtc', type: DateTime },
            round_id: { name: 'roundId' },
            bet_id: { name: 'betId' },
            slip_id: { name: 'slipId' },
            origin: { name: 'origin', type: Origin },
            bettor: { name: 'bettor', type: Ref },
            code: { name: 'code' },
            amount: { name: 'amount' },
            location_address_or_bettor_info: { name: 'locationAddressOrBettorInfo' },
        }
    end

end

class SuperWinInfo
    include ServiceStack::DTO

    # @return [TrueClass]
    attr_accessor :is_active
    # @return [SuperWinWinner]
    attr_accessor :winner
    # @return [BigDecimal]
    attr_accessor :available_amount
    # @return [TrueClass]
    attr_accessor :all_prizes_awarded

    def self.properties
        {
            is_active: { name: 'isActive' },
            winner: { name: 'winner', type: SuperWinWinner },
            available_amount: { name: 'availableAmount' },
            all_prizes_awarded: { name: 'allPrizesAwarded' },
        }
    end

end

class JackPot5Winner
    include ServiceStack::DTO

    # @return [String]
    attr_accessor :bet_id
    # @return [Integer]
    attr_accessor :nr_of_combinations
    # @return [BigDecimal]
    attr_accessor :winnings_amount
    # @return [Origin]
    attr_accessor :origin
    # @return [Ref]
    attr_accessor :bettor
    # @return [Dictionary]
    attr_accessor :payload

    def self.properties
        {
            bet_id: { name: 'betId' },
            nr_of_combinations: { name: 'nrOfCombinations' },
            winnings_amount: { name: 'winningsAmount' },
            origin: { name: 'origin', type: Origin },
            bettor: { name: 'bettor', type: Ref },
            payload: { name: 'payload' },
        }
    end

end

class Jackpot5Info
    include ServiceStack::DTO

    # @return [TrueClass]
    attr_accessor :is_hit
    # @return [BigDecimal]
    attr_accessor :amount_accumulated
    # @return [BigDecimal]
    attr_accessor :amount_awarded
    # @return [Integer]
    attr_accessor :nr_of_winners
    # @return [List]
    attr_accessor :jack_pot5_winners

    def self.properties
        {
            is_hit: { name: 'isHit' },
            amount_accumulated: { name: 'amountAccumulated' },
            amount_awarded: { name: 'amountAwarded' },
            nr_of_winners: { name: 'nrOfWinners' },
            jack_pot5_winners: { name: 'jackPot5Winners', type: [JackPot5Winner] },
        }
    end

end

class GlobalCodePotInfo
    include ServiceStack::DTO

    # @return [TrueClass]
    attr_accessor :is_active
    # @return [TrueClass]
    attr_accessor :is_drawn
    # @return [WinnerByCode]
    attr_accessor :winner
    # @return [String]
    attr_accessor :inert_code
    # @return [BigDecimal]
    attr_accessor :accumulation

    def self.properties
        {
            is_active: { name: 'isActive' },
            is_drawn: { name: 'isDrawn' },
            winner: { name: 'winner', type: WinnerByCode },
            inert_code: { name: 'inertCode' },
            accumulation: { name: 'accumulation' },
        }
    end

end

class RoundOutcome
    include ServiceStack::DTO

    # @return [List]
    attr_accessor :draw
    # @return [List]
    attr_accessor :custom_bet_outcomes
    # @return [List]
    attr_accessor :lcp_winners
    # @return [SuperWinInfo]
    attr_accessor :super_win_info
    # @return [Jackpot5Info]
    attr_accessor :jackpot5_info
    # @return [GlobalCodePotInfo]
    attr_accessor :global_code_pot_info
    # @return [BigDecimal]
    attr_accessor :stake
    # @return [Integer]
    attr_accessor :bet_count
    # @return [BigDecimal]
    attr_accessor :winnings
    # @return [BigDecimal]
    attr_accessor :balance
    # @return [BigDecimal]
    attr_accessor :return_to_player
    # @return [Integer]
    attr_accessor :win_count
    # @return [Integer]
    attr_accessor :slip_win_count
    # @return [Float]
    attr_accessor :win_count_pct
    # @return [Integer]
    attr_accessor :slip_count
    # @return [Integer]
    attr_accessor :unit_bet_count

    def self.properties
        {
            draw: { name: 'draw', type: [DrawItem] },
            custom_bet_outcomes: { name: 'customBetOutcomes', type: [CustomBetOutcome] },
            lcp_winners: { name: 'lcpWinners', type: [WinnerByCode] },
            super_win_info: { name: 'superWinInfo', type: SuperWinInfo },
            jackpot5_info: { name: 'jackpot5Info', type: Jackpot5Info },
            global_code_pot_info: { name: 'globalCodePotInfo', type: GlobalCodePotInfo },
            stake: { name: 'stake' },
            bet_count: { name: 'betCount' },
            winnings: { name: 'winnings' },
            balance: { name: 'balance' },
            return_to_player: { name: 'returnToPlayer' },
            win_count: { name: 'winCount' },
            slip_win_count: { name: 'slipWinCount' },
            win_count_pct: { name: 'winCountPct' },
            slip_count: { name: 'slipCount' },
            unit_bet_count: { name: 'unitBetCount' },
        }
    end

end

class Draw
    include ServiceStack::DTO

    # @return [String]
    attr_accessor :id
    # @return [String]
    attr_accessor :sequence
    # @return [List]
    attr_accessor :input_accumulation
    # @return [List]
    attr_accessor :output_accumulation
    # @return [RoundOutcome]
    attr_accessor :outcome

    def self.properties
        {
            id: { name: 'id' },
            sequence: { name: 'sequence' },
            input_accumulation: { name: 'inputAccumulation', type: [Pool] },
            output_accumulation: { name: 'outputAccumulation', type: [Pool] },
            outcome: { name: 'outcome', type: RoundOutcome },
        }
    end

end

class GetDraw
    include ServiceStack::DTO

    # @return [String]
    attr_accessor :id

    def self.properties
        {
            id: { name: 'id' },
        }
    end

    def response_type() = Draw
    def get_type_name() = 'GetDraw'
end

class RecordDictionary < Hash
end

Ruby GetDraw 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/rounds/draw HTTP/1.1 
Host: s4w1.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,
			reserveAmount: 0
		}
	],
	outputAccumulation: 
	[
		{
			id: 0,
			name: String,
			amount: 0,
			reserveAmount: 0
		}
	],
	outcome: 
	{
		draw: 
		[
			{
				ordinal: 0,
				number: 0,
				coefficient: 0,
				isDoubleTriple: False,
				constitutesJackpot: False,
				hits: 0,
				win: 0
			}
		],
		customBetOutcomes: 
		[
			{
				type: 4,
				coef: 0,
				winCount: 0,
				win: 0,
				isWin: False,
				results: String
			}
		],
		lcpWinners: 
		[
			{
				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
			}
		],
		superWinInfo: 
		{
			isActive: False,
			winner: 
			{
				isDrawn: False,
				drawnAtUtc: 0001-01-01,
				roundId: String,
				betId: String,
				slipId: 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
					}
				},
				bettor: 
				{
					id: String,
					val: String
				},
				code: String,
				amount: 0,
				locationAddressOrBettorInfo: String
			},
			availableAmount: 0,
			allPrizesAwarded: False
		},
		jackpot5Info: 
		{
			isHit: False,
			amountAccumulated: 0,
			amountAwarded: 0,
			nrOfWinners: 0,
			jackPot5Winners: 
			[
				{
					betId: String,
					nrOfCombinations: 0,
					winningsAmount: 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
					},
					payload: 
					{
						String: String
					}
				}
			]
		},
		globalCodePotInfo: 
		{
			isActive: False,
			isDrawn: True,
			winner: 
			{
				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
			},
			inertCode: String,
			accumulation: 0
		},
		stake: 0,
		betCount: 0,
		winnings: 0,
		balance: 0,
		returnToPlayer: 0,
		winCount: 0,
		slipWinCount: 0,
		winCountPct: 0,
		slipCount: 0,
		unitBetCount: 0
	}
}