Six4Win.WebApi

<back to all web services

GetRecentGlobalCodePotWinners

The following routes are available for this service:
GET/qry/recentGlobalCodePotWinners
import Foundation
import ServiceStack

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

public class RecentGlobalCodePotWinners : Codable
{
    public var id:String
    public var recentWinners:[WinnerByCode]

    required public init(){}
}

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

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)
    }
}


Swift GetRecentGlobalCodePotWinners DTOs

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

HTTP + XML

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

GET /qry/recentGlobalCodePotWinners HTTP/1.1 
Host: s4w2.api.bettor.cc 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<RecentGlobalCodePotWinners xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Six4Win.ReadModel">
  <RecentWinners xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
    <d2p1:_array xmlns:d3p1="http://schemas.datacontract.org/2004/07/Six4Win" />
    <d2p1:_head>0</d2p1:_head>
    <d2p1:_size>0</d2p1:_size>
    <d2p1:_tail>0</d2p1:_tail>
    <d2p1:_version>0</d2p1:_version>
  </RecentWinners>
</RecentGlobalCodePotWinners>