| GET | /api/v1/devices |
|---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
import com.google.gson.annotations.*;
import com.google.gson.reflect.*;
public class dtos
{
public static class GetDeviceList implements IHasBearerToken
{
@ApiMember(IsRequired=true, ParameterType="query")
public String bearerToken = null;
/**
* Optional! Follow the format : /api/v1/devices?filter[ObjektGuid]=*
*/
@DataMember(Name="filter[ObjektGuid]")
@SerializedName("filter[ObjektGuid]")
@ApiMember(Description="Optional! Follow the format : /api/v1/devices?filter[ObjektGuid]=*", ParameterType="query")
public String filterByObjektGuid = null;
/**
* Optional! Follow the format : /api/v1/devices?filter[NutzerGuid]=*
*/
@DataMember(Name="filter[NutzerGuid]")
@SerializedName("filter[NutzerGuid]")
@ApiMember(Description="Optional! Follow the format : /api/v1/devices?filter[NutzerGuid]=*", ParameterType="query")
public String filterByNutzeinheitGuid = null;
public String getBearerToken() { return bearerToken; }
public GetDeviceList setBearerToken(String value) { this.bearerToken = value; return this; }
public String getFilterByObjektGuid() { return filterByObjektGuid; }
public GetDeviceList setFilterByObjektGuid(String value) { this.filterByObjektGuid = value; return this; }
public String getFilterByNutzeinheitGuid() { return filterByNutzeinheitGuid; }
public GetDeviceList setFilterByNutzeinheitGuid(String value) { this.filterByNutzeinheitGuid = value; return this; }
}
public static class GetDeviceListResponse
{
public ArrayList<Device> deviceList = null;
public ResponseStatus responseStatus = null;
public ArrayList<Device> getDeviceList() { return deviceList; }
public GetDeviceListResponse setDeviceList(ArrayList<Device> value) { this.deviceList = value; return this; }
public ResponseStatus getResponseStatus() { return responseStatus; }
public GetDeviceListResponse setResponseStatus(ResponseStatus value) { this.responseStatus = value; return this; }
}
@DataContract
public static class Device
{
@DataMember(Name="Guid")
@SerializedName("Guid")
public String guid = null;
@DataMember(Name="Geraetenummer")
@SerializedName("Geraetenummer")
public String number = null;
@DataMember(Name="Bezeichnung")
@SerializedName("Bezeichnung")
public String label = null;
@DataMember(Name="Beschreibung")
@SerializedName("Beschreibung")
public String description = null;
@DataMember(Name="Einbaudatum")
@SerializedName("Einbaudatum")
public Date installationDate = null;
@DataMember(Name="Ausbaudatum")
@SerializedName("Ausbaudatum")
public Date deinstallationDate = null;
@DataMember(Name="Eichdatum")
@SerializedName("Eichdatum")
public Date calibrationDate = null;
@DataMember(Name="Einheit")
@SerializedName("Einheit")
public String unit = null;
@DataMember(Name="Memo")
@SerializedName("Memo")
public String note = null;
@DataMember(Name="DeviceCatalogGuid")
@SerializedName("DeviceCatalogGuid")
public String deviceCatalogGuid = null;
public String getGuid() { return guid; }
public Device setGuid(String value) { this.guid = value; return this; }
public String getNumber() { return number; }
public Device setNumber(String value) { this.number = value; return this; }
public String getLabel() { return label; }
public Device setLabel(String value) { this.label = value; return this; }
public String getDescription() { return description; }
public Device setDescription(String value) { this.description = value; return this; }
public Date getInstallationDate() { return installationDate; }
public Device setInstallationDate(Date value) { this.installationDate = value; return this; }
public Date getDeinstallationDate() { return deinstallationDate; }
public Device setDeinstallationDate(Date value) { this.deinstallationDate = value; return this; }
public Date getCalibrationDate() { return calibrationDate; }
public Device setCalibrationDate(Date value) { this.calibrationDate = value; return this; }
public String getUnit() { return unit; }
public Device setUnit(String value) { this.unit = value; return this; }
public String getNote() { return note; }
public Device setNote(String value) { this.note = value; return this; }
public String getDeviceCatalogGuid() { return deviceCatalogGuid; }
public Device setDeviceCatalogGuid(String value) { this.deviceCatalogGuid = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /api/v1/devices HTTP/1.1 Host: calotec-portal-servdesk.eras-online.de Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetDeviceListResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eras2Web.Service.Desktop.Server.ServiceModel.Eras2WebExt.Get">
<DeviceList xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eras2Web.Service.Desktop.Server.ServiceModel.Eras2WebExt.Models" i:nil="true" />
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1: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>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1: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>
</d2p1:Meta>
</ResponseStatus>
</GetDeviceListResponse>