All Verbs | /app-overview |
---|
<?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 TechnologyTier : string
{
case ProgrammingLanguage = 'ProgrammingLanguage';
case Client = 'Client';
case Http = 'Http';
case Server = 'Server';
case Data = 'Data';
case SoftwareInfrastructure = 'SoftwareInfrastructure';
case OperatingSystem = 'OperatingSystem';
case HardwareInfrastructure = 'HardwareInfrastructure';
case ThirdPartyServices = 'ThirdPartyServices';
}
// @DataContract
class Option implements JsonSerializable
{
public function __construct(
// @DataMember(Name="name")
/** @var string|null */
public ?string $name=null,
// @DataMember(Name="title")
/** @var string|null */
public ?string $title=null,
// @DataMember(Name="value")
/** @var TechnologyTier|null */
public ?TechnologyTier $value=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['title'])) $this->title = $o['title'];
if (isset($o['value'])) $this->value = JsonConverters::from('TechnologyTier', $o['value']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->title)) $o['title'] = $this->title;
if (isset($this->value)) $o['value'] = JsonConverters::to('TechnologyTier', $this->value);
return empty($o) ? new class(){} : $o;
}
}
class TechnologyInfo implements JsonSerializable
{
public function __construct(
/** @var TechnologyTier|null */
public ?TechnologyTier $tier=null,
/** @var string|null */
public ?string $slug=null,
/** @var string|null */
public ?string $name=null,
/** @var string|null */
public ?string $logoUrl=null,
/** @var int */
public int $stacksCount=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['tier'])) $this->tier = JsonConverters::from('TechnologyTier', $o['tier']);
if (isset($o['slug'])) $this->slug = $o['slug'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['logoUrl'])) $this->logoUrl = $o['logoUrl'];
if (isset($o['stacksCount'])) $this->stacksCount = $o['stacksCount'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->tier)) $o['tier'] = JsonConverters::to('TechnologyTier', $this->tier);
if (isset($this->slug)) $o['slug'] = $this->slug;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->logoUrl)) $o['logoUrl'] = $this->logoUrl;
if (isset($this->stacksCount)) $o['stacksCount'] = $this->stacksCount;
return empty($o) ? new class(){} : $o;
}
}
class AppOverviewResponse implements JsonSerializable
{
public function __construct(
/** @var DateTime */
public DateTime $created=new DateTime(),
/** @var array<Option>|null */
public ?array $allTiers=null,
/** @var array<TechnologyInfo>|null */
public ?array $topTechnologies=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['created'])) $this->created = JsonConverters::from('DateTime', $o['created']);
if (isset($o['allTiers'])) $this->allTiers = JsonConverters::fromArray('Option', $o['allTiers']);
if (isset($o['topTechnologies'])) $this->topTechnologies = JsonConverters::fromArray('TechnologyInfo', $o['topTechnologies']);
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->created)) $o['created'] = JsonConverters::to('DateTime', $this->created);
if (isset($this->allTiers)) $o['allTiers'] = JsonConverters::toArray('Option', $this->allTiers);
if (isset($this->topTechnologies)) $o['topTechnologies'] = JsonConverters::toArray('TechnologyInfo', $this->topTechnologies);
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
return empty($o) ? new class(){} : $o;
}
}
class AppOverview implements IGet, JsonSerializable
{
public function __construct(
/** @var bool|null */
public ?bool $reload=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['reload'])) $this->reload = $o['reload'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->reload)) $o['reload'] = $this->reload;
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.
POST /app-overview HTTP/1.1
Host: techstacks.io
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<AppOverview xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TechStacks.ServiceModel">
<Reload>false</Reload>
</AppOverview>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <AppOverviewResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TechStacks.ServiceModel"> <AllTiers> <Option> <name>String</name> <title>String</title> <value>ProgrammingLanguage</value> </Option> </AllTiers> <Created>0001-01-01T00:00:00</Created> <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types"> <d2p1:ErrorCode>String</d2p1:ErrorCode> <d2p1:Message>String</d2p1:Message> <d2p1:StackTrace>String</d2p1:StackTrace> <d2p1:Errors> <d2p1:ResponseError> <d2p1:ErrorCode>String</d2p1:ErrorCode> <d2p1:FieldName>String</d2p1:FieldName> <d2p1:Message>String</d2p1:Message> <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d5p1:KeyValueOfstringstring> <d5p1:Key>String</d5p1:Key> <d5p1:Value>String</d5p1:Value> </d5p1:KeyValueOfstringstring> </d2p1:Meta> </d2p1:ResponseError> </d2p1:Errors> <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringstring> <d3p1:Key>String</d3p1:Key> <d3p1:Value>String</d3p1:Value> </d3p1:KeyValueOfstringstring> </d2p1:Meta> </ResponseStatus> <TopTechnologies> <TechnologyInfo> <LogoUrl>String</LogoUrl> <Name>String</Name> <Slug>String</Slug> <StacksCount>0</StacksCount> <Tier>ProgrammingLanguage</Tier> </TechnologyInfo> </TopTechnologies> </AppOverviewResponse>