GET | /RestApi/apiservice/services/{Route}/{UrlName} |
---|
<?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 GetService implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $UrlName=null,
/** @var string|null */
public ?string $Route=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['UrlName'])) $this->UrlName = $o['UrlName'];
if (isset($o['Route'])) $this->Route = $o['Route'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->UrlName)) $o['UrlName'] = $this->UrlName;
if (isset($this->Route)) $o['Route'] = $this->Route;
return empty($o) ? new class(){} : $o;
}
}
class PropertiesProxy implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $PropertyType=null,
/** @var bool|null */
public ?bool $IsPersistent=null,
/** @var bool|null */
public ?bool $AllowSort=null,
/** @var bool|null */
public ?bool $AllowFilter=null,
/** @var bool|null */
public ?bool $IsKey=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['PropertyType'])) $this->PropertyType = $o['PropertyType'];
if (isset($o['IsPersistent'])) $this->IsPersistent = $o['IsPersistent'];
if (isset($o['AllowSort'])) $this->AllowSort = $o['AllowSort'];
if (isset($o['AllowFilter'])) $this->AllowFilter = $o['AllowFilter'];
if (isset($o['IsKey'])) $this->IsKey = $o['IsKey'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->PropertyType)) $o['PropertyType'] = $this->PropertyType;
if (isset($this->IsPersistent)) $o['IsPersistent'] = $this->IsPersistent;
if (isset($this->AllowSort)) $o['AllowSort'] = $this->AllowSort;
if (isset($this->AllowFilter)) $o['AllowFilter'] = $this->AllowFilter;
if (isset($this->IsKey)) $o['IsKey'] = $this->IsKey;
return empty($o) ? new class(){} : $o;
}
}
class ContentsProxy implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Name=null,
/** @var bool|null */
public ?bool $ReadOnly=null,
/** @var string|null */
public ?string $UrlKey=null,
/** @var string|null */
public ?string $ClrType=null,
/** @var string|null */
public ?string $Access=null,
/** @var array<PropertiesProxy>|null */
public ?array $Properties=null,
/** @var array<ContentsProxy>|null */
public ?array $Children=null,
/** @var bool|null */
public ?bool $AutogenerateProperties=null,
/** @var string|null */
public ?string $parentId=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['ReadOnly'])) $this->ReadOnly = $o['ReadOnly'];
if (isset($o['UrlKey'])) $this->UrlKey = $o['UrlKey'];
if (isset($o['ClrType'])) $this->ClrType = $o['ClrType'];
if (isset($o['Access'])) $this->Access = $o['Access'];
if (isset($o['Properties'])) $this->Properties = JsonConverters::fromArray('PropertiesProxy', $o['Properties']);
if (isset($o['Children'])) $this->Children = JsonConverters::fromArray('ContentsProxy', $o['Children']);
if (isset($o['AutogenerateProperties'])) $this->AutogenerateProperties = $o['AutogenerateProperties'];
if (isset($o['parentId'])) $this->parentId = $o['parentId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->ReadOnly)) $o['ReadOnly'] = $this->ReadOnly;
if (isset($this->UrlKey)) $o['UrlKey'] = $this->UrlKey;
if (isset($this->ClrType)) $o['ClrType'] = $this->ClrType;
if (isset($this->Access)) $o['Access'] = $this->Access;
if (isset($this->Properties)) $o['Properties'] = JsonConverters::toArray('PropertiesProxy', $this->Properties);
if (isset($this->Children)) $o['Children'] = JsonConverters::toArray('ContentsProxy', $this->Children);
if (isset($this->AutogenerateProperties)) $o['AutogenerateProperties'] = $this->AutogenerateProperties;
if (isset($this->parentId)) $o['parentId'] = $this->parentId;
return empty($o) ? new class(){} : $o;
}
}
class ServicesProxy implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Route=null,
/** @var string|null */
public ?string $UrlName=null,
/** @var bool|null */
public ?bool $Enabled=null,
/** @var string|null */
public ?string $Access=null,
/** @var string|null */
public ?string $ApiKey=null,
/** @var string|null */
public ?string $AccessControlAllowOrigin=null,
/** @var bool|null */
public ?bool $AutogenerateTypes=null,
/** @var array<ContentsProxy>|null */
public ?array $Types=null,
/** @var string|null */
public ?string $Protocol=null,
/** @var string|null */
public ?string $ErrorMessage=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Route'])) $this->Route = $o['Route'];
if (isset($o['UrlName'])) $this->UrlName = $o['UrlName'];
if (isset($o['Enabled'])) $this->Enabled = $o['Enabled'];
if (isset($o['Access'])) $this->Access = $o['Access'];
if (isset($o['ApiKey'])) $this->ApiKey = $o['ApiKey'];
if (isset($o['AccessControlAllowOrigin'])) $this->AccessControlAllowOrigin = $o['AccessControlAllowOrigin'];
if (isset($o['AutogenerateTypes'])) $this->AutogenerateTypes = $o['AutogenerateTypes'];
if (isset($o['Types'])) $this->Types = JsonConverters::fromArray('ContentsProxy', $o['Types']);
if (isset($o['Protocol'])) $this->Protocol = $o['Protocol'];
if (isset($o['ErrorMessage'])) $this->ErrorMessage = $o['ErrorMessage'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Route)) $o['Route'] = $this->Route;
if (isset($this->UrlName)) $o['UrlName'] = $this->UrlName;
if (isset($this->Enabled)) $o['Enabled'] = $this->Enabled;
if (isset($this->Access)) $o['Access'] = $this->Access;
if (isset($this->ApiKey)) $o['ApiKey'] = $this->ApiKey;
if (isset($this->AccessControlAllowOrigin)) $o['AccessControlAllowOrigin'] = $this->AccessControlAllowOrigin;
if (isset($this->AutogenerateTypes)) $o['AutogenerateTypes'] = $this->AutogenerateTypes;
if (isset($this->Types)) $o['Types'] = JsonConverters::toArray('ContentsProxy', $this->Types);
if (isset($this->Protocol)) $o['Protocol'] = $this->Protocol;
if (isset($this->ErrorMessage)) $o['ErrorMessage'] = $this->ErrorMessage;
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.
GET /RestApi/apiservice/services/{Route}/{UrlName} HTTP/1.1 Host: www.asg.com.au Accept: text/jsonl
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"Name":"String","Route":"String","UrlName":"String","Enabled":false,"Access":"String","ApiKey":"String","AccessControlAllowOrigin":"String","AutogenerateTypes":false,"Types":null,"Protocol":"String","ErrorMessage":"String"}