Six4Win.WebApi

<back to all web services

GetSuperWinConfiguration

The following routes are available for this service:
All Verbs/qry/super-win/config
import Foundation
import ServiceStack

public class GetSuperWinConfiguration : Codable
{
    required public init(){}
}

public class SuperWinStateDoc : Codable
{
    public var id:String
    public var state:SuperWinState

    required public init(){}
}

public class SuperWinState : Codable
{
    public var currentDate:String
    public var availableAmount:Double
    public var pools:RecordDictionary<Int, SuperWinPool>

    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 SuperWinPool : Codable
{
    public var id:Int
    public var state:SuperWinPoolState
    public var amount:Double
    public var schedule:RecordList<SuperWinPrize>

    required public init(){}
}

public enum SuperWinPoolState : Int, Codable
{
    case Idle = 0
    case Accumulating = 1
    case Awarding = 2
}

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 SuperWinPrize : Codable
{
    public var id:Int
    public var amount:Double
    public var scheduledAt:Date
    public var winner:SuperWinWinner

    required public init(){}
}

public class SuperWinWinner : Codable
{
    public var isDrawn:Bool
    public var drawnAtUtc:Date
    public var roundId:String
    public var betId:String
    public var slipId:String
    public var origin:Origin
    public var bettor:Ref
    public var code:String
    public var amount:Double
    public var locationAddressOrBettorInfo: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(){}
}


Swift GetSuperWinConfiguration DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /qry/super-win/config HTTP/1.1 
Host: s4w2.api.bettor.cc 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"id":"String","state":{"currentDate":"String","availableAmount":0,"pools":{"0":{"id":0,"state":0,"amount":0,"schedule":[{"id":0,"amount":0,"scheduledAt":"0001-01-01T00:00:00.0000000Z","winner":{"isDrawn":false,"drawnAtUtc":"0001-01-01T00:00:00.0000000Z","roundId":"String","betId":"String","slipId":"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"}},"bettor":{"id":"String","val":"String"},"code":"String","amount":0,"locationAddressOrBettorInfo":"String"}}]}}}}