Betting.WebApi

<back to all web services

GetProductInstanceConfiguration

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


require 'json'
require 'servicestack'


module PayinConstraintType
    SINGLE_BET = 0
    MULTI_BET = 1
    SYSTEM_BET = 2
end

module WinningsCapType
    SINGLE_BET = 0
    MULTI_BET = 1
    SYSTEM_BET = 2
end

class Money
    include ServiceStack::DTO

    # @return [BigDecimal]
    attr_accessor :amount
    # @return [String]
    attr_accessor :currency

    def self.properties
        {
            amount: { name: 'amount' },
            currency: { name: 'currency' },
        }
    end

end

class PayinConstraint
    include ServiceStack::DTO

    # @return [PayinConstraintType]
    attr_accessor :type
    # @return [Money]
    attr_accessor :min
    # @return [Money]
    attr_accessor :default
    # @return [Money]
    attr_accessor :warning_threshold
    # @return [Money]
    attr_accessor :max

    def self.properties
        {
            type: { name: 'type' },
            min: { name: 'min', type: Money },
            default: { name: 'default', type: Money },
            warning_threshold: { name: 'warningThreshold', type: Money },
            max: { name: 'max', type: Money },
        }
    end

end

class WinningsCap
    include ServiceStack::DTO

    # @return [WinningsCapType]
    attr_accessor :type
    # @return [Money]
    attr_accessor :cap

    def self.properties
        {
            type: { name: 'type' },
            cap: { name: 'cap', type: Money },
        }
    end

end

class BettingPolicies
    include ServiceStack::DTO

    # @return [RecordList]
    attr_accessor :payin_constraints
    # @return [String]
    attr_accessor :payin_taxation_policy_id
    # @return [RecordList]
    attr_accessor :winnings_caps
    # @return [String]
    attr_accessor :winnings_taxation_policy_id

    def self.properties
        {
            payin_constraints: { name: 'payinConstraints', type: RecordList },
            payin_taxation_policy_id: { name: 'payinTaxationPolicyId' },
            winnings_caps: { name: 'winningsCaps', type: RecordList },
            winnings_taxation_policy_id: { name: 'winningsTaxationPolicyId' },
        }
    end

end

class ProductInstanceConfiguration
    include ServiceStack::DTO

    # @return [String]
    attr_accessor :id
    # @return [BettingPolicies]
    attr_accessor :betting_policies
    # @return [String]
    attr_accessor :api_url
    # @return [Dictionary]
    attr_accessor :settings

    def self.properties
        {
            id: { name: 'id' },
            betting_policies: { name: 'bettingPolicies', type: BettingPolicies },
            api_url: { name: 'apiUrl' },
            settings: { name: 'settings' },
        }
    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 GetProductInstanceConfiguration
    include ServiceStack::DTO

    # @return [String]
    attr_accessor :id
    # @return [Origin]
    attr_accessor :origin

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

    def response_type() = ProductInstanceConfiguration
    def get_type_name() = 'GetProductInstanceConfiguration'
end

class RecordDictionary < Hash
end

class RecordList < Array
end

Ruby GetProductInstanceConfiguration 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/configurations/productInstances HTTP/1.1 
Host: api.bettor.webhop.biz 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	id: 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
		}
	}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	id: String,
	bettingPolicies: 
	{
		payinConstraints: 
		[
			{
				type: 0,
				min: 
				{
					amount: 0,
					currency: String
				},
				default: 
				{
					amount: 0,
					currency: String
				},
				warningThreshold: 
				{
					amount: 0,
					currency: String
				},
				max: 
				{
					amount: 0,
					currency: String
				}
			}
		],
		payinTaxationPolicyId: String,
		winningsCaps: 
		[
			{
				type: 0,
				cap: 
				{
					amount: 0,
					currency: String
				}
			}
		],
		winningsTaxationPolicyId: String
	},
	apiUrl: String,
	settings: 
	{
		String: String
	}
}