Betting.WebApi

<back to all web services

GetUserNotifications

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

class Severity
{
    static const Severity Success = const Severity._(0);
    static const Severity Info = const Severity._(1);
    static const Severity Warning = const Severity._(2);
    static const Severity Error = const Severity._(3);

    final int _value;
    const Severity._(this._value);
    int get value => _value;
    static List<Severity> get values => const [Success,Info,Warning,Error];
}

class NotificationType
{
    static const NotificationType Default = const NotificationType._(0);
    static const NotificationType SlipDeliveryConfirmationRequest = const NotificationType._(1);
    static const NotificationType SlipDeliveryIssueResolved = const NotificationType._(2);

    final int _value;
    const NotificationType._(this._value);
    int get value => _value;
    static List<NotificationType> get values => const [Default,SlipDeliveryConfirmationRequest,SlipDeliveryIssueResolved];
}

class Notification implements IConvertible
{
    Severity? severity;
    NotificationType? type;
    RecordDictionary<String,String>? data;

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

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

    Map<String, dynamic> toJson() => {
        'severity': JsonConverters.toJson(severity,'Severity',context!),
        'type': JsonConverters.toJson(type,'NotificationType',context!),
        'data': JsonConverters.toJson(data,'RecordDictionary<String,String>',context!)
    };

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

class UserNotification implements IConvertible
{
    String? id;
    Notification? notification;
    DateTime? dispatchedAt;

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

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        notification = JsonConverters.fromJson(json['notification'],'Notification',context!);
        dispatchedAt = JsonConverters.fromJson(json['dispatchedAt'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'notification': JsonConverters.toJson(notification,'Notification',context!),
        'dispatchedAt': JsonConverters.toJson(dispatchedAt,'DateTime',context!)
    };

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

class UserNotifications implements IConvertible
{
    String? id;
    int? n;
    int? s;
    int? i;
    int? w;
    int? e;
    Map<String,UserNotification?>? notifications;

    UserNotifications({this.id,this.n,this.s,this.i,this.w,this.e,this.notifications});
    UserNotifications.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        n = json['n'];
        s = json['s'];
        i = json['i'];
        w = json['w'];
        e = json['e'];
        notifications = JsonConverters.fromJson(json['notifications'],'Map<String,UserNotification?>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'n': n,
        's': s,
        'i': i,
        'w': w,
        'e': e,
        'notifications': JsonConverters.toJson(notifications,'Map<String,UserNotification?>',context!)
    };

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

class GetUserNotifications implements IConvertible
{
    String? id;

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

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

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

    getTypeName() => "GetUserNotifications";
    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> {
    'Severity': TypeInfo(TypeOf.Enum, enumValues:Severity.values),
    'NotificationType': TypeInfo(TypeOf.Enum, enumValues:NotificationType.values),
    'Notification': TypeInfo(TypeOf.Class, create:() => Notification()),
    'RecordDictionary<String,String>': TypeInfo(TypeOf.Class, create:() => RecordDictionary<String,String>()),
    'UserNotification': TypeInfo(TypeOf.Class, create:() => UserNotification()),
    'UserNotifications': TypeInfo(TypeOf.Class, create:() => UserNotifications()),
    'Map<String,UserNotification?>': TypeInfo(TypeOf.Class, create:() => Map<String,UserNotification?>()),
    'GetUserNotifications': TypeInfo(TypeOf.Class, create:() => GetUserNotifications()),
    'RecordDictionary<TKey,TVal>': TypeInfo(TypeOf.GenericDef,create:() => RecordDictionary()),
});

Dart GetUserNotifications DTOs

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

HTTP + CSV

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

POST /qry/users/notifications HTTP/1.1 
Host: api.sbbet.ath.cx 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

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

{"id":"String","n":1,"s":1,"i":0,"w":0,"e":0,"notifications":{"String":{"id":"String","notification":{"severity":0,"type":0,"data":{"String":"String"}},"dispatchedAt":"0001-01-01T00:00:00.0000000Z"}}}