Server

<back to all web services

GetDeviceConsumptionList

Deviceconsumptions
Requires Authentication
The following routes are available for this service:
GET/api/v1/deviceconsumptions
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


class DeviceReadingKind(str, Enum):
    ZA = 'ZA'
    HA = 'HA'
    MO = 'MO'
    EB = 'EB'
    AB = 'AB'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DeviceConsumption:
    guid: Optional[str] = None
    device_reading: Optional[float] = None
    device_reading_date: Optional[datetime.datetime] = None
    device_reading_kind: Optional[DeviceReadingKind] = None
    change_date: Optional[datetime.datetime] = None
    note: Optional[str] = None
    ampoule_colour: Optional[str] = None
    device_guid: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetDeviceConsumptionListResponse:
    device_consumption_list: Optional[List[DeviceConsumption]] = None
    response_status: Optional[ResponseStatus] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetDeviceConsumptionList(IHasBearerToken):
    # @ApiMember(IsRequired=true, ParameterType="query")
    bearer_token: Optional[str] = None

    # @ApiMember(Description="Optional! Follow the format : /api/v1/deviceconsumptions?filter[DeviceGuid]=*", ParameterType="query")
    filter_by_device_guid: Optional[str] = None
    """
    Optional! Follow the format : /api/v1/deviceconsumptions?filter[DeviceGuid]=*
    """

Python GetDeviceConsumptionList 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.

GET /api/v1/deviceconsumptions HTTP/1.1 
Host: kromer-servdesk.eras-online.de 
Accept: text/jsonl
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"}}}