| All Verbs | /qry/configurations/productInstances |
|---|
import Foundation
import ServiceStack
public class GetProductInstanceConfiguration : Codable
{
public var id:String
public var origin:Origin
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)
}
}
public class ProductInstanceConfiguration : Codable
{
public var id:String
public var bettingPolicies:BettingPolicies
public var apiUrl:String
public var settings:[String:String]
required public init(){}
}
public class BettingPolicies : Codable
{
public var payinConstraints:RecordList<PayinConstraint>
public var payinTaxationPolicyId:String
public var winningsCaps:RecordList<WinningsCap>
public var winningsTaxationPolicyId:String
required public init(){}
}
public class RecordList<T : Codable> : List<T>
{
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)
}
}
public class PayinConstraint : Codable
{
public var type:PayinConstraintType
public var min:Money
public var `default`:Money
public var warningThreshold:Money
public var max:Money
required public init(){}
}
public enum PayinConstraintType : Int, Codable
{
case SingleBet = 0
case MultiBet = 1
case SystemBet = 2
}
public class Money : Codable
{
public var amount:Double
public var currency:String
required public init(){}
}
public class WinningsCap : Codable
{
public var type:WinningsCapType
public var cap:Money
required public init(){}
}
public enum WinningsCapType : Int, Codable
{
case SingleBet = 0
case MultiBet = 1
case SystemBet = 2
}
Swift GetProductInstanceConfiguration 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.
POST /qry/configurations/productInstances HTTP/1.1
Host: api.sbbet.ath.cx
Accept: text/csv
Content-Type: text/csv
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/csv
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"}}