Trackunit API

<back to all web services

GetReportKeyHistory

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 KeyHistory implements IConvertible
{
    // @DataMember
    String? unitId;

    // @DataMember
    DateTime? time;

    // @DataMember
    Location? location;

    // @DataMember
    Address? address;

    // @DataMember
    int? heading;

    // @DataMember
    double? speed;

    // @DataMember
    double? km;

    // @DataMember
    double? run1;

    // @DataMember
    double? run2;

    // @DataMember
    double? runOdo;

    // @DataMember
    double? temperature1;

    // @DataMember
    double? temperature2;

    // @DataMember
    bool? input1;

    // @DataMember
    bool? input2;

    // @DataMember
    bool? output3;

    // @DataMember
    double? batteryLevel;

    // @DataMember
    double? externalPower;

    KeyHistory({this.unitId,this.time,this.location,this.address,this.heading,this.speed,this.km,this.run1,this.run2,this.runOdo,this.temperature1,this.temperature2,this.input1,this.input2,this.output3,this.batteryLevel,this.externalPower});
    KeyHistory.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        unitId = json['unitId'];
        time = JsonConverters.fromJson(json['time'],'DateTime',context!);
        location = JsonConverters.fromJson(json['location'],'Location',context!);
        address = JsonConverters.fromJson(json['address'],'Address',context!);
        heading = json['heading'];
        speed = JsonConverters.toDouble(json['speed']);
        km = JsonConverters.toDouble(json['km']);
        run1 = JsonConverters.toDouble(json['run1']);
        run2 = JsonConverters.toDouble(json['run2']);
        runOdo = JsonConverters.toDouble(json['runOdo']);
        temperature1 = JsonConverters.toDouble(json['temperature1']);
        temperature2 = JsonConverters.toDouble(json['temperature2']);
        input1 = json['input1'];
        input2 = json['input2'];
        output3 = json['output3'];
        batteryLevel = JsonConverters.toDouble(json['batteryLevel']);
        externalPower = JsonConverters.toDouble(json['externalPower']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'unitId': unitId,
        'time': JsonConverters.toJson(time,'DateTime',context!),
        'location': JsonConverters.toJson(location,'Location',context!),
        'address': JsonConverters.toJson(address,'Address',context!),
        'heading': heading,
        'speed': speed,
        'km': km,
        'run1': run1,
        'run2': run2,
        'runOdo': runOdo,
        'temperature1': temperature1,
        'temperature2': temperature2,
        'input1': input1,
        'input2': input2,
        'output3': output3,
        'batteryLevel': batteryLevel,
        'externalPower': externalPower
    };

    getTypeName() => "KeyHistory";
    TypeContext? context = _ctx;
}

// @DataContract
class GetReportKeyHistoryResponse implements IConvertible
{
    // @DataMember
    List<KeyHistory>? list;

    // @DataMember
    ResponseStatus? responseStatus;

    GetReportKeyHistoryResponse({this.list,this.responseStatus});
    GetReportKeyHistoryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        list = JsonConverters.fromJson(json['list'],'List<KeyHistory>',context!);
        responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'list': JsonConverters.toJson(list,'List<KeyHistory>',context!),
        'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
    };

    getTypeName() => "GetReportKeyHistoryResponse";
    TypeContext? context = _ctx;
}

// @DataContract
class GetReportKeyHistory implements IConvertible
{
    // @DataMember
    String? keyId;

    // @DataMember
    DateTime? from;

    // @DataMember
    DateTime? to;

    GetReportKeyHistory({this.keyId,this.from,this.to});
    GetReportKeyHistory.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        keyId = json['keyId'];
        from = JsonConverters.fromJson(json['from'],'DateTime',context!);
        to = JsonConverters.fromJson(json['to'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'keyId': keyId,
        'from': JsonConverters.toJson(from,'DateTime',context!),
        'to': JsonConverters.toJson(to,'DateTime',context!)
    };

    getTypeName() => "GetReportKeyHistory";
    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()),
    'KeyHistory': TypeInfo(TypeOf.Class, create:() => KeyHistory()),
    'GetReportKeyHistoryResponse': TypeInfo(TypeOf.Class, create:() => GetReportKeyHistoryResponse()),
    'List<KeyHistory>': TypeInfo(TypeOf.Class, create:() => <KeyHistory>[]),
    'GetReportKeyHistory': TypeInfo(TypeOf.Class, create:() => GetReportKeyHistory()),
});

Dart GetReportKeyHistory DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .soap12 suffix or ?format=soap12

HTTP + 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>

<GetReportKeyHistory xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
  <From>0001-01-01T00:00:00</From>
  <KeyId>String</KeyId>
  <To>0001-01-01T00:00:00</To>
</GetReportKeyHistory>

</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>

<GetReportKeyHistoryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
  <List>
    <KeyHistory>
      <Address>
        <City>String</City>
        <Country>String</Country>
        <StreetAddress>String</StreetAddress>
        <ZipCode>String</ZipCode>
      </Address>
      <BatteryLevel>0</BatteryLevel>
      <ExternalPower>0</ExternalPower>
      <Heading>0</Heading>
      <Input1>false</Input1>
      <Input2>false</Input2>
      <Km>0</Km>
      <Location>
        <Latitude>0</Latitude>
        <Longitude>0</Longitude>
      </Location>
      <Output3>false</Output3>
      <Run1>0</Run1>
      <Run2>0</Run2>
      <RunOdo>0</RunOdo>
      <Speed>0</Speed>
      <Temperature1>0</Temperature1>
      <Temperature2>0</Temperature2>
      <Time>0001-01-01T00:00:00</Time>
      <UnitId>String</UnitId>
    </KeyHistory>
  </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>
</GetReportKeyHistoryResponse>

</soap12:Body>
</soap12:Envelope>