GET | /RestApi/diagnostics/methods |
---|
<?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 GetRootMethods implements JsonSerializable
{
public function __construct(
/** @var string */
public string $RootOperationId='',
/** @var string|null */
public ?string $Category=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['RootOperationId'])) $this->RootOperationId = $o['RootOperationId'];
if (isset($o['Category'])) $this->Category = $o['Category'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->RootOperationId)) $o['RootOperationId'] = $this->RootOperationId;
if (isset($this->Category)) $o['Category'] = $this->Category;
return empty($o) ? new class(){} : $o;
}
}
class MethodViewModel implements JsonSerializable
{
public function __construct(
/** @var string */
public string $Id='',
/** @var string */
public string $RootOperationId='',
/** @var string */
public string $ParentOperationId='',
/** @var string|null */
public ?string $Method=null,
/** @var DateTime|null */
public ?DateTime $Start=null,
/** @var DateTime|null */
public ?DateTime $End=null,
/** @var float|null */
public ?float $Duration=null,
/** @var int */
public int $QueryCount=0,
/** @var bool|null */
public ?bool $HasChildren=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['RootOperationId'])) $this->RootOperationId = $o['RootOperationId'];
if (isset($o['ParentOperationId'])) $this->ParentOperationId = $o['ParentOperationId'];
if (isset($o['Method'])) $this->Method = $o['Method'];
if (isset($o['Start'])) $this->Start = JsonConverters::from('DateTime', $o['Start']);
if (isset($o['End'])) $this->End = JsonConverters::from('DateTime', $o['End']);
if (isset($o['Duration'])) $this->Duration = $o['Duration'];
if (isset($o['QueryCount'])) $this->QueryCount = $o['QueryCount'];
if (isset($o['HasChildren'])) $this->HasChildren = $o['HasChildren'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->RootOperationId)) $o['RootOperationId'] = $this->RootOperationId;
if (isset($this->ParentOperationId)) $o['ParentOperationId'] = $this->ParentOperationId;
if (isset($this->Method)) $o['Method'] = $this->Method;
if (isset($this->Start)) $o['Start'] = JsonConverters::to('DateTime', $this->Start);
if (isset($this->End)) $o['End'] = JsonConverters::to('DateTime', $this->End);
if (isset($this->Duration)) $o['Duration'] = $this->Duration;
if (isset($this->QueryCount)) $o['QueryCount'] = $this->QueryCount;
if (isset($this->HasChildren)) $o['HasChildren'] = $this->HasChildren;
return empty($o) ? new class(){} : $o;
}
}
class MethodsProxy implements JsonSerializable
{
public function __construct(
/** @var array<MethodViewModel>|null */
public ?array $Items=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Items'])) $this->Items = JsonConverters::fromArray('MethodViewModel', $o['Items']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Items)) $o['Items'] = JsonConverters::toArray('MethodViewModel', $this->Items);
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /RestApi/diagnostics/methods HTTP/1.1 Host: www.asg.com.au Accept: text/jsv
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { }