GET POST | /report/unitsummary | ||
---|---|---|---|
GET POST | /report/unitsummary/{Id} |
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
@DataContract
public static class GetReportUnitSummary
{
@DataMember
public String unitId = null;
@DataMember
public Date date = null;
public String getUnitId() { return unitId; }
public GetReportUnitSummary setUnitId(String value) { this.unitId = value; return this; }
public Date getDate() { return date; }
public GetReportUnitSummary setDate(Date value) { this.date = value; return this; }
}
@DataContract
public static class GetReportUnitSummaryResponse
{
@DataMember
public ArrayList<UnitDaySummary> list = null;
@DataMember
public ResponseStatus responseStatus = null;
public ArrayList<UnitDaySummary> getList() { return list; }
public GetReportUnitSummaryResponse setList(ArrayList<UnitDaySummary> value) { this.list = value; return this; }
public ResponseStatus getResponseStatus() { return responseStatus; }
public GetReportUnitSummaryResponse setResponseStatus(ResponseStatus value) { this.responseStatus = value; return this; }
}
@DataContract
public static class UnitDaySummary
{
@DataMember
public String unitId = null;
@DataMember
public Date startTime = null;
@DataMember
public Location startLocation = null;
@DataMember
public Address startAddress = null;
@DataMember
public Date stopTime = null;
@DataMember
public Location stopLocation = null;
@DataMember
public Address stopAddress = null;
@DataMember
public Integer input1ChangeCounter = null;
@DataMember
public Integer input2ChangeCounter = null;
@DataMember
public Double run1 = null;
@DataMember
public Double run2 = null;
@DataMember
public Double run3 = null;
@DataMember
public Double run4 = null;
@DataMember
public Double runOdo = null;
@DataMember
public Double km = null;
public String getUnitId() { return unitId; }
public UnitDaySummary setUnitId(String value) { this.unitId = value; return this; }
public Date getStartTime() { return startTime; }
public UnitDaySummary setStartTime(Date value) { this.startTime = value; return this; }
public Location getStartLocation() { return startLocation; }
public UnitDaySummary setStartLocation(Location value) { this.startLocation = value; return this; }
public Address getStartAddress() { return startAddress; }
public UnitDaySummary setStartAddress(Address value) { this.startAddress = value; return this; }
public Date getStopTime() { return stopTime; }
public UnitDaySummary setStopTime(Date value) { this.stopTime = value; return this; }
public Location getStopLocation() { return stopLocation; }
public UnitDaySummary setStopLocation(Location value) { this.stopLocation = value; return this; }
public Address getStopAddress() { return stopAddress; }
public UnitDaySummary setStopAddress(Address value) { this.stopAddress = value; return this; }
public Integer getInput1ChangeCounter() { return input1ChangeCounter; }
public UnitDaySummary setInput1ChangeCounter(Integer value) { this.input1ChangeCounter = value; return this; }
public Integer getInput2ChangeCounter() { return input2ChangeCounter; }
public UnitDaySummary setInput2ChangeCounter(Integer value) { this.input2ChangeCounter = value; return this; }
public Double getRun1() { return run1; }
public UnitDaySummary setRun1(Double value) { this.run1 = value; return this; }
public Double getRun2() { return run2; }
public UnitDaySummary setRun2(Double value) { this.run2 = value; return this; }
public Double getRun3() { return run3; }
public UnitDaySummary setRun3(Double value) { this.run3 = value; return this; }
public Double getRun4() { return run4; }
public UnitDaySummary setRun4(Double value) { this.run4 = value; return this; }
public Double getRunOdo() { return runOdo; }
public UnitDaySummary setRunOdo(Double value) { this.runOdo = value; return this; }
public Double getKm() { return km; }
public UnitDaySummary setKm(Double value) { this.km = value; return this; }
}
@DataContract
public static class Location
{
@DataMember
public Double latitude = null;
@DataMember
public Double longitude = null;
public Double getLatitude() { return latitude; }
public Location setLatitude(Double value) { this.latitude = value; return this; }
public Double getLongitude() { return longitude; }
public Location setLongitude(Double value) { this.longitude = value; return this; }
}
@DataContract
public static class Address
{
@DataMember
public String country = null;
@DataMember
public String zipCode = null;
@DataMember
public String city = null;
@DataMember
public String streetAddress = null;
public String getCountry() { return country; }
public Address setCountry(String value) { this.country = value; return this; }
public String getZipCode() { return zipCode; }
public Address setZipCode(String value) { this.zipCode = value; return this; }
public String getCity() { return city; }
public Address setCity(String value) { this.city = value; return this; }
public String getStreetAddress() { return streetAddress; }
public Address setStreetAddress(String value) { this.streetAddress = value; return this; }
}
}
Java GetReportUnitSummary 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.
POST /report/unitsummary HTTP/1.1
Host: api.trackunit.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"unitId":"String","date":"0001-01-01T00:00:00.0000000Z"}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"list":[{"unitId":"String","startTime":"0001-01-01T00:00:00.0000000Z","startLocation":{"latitude":0,"longitude":0},"startAddress":{"country":"String","zipCode":"String","city":"String","streetAddress":"String"},"stopTime":"0001-01-01T00:00:00.0000000Z","stopLocation":{"latitude":0,"longitude":0},"stopAddress":{"country":"String","zipCode":"String","city":"String","streetAddress":"String"},"input1ChangeCounter":0,"input2ChangeCounter":0,"run1":0,"run2":0,"run3":0,"run4":0,"runOdo":0,"km":0}],"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}