| POST,OPTIONS | /v1/dashboard/agreements |
|---|
import 'package:servicestack/servicestack.dart';
class DashboardStatTile implements IConvertible
{
String? Key;
String? Label;
double? Value;
double? PreviousValue;
String? Unit;
double? DeltaPct;
DashboardStatTile({this.Key,this.Label,this.Value,this.PreviousValue,this.Unit,this.DeltaPct});
DashboardStatTile.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Key = json['Key'];
Label = json['Label'];
Value = JsonConverters.toDouble(json['Value']);
PreviousValue = JsonConverters.toDouble(json['PreviousValue']);
Unit = json['Unit'];
DeltaPct = JsonConverters.toDouble(json['DeltaPct']);
return this;
}
Map<String, dynamic> toJson() => {
'Key': Key,
'Label': Label,
'Value': Value,
'PreviousValue': PreviousValue,
'Unit': Unit,
'DeltaPct': DeltaPct
};
getTypeName() => "DashboardStatTile";
TypeContext? context = _ctx;
}
class AgreementKpiBranchRow implements IConvertible
{
String? BranchName;
int? ActiveCount;
double? Mrr;
int? ExpiringCount;
int? ChurnCount;
double? SkippedRate;
AgreementKpiBranchRow({this.BranchName,this.ActiveCount,this.Mrr,this.ExpiringCount,this.ChurnCount,this.SkippedRate});
AgreementKpiBranchRow.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
BranchName = json['BranchName'];
ActiveCount = json['ActiveCount'];
Mrr = JsonConverters.toDouble(json['Mrr']);
ExpiringCount = json['ExpiringCount'];
ChurnCount = json['ChurnCount'];
SkippedRate = JsonConverters.toDouble(json['SkippedRate']);
return this;
}
Map<String, dynamic> toJson() => {
'BranchName': BranchName,
'ActiveCount': ActiveCount,
'Mrr': Mrr,
'ExpiringCount': ExpiringCount,
'ChurnCount': ChurnCount,
'SkippedRate': SkippedRate
};
getTypeName() => "AgreementKpiBranchRow";
TypeContext? context = _ctx;
}
class AgreementKpiResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
List<DashboardStatTile>? Stats = [];
List<AgreementKpiBranchRow>? ByBranch = [];
AgreementKpiResponse({this.ResponseStatus,this.Stats,this.ByBranch});
AgreementKpiResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
Stats = JsonConverters.fromJson(json['Stats'],'List<DashboardStatTile>',context!);
ByBranch = JsonConverters.fromJson(json['ByBranch'],'List<AgreementKpiBranchRow>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'Stats': JsonConverters.toJson(Stats,'List<DashboardStatTile>',context!),
'ByBranch': JsonConverters.toJson(ByBranch,'List<AgreementKpiBranchRow>',context!)
};
getTypeName() => "AgreementKpiResponse";
TypeContext? context = _ctx;
}
class AgreementKpiRequest implements IConvertible
{
DateTime? FromDate;
DateTime? ToDate;
List<String>? LocationIds = [];
AgreementKpiRequest({this.FromDate,this.ToDate,this.LocationIds});
AgreementKpiRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
FromDate = JsonConverters.fromJson(json['FromDate'],'DateTime',context!);
ToDate = JsonConverters.fromJson(json['ToDate'],'DateTime',context!);
LocationIds = JsonConverters.fromJson(json['LocationIds'],'List<String>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'FromDate': JsonConverters.toJson(FromDate,'DateTime',context!),
'ToDate': JsonConverters.toJson(ToDate,'DateTime',context!),
'LocationIds': JsonConverters.toJson(LocationIds,'List<String>',context!)
};
getTypeName() => "AgreementKpiRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'DashboardStatTile': TypeInfo(TypeOf.Class, create:() => DashboardStatTile()),
'AgreementKpiBranchRow': TypeInfo(TypeOf.Class, create:() => AgreementKpiBranchRow()),
'AgreementKpiResponse': TypeInfo(TypeOf.Class, create:() => AgreementKpiResponse()),
'List<DashboardStatTile>': TypeInfo(TypeOf.Class, create:() => <DashboardStatTile>[]),
'List<AgreementKpiBranchRow>': TypeInfo(TypeOf.Class, create:() => <AgreementKpiBranchRow>[]),
'AgreementKpiRequest': TypeInfo(TypeOf.Class, create:() => AgreementKpiRequest()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/dashboard/agreements HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"FromDate":"0001-01-01T00:00:00.0000000","ToDate":"0001-01-01T00:00:00.0000000","LocationIds":["00000000000000000000000000000000"]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Stats":[{"Key":"String","Label":"String","Value":0,"PreviousValue":0,"Unit":"String","DeltaPct":null}],"ByBranch":[{"BranchName":"String","ActiveCount":0,"Mrr":0,"ExpiringCount":0,"ChurnCount":0,"SkippedRate":0}]}