| GET | /qry/self-service-device-betting-sessions/{Id} |
|---|
# frozen_string_literal: true
# encoding: utf-8
require 'json'
require 'servicestack'
module SessionStatus
OPENING = 1
OPEN = 2
ENDING = 3
ENDED = 4
REJECTED = 5
end
module TopUpStatus
PENDING = 1
COMPLETED = 2
FAILED = 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 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 SessionTopUp
include ServiceStack::DTO
# @return [String]
attr_accessor :id
# @return [Money]
attr_accessor :amount
# @return [Ref]
attr_accessor :clerk
# @return [TopUpStatus]
attr_accessor :status
# @return [String]
attr_accessor :failure_reason
def self.properties
{
id: { name: 'id' },
amount: { name: 'amount', type: Money },
clerk: { name: 'clerk', type: Ref },
status: { name: 'status' },
failure_reason: { name: 'failureReason' },
}
end
end
class SelfServiceDeviceBettingSession
include ServiceStack::DTO
# @return [String]
attr_accessor :id
# @return [Ref]
attr_accessor :device
# @return [Ref]
attr_accessor :location
# @return [SessionStatus]
attr_accessor :status
# @return [DateTime]
attr_accessor :started_at
# @return [Ref]
attr_accessor :issued_by_clerk
# @return [String]
attr_accessor :patron_name
# @return [Money]
attr_accessor :initial_credit
# @return [RecordList]
attr_accessor :top_ups
# @return [String]
attr_accessor :payout_id
# @return [Money]
attr_accessor :payout
# @return [String]
attr_accessor :rejection_reason
def self.properties
{
id: { name: 'id' },
device: { name: 'device', type: Ref },
location: { name: 'location', type: Ref },
status: { name: 'status' },
started_at: { name: 'startedAt', type: DateTime },
issued_by_clerk: { name: 'issuedByClerk', type: Ref },
patron_name: { name: 'patronName' },
initial_credit: { name: 'initialCredit', type: Money },
top_ups: { name: 'topUps', type: RecordList },
payout_id: { name: 'payoutId' },
payout: { name: 'payout', type: Money },
rejection_reason: { name: 'rejectionReason' },
}
end
end
class GetSelfServiceDeviceBettingSession
include ServiceStack::DTO
# @return [String]
attr_accessor :id
def self.properties
{
id: { name: 'id' },
}
end
def response_type() = SelfServiceDeviceBettingSession
def get_type_name() = 'GetSelfServiceDeviceBettingSession'
end
class RecordList < Array
end
Ruby GetSelfServiceDeviceBettingSession DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /qry/self-service-device-betting-sessions/{Id} HTTP/1.1
Host: api.testenv.webhop.biz
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"id":"String","device":{"id":"String","val":"String"},"location":{"id":"String","val":"String"},"status":1,"startedAt":"0001-01-01T00:00:00.0000000Z","issuedByClerk":{"id":"String","val":"String"},"patronName":"String","initialCredit":{"amount":0,"currency":"String"},"topUps":[{"id":"String","amount":{"amount":0,"currency":"String"},"clerk":{"id":"String","val":"String"},"status":1,"failureReason":"String"}],"payoutId":"String","payout":{"amount":0,"currency":"String"},"rejectionReason":"String"}