| All Verbs | /SaveArea/{Area} |
|---|
<?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 AreaContent implements JsonSerializable
{
public function __construct(
/** @var int */
public int $ID=0,
/** @var string */
public string $LCAddress='',
/** @var int */
public int $PixelStart=0,
/** @var int */
public int $PixelStop=0,
/** @var int */
public int $AreaID=0,
/** @var int */
public int $Pos=0,
/** @var bool|null */
public ?bool $Reverse=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ID'])) $this->ID = $o['ID'];
if (isset($o['LCAddress'])) $this->LCAddress = $o['LCAddress'];
if (isset($o['PixelStart'])) $this->PixelStart = $o['PixelStart'];
if (isset($o['PixelStop'])) $this->PixelStop = $o['PixelStop'];
if (isset($o['AreaID'])) $this->AreaID = $o['AreaID'];
if (isset($o['Pos'])) $this->Pos = $o['Pos'];
if (isset($o['Reverse'])) $this->Reverse = $o['Reverse'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ID)) $o['ID'] = $this->ID;
if (isset($this->LCAddress)) $o['LCAddress'] = $this->LCAddress;
if (isset($this->PixelStart)) $o['PixelStart'] = $this->PixelStart;
if (isset($this->PixelStop)) $o['PixelStop'] = $this->PixelStop;
if (isset($this->AreaID)) $o['AreaID'] = $this->AreaID;
if (isset($this->Pos)) $o['Pos'] = $this->Pos;
if (isset($this->Reverse)) $o['Reverse'] = $this->Reverse;
return empty($o) ? new class(){} : $o;
}
}
class Area implements JsonSerializable
{
public function __construct(
/** @var int */
public int $AreaID=0,
/** @var string */
public string $Label='',
/** @var int|null */
public ?int $StockroomID=null,
/** @var array<AreaContent>|null */
public ?array $Content=null,
/** @var int */
public int $NumberOfPixels=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['AreaID'])) $this->AreaID = $o['AreaID'];
if (isset($o['Label'])) $this->Label = $o['Label'];
if (isset($o['StockroomID'])) $this->StockroomID = $o['StockroomID'];
if (isset($o['Content'])) $this->Content = JsonConverters::fromArray('AreaContent', $o['Content']);
if (isset($o['NumberOfPixels'])) $this->NumberOfPixels = $o['NumberOfPixels'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->AreaID)) $o['AreaID'] = $this->AreaID;
if (isset($this->Label)) $o['Label'] = $this->Label;
if (isset($this->StockroomID)) $o['StockroomID'] = $this->StockroomID;
if (isset($this->Content)) $o['Content'] = JsonConverters::toArray('AreaContent', $this->Content);
if (isset($this->NumberOfPixels)) $o['NumberOfPixels'] = $this->NumberOfPixels;
return empty($o) ? new class(){} : $o;
}
}
class SaveArea implements JsonSerializable
{
public function __construct(
/** @description Area */
// @ApiMember(Description="Area", IsRequired=true)
/** @var Area|null */
public ?Area $Area=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Area'])) $this->Area = JsonConverters::from('Area', $o['Area']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Area)) $o['Area'] = JsonConverters::to('Area', $this->Area);
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 /SaveArea/{Area} HTTP/1.1
Host: clouddemo.pickeos.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"Area":{"AreaID":0,"Label":"String","StockroomID":0,"Content":[{"ID":0,"LCAddress":"String","PixelStart":0,"PixelStop":0,"AreaID":0,"Pos":0,"Reverse":false}],"NumberOfPixels":1}}