| GET,POST,PUT,OPTIONS | /v1/Equipment/{EquipmentID}/maintenance | ||
|---|---|---|---|
| PUT,OPTIONS | /v1/Equipment/{EquipmentID}/maintenance/{EquipmentMaintenanceID} |
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
public static class EquipmentMaintenanceRequest
{
public Integer EquipmentID = null;
public Integer EquipmentMaintenanceID = null;
public ArrayList<EquipmentMaintenance> Maintenance = new ArrayList<EquipmentMaintenance>();
public Integer getEquipmentID() { return EquipmentID; }
public EquipmentMaintenanceRequest setEquipmentID(Integer value) { this.EquipmentID = value; return this; }
public Integer getEquipmentMaintenanceID() { return EquipmentMaintenanceID; }
public EquipmentMaintenanceRequest setEquipmentMaintenanceID(Integer value) { this.EquipmentMaintenanceID = value; return this; }
public ArrayList<EquipmentMaintenance> getMaintenance() { return Maintenance; }
public EquipmentMaintenanceRequest setMaintenance(ArrayList<EquipmentMaintenance> value) { this.Maintenance = value; return this; }
}
public static class EquipmentMaintenance
{
public Integer EquipmentMaintenanceID = null;
public Integer EquipmentID = null;
public String Type = null;
public Date ScheduledDate = null;
public Integer IntervalDays = null;
public Date LastServiced = null;
public String Notes = null;
public String Status = null;
public String CreatedBy = null;
public Date CreatedAt = null;
public Date UpdatedAt = null;
public Date NextDue = null;
public Integer getEquipmentMaintenanceID() { return EquipmentMaintenanceID; }
public EquipmentMaintenance setEquipmentMaintenanceID(Integer value) { this.EquipmentMaintenanceID = value; return this; }
public Integer getEquipmentID() { return EquipmentID; }
public EquipmentMaintenance setEquipmentID(Integer value) { this.EquipmentID = value; return this; }
public String getType() { return Type; }
public EquipmentMaintenance setType(String value) { this.Type = value; return this; }
public Date getScheduledDate() { return ScheduledDate; }
public EquipmentMaintenance setScheduledDate(Date value) { this.ScheduledDate = value; return this; }
public Integer getIntervalDays() { return IntervalDays; }
public EquipmentMaintenance setIntervalDays(Integer value) { this.IntervalDays = value; return this; }
public Date getLastServiced() { return LastServiced; }
public EquipmentMaintenance setLastServiced(Date value) { this.LastServiced = value; return this; }
public String getNotes() { return Notes; }
public EquipmentMaintenance setNotes(String value) { this.Notes = value; return this; }
public String getStatus() { return Status; }
public EquipmentMaintenance setStatus(String value) { this.Status = value; return this; }
public String getCreatedBy() { return CreatedBy; }
public EquipmentMaintenance setCreatedBy(String value) { this.CreatedBy = value; return this; }
public Date getCreatedAt() { return CreatedAt; }
public EquipmentMaintenance setCreatedAt(Date value) { this.CreatedAt = value; return this; }
public Date getUpdatedAt() { return UpdatedAt; }
public EquipmentMaintenance setUpdatedAt(Date value) { this.UpdatedAt = value; return this; }
public Date getNextDue() { return NextDue; }
public EquipmentMaintenance setNextDue(Date value) { this.NextDue = value; return this; }
}
public static class EquipmentMaintenanceResponse
{
public ResponseStatus ResponseStatus = null;
public ArrayList<EquipmentMaintenance> Maintenance = new ArrayList<EquipmentMaintenance>();
public ResponseStatus getResponseStatus() { return ResponseStatus; }
public EquipmentMaintenanceResponse setResponseStatus(ResponseStatus value) { this.ResponseStatus = value; return this; }
public ArrayList<EquipmentMaintenance> getMaintenance() { return Maintenance; }
public EquipmentMaintenanceResponse setMaintenance(ArrayList<EquipmentMaintenance> value) { this.Maintenance = value; return this; }
}
}
Java EquipmentMaintenanceRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/Equipment/{EquipmentID}/maintenance HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
EquipmentID: 0,
EquipmentMaintenanceID: 0,
Maintenance:
[
{
EquipmentMaintenanceID: 0,
EquipmentID: 0,
Type: String,
ScheduledDate: 0001-01-01,
IntervalDays: 0,
LastServiced: 0001-01-01,
Notes: String,
Status: String,
CreatedBy: String,
CreatedAt: 0001-01-01,
UpdatedAt: 0001-01-01,
NextDue: 0001-01-01
}
]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
},
Maintenance:
[
{
EquipmentMaintenanceID: 0,
EquipmentID: 0,
Type: String,
ScheduledDate: 0001-01-01,
IntervalDays: 0,
LastServiced: 0001-01-01,
Notes: String,
Status: String,
CreatedBy: String,
CreatedAt: 0001-01-01,
UpdatedAt: 0001-01-01,
NextDue: 0001-01-01
}
]
}