| GET,OPTIONS | /v1/routeplan/week |
|---|
import 'package:servicestack/servicestack.dart';
class RoutePlanCrew implements IConvertible
{
int? CrewID;
String? CrewName;
String? CrewColor;
String? HomeZip;
double? YardLat;
double? YardLng;
int? DailyCapacityMin;
int? WeeklyCapacityMin;
bool? Specialist;
RoutePlanCrew({this.CrewID,this.CrewName,this.CrewColor,this.HomeZip,this.YardLat,this.YardLng,this.DailyCapacityMin,this.WeeklyCapacityMin,this.Specialist});
RoutePlanCrew.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CrewID = json['CrewID'];
CrewName = json['CrewName'];
CrewColor = json['CrewColor'];
HomeZip = json['HomeZip'];
YardLat = JsonConverters.toDouble(json['YardLat']);
YardLng = JsonConverters.toDouble(json['YardLng']);
DailyCapacityMin = json['DailyCapacityMin'];
WeeklyCapacityMin = json['WeeklyCapacityMin'];
Specialist = json['Specialist'];
return this;
}
Map<String, dynamic> toJson() => {
'CrewID': CrewID,
'CrewName': CrewName,
'CrewColor': CrewColor,
'HomeZip': HomeZip,
'YardLat': YardLat,
'YardLng': YardLng,
'DailyCapacityMin': DailyCapacityMin,
'WeeklyCapacityMin': WeeklyCapacityMin,
'Specialist': Specialist
};
getTypeName() => "RoutePlanCrew";
TypeContext? context = _ctx;
}
class RoutePlanVisit implements IConvertible
{
int? AgreementID;
int? AgreementJobID;
String? Name;
String? Sub;
String? ServiceType;
String? Zip;
String? Area;
double? Lat;
double? Lng;
int? DurationMin;
String? DueIso;
String? DueLabel;
bool? Overdue;
int? DefaultCrewID;
int? RouteCrewID;
int? RouteSeq;
String? RouteDateIso;
int? LateDays;
bool? AutoPay;
String? SkipPolicy;
double? SkipCreditAmount;
RoutePlanVisit({this.AgreementID,this.AgreementJobID,this.Name,this.Sub,this.ServiceType,this.Zip,this.Area,this.Lat,this.Lng,this.DurationMin,this.DueIso,this.DueLabel,this.Overdue,this.DefaultCrewID,this.RouteCrewID,this.RouteSeq,this.RouteDateIso,this.LateDays,this.AutoPay,this.SkipPolicy,this.SkipCreditAmount});
RoutePlanVisit.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
AgreementID = json['AgreementID'];
AgreementJobID = json['AgreementJobID'];
Name = json['Name'];
Sub = json['Sub'];
ServiceType = json['ServiceType'];
Zip = json['Zip'];
Area = json['Area'];
Lat = JsonConverters.toDouble(json['Lat']);
Lng = JsonConverters.toDouble(json['Lng']);
DurationMin = json['DurationMin'];
DueIso = json['DueIso'];
DueLabel = json['DueLabel'];
Overdue = json['Overdue'];
DefaultCrewID = json['DefaultCrewID'];
RouteCrewID = json['RouteCrewID'];
RouteSeq = json['RouteSeq'];
RouteDateIso = json['RouteDateIso'];
LateDays = json['LateDays'];
AutoPay = json['AutoPay'];
SkipPolicy = json['SkipPolicy'];
SkipCreditAmount = JsonConverters.toDouble(json['SkipCreditAmount']);
return this;
}
Map<String, dynamic> toJson() => {
'AgreementID': AgreementID,
'AgreementJobID': AgreementJobID,
'Name': Name,
'Sub': Sub,
'ServiceType': ServiceType,
'Zip': Zip,
'Area': Area,
'Lat': Lat,
'Lng': Lng,
'DurationMin': DurationMin,
'DueIso': DueIso,
'DueLabel': DueLabel,
'Overdue': Overdue,
'DefaultCrewID': DefaultCrewID,
'RouteCrewID': RouteCrewID,
'RouteSeq': RouteSeq,
'RouteDateIso': RouteDateIso,
'LateDays': LateDays,
'AutoPay': AutoPay,
'SkipPolicy': SkipPolicy,
'SkipCreditAmount': SkipCreditAmount
};
getTypeName() => "RoutePlanVisit";
TypeContext? context = _ctx;
}
class RoutePlanSkippedVisit implements IConvertible
{
int? AgreementJobID;
int? AgreementID;
String? Name;
String? DateIso;
String? Reason;
double? CreditAmount;
RoutePlanSkippedVisit({this.AgreementJobID,this.AgreementID,this.Name,this.DateIso,this.Reason,this.CreditAmount});
RoutePlanSkippedVisit.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
AgreementJobID = json['AgreementJobID'];
AgreementID = json['AgreementID'];
Name = json['Name'];
DateIso = json['DateIso'];
Reason = json['Reason'];
CreditAmount = JsonConverters.toDouble(json['CreditAmount']);
return this;
}
Map<String, dynamic> toJson() => {
'AgreementJobID': AgreementJobID,
'AgreementID': AgreementID,
'Name': Name,
'DateIso': DateIso,
'Reason': Reason,
'CreditAmount': CreditAmount
};
getTypeName() => "RoutePlanSkippedVisit";
TypeContext? context = _ctx;
}
class RoutePlanWeekResponse implements IConvertible
{
String? FromIso;
String? ToIso;
List<RoutePlanCrew>? Crews = [];
List<RoutePlanVisit>? Visits = [];
List<RoutePlanSkippedVisit>? Skipped = [];
ResponseStatus? ResponseStatus;
RoutePlanWeekResponse({this.FromIso,this.ToIso,this.Crews,this.Visits,this.Skipped,this.ResponseStatus});
RoutePlanWeekResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
FromIso = json['FromIso'];
ToIso = json['ToIso'];
Crews = JsonConverters.fromJson(json['Crews'],'List<RoutePlanCrew>',context!);
Visits = JsonConverters.fromJson(json['Visits'],'List<RoutePlanVisit>',context!);
Skipped = JsonConverters.fromJson(json['Skipped'],'List<RoutePlanSkippedVisit>',context!);
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'FromIso': FromIso,
'ToIso': ToIso,
'Crews': JsonConverters.toJson(Crews,'List<RoutePlanCrew>',context!),
'Visits': JsonConverters.toJson(Visits,'List<RoutePlanVisit>',context!),
'Skipped': JsonConverters.toJson(Skipped,'List<RoutePlanSkippedVisit>',context!),
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "RoutePlanWeekResponse";
TypeContext? context = _ctx;
}
class RoutePlanWeekRequest implements IConvertible
{
String? From;
RoutePlanWeekRequest({this.From});
RoutePlanWeekRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
From = json['From'];
return this;
}
Map<String, dynamic> toJson() => {
'From': From
};
getTypeName() => "RoutePlanWeekRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'RoutePlanCrew': TypeInfo(TypeOf.Class, create:() => RoutePlanCrew()),
'RoutePlanVisit': TypeInfo(TypeOf.Class, create:() => RoutePlanVisit()),
'RoutePlanSkippedVisit': TypeInfo(TypeOf.Class, create:() => RoutePlanSkippedVisit()),
'RoutePlanWeekResponse': TypeInfo(TypeOf.Class, create:() => RoutePlanWeekResponse()),
'List<RoutePlanCrew>': TypeInfo(TypeOf.Class, create:() => <RoutePlanCrew>[]),
'List<RoutePlanVisit>': TypeInfo(TypeOf.Class, create:() => <RoutePlanVisit>[]),
'List<RoutePlanSkippedVisit>': TypeInfo(TypeOf.Class, create:() => <RoutePlanSkippedVisit>[]),
'RoutePlanWeekRequest': TypeInfo(TypeOf.Class, create:() => RoutePlanWeekRequest()),
});
Dart RoutePlanWeekRequest DTOs
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.
GET /v1/routeplan/week HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"FromIso":"String","ToIso":"String","Crews":[{"CrewID":0,"CrewName":"String","CrewColor":"String","HomeZip":"String","YardLat":0,"YardLng":0,"DailyCapacityMin":0,"WeeklyCapacityMin":0,"Specialist":false}],"Visits":[{"AgreementID":0,"AgreementJobID":0,"Name":"String","Sub":"String","ServiceType":"String","Zip":"String","Area":"String","Lat":0,"Lng":0,"DurationMin":0,"DueIso":"String","DueLabel":"String","Overdue":false,"DefaultCrewID":0,"RouteCrewID":0,"RouteSeq":0,"RouteDateIso":"String","LateDays":0,"AutoPay":false,"SkipPolicy":"String","SkipCreditAmount":0}],"Skipped":[{"AgreementJobID":0,"AgreementID":0,"Name":"String","DateIso":"String","Reason":"String","CreditAmount":0}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}