| GET,OPTIONS | /v1/fleet/live |
|---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class FleetRowDto implements IConvertible
{
int? ContactID;
String? WorkerName;
int? CrewID;
String? CrewName;
String? BranchId;
String? LiveStatus;
int? WorkerScheduleItemID;
int? JobID;
String? CurProperty;
String? CurAddress;
String? CurZip;
String? EnRouteAt;
String? StartedAt;
double? LastLat;
double? LastLng;
String? LastLocAt;
String? NextProperty;
int? DoneVisits;
int? TotalVisits;
FleetRowDto({this.ContactID,this.WorkerName,this.CrewID,this.CrewName,this.BranchId,this.LiveStatus,this.WorkerScheduleItemID,this.JobID,this.CurProperty,this.CurAddress,this.CurZip,this.EnRouteAt,this.StartedAt,this.LastLat,this.LastLng,this.LastLocAt,this.NextProperty,this.DoneVisits,this.TotalVisits});
FleetRowDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ContactID = json['ContactID'];
WorkerName = json['WorkerName'];
CrewID = json['CrewID'];
CrewName = json['CrewName'];
BranchId = json['BranchId'];
LiveStatus = json['LiveStatus'];
WorkerScheduleItemID = json['WorkerScheduleItemID'];
JobID = json['JobID'];
CurProperty = json['CurProperty'];
CurAddress = json['CurAddress'];
CurZip = json['CurZip'];
EnRouteAt = json['EnRouteAt'];
StartedAt = json['StartedAt'];
LastLat = JsonConverters.toDouble(json['LastLat']);
LastLng = JsonConverters.toDouble(json['LastLng']);
LastLocAt = json['LastLocAt'];
NextProperty = json['NextProperty'];
DoneVisits = json['DoneVisits'];
TotalVisits = json['TotalVisits'];
return this;
}
Map<String, dynamic> toJson() => {
'ContactID': ContactID,
'WorkerName': WorkerName,
'CrewID': CrewID,
'CrewName': CrewName,
'BranchId': BranchId,
'LiveStatus': LiveStatus,
'WorkerScheduleItemID': WorkerScheduleItemID,
'JobID': JobID,
'CurProperty': CurProperty,
'CurAddress': CurAddress,
'CurZip': CurZip,
'EnRouteAt': EnRouteAt,
'StartedAt': StartedAt,
'LastLat': LastLat,
'LastLng': LastLng,
'LastLocAt': LastLocAt,
'NextProperty': NextProperty,
'DoneVisits': DoneVisits,
'TotalVisits': TotalVisits
};
getTypeName() => "FleetRowDto";
TypeContext? context = _ctx;
}
class FleetLiveResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
List<FleetRowDto>? Rows = [];
int? ActiveWorkers;
int? EnRoute;
int? OnSite;
int? Waiting;
int? Done;
int? RunningLate;
int? PageTotal;
int? Page;
int? PageSize;
FleetLiveResponse({this.ResponseStatus,this.Rows,this.ActiveWorkers,this.EnRoute,this.OnSite,this.Waiting,this.Done,this.RunningLate,this.PageTotal,this.Page,this.PageSize});
FleetLiveResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
Rows = JsonConverters.fromJson(json['Rows'],'List<FleetRowDto>',context!);
ActiveWorkers = json['ActiveWorkers'];
EnRoute = json['EnRoute'];
OnSite = json['OnSite'];
Waiting = json['Waiting'];
Done = json['Done'];
RunningLate = json['RunningLate'];
PageTotal = json['PageTotal'];
Page = json['Page'];
PageSize = json['PageSize'];
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'Rows': JsonConverters.toJson(Rows,'List<FleetRowDto>',context!),
'ActiveWorkers': ActiveWorkers,
'EnRoute': EnRoute,
'OnSite': OnSite,
'Waiting': Waiting,
'Done': Done,
'RunningLate': RunningLate,
'PageTotal': PageTotal,
'Page': Page,
'PageSize': PageSize
};
getTypeName() => "FleetLiveResponse";
TypeContext? context = _ctx;
}
class FleetLiveRequest implements IConvertible
{
String? Date;
String? Status;
int? CrewID;
String? Zip;
String? BranchId;
String? Search;
int? Page;
int? PageSize;
FleetLiveRequest({this.Date,this.Status,this.CrewID,this.Zip,this.BranchId,this.Search,this.Page,this.PageSize});
FleetLiveRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Date = json['Date'];
Status = json['Status'];
CrewID = json['CrewID'];
Zip = json['Zip'];
BranchId = json['BranchId'];
Search = json['Search'];
Page = json['Page'];
PageSize = json['PageSize'];
return this;
}
Map<String, dynamic> toJson() => {
'Date': Date,
'Status': Status,
'CrewID': CrewID,
'Zip': Zip,
'BranchId': BranchId,
'Search': Search,
'Page': Page,
'PageSize': PageSize
};
getTypeName() => "FleetLiveRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'FleetRowDto': TypeInfo(TypeOf.Class, create:() => FleetRowDto()),
'FleetLiveResponse': TypeInfo(TypeOf.Class, create:() => FleetLiveResponse()),
'List<FleetRowDto>': TypeInfo(TypeOf.Class, create:() => <FleetRowDto>[]),
'FleetLiveRequest': TypeInfo(TypeOf.Class, create:() => FleetLiveRequest()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/fleet/live HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<FleetLiveResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<ActiveWorkers>0</ActiveWorkers>
<Done>0</Done>
<EnRoute>0</EnRoute>
<OnSite>0</OnSite>
<Page>0</Page>
<PageSize>0</PageSize>
<PageTotal>0</PageTotal>
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
<Rows>
<FleetRowDto>
<BranchId>00000000-0000-0000-0000-000000000000</BranchId>
<ContactID>0</ContactID>
<CrewID>0</CrewID>
<CrewName>String</CrewName>
<CurAddress>String</CurAddress>
<CurProperty>String</CurProperty>
<CurZip>String</CurZip>
<DoneVisits>0</DoneVisits>
<EnRouteAt>String</EnRouteAt>
<JobID>0</JobID>
<LastLat>0</LastLat>
<LastLng>0</LastLng>
<LastLocAt>String</LastLocAt>
<LiveStatus>String</LiveStatus>
<NextProperty>String</NextProperty>
<StartedAt>String</StartedAt>
<TotalVisits>0</TotalVisits>
<WorkerName>String</WorkerName>
<WorkerScheduleItemID>0</WorkerScheduleItemID>
</FleetRowDto>
</Rows>
<RunningLate>0</RunningLate>
<Waiting>0</Waiting>
</FleetLiveResponse>