| POST | /cmd/products/instances |
|---|
import Foundation
import ServiceStack
public class InstallProductInstance : Codable
{
public var id:String
public var name:String
public var title:String
public var product:ProductReference
public var currency:Ref
public var bettingPolicies:BettingPolicies
public var apiUrl:String
public var backOfficeUrl:String
public var instanceUrl:String
public var feedPlayerUrl:String
required public init(){}
}
public class ProductReference : Codable
{
public var id:String
public var value:String
public var category:String
public var productProvider:Ref
required public init(){}
}
public class Ref : Codable
{
public var id:String
public var val: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 InstallProductInstance DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /cmd/products/instances HTTP/1.1
Host: api.sbbet.ath.cx
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
id: String,
name: String,
title: String,
product:
{
id: String,
value: String,
category: String,
productProvider:
{
id: String,
val: String
}
},
currency:
{
id: String,
val: 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,
backOfficeUrl: String,
instanceUrl: String,
feedPlayerUrl: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
}