Server

<back to all web services

GetDevice

Devices
Requires Authentication
The following routes are available for this service:
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;
    }

}

Java GetDevice DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

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: eca-abrechnungsservice-servdesk.eras-online.de 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	device: 
	{
		guid: 00000000000000000000000000000000,
		number: String,
		label: String,
		description: String,
		installationDate: 0001-01-01T00:00:00Z,
		deinstallationDate: 0001-01-01T00:00:00Z,
		calibrationDate: 0001-01-01T00:00:00Z,
		unit: L,
		note: String,
		deviceCatalog: 
		{
			Guid: String,
			TypKurz: String,
			TypLang: String,
			Ablesbar: False,
			Klasse: String,
			Abzug: False,
			Hkvv: False,
			Funk: False
		},
		deviceConsumptions: 
		[
			{
				guid: 00000000000000000000000000000000,
				deviceReading: 0,
				deviceReadingDate: 0001-01-01T00:00:00Z,
				deviceReadingKind: ZA,
				changeDate: 0001-01-01T00:00:00Z,
				note: String,
				ampouleColour: String,
				deviceGuid: String
			}
		]
	},
	responseStatus: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	}
}