Server

<back to all web services

PutDeviceConsumption

Deviceconsumptions
Requires Authentication
The following routes are available for this service:
PUT/api/v1/deviceconsumptions
import Foundation
import ServiceStack

public class PutDeviceConsumption : IHasBearerToken, Codable
{
    // @ApiMember(IsRequired=true, ParameterType="body")
    public var deviceConsumption:DeviceConsumption

    // @ApiMember(IsRequired=true, ParameterType="body")
    public var relatedToDevice:RelatedTo

    // @ApiMember(IsRequired=true, ParameterType="body")
    public var bearerToken:String

    required public init(){}
}

// @DataContract
public class DeviceConsumption : Codable
{
    // @DataMember
    public var guid:String

    // @DataMember
    public var deviceReading:Double?

    // @DataMember
    public var deviceReadingDate:Date?

    // @DataMember
    public var deviceReadingKind:DeviceReadingKind

    // @DataMember
    public var changeDate:Date?

    // @DataMember
    public var note:String

    // @DataMember
    public var ampouleColour:String

    // @DataMember
    public var deviceGuid:String

    required public init(){}
}

public enum DeviceReadingKind : String, Codable
{
    case ZA
    case HA
    case MO
    case EB
    case AB
}

// @DataContract
public class RelatedTo : Codable
{
    // @DataMember
    public var guid:String

    required public init(){}
}

public class PutDeviceConsumptionResponse : Codable
{
    public var responseStatus:ResponseStatus

    required public init(){}
}


Swift PutDeviceConsumption DTOs

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

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

PUT /api/v1/deviceconsumptions HTTP/1.1 
Host: kromer-servdesk.eras-online.de 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"deviceConsumption":{"guid":"00000000000000000000000000000000","deviceReading":0,"deviceReadingDate":"0001-01-01T00:00:00.0000000Z","deviceReadingKind":"ZA","changeDate":"0001-01-01T00:00:00.0000000Z","note":"String","ampouleColour":"String","deviceGuid":"String"},"relatedToDevice":{"guid":"00000000000000000000000000000000"},"bearerToken":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}