| All Verbs | /qry/rounds/integrity |
|---|
import Foundation
import ServiceStack
public class GetRoundIntegrity : Codable
{
public var roundId:String
required public init(){}
}
public class RoundIntegrityCheckResult : Codable
{
public var status:CheckStatus
public var extraWinnings:Double
public var betCount:Int
public var jpInfo:Jackpot5Info
required public init(){}
}
public enum CheckStatus : Int, Codable
{
case Ok = 1
case Error = 2
}
public class Jackpot5Info : Codable
{
public var isHit:Bool
public var amountAccumulated:Double
public var amountAwarded:Double
public var nrOfWinners:Int
public var jackPot5Winners:[JackPot5Winner]
required public init(){}
}
public class JackPot5Winner : Codable
{
public var betId:String
public var nrOfCombinations:Int
public var winningsAmount:Double
public var origin:Origin
public var bettor:Ref
public var payload:[String:String]
required public init(){}
}
public class Origin : Codable
{
public var application:BettingApp
public var ip:String
public var organization:RefEx
public var region:Ref
public var locationGroup:Ref
public var location:RefEx
public var device:RefEx
public var clerk:Ref
required public init(){}
}
public class BettingApp : Codable
{
public var name:String
public var version:String
required public init(){}
}
public class RefEx : Ref
{
public var data:RecordDictionary<String, String>
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case data
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
data = try container.decodeIfPresent(RecordDictionary<String, String>.self, forKey: .data)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if data != nil { try container.encode(data, forKey: .data) }
}
}
public class Ref : Codable
{
public var id:String
public var val:String
required public init(){}
}
public class RecordDictionary<TKey : Codable, TVal : Codable> : List<TKey:TVal>
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /qry/rounds/integrity HTTP/1.1
Host: s4w2.api.bettor.cc
Accept: application/json
Content-Type: application/json
Content-Length: length
{"roundId":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"status":1,"extraWinnings":0,"betCount":0,"jpInfo":{"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"}}]}}