import 'package:servicestack/servicestack.dart';
// @DataContract
class Location implements IConvertible
{
// @DataMember
double? latitude;
// @DataMember
double? longitude;
Location({this.latitude,this.longitude});
Location.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
latitude = JsonConverters.toDouble(json['latitude']);
longitude = JsonConverters.toDouble(json['longitude']);
return this;
}
Map<String, dynamic> toJson() => {
'latitude': latitude,
'longitude': longitude
};
getTypeName() => "Location";
TypeContext? context = _ctx;
}
// @DataContract
class Address implements IConvertible
{
// @DataMember
String? country;
// @DataMember
String? zipCode;
// @DataMember
String? city;
// @DataMember
String? streetAddress;
Address({this.country,this.zipCode,this.city,this.streetAddress});
Address.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
country = json['country'];
zipCode = json['zipCode'];
city = json['city'];
streetAddress = json['streetAddress'];
return this;
}
Map<String, dynamic> toJson() => {
'country': country,
'zipCode': zipCode,
'city': city,
'streetAddress': streetAddress
};
getTypeName() => "Address";
TypeContext? context = _ctx;
}
// @DataContract
class Trip implements IConvertible
{
// @DataMember
String? unitId;
// @DataMember
String? keyId;
// @DataMember
DateTime? startTime;
// @DataMember
Location? startLocation;
// @DataMember
Address? startAddress;
// @DataMember
double? startKm;
// @DataMember
double? startRun1;
// @DataMember
DateTime? stopTime;
// @DataMember
Location? stopLocation;
// @DataMember
Address? stopAddress;
// @DataMember
double? stopKm;
// @DataMember
double? stopRun1;
// @DataMember
bool? finished;
// @DataMember
double? maxSpeed;
Trip({this.unitId,this.keyId,this.startTime,this.startLocation,this.startAddress,this.startKm,this.startRun1,this.stopTime,this.stopLocation,this.stopAddress,this.stopKm,this.stopRun1,this.finished,this.maxSpeed});
Trip.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
unitId = json['unitId'];
keyId = json['keyId'];
startTime = JsonConverters.fromJson(json['startTime'],'DateTime',context!);
startLocation = JsonConverters.fromJson(json['startLocation'],'Location',context!);
startAddress = JsonConverters.fromJson(json['startAddress'],'Address',context!);
startKm = JsonConverters.toDouble(json['startKm']);
startRun1 = JsonConverters.toDouble(json['startRun1']);
stopTime = JsonConverters.fromJson(json['stopTime'],'DateTime',context!);
stopLocation = JsonConverters.fromJson(json['stopLocation'],'Location',context!);
stopAddress = JsonConverters.fromJson(json['stopAddress'],'Address',context!);
stopKm = JsonConverters.toDouble(json['stopKm']);
stopRun1 = JsonConverters.toDouble(json['stopRun1']);
finished = json['finished'];
maxSpeed = JsonConverters.toDouble(json['maxSpeed']);
return this;
}
Map<String, dynamic> toJson() => {
'unitId': unitId,
'keyId': keyId,
'startTime': JsonConverters.toJson(startTime,'DateTime',context!),
'startLocation': JsonConverters.toJson(startLocation,'Location',context!),
'startAddress': JsonConverters.toJson(startAddress,'Address',context!),
'startKm': startKm,
'startRun1': startRun1,
'stopTime': JsonConverters.toJson(stopTime,'DateTime',context!),
'stopLocation': JsonConverters.toJson(stopLocation,'Location',context!),
'stopAddress': JsonConverters.toJson(stopAddress,'Address',context!),
'stopKm': stopKm,
'stopRun1': stopRun1,
'finished': finished,
'maxSpeed': maxSpeed
};
getTypeName() => "Trip";
TypeContext? context = _ctx;
}
// @DataContract
class GetReportTripResponse implements IConvertible
{
// @DataMember
List<Trip>? list;
// @DataMember
ResponseStatus? responseStatus;
GetReportTripResponse({this.list,this.responseStatus});
GetReportTripResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
list = JsonConverters.fromJson(json['list'],'List<Trip>',context!);
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'list': JsonConverters.toJson(list,'List<Trip>',context!),
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
};
getTypeName() => "GetReportTripResponse";
TypeContext? context = _ctx;
}
// @DataContract
class GetReportTrip implements IConvertible
{
// @DataMember
String? unitId;
// @DataMember
String? keyId;
// @DataMember
DateTime? dateFrom;
// @DataMember
DateTime? dateTo;
GetReportTrip({this.unitId,this.keyId,this.dateFrom,this.dateTo});
GetReportTrip.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
unitId = json['unitId'];
keyId = json['keyId'];
dateFrom = JsonConverters.fromJson(json['dateFrom'],'DateTime',context!);
dateTo = JsonConverters.fromJson(json['dateTo'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'unitId': unitId,
'keyId': keyId,
'dateFrom': JsonConverters.toJson(dateFrom,'DateTime',context!),
'dateTo': JsonConverters.toJson(dateTo,'DateTime',context!)
};
getTypeName() => "GetReportTrip";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.trackunit.com', types: <String, TypeInfo> {
'Location': TypeInfo(TypeOf.Class, create:() => Location()),
'Address': TypeInfo(TypeOf.Class, create:() => Address()),
'Trip': TypeInfo(TypeOf.Class, create:() => Trip()),
'GetReportTripResponse': TypeInfo(TypeOf.Class, create:() => GetReportTripResponse()),
'List<Trip>': TypeInfo(TypeOf.Class, create:() => <Trip>[]),
'GetReportTrip': TypeInfo(TypeOf.Class, create:() => GetReportTrip()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .soap12 suffix or ?format=soap12
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /soap12 HTTP/1.1
Host: api.trackunit.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<GetReportTrip xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
<DateFrom>0001-01-01T00:00:00</DateFrom>
<DateTo>0001-01-01T00:00:00</DateTo>
<KeyId>String</KeyId>
<UnitId>String</UnitId>
</GetReportTrip>
</soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <GetReportTripResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types"> <List> <Trip> <Finished>false</Finished> <KeyId>String</KeyId> <MaxSpeed>0</MaxSpeed> <StartAddress> <City>String</City> <Country>String</Country> <StreetAddress>String</StreetAddress> <ZipCode>String</ZipCode> </StartAddress> <StartKm>0</StartKm> <StartLocation> <Latitude>0</Latitude> <Longitude>0</Longitude> </StartLocation> <StartRun1>0</StartRun1> <StartTime>0001-01-01T00:00:00</StartTime> <StopAddress> <City>String</City> <Country>String</Country> <StreetAddress>String</StreetAddress> <ZipCode>String</ZipCode> </StopAddress> <StopKm>0</StopKm> <StopLocation> <Latitude>0</Latitude> <Longitude>0</Longitude> </StopLocation> <StopRun1>0</StopRun1> <StopTime>0001-01-01T00:00:00</StopTime> <UnitId>String</UnitId> </Trip> </List> <ResponseStatus> <ErrorCode>String</ErrorCode> <Message>String</Message> <StackTrace>String</StackTrace> <Errors> <ResponseError> <ErrorCode>String</ErrorCode> <FieldName>String</FieldName> <Message>String</Message> <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> </Meta> </ResponseError> </Errors> <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> </Meta> </ResponseStatus> </GetReportTripResponse> </soap12:Body> </soap12:Envelope>