| POST,OPTIONS | /v1/Leaderboard | ||
|---|---|---|---|
| GET,OPTIONS | /v1/Leaderboard/{LeaderboardType}/{StartDate}/{EndDate} |
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class Leaderboard implements IConvertible
{
int? Position;
String? Name;
String? Location;
double? LifeCashFlow;
double? AnnuityCashFlow;
double? TotalCashFlow;
double? PremiumLife;
double? PremiumAnnuity;
double? PointsLife;
double? PointsAnnuity;
double? TotalPoints;
bool? IsMVP;
bool? IsRVP;
bool? IsAVP;
bool? IsAgent;
String? Phone;
String? Upline1Name;
String? Upline2Name;
Leaderboard({this.Position,this.Name,this.Location,this.LifeCashFlow,this.AnnuityCashFlow,this.TotalCashFlow,this.PremiumLife,this.PremiumAnnuity,this.PointsLife,this.PointsAnnuity,this.TotalPoints,this.IsMVP,this.IsRVP,this.IsAVP,this.IsAgent,this.Phone,this.Upline1Name,this.Upline2Name});
Leaderboard.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Position = json['Position'];
Name = json['Name'];
Location = json['Location'];
LifeCashFlow = JsonConverters.toDouble(json['LifeCashFlow']);
AnnuityCashFlow = JsonConverters.toDouble(json['AnnuityCashFlow']);
TotalCashFlow = JsonConverters.toDouble(json['TotalCashFlow']);
PremiumLife = JsonConverters.toDouble(json['PremiumLife']);
PremiumAnnuity = JsonConverters.toDouble(json['PremiumAnnuity']);
PointsLife = JsonConverters.toDouble(json['PointsLife']);
PointsAnnuity = JsonConverters.toDouble(json['PointsAnnuity']);
TotalPoints = JsonConverters.toDouble(json['TotalPoints']);
IsMVP = json['IsMVP'];
IsRVP = json['IsRVP'];
IsAVP = json['IsAVP'];
IsAgent = json['IsAgent'];
Phone = json['Phone'];
Upline1Name = json['Upline1Name'];
Upline2Name = json['Upline2Name'];
return this;
}
Map<String, dynamic> toJson() => {
'Position': Position,
'Name': Name,
'Location': Location,
'LifeCashFlow': LifeCashFlow,
'AnnuityCashFlow': AnnuityCashFlow,
'TotalCashFlow': TotalCashFlow,
'PremiumLife': PremiumLife,
'PremiumAnnuity': PremiumAnnuity,
'PointsLife': PointsLife,
'PointsAnnuity': PointsAnnuity,
'TotalPoints': TotalPoints,
'IsMVP': IsMVP,
'IsRVP': IsRVP,
'IsAVP': IsAVP,
'IsAgent': IsAgent,
'Phone': Phone,
'Upline1Name': Upline1Name,
'Upline2Name': Upline2Name
};
getTypeName() => "Leaderboard";
TypeContext? context = _ctx;
}
class LeaderboardResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
List<Leaderboard>? AllData = [];
List<Leaderboard>? MVP = [];
List<Leaderboard>? AVP = [];
List<Leaderboard>? RVP = [];
List<Leaderboard>? Agents = [];
LeaderboardResponse({this.ResponseStatus,this.AllData,this.MVP,this.AVP,this.RVP,this.Agents});
LeaderboardResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
AllData = JsonConverters.fromJson(json['AllData'],'List<Leaderboard>',context!);
MVP = JsonConverters.fromJson(json['MVP'],'List<Leaderboard>',context!);
AVP = JsonConverters.fromJson(json['AVP'],'List<Leaderboard>',context!);
RVP = JsonConverters.fromJson(json['RVP'],'List<Leaderboard>',context!);
Agents = JsonConverters.fromJson(json['Agents'],'List<Leaderboard>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'AllData': JsonConverters.toJson(AllData,'List<Leaderboard>',context!),
'MVP': JsonConverters.toJson(MVP,'List<Leaderboard>',context!),
'AVP': JsonConverters.toJson(AVP,'List<Leaderboard>',context!),
'RVP': JsonConverters.toJson(RVP,'List<Leaderboard>',context!),
'Agents': JsonConverters.toJson(Agents,'List<Leaderboard>',context!)
};
getTypeName() => "LeaderboardResponse";
TypeContext? context = _ctx;
}
class LeaderboardRequest implements IConvertible
{
String? StartDate;
String? EndDate;
String? LeaderboardType;
LeaderboardRequest({this.StartDate,this.EndDate,this.LeaderboardType});
LeaderboardRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
StartDate = json['StartDate'];
EndDate = json['EndDate'];
LeaderboardType = json['LeaderboardType'];
return this;
}
Map<String, dynamic> toJson() => {
'StartDate': StartDate,
'EndDate': EndDate,
'LeaderboardType': LeaderboardType
};
getTypeName() => "LeaderboardRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'Leaderboard': TypeInfo(TypeOf.Class, create:() => Leaderboard()),
'LeaderboardResponse': TypeInfo(TypeOf.Class, create:() => LeaderboardResponse()),
'List<Leaderboard>': TypeInfo(TypeOf.Class, create:() => <Leaderboard>[]),
'LeaderboardRequest': TypeInfo(TypeOf.Class, create:() => LeaderboardRequest()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/Leaderboard HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
StartDate: String,
EndDate: String,
LeaderboardType: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
},
AllData:
[
{
Position: 0,
Name: String,
Location: String,
LifeCashFlow: 0,
AnnuityCashFlow: 0,
TotalCashFlow: 0,
PremiumLife: 0,
PremiumAnnuity: 0,
PointsLife: 0,
PointsAnnuity: 0,
TotalPoints: 0,
IsMVP: False,
IsRVP: False,
IsAVP: False,
IsAgent: False,
Phone: String,
Upline1Name: String,
Upline2Name: String
}
],
MVP:
[
{
Position: 0,
Name: String,
Location: String,
LifeCashFlow: 0,
AnnuityCashFlow: 0,
TotalCashFlow: 0,
PremiumLife: 0,
PremiumAnnuity: 0,
PointsLife: 0,
PointsAnnuity: 0,
TotalPoints: 0,
IsMVP: False,
IsRVP: False,
IsAVP: False,
IsAgent: False,
Phone: String,
Upline1Name: String,
Upline2Name: String
}
],
AVP:
[
{
Position: 0,
Name: String,
Location: String,
LifeCashFlow: 0,
AnnuityCashFlow: 0,
TotalCashFlow: 0,
PremiumLife: 0,
PremiumAnnuity: 0,
PointsLife: 0,
PointsAnnuity: 0,
TotalPoints: 0,
IsMVP: False,
IsRVP: False,
IsAVP: False,
IsAgent: False,
Phone: String,
Upline1Name: String,
Upline2Name: String
}
],
RVP:
[
{
Position: 0,
Name: String,
Location: String,
LifeCashFlow: 0,
AnnuityCashFlow: 0,
TotalCashFlow: 0,
PremiumLife: 0,
PremiumAnnuity: 0,
PointsLife: 0,
PointsAnnuity: 0,
TotalPoints: 0,
IsMVP: False,
IsRVP: False,
IsAVP: False,
IsAgent: False,
Phone: String,
Upline1Name: String,
Upline2Name: String
}
],
Agents:
[
{
Position: 0,
Name: String,
Location: String,
LifeCashFlow: 0,
AnnuityCashFlow: 0,
TotalCashFlow: 0,
PremiumLife: 0,
PremiumAnnuity: 0,
PointsLife: 0,
PointsAnnuity: 0,
TotalPoints: 0,
IsMVP: False,
IsRVP: False,
IsAVP: False,
IsAgent: False,
Phone: String,
Upline1Name: String,
Upline2Name: String
}
]
}