PUT | /unit | ||
---|---|---|---|
PUT | /unit/{Id} | ||
GET POST | /UpdateUnit | ||
GET POST | /UpdateUnit/{Id} |
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
@DataContract
public static class UpdateUnit
{
@DataMember
public String id = null;
@DataMember
public String name = null;
@DataMember
public String referenceNumber = null;
@DataMember
public String clientId = null;
@DataMember
public String categoryId = null;
@DataMember
public String vehicleType = null;
@DataMember
public Double preKm = null;
@DataMember
public Double preRun1 = null;
@DataMember
public Double preRun2 = null;
@DataMember
public String note = null;
@DataMember
public Boolean isActive = null;
@DataMember
public String input1Name = null;
@DataMember
public String input2Name = null;
@DataMember
public String input3Name = null;
@DataMember
public String input4Name = null;
@DataMember
public Boolean lock = null;
public String getId() { return id; }
public UpdateUnit setId(String value) { this.id = value; return this; }
public String getName() { return name; }
public UpdateUnit setName(String value) { this.name = value; return this; }
public String getReferenceNumber() { return referenceNumber; }
public UpdateUnit setReferenceNumber(String value) { this.referenceNumber = value; return this; }
public String getClientId() { return clientId; }
public UpdateUnit setClientId(String value) { this.clientId = value; return this; }
public String getCategoryId() { return categoryId; }
public UpdateUnit setCategoryId(String value) { this.categoryId = value; return this; }
public String getVehicleType() { return vehicleType; }
public UpdateUnit setVehicleType(String value) { this.vehicleType = value; return this; }
public Double getPreKm() { return preKm; }
public UpdateUnit setPreKm(Double value) { this.preKm = value; return this; }
public Double getPreRun1() { return preRun1; }
public UpdateUnit setPreRun1(Double value) { this.preRun1 = value; return this; }
public Double getPreRun2() { return preRun2; }
public UpdateUnit setPreRun2(Double value) { this.preRun2 = value; return this; }
public String getNote() { return note; }
public UpdateUnit setNote(String value) { this.note = value; return this; }
public Boolean getIsActive() { return isActive; }
public UpdateUnit setIsActive(Boolean value) { this.isActive = value; return this; }
public String getInput1Name() { return input1Name; }
public UpdateUnit setInput1Name(String value) { this.input1Name = value; return this; }
public String getInput2Name() { return input2Name; }
public UpdateUnit setInput2Name(String value) { this.input2Name = value; return this; }
public String getInput3Name() { return input3Name; }
public UpdateUnit setInput3Name(String value) { this.input3Name = value; return this; }
public String getInput4Name() { return input4Name; }
public UpdateUnit setInput4Name(String value) { this.input4Name = value; return this; }
public Boolean isLock() { return lock; }
public UpdateUnit setLock(Boolean value) { this.lock = value; return this; }
}
@DataContract
public static class UpdateUnitResponse
{
@DataMember
public ResponseStatus responseStatus = null;
public ResponseStatus getResponseStatus() { return responseStatus; }
public UpdateUnitResponse setResponseStatus(ResponseStatus value) { this.responseStatus = value; return this; }
}
}
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 /UpdateUnit HTTP/1.1
Host: api.trackunit.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"id":"String","name":"String","referenceNumber":"String","clientId":"String","categoryId":"String","vehicleType":"String","preKm":0,"preRun1":0,"preRun2":0,"note":"String","isActive":false,"input1Name":"String","input2Name":"String","input3Name":"String","input4Name":"String","lock":false}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}