Betting.WebApi

<back to all web services

GetLookup

The following routes are available for this service:
All Verbs/qry/lookups
import 'package:servicestack/servicestack.dart';

class Ref implements IConvertible
{
    String? id;
    String? val;

    Ref({this.id,this.val});
    Ref.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        val = json['val'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'val': val
    };

    getTypeName() => "Ref";
    TypeContext? context = _ctx;
}

class RefEx extends Ref implements IConvertible
{
    RecordDictionary<String,String>? data;

    RefEx({this.data});
    RefEx.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        data = JsonConverters.fromJson(json['data'],'RecordDictionary<String,String>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'data': JsonConverters.toJson(data,'RecordDictionary<String,String>',context!)
    });

    getTypeName() => "RefEx";
    TypeContext? context = _ctx;
}

class Lookup implements IConvertible
{
    String? id;
    List<RefEx>? data;

    Lookup({this.id,this.data});
    Lookup.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        data = JsonConverters.fromJson(json['data'],'List<RefEx>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'data': JsonConverters.toJson(data,'List<RefEx>',context!)
    };

    getTypeName() => "Lookup";
    TypeContext? context = _ctx;
}

class GetLookup implements IConvertible
{
    String? id;

    GetLookup({this.id});
    GetLookup.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id
    };

    getTypeName() => "GetLookup";
    TypeContext? context = _ctx;
}

class RecordDictionary<TKey,TVal> extends Map<TKey,TVal?> implements IConvertible
{
    RecordDictionary();
    RecordDictionary.fromJson(Map<String, dynamic> json) : super.fromJson(json);
    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson();
    getTypeName() => "RecordDictionary<$TKey,$TVal>";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.sbbet.ath.cx', types: <String, TypeInfo> {
    'Ref': TypeInfo(TypeOf.Class, create:() => Ref()),
    'RefEx': TypeInfo(TypeOf.Class, create:() => RefEx()),
    'RecordDictionary<String,String>': TypeInfo(TypeOf.Class, create:() => RecordDictionary<String,String>()),
    'Lookup': TypeInfo(TypeOf.Class, create:() => Lookup()),
    'List<RefEx>': TypeInfo(TypeOf.Class, create:() => <RefEx>[]),
    'GetLookup': TypeInfo(TypeOf.Class, create:() => GetLookup()),
    'RecordDictionary<TKey,TVal>': TypeInfo(TypeOf.GenericDef,create:() => RecordDictionary()),
});

Dart GetLookup DTOs

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

HTTP + JSV

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

POST /qry/lookups HTTP/1.1 
Host: api.sbbet.ath.cx 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	id: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	id: String,
	data: 
	[
		{
			data: 
			{
				String: String
			},
			id: String,
			val: String
		}
	]
}