| POST | /v8/readings-bulk-reset/{to} |
|---|
<?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};
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=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['apiKey'])) $this->apiKey = $o['apiKey'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->apiKey)) $o['apiKey'] = $this->apiKey;
return empty($o) ? new class(){} : $o;
}
}
class ReadingsBulkReset extends Generic implements IPost, JsonSerializable
{
/**
* @param string $apiKey
*/
public function __construct(
string $apiKey='',
/** @description Reset the 'Last Downloaded' - time stamp. Keep in mind ... this is the time stamp of the message(s) we received from EDSN/GridOperators, not the Date of the actual data! If you want to start for example from January 1st, 2025, give: 20250101-000000-000000. About 2 weeks of history is available through the ReadingsBulkRequest */
// @ApiMember(DataType="Time stamp with format: yyyyMMdd-HHmmss-ffffff", Description="Reset the 'Last Downloaded' - time stamp. Keep in mind ... this is the time stamp of the message(s) we received from EDSN/GridOperators, not the Date of the actual data! If you want to start for example from January 1st, 2025, give: 20250101-000000-000000. About 2 weeks of history is available through the ReadingsBulkRequest", IsRequired=true, Name="To")
/** @var string */
public string $to=''
) {
parent::__construct($apiKey);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['to'])) $this->to = $o['to'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->to)) $o['to'] = $this->to;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v8/readings-bulk-reset/{to} HTTP/1.1
Host: p4.smartdatasolutions.eu
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"to":"String","apiKey":"String"}