| GET | /api/v5/meteringpoints/{Ean}/status | Get the status of a single asset | |
|---|---|---|---|
| GET | /api/v8/meteringpoints/{Ean}/status | Get the status of a single asset |
<?php namespace dtos;
use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};
enum DateTimeFormat : string
{
case ISO8601 = 'ISO8601';
case UTC = 'UTC';
case NL = 'NL';
case NLOffset = 'NLOffset';
case IN = 'IN';
case INOffset = 'INOffset';
case Unix = 'Unix';
case UnixMillis = 'UnixMillis';
}
class Generic implements JsonSerializable
{
public function __construct(
/** @description Api-key. Used to provide credentials to the api. Can also be provided through the request headers with key: X-API-KEY */
// @ApiMember(DataType="String", Description="Api-key. Used to provide credentials to the api. Can also be provided through the request headers with key: X-API-KEY", IsRequired=true, Name="ApiKey")
/** @var string */
public string $ApiKey='',
/** @description Normally the result of the request is put inside a resultobject with some status information about the request. If you want the output as csv this outer object can be irritating. Default value: FALSE */
// @ApiMember(DataType="Boolean", Description="Normally the result of the request is put inside a resultobject with some status information about the request. If you want the output as csv this outer object can be irritating. Default value: FALSE ", Name="OnlyPayload")
/** @var bool|null */
public ?bool $OnlyPayload=null,
/** @description Show the request as interpreted by the api. Useful to see how filters / dates are parsed. If no value us provided, the default value is: FALSE */
// @ApiMember(DataType="Boolean", Description="Show the request as interpreted by the api. Useful to see how filters / dates are parsed. If no value us provided, the default value is: FALSE ", Name="ShowRequest")
/** @var bool|null */
public ?bool $ShowRequest=null,
/** @description Format all DateTime in the response object. If used in browser, sometimes ISO8601 is not correctly transformed. Enum options: ISO8601 (DEFAULT), UTC, NL, NLOffset, Unix, UnixMillis */
// @ApiMember(DataType="Enum", Description="Format all DateTime in the response object. If used in browser, sometimes ISO8601 is not correctly transformed. Enum options: ISO8601 (DEFAULT), UTC, NL, NLOffset, Unix, UnixMillis", Name="DateTimeFormat")
/** @var DateTimeFormat|null */
public ?DateTimeFormat $DateTimeFormat=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ApiKey'])) $this->ApiKey = $o['ApiKey'];
if (isset($o['OnlyPayload'])) $this->OnlyPayload = $o['OnlyPayload'];
if (isset($o['ShowRequest'])) $this->ShowRequest = $o['ShowRequest'];
if (isset($o['DateTimeFormat'])) $this->DateTimeFormat = JsonConverters::from('DateTimeFormat', $o['DateTimeFormat']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ApiKey)) $o['ApiKey'] = $this->ApiKey;
if (isset($this->OnlyPayload)) $o['OnlyPayload'] = $this->OnlyPayload;
if (isset($this->ShowRequest)) $o['ShowRequest'] = $this->ShowRequest;
if (isset($this->DateTimeFormat)) $o['DateTimeFormat'] = JsonConverters::to('DateTimeFormat', $this->DateTimeFormat);
return empty($o) ? new class(){} : $o;
}
}
/** @description Get status */
// @Api(Description="Get status")
class StatusV8 extends Generic implements JsonSerializable
{
/**
* @param string $ApiKey
* @param bool|null $OnlyPayload
* @param bool|null $ShowRequest
* @param DateTimeFormat|null $DateTimeFormat
*/
public function __construct(
string $ApiKey='',
?bool $OnlyPayload=null,
?bool $ShowRequest=null,
?DateTimeFormat $DateTimeFormat=null,
/** @description Request of details of specific metering point with specified ean */
// @ApiMember(DataType="EAN (18 numbers)", Description="Request of details of specific metering point with specified ean", Name="Ean")
/** @var string|null */
public ?string $Ean=null
) {
parent::__construct($ApiKey,$OnlyPayload,$ShowRequest,$DateTimeFormat);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['Ean'])) $this->Ean = $o['Ean'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->Ean)) $o['Ean'] = $this->Ean;
return empty($o) ? new class(){} : $o;
}
}
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/v5/meteringpoints/{Ean}/status HTTP/1.1
Host: p4v8.smartdatasolutions.nl
Accept: application/xml