Trendsic Platform Service

<back to all web services

KpiV2LiveRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/dashboard/kpiv2/live/{BranchId}
import 'package:servicestack/servicestack.dart';

class SvcLiveWindow implements IConvertible
{
    String? StationId;
    String? Name;
    String? Status;
    String? EmployeeId;
    String? EmployeeName;
    DateTime? SignedInUtc;
    DateTime? LastSeenUtc;
    DateTime? SinceUtc;
    String? PauseReason;
    String? CheckinId;
    String? TicketLabel;
    String? CustomerName;
    String? ServiceName;
    DateTime? StartUtc;
    DateTime? CalledUtc;
    int? ServedToday;
    DateTime? LastCalledUtc;

    SvcLiveWindow({this.StationId,this.Name,this.Status,this.EmployeeId,this.EmployeeName,this.SignedInUtc,this.LastSeenUtc,this.SinceUtc,this.PauseReason,this.CheckinId,this.TicketLabel,this.CustomerName,this.ServiceName,this.StartUtc,this.CalledUtc,this.ServedToday,this.LastCalledUtc});
    SvcLiveWindow.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        StationId = json['StationId'];
        Name = json['Name'];
        Status = json['Status'];
        EmployeeId = json['EmployeeId'];
        EmployeeName = json['EmployeeName'];
        SignedInUtc = JsonConverters.fromJson(json['SignedInUtc'],'DateTime',context!);
        LastSeenUtc = JsonConverters.fromJson(json['LastSeenUtc'],'DateTime',context!);
        SinceUtc = JsonConverters.fromJson(json['SinceUtc'],'DateTime',context!);
        PauseReason = json['PauseReason'];
        CheckinId = json['CheckinId'];
        TicketLabel = json['TicketLabel'];
        CustomerName = json['CustomerName'];
        ServiceName = json['ServiceName'];
        StartUtc = JsonConverters.fromJson(json['StartUtc'],'DateTime',context!);
        CalledUtc = JsonConverters.fromJson(json['CalledUtc'],'DateTime',context!);
        ServedToday = json['ServedToday'];
        LastCalledUtc = JsonConverters.fromJson(json['LastCalledUtc'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'StationId': StationId,
        'Name': Name,
        'Status': Status,
        'EmployeeId': EmployeeId,
        'EmployeeName': EmployeeName,
        'SignedInUtc': JsonConverters.toJson(SignedInUtc,'DateTime',context!),
        'LastSeenUtc': JsonConverters.toJson(LastSeenUtc,'DateTime',context!),
        'SinceUtc': JsonConverters.toJson(SinceUtc,'DateTime',context!),
        'PauseReason': PauseReason,
        'CheckinId': CheckinId,
        'TicketLabel': TicketLabel,
        'CustomerName': CustomerName,
        'ServiceName': ServiceName,
        'StartUtc': JsonConverters.toJson(StartUtc,'DateTime',context!),
        'CalledUtc': JsonConverters.toJson(CalledUtc,'DateTime',context!),
        'ServedToday': ServedToday,
        'LastCalledUtc': JsonConverters.toJson(LastCalledUtc,'DateTime',context!)
    };

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

class SvcLiveLine implements IConvertible
{
    String? LineId;
    String? Name;
    int? Waiting;
    DateTime? OldestHereUtc;

    SvcLiveLine({this.LineId,this.Name,this.Waiting,this.OldestHereUtc});
    SvcLiveLine.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        LineId = json['LineId'];
        Name = json['Name'];
        Waiting = json['Waiting'];
        OldestHereUtc = JsonConverters.fromJson(json['OldestHereUtc'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'LineId': LineId,
        'Name': Name,
        'Waiting': Waiting,
        'OldestHereUtc': JsonConverters.toJson(OldestHereUtc,'DateTime',context!)
    };

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

class SvcAlert implements IConvertible
{
    String? Level;
    String? View;
    String? Code;
    String? StationId;
    String? EmployeeId;
    String? BranchId;
    String? LineId;
    String? Name;
    String? OtherLineId;
    String? OtherName;
    List<String>? StationIds = [];
    Map<String,double?>? Values = {};

    SvcAlert({this.Level,this.View,this.Code,this.StationId,this.EmployeeId,this.BranchId,this.LineId,this.Name,this.OtherLineId,this.OtherName,this.StationIds,this.Values});
    SvcAlert.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Level = json['Level'];
        View = json['View'];
        Code = json['Code'];
        StationId = json['StationId'];
        EmployeeId = json['EmployeeId'];
        BranchId = json['BranchId'];
        LineId = json['LineId'];
        Name = json['Name'];
        OtherLineId = json['OtherLineId'];
        OtherName = json['OtherName'];
        StationIds = JsonConverters.fromJson(json['StationIds'],'List<String>',context!);
        Values = JsonConverters.fromJson(json['Values'],'Map<String,double?>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Level': Level,
        'View': View,
        'Code': Code,
        'StationId': StationId,
        'EmployeeId': EmployeeId,
        'BranchId': BranchId,
        'LineId': LineId,
        'Name': Name,
        'OtherLineId': OtherLineId,
        'OtherName': OtherName,
        'StationIds': JsonConverters.toJson(StationIds,'List<String>',context!),
        'Values': JsonConverters.toJson(Values,'Map<String,double?>',context!)
    };

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

class SvcLive implements IConvertible
{
    String? BranchId;
    DateTime? NowUtc;
    int? LocalOffMin;
    String? ZoneCode;
    List<SvcLiveWindow>? Windows = [];
    List<SvcLiveLine>? Line = [];
    int? InLine;
    int? LongestWaitSec;
    int? Staffed;
    List<SvcAlert>? Alerts = [];

    SvcLive({this.BranchId,this.NowUtc,this.LocalOffMin,this.ZoneCode,this.Windows,this.Line,this.InLine,this.LongestWaitSec,this.Staffed,this.Alerts});
    SvcLive.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        BranchId = json['BranchId'];
        NowUtc = JsonConverters.fromJson(json['NowUtc'],'DateTime',context!);
        LocalOffMin = json['LocalOffMin'];
        ZoneCode = json['ZoneCode'];
        Windows = JsonConverters.fromJson(json['Windows'],'List<SvcLiveWindow>',context!);
        Line = JsonConverters.fromJson(json['Line'],'List<SvcLiveLine>',context!);
        InLine = json['InLine'];
        LongestWaitSec = json['LongestWaitSec'];
        Staffed = json['Staffed'];
        Alerts = JsonConverters.fromJson(json['Alerts'],'List<SvcAlert>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'BranchId': BranchId,
        'NowUtc': JsonConverters.toJson(NowUtc,'DateTime',context!),
        'LocalOffMin': LocalOffMin,
        'ZoneCode': ZoneCode,
        'Windows': JsonConverters.toJson(Windows,'List<SvcLiveWindow>',context!),
        'Line': JsonConverters.toJson(Line,'List<SvcLiveLine>',context!),
        'InLine': InLine,
        'LongestWaitSec': LongestWaitSec,
        'Staffed': Staffed,
        'Alerts': JsonConverters.toJson(Alerts,'List<SvcAlert>',context!)
    };

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

class KpiV2LiveResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    SvcLive? Live;

    KpiV2LiveResponse({this.ResponseStatus,this.Live});
    KpiV2LiveResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
        'Live': JsonConverters.toJson(Live,'SvcLive',context!)
    };

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

class KpiV2LiveRequest implements IConvertible
{
    String? BranchId;

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

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

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

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'SvcLiveWindow': TypeInfo(TypeOf.Class, create:() => SvcLiveWindow()),
    'SvcLiveLine': TypeInfo(TypeOf.Class, create:() => SvcLiveLine()),
    'SvcAlert': TypeInfo(TypeOf.Class, create:() => SvcAlert()),
    'Map<String,double?>': TypeInfo(TypeOf.Class, create:() => Map<String,double?>()),
    'SvcLive': TypeInfo(TypeOf.Class, create:() => SvcLive()),
    'List<SvcLiveWindow>': TypeInfo(TypeOf.Class, create:() => <SvcLiveWindow>[]),
    'List<SvcLiveLine>': TypeInfo(TypeOf.Class, create:() => <SvcLiveLine>[]),
    'List<SvcAlert>': TypeInfo(TypeOf.Class, create:() => <SvcAlert>[]),
    'KpiV2LiveResponse': TypeInfo(TypeOf.Class, create:() => KpiV2LiveResponse()),
    'KpiV2LiveRequest': TypeInfo(TypeOf.Class, create:() => KpiV2LiveRequest()),
});

Dart KpiV2LiveRequest 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.

GET /v1/dashboard/kpiv2/live/{BranchId} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Live":{"BranchId":"00000000000000000000000000000000","NowUtc":"0001-01-01T00:00:00.0000000","LocalOffMin":0,"ZoneCode":"String","Windows":[{"StationId":"00000000000000000000000000000000","Name":"String","Status":"String","EmployeeId":"00000000000000000000000000000000","EmployeeName":"String","SignedInUtc":"0001-01-01T00:00:00.0000000","LastSeenUtc":"0001-01-01T00:00:00.0000000","SinceUtc":"0001-01-01T00:00:00.0000000","PauseReason":"String","CheckinId":"00000000000000000000000000000000","TicketLabel":"String","CustomerName":"String","ServiceName":"String","StartUtc":"0001-01-01T00:00:00.0000000","CalledUtc":"0001-01-01T00:00:00.0000000","ServedToday":0,"LastCalledUtc":"0001-01-01T00:00:00.0000000"}],"Line":[{"LineId":"00000000000000000000000000000000","Name":"String","Waiting":0,"OldestHereUtc":"0001-01-01T00:00:00.0000000"}],"InLine":0,"LongestWaitSec":0,"Staffed":0,"Alerts":[{"Level":"String","View":"String","Code":"String","StationId":"00000000000000000000000000000000","EmployeeId":"00000000000000000000000000000000","BranchId":"00000000000000000000000000000000","LineId":"00000000000000000000000000000000","Name":"String","OtherLineId":"00000000000000000000000000000000","OtherName":"String","StationIds":["00000000000000000000000000000000"],"Values":{"String":0}}]}}