| All Verbs | /userinfo/{Id} |
|---|
<?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 TechnologyStackBase implements JsonSerializable
{
public function __construct(
/** @var int|null */
public ?int $id=null,
/** @var string */
public string $name='',
/** @var string */
public string $vendorName='',
/** @var string */
public string $description='',
/** @var string */
public string $appUrl='',
/** @var string */
public string $screenshotUrl='',
/** @var DateTime|null */
public ?DateTime $created=null,
/** @var string */
public string $createdBy='',
/** @var DateTime|null */
public ?DateTime $lastModified=null,
/** @var string */
public string $lastModifiedBy='',
/** @var bool|null */
public ?bool $isLocked=null,
/** @var string */
public string $ownerId='',
/** @var string */
public string $slug='',
// @StringLength(2147483647)
/** @var string */
public string $details='',
// @StringLength(2147483647)
/** @var string */
public string $detailsHtml='',
/** @var DateTime|null */
public ?DateTime $lastStatusUpdate=null,
/** @var int|null */
public ?int $organizationId=null,
/** @var int|null */
public ?int $commentsPostId=null,
/** @var int|null */
public ?int $viewCount=null,
/** @var int|null */
public ?int $favCount=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['vendorName'])) $this->vendorName = $o['vendorName'];
if (isset($o['description'])) $this->description = $o['description'];
if (isset($o['appUrl'])) $this->appUrl = $o['appUrl'];
if (isset($o['screenshotUrl'])) $this->screenshotUrl = $o['screenshotUrl'];
if (isset($o['created'])) $this->created = JsonConverters::from('DateTime', $o['created']);
if (isset($o['createdBy'])) $this->createdBy = $o['createdBy'];
if (isset($o['lastModified'])) $this->lastModified = JsonConverters::from('DateTime', $o['lastModified']);
if (isset($o['lastModifiedBy'])) $this->lastModifiedBy = $o['lastModifiedBy'];
if (isset($o['isLocked'])) $this->isLocked = $o['isLocked'];
if (isset($o['ownerId'])) $this->ownerId = $o['ownerId'];
if (isset($o['slug'])) $this->slug = $o['slug'];
if (isset($o['details'])) $this->details = $o['details'];
if (isset($o['detailsHtml'])) $this->detailsHtml = $o['detailsHtml'];
if (isset($o['lastStatusUpdate'])) $this->lastStatusUpdate = JsonConverters::from('DateTime', $o['lastStatusUpdate']);
if (isset($o['organizationId'])) $this->organizationId = $o['organizationId'];
if (isset($o['commentsPostId'])) $this->commentsPostId = $o['commentsPostId'];
if (isset($o['viewCount'])) $this->viewCount = $o['viewCount'];
if (isset($o['favCount'])) $this->favCount = $o['favCount'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->vendorName)) $o['vendorName'] = $this->vendorName;
if (isset($this->description)) $o['description'] = $this->description;
if (isset($this->appUrl)) $o['appUrl'] = $this->appUrl;
if (isset($this->screenshotUrl)) $o['screenshotUrl'] = $this->screenshotUrl;
if (isset($this->created)) $o['created'] = JsonConverters::to('DateTime', $this->created);
if (isset($this->createdBy)) $o['createdBy'] = $this->createdBy;
if (isset($this->lastModified)) $o['lastModified'] = JsonConverters::to('DateTime', $this->lastModified);
if (isset($this->lastModifiedBy)) $o['lastModifiedBy'] = $this->lastModifiedBy;
if (isset($this->isLocked)) $o['isLocked'] = $this->isLocked;
if (isset($this->ownerId)) $o['ownerId'] = $this->ownerId;
if (isset($this->slug)) $o['slug'] = $this->slug;
if (isset($this->details)) $o['details'] = $this->details;
if (isset($this->detailsHtml)) $o['detailsHtml'] = $this->detailsHtml;
if (isset($this->lastStatusUpdate)) $o['lastStatusUpdate'] = JsonConverters::to('DateTime', $this->lastStatusUpdate);
if (isset($this->organizationId)) $o['organizationId'] = $this->organizationId;
if (isset($this->commentsPostId)) $o['commentsPostId'] = $this->commentsPostId;
if (isset($this->viewCount)) $o['viewCount'] = $this->viewCount;
if (isset($this->favCount)) $o['favCount'] = $this->favCount;
return empty($o) ? new class(){} : $o;
}
}
class TechnologyStack extends TechnologyStackBase implements JsonSerializable
{
/**
* @param int|null $id
* @param string $name
* @param string $vendorName
* @param string $description
* @param string $appUrl
* @param string $screenshotUrl
* @param DateTime|null $created
* @param string $createdBy
* @param DateTime|null $lastModified
* @param string $lastModifiedBy
* @param bool|null $isLocked
* @param string $ownerId
* @param string $slug
* @param string $details
* @param string $detailsHtml
* @param DateTime|null $lastStatusUpdate
* @param int|null $organizationId
* @param int|null $commentsPostId
* @param int|null $viewCount
* @param int|null $favCount
*/
public function __construct(
?int $id=null,
string $name='',
string $vendorName='',
string $description='',
string $appUrl='',
string $screenshotUrl='',
?DateTime $created=null,
string $createdBy='',
?DateTime $lastModified=null,
string $lastModifiedBy='',
?bool $isLocked=null,
string $ownerId='',
string $slug='',
string $details='',
string $detailsHtml='',
?DateTime $lastStatusUpdate=null,
?int $organizationId=null,
?int $commentsPostId=null,
?int $viewCount=null,
?int $favCount=null
) {
parent::__construct($id,$name,$vendorName,$description,$appUrl,$screenshotUrl,$created,$createdBy,$lastModified,$lastModifiedBy,$isLocked,$ownerId,$slug,$details,$detailsHtml,$lastStatusUpdate,$organizationId,$commentsPostId,$viewCount,$favCount);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
return empty($o) ? new class(){} : $o;
}
}
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';
}
class TechnologyBase implements JsonSerializable
{
public function __construct(
/** @var int|null */
public ?int $id=null,
/** @var string */
public string $name='',
/** @var string */
public string $vendorName='',
/** @var string */
public string $vendorUrl='',
/** @var string */
public string $productUrl='',
/** @var string */
public string $logoUrl='',
/** @var string */
public string $description='',
/** @var DateTime|null */
public ?DateTime $created=null,
/** @var string */
public string $createdBy='',
/** @var DateTime|null */
public ?DateTime $lastModified=null,
/** @var string */
public string $lastModifiedBy='',
/** @var string */
public string $ownerId='',
/** @var string */
public string $slug='',
/** @var bool|null */
public ?bool $logoApproved=null,
/** @var bool|null */
public ?bool $isLocked=null,
/** @var TechnologyTier|null */
public ?TechnologyTier $tier=null,
/** @var DateTime|null */
public ?DateTime $lastStatusUpdate=null,
/** @var int|null */
public ?int $organizationId=null,
/** @var int|null */
public ?int $commentsPostId=null,
/** @var int|null */
public ?int $viewCount=null,
/** @var int|null */
public ?int $favCount=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['vendorName'])) $this->vendorName = $o['vendorName'];
if (isset($o['vendorUrl'])) $this->vendorUrl = $o['vendorUrl'];
if (isset($o['productUrl'])) $this->productUrl = $o['productUrl'];
if (isset($o['logoUrl'])) $this->logoUrl = $o['logoUrl'];
if (isset($o['description'])) $this->description = $o['description'];
if (isset($o['created'])) $this->created = JsonConverters::from('DateTime', $o['created']);
if (isset($o['createdBy'])) $this->createdBy = $o['createdBy'];
if (isset($o['lastModified'])) $this->lastModified = JsonConverters::from('DateTime', $o['lastModified']);
if (isset($o['lastModifiedBy'])) $this->lastModifiedBy = $o['lastModifiedBy'];
if (isset($o['ownerId'])) $this->ownerId = $o['ownerId'];
if (isset($o['slug'])) $this->slug = $o['slug'];
if (isset($o['logoApproved'])) $this->logoApproved = $o['logoApproved'];
if (isset($o['isLocked'])) $this->isLocked = $o['isLocked'];
if (isset($o['tier'])) $this->tier = JsonConverters::from('TechnologyTier', $o['tier']);
if (isset($o['lastStatusUpdate'])) $this->lastStatusUpdate = JsonConverters::from('DateTime', $o['lastStatusUpdate']);
if (isset($o['organizationId'])) $this->organizationId = $o['organizationId'];
if (isset($o['commentsPostId'])) $this->commentsPostId = $o['commentsPostId'];
if (isset($o['viewCount'])) $this->viewCount = $o['viewCount'];
if (isset($o['favCount'])) $this->favCount = $o['favCount'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->vendorName)) $o['vendorName'] = $this->vendorName;
if (isset($this->vendorUrl)) $o['vendorUrl'] = $this->vendorUrl;
if (isset($this->productUrl)) $o['productUrl'] = $this->productUrl;
if (isset($this->logoUrl)) $o['logoUrl'] = $this->logoUrl;
if (isset($this->description)) $o['description'] = $this->description;
if (isset($this->created)) $o['created'] = JsonConverters::to('DateTime', $this->created);
if (isset($this->createdBy)) $o['createdBy'] = $this->createdBy;
if (isset($this->lastModified)) $o['lastModified'] = JsonConverters::to('DateTime', $this->lastModified);
if (isset($this->lastModifiedBy)) $o['lastModifiedBy'] = $this->lastModifiedBy;
if (isset($this->ownerId)) $o['ownerId'] = $this->ownerId;
if (isset($this->slug)) $o['slug'] = $this->slug;
if (isset($this->logoApproved)) $o['logoApproved'] = $this->logoApproved;
if (isset($this->isLocked)) $o['isLocked'] = $this->isLocked;
if (isset($this->tier)) $o['tier'] = JsonConverters::to('TechnologyTier', $this->tier);
if (isset($this->lastStatusUpdate)) $o['lastStatusUpdate'] = JsonConverters::to('DateTime', $this->lastStatusUpdate);
if (isset($this->organizationId)) $o['organizationId'] = $this->organizationId;
if (isset($this->commentsPostId)) $o['commentsPostId'] = $this->commentsPostId;
if (isset($this->viewCount)) $o['viewCount'] = $this->viewCount;
if (isset($this->favCount)) $o['favCount'] = $this->favCount;
return empty($o) ? new class(){} : $o;
}
}
class Technology extends TechnologyBase implements JsonSerializable
{
/**
* @param int|null $id
* @param string $name
* @param string $vendorName
* @param string $vendorUrl
* @param string $productUrl
* @param string $logoUrl
* @param string $description
* @param DateTime|null $created
* @param string $createdBy
* @param DateTime|null $lastModified
* @param string $lastModifiedBy
* @param string $ownerId
* @param string $slug
* @param bool|null $logoApproved
* @param bool|null $isLocked
* @param TechnologyTier|null $tier
* @param DateTime|null $lastStatusUpdate
* @param int|null $organizationId
* @param int|null $commentsPostId
* @param int|null $viewCount
* @param int|null $favCount
*/
public function __construct(
?int $id=null,
string $name='',
string $vendorName='',
string $vendorUrl='',
string $productUrl='',
string $logoUrl='',
string $description='',
?DateTime $created=null,
string $createdBy='',
?DateTime $lastModified=null,
string $lastModifiedBy='',
string $ownerId='',
string $slug='',
?bool $logoApproved=null,
?bool $isLocked=null,
?TechnologyTier $tier=null,
?DateTime $lastStatusUpdate=null,
?int $organizationId=null,
?int $commentsPostId=null,
?int $viewCount=null,
?int $favCount=null
) {
parent::__construct($id,$name,$vendorName,$vendorUrl,$productUrl,$logoUrl,$description,$created,$createdBy,$lastModified,$lastModifiedBy,$ownerId,$slug,$logoApproved,$isLocked,$tier,$lastStatusUpdate,$organizationId,$commentsPostId,$viewCount,$favCount);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
return empty($o) ? new class(){} : $o;
}
}
class UserActivity implements JsonSerializable
{
public function __construct(
/** @var int|null */
public ?int $id=null,
/** @var string */
public string $userName='',
/** @var int|null */
public ?int $karma=null,
/** @var int|null */
public ?int $technologyCount=null,
/** @var int|null */
public ?int $techStacksCount=null,
/** @var int|null */
public ?int $postsCount=null,
/** @var int|null */
public ?int $postUpVotes=null,
/** @var int|null */
public ?int $postDownVotes=null,
/** @var int|null */
public ?int $commentUpVotes=null,
/** @var int|null */
public ?int $commentDownVotes=null,
/** @var int|null */
public ?int $postCommentsCount=null,
/** @var int|null */
public ?int $pinnedCommentCount=null,
/** @var int|null */
public ?int $postReportCount=null,
/** @var int|null */
public ?int $postCommentReportCount=null,
/** @var DateTime|null */
public ?DateTime $created=null,
/** @var DateTime|null */
public ?DateTime $modified=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['userName'])) $this->userName = $o['userName'];
if (isset($o['karma'])) $this->karma = $o['karma'];
if (isset($o['technologyCount'])) $this->technologyCount = $o['technologyCount'];
if (isset($o['techStacksCount'])) $this->techStacksCount = $o['techStacksCount'];
if (isset($o['postsCount'])) $this->postsCount = $o['postsCount'];
if (isset($o['postUpVotes'])) $this->postUpVotes = $o['postUpVotes'];
if (isset($o['postDownVotes'])) $this->postDownVotes = $o['postDownVotes'];
if (isset($o['commentUpVotes'])) $this->commentUpVotes = $o['commentUpVotes'];
if (isset($o['commentDownVotes'])) $this->commentDownVotes = $o['commentDownVotes'];
if (isset($o['postCommentsCount'])) $this->postCommentsCount = $o['postCommentsCount'];
if (isset($o['pinnedCommentCount'])) $this->pinnedCommentCount = $o['pinnedCommentCount'];
if (isset($o['postReportCount'])) $this->postReportCount = $o['postReportCount'];
if (isset($o['postCommentReportCount'])) $this->postCommentReportCount = $o['postCommentReportCount'];
if (isset($o['created'])) $this->created = JsonConverters::from('DateTime', $o['created']);
if (isset($o['modified'])) $this->modified = JsonConverters::from('DateTime', $o['modified']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->userName)) $o['userName'] = $this->userName;
if (isset($this->karma)) $o['karma'] = $this->karma;
if (isset($this->technologyCount)) $o['technologyCount'] = $this->technologyCount;
if (isset($this->techStacksCount)) $o['techStacksCount'] = $this->techStacksCount;
if (isset($this->postsCount)) $o['postsCount'] = $this->postsCount;
if (isset($this->postUpVotes)) $o['postUpVotes'] = $this->postUpVotes;
if (isset($this->postDownVotes)) $o['postDownVotes'] = $this->postDownVotes;
if (isset($this->commentUpVotes)) $o['commentUpVotes'] = $this->commentUpVotes;
if (isset($this->commentDownVotes)) $o['commentDownVotes'] = $this->commentDownVotes;
if (isset($this->postCommentsCount)) $o['postCommentsCount'] = $this->postCommentsCount;
if (isset($this->pinnedCommentCount)) $o['pinnedCommentCount'] = $this->pinnedCommentCount;
if (isset($this->postReportCount)) $o['postReportCount'] = $this->postReportCount;
if (isset($this->postCommentReportCount)) $o['postCommentReportCount'] = $this->postCommentReportCount;
if (isset($this->created)) $o['created'] = JsonConverters::to('DateTime', $this->created);
if (isset($this->modified)) $o['modified'] = JsonConverters::to('DateTime', $this->modified);
return empty($o) ? new class(){} : $o;
}
}
class GetUserInfoResponse implements JsonSerializable
{
public function __construct(
/** @var int|null */
public ?int $id=null,
/** @var string */
public string $userName='',
/** @var DateTime|null */
public ?DateTime $created=null,
/** @var string */
public string $avatarUrl='',
/** @var array<TechnologyStack>|null */
public ?array $techStacks=null,
/** @var array<TechnologyStack>|null */
public ?array $favoriteTechStacks=null,
/** @var array<Technology>|null */
public ?array $favoriteTechnologies=null,
/** @var UserActivity|null */
public ?UserActivity $userActivity=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['userName'])) $this->userName = $o['userName'];
if (isset($o['created'])) $this->created = JsonConverters::from('DateTime', $o['created']);
if (isset($o['avatarUrl'])) $this->avatarUrl = $o['avatarUrl'];
if (isset($o['techStacks'])) $this->techStacks = JsonConverters::fromArray('TechnologyStack', $o['techStacks']);
if (isset($o['favoriteTechStacks'])) $this->favoriteTechStacks = JsonConverters::fromArray('TechnologyStack', $o['favoriteTechStacks']);
if (isset($o['favoriteTechnologies'])) $this->favoriteTechnologies = JsonConverters::fromArray('Technology', $o['favoriteTechnologies']);
if (isset($o['userActivity'])) $this->userActivity = JsonConverters::from('UserActivity', $o['userActivity']);
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->userName)) $o['userName'] = $this->userName;
if (isset($this->created)) $o['created'] = JsonConverters::to('DateTime', $this->created);
if (isset($this->avatarUrl)) $o['avatarUrl'] = $this->avatarUrl;
if (isset($this->techStacks)) $o['techStacks'] = JsonConverters::toArray('TechnologyStack', $this->techStacks);
if (isset($this->favoriteTechStacks)) $o['favoriteTechStacks'] = JsonConverters::toArray('TechnologyStack', $this->favoriteTechStacks);
if (isset($this->favoriteTechnologies)) $o['favoriteTechnologies'] = JsonConverters::toArray('Technology', $this->favoriteTechnologies);
if (isset($this->userActivity)) $o['userActivity'] = JsonConverters::to('UserActivity', $this->userActivity);
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
return empty($o) ? new class(){} : $o;
}
}
class GetUserInfo implements IGet, JsonSerializable
{
public function __construct(
/** @var int|null */
public ?int $id=null,
/** @var string */
public string $userName=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['userName'])) $this->userName = $o['userName'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->userName)) $o['userName'] = $this->userName;
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 /userinfo/{Id} HTTP/1.1
Host: techstacks.io
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"id":0,"userName":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"id":0,"userName":"String","created":"0001-01-01T00:00:00.0000000","avatarUrl":"String","techStacks":[{"id":0,"name":"String","vendorName":"String","description":"String","appUrl":"String","screenshotUrl":"String","created":"0001-01-01T00:00:00.0000000","createdBy":"String","lastModified":"0001-01-01T00:00:00.0000000","lastModifiedBy":"String","isLocked":false,"ownerId":"String","slug":"String","details":"String","detailsHtml":"String","lastStatusUpdate":"0001-01-01T00:00:00.0000000","organizationId":0,"commentsPostId":0,"viewCount":0,"favCount":0}],"favoriteTechStacks":[{"id":0,"name":"String","vendorName":"String","description":"String","appUrl":"String","screenshotUrl":"String","created":"0001-01-01T00:00:00.0000000","createdBy":"String","lastModified":"0001-01-01T00:00:00.0000000","lastModifiedBy":"String","isLocked":false,"ownerId":"String","slug":"String","details":"String","detailsHtml":"String","lastStatusUpdate":"0001-01-01T00:00:00.0000000","organizationId":0,"commentsPostId":0,"viewCount":0,"favCount":0}],"favoriteTechnologies":[{"id":0,"name":"String","vendorName":"String","vendorUrl":"String","productUrl":"String","logoUrl":"String","description":"String","created":"0001-01-01T00:00:00.0000000","createdBy":"String","lastModified":"0001-01-01T00:00:00.0000000","lastModifiedBy":"String","ownerId":"String","slug":"String","logoApproved":false,"isLocked":false,"tier":"ProgrammingLanguage","lastStatusUpdate":"0001-01-01T00:00:00.0000000","organizationId":0,"commentsPostId":0,"viewCount":0,"favCount":0}],"userActivity":{"id":0,"userName":"String","karma":0,"technologyCount":0,"techStacksCount":0,"postsCount":0,"postUpVotes":0,"postDownVotes":0,"commentUpVotes":0,"commentDownVotes":0,"postCommentsCount":0,"pinnedCommentCount":0,"postReportCount":0,"postCommentReportCount":0,"created":"0001-01-01T00:00:00.0000000","modified":"0001-01-01T00:00:00.0000000"},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}