| GET | /api/v1/devices/{Guid} |
|---|
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 GetDevice implements IHasBearerToken
{
@ApiMember(IsRequired=true, ParameterType="query")
public String bearerToken = null;
@ApiMember(IsRequired=true, ParameterType="path")
public UUID guid = null;
public String getBearerToken() { return bearerToken; }
public GetDevice setBearerToken(String value) { this.bearerToken = value; return this; }
public UUID getGuid() { return guid; }
public GetDevice setGuid(UUID value) { this.guid = value; return this; }
}
public static class GetDeviceResponse
{
public Device device = null;
public ResponseStatus responseStatus = null;
public Device getDevice() { return device; }
public GetDeviceResponse setDevice(Device value) { this.device = value; return this; }
public ResponseStatus getResponseStatus() { return responseStatus; }
public GetDeviceResponse setResponseStatus(ResponseStatus value) { this.responseStatus = value; return this; }
}
@DataContract
public static class Device
{
@DataMember
public UUID guid = null;
@DataMember
public String number = null;
@DataMember
public String label = null;
@DataMember
public String description = null;
@DataMember
public Date installationDate = null;
@DataMember
public Date deinstallationDate = null;
@DataMember
public Date calibrationDate = null;
@DataMember
public EinheitType unit = null;
@DataMember
public String note = null;
@DataMember
public DeviceCatalog deviceCatalog = null;
@DataMember
public ArrayList<DeviceConsumption> deviceConsumptions = null;
public UUID getGuid() { return guid; }
public Device setGuid(UUID 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 EinheitType getUnit() { return unit; }
public Device setUnit(EinheitType value) { this.unit = value; return this; }
public String getNote() { return note; }
public Device setNote(String value) { this.note = value; return this; }
public DeviceCatalog getDeviceCatalog() { return deviceCatalog; }
public Device setDeviceCatalog(DeviceCatalog value) { this.deviceCatalog = value; return this; }
public ArrayList<DeviceConsumption> getDeviceConsumptions() { return deviceConsumptions; }
public Device setDeviceConsumptions(ArrayList<DeviceConsumption> value) { this.deviceConsumptions = value; return this; }
}
public static enum EinheitType
{
L,
Kg,
Cbm,
Stck,
Kwh,
Mwh,
Gwh,
T,
Rm,
Einheit,
Qm,
Gj,
Mj,
Null,
St,
Srm,
Wh;
}
@DataContract
public static class DeviceCatalog
{
@DataMember(Name="Guid")
@SerializedName("Guid")
public String guid = null;
@DataMember(Name="TypKurz")
@SerializedName("TypKurz")
public String typeShort = null;
@DataMember(Name="TypLang")
@SerializedName("TypLang")
public String typeLong = null;
@DataMember(Name="Ablesbar")
@SerializedName("Ablesbar")
public Boolean readable = null;
@DataMember(Name="Klasse")
@SerializedName("Klasse")
@SerializedName("class") public String Class = null;
@DataMember(Name="Abzug")
@SerializedName("Abzug")
public Boolean subtraction = null;
@DataMember(Name="Hkvv")
@SerializedName("Hkvv")
public Boolean hkvv = null;
@DataMember(Name="Funk")
@SerializedName("Funk")
public Boolean radio = null;
public String getGuid() { return guid; }
public DeviceCatalog setGuid(String value) { this.guid = value; return this; }
public String getTypeShort() { return typeShort; }
public DeviceCatalog setTypeShort(String value) { this.typeShort = value; return this; }
public String getTypeLong() { return typeLong; }
public DeviceCatalog setTypeLong(String value) { this.typeLong = value; return this; }
public Boolean isReadable() { return readable; }
public DeviceCatalog setReadable(Boolean value) { this.readable = value; return this; }
public String getClass() { return Class; }
public DeviceCatalog setClass(String value) { this.Class = value; return this; }
public Boolean isSubtraction() { return subtraction; }
public DeviceCatalog setSubtraction(Boolean value) { this.subtraction = value; return this; }
public Boolean isHkvv() { return hkvv; }
public DeviceCatalog setHkvv(Boolean value) { this.hkvv = value; return this; }
public Boolean isRadio() { return radio; }
public DeviceCatalog setRadio(Boolean value) { this.radio = value; return this; }
}
@DataContract
public static class DeviceConsumption
{
@DataMember
public UUID guid = null;
@DataMember
public Double deviceReading = null;
@DataMember
public Date deviceReadingDate = null;
@DataMember
public DeviceReadingKind deviceReadingKind = null;
@DataMember
public Date changeDate = null;
@DataMember
public String note = null;
@DataMember
public String ampouleColour = null;
@DataMember
public String deviceGuid = null;
public UUID getGuid() { return guid; }
public DeviceConsumption setGuid(UUID value) { this.guid = value; return this; }
public Double getDeviceReading() { return deviceReading; }
public DeviceConsumption setDeviceReading(Double value) { this.deviceReading = value; return this; }
public Date getDeviceReadingDate() { return deviceReadingDate; }
public DeviceConsumption setDeviceReadingDate(Date value) { this.deviceReadingDate = value; return this; }
public DeviceReadingKind getDeviceReadingKind() { return deviceReadingKind; }
public DeviceConsumption setDeviceReadingKind(DeviceReadingKind value) { this.deviceReadingKind = value; return this; }
public Date getChangeDate() { return changeDate; }
public DeviceConsumption setChangeDate(Date value) { this.changeDate = value; return this; }
public String getNote() { return note; }
public DeviceConsumption setNote(String value) { this.note = value; return this; }
public String getAmpouleColour() { return ampouleColour; }
public DeviceConsumption setAmpouleColour(String value) { this.ampouleColour = value; return this; }
public String getDeviceGuid() { return deviceGuid; }
public DeviceConsumption setDeviceGuid(String value) { this.deviceGuid = value; return this; }
}
public static enum DeviceReadingKind
{
Za,
Ha,
Mo,
Eb,
Ab;
}
}
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/{Guid} HTTP/1.1
Host: immo-account-servdesk.eras-online.de
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetDeviceResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eras2Web.Service.Desktop.Server.ServiceModel.Eras2WebExt.Get">
<Device xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eras2Web.Service.Desktop.Server.ServiceModel.Eras2WebExt.Models">
<d2p1:CalibrationDate>0001-01-01T00:00:00</d2p1:CalibrationDate>
<d2p1:DeinstallationDate>0001-01-01T00:00:00</d2p1:DeinstallationDate>
<d2p1:Description>String</d2p1:Description>
<d2p1:DeviceCatalog xmlns:d3p1="http://schemas.datacontract.org/2004/07/Eras2Web.Service.Desktop.Server.ServiceModel.Stammdaten">
<d3p1:Ablesbar>false</d3p1:Ablesbar>
<d3p1:Abzug>false</d3p1:Abzug>
<d3p1:Funk>false</d3p1:Funk>
<d3p1:Guid>String</d3p1:Guid>
<d3p1:Hkvv>false</d3p1:Hkvv>
<d3p1:Klasse>String</d3p1:Klasse>
<d3p1:TypKurz>String</d3p1:TypKurz>
<d3p1:TypLang>String</d3p1:TypLang>
</d2p1:DeviceCatalog>
<d2p1:DeviceConsumptions>
<d2p1:DeviceConsumption>
<d2p1:AmpouleColour>String</d2p1:AmpouleColour>
<d2p1:ChangeDate>0001-01-01T00:00:00</d2p1:ChangeDate>
<d2p1:DeviceGuid>String</d2p1:DeviceGuid>
<d2p1:DeviceReading>0</d2p1:DeviceReading>
<d2p1:DeviceReadingDate>0001-01-01T00:00:00</d2p1:DeviceReadingDate>
<d2p1:DeviceReadingKind>ZA</d2p1:DeviceReadingKind>
<d2p1:Guid>00000000-0000-0000-0000-000000000000</d2p1:Guid>
<d2p1:Note>String</d2p1:Note>
</d2p1:DeviceConsumption>
</d2p1:DeviceConsumptions>
<d2p1:Guid>00000000-0000-0000-0000-000000000000</d2p1:Guid>
<d2p1:InstallationDate>0001-01-01T00:00:00</d2p1:InstallationDate>
<d2p1:Label>String</d2p1:Label>
<d2p1:Note>String</d2p1:Note>
<d2p1:Number>String</d2p1:Number>
<d2p1:Unit>L</d2p1:Unit>
</Device>
<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>
</GetDeviceResponse>