| POST | /cmd/bettingPolicies/config |
|---|
import Foundation
import ServiceStack
public class SetBettingPoliciesConfig : Codable
{
public var id:String
public var policies:BettingPolicies
public var productInstanceRef:Ref
public var ownerRef:Ref
public var isActive:Bool
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
}
public class Ref : Codable
{
public var id:String
public var val:String
required public init(){}
}
Swift SetBettingPoliciesConfig DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /cmd/bettingPolicies/config HTTP/1.1
Host: api.sbbet.ath.cx
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"id":"String","policies":{"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"},"productInstanceRef":{"id":"String","val":"String"},"ownerRef":{"id":"String","val":"String"},"isActive":false}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}