All Verbs | /techstacks/query |
---|
<?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};
// @DataContract
class QueryBase implements JsonSerializable
{
public function __construct(
// @DataMember(Order=1)
/** @var int|null */
public ?int $skip=null,
// @DataMember(Order=2)
/** @var int|null */
public ?int $take=null,
// @DataMember(Order=3)
/** @var string|null */
public ?string $orderBy=null,
// @DataMember(Order=4)
/** @var string|null */
public ?string $orderByDesc=null,
// @DataMember(Order=5)
/** @var string|null */
public ?string $include=null,
// @DataMember(Order=6)
/** @var string|null */
public ?string $fields=null,
// @DataMember(Order=7)
/** @var array<string,string>|null */
public ?array $meta=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['skip'])) $this->skip = $o['skip'];
if (isset($o['take'])) $this->take = $o['take'];
if (isset($o['orderBy'])) $this->orderBy = $o['orderBy'];
if (isset($o['orderByDesc'])) $this->orderByDesc = $o['orderByDesc'];
if (isset($o['include'])) $this->include = $o['include'];
if (isset($o['fields'])) $this->fields = $o['fields'];
if (isset($o['meta'])) $this->meta = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['meta']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->skip)) $o['skip'] = $this->skip;
if (isset($this->take)) $o['take'] = $this->take;
if (isset($this->orderBy)) $o['orderBy'] = $this->orderBy;
if (isset($this->orderByDesc)) $o['orderByDesc'] = $this->orderByDesc;
if (isset($this->include)) $o['include'] = $this->include;
if (isset($this->fields)) $o['fields'] = $this->fields;
if (isset($this->meta)) $o['meta'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->meta);
return empty($o) ? new class(){} : $o;
}
}
/**
* @template From
* @template Into
*/
class QueryDb2 extends QueryBase implements JsonSerializable
{
public array $genericArgs = [];
public static function create(array $genericArgs=[]): QueryDb2 {
$to = new QueryDb2();
$to->genericArgs = $genericArgs;
return $to;
}
/**
* @param int|null $skip
* @param int|null $take
* @param string|null $orderBy
* @param string|null $orderByDesc
* @param string|null $include
* @param string|null $fields
* @param array<string,string>|null $meta
*/
public function __construct(
mixed $skip=null,
mixed $take=null,
mixed $orderBy=null,
mixed $orderByDesc=null,
mixed $include=null,
mixed $fields=null,
mixed $meta=null
) {
parent::__construct($skip,$take,$orderBy,$orderByDesc,$include,$fields,$meta);
}
/** @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 TechnologyStackView implements JsonSerializable
{
public function __construct(
/** @var int|null */
public ?int $id=null,
/** @var string|null */
public ?string $name=null,
/** @var string|null */
public ?string $vendorName=null,
/** @var string|null */
public ?string $description=null,
/** @var string|null */
public ?string $appUrl=null,
/** @var string|null */
public ?string $screenshotUrl=null,
/** @var DateTime|null */
public ?DateTime $created=null,
/** @var string|null */
public ?string $createdBy=null,
/** @var DateTime|null */
public ?DateTime $lastModified=null,
/** @var string|null */
public ?string $lastModifiedBy=null,
/** @var bool|null */
public ?bool $isLocked=null,
/** @var string|null */
public ?string $ownerId=null,
/** @var string|null */
public ?string $slug=null,
/** @var string|null */
public ?string $details=null,
/** @var string|null */
public ?string $detailsHtml=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['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 TechnologyStackBase implements JsonSerializable
{
public function __construct(
/** @var int */
public int $id=0,
/** @var string|null */
public ?string $name=null,
/** @var string|null */
public ?string $vendorName=null,
/** @var string|null */
public ?string $description=null,
/** @var string|null */
public ?string $appUrl=null,
/** @var string|null */
public ?string $screenshotUrl=null,
/** @var DateTime */
public DateTime $created=new DateTime(),
/** @var string|null */
public ?string $createdBy=null,
/** @var DateTime */
public DateTime $lastModified=new DateTime(),
/** @var string|null */
public ?string $lastModifiedBy=null,
/** @var bool|null */
public ?bool $isLocked=null,
/** @var string|null */
public ?string $ownerId=null,
/** @var string|null */
public ?string $slug=null,
// @StringLength(2147483647)
/** @var string|null */
public ?string $details=null,
// @StringLength(2147483647)
/** @var string|null */
public ?string $detailsHtml=null,
/** @var DateTime|null */
public ?DateTime $lastStatusUpdate=null,
/** @var int|null */
public ?int $organizationId=null,
/** @var int|null */
public ?int $commentsPostId=null,
/** @var int */
public int $viewCount=0,
/** @var int */
public int $favCount=0
) {
}
/** @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 $id
* @param string|null $name
* @param string|null $vendorName
* @param string|null $description
* @param string|null $appUrl
* @param string|null $screenshotUrl
* @param DateTime $created
* @param string|null $createdBy
* @param DateTime $lastModified
* @param string|null $lastModifiedBy
* @param bool|null $isLocked
* @param string|null $ownerId
* @param string|null $slug
* @param string|null $details
* @param string|null $detailsHtml
* @param DateTime|null $lastStatusUpdate
* @param int|null $organizationId
* @param int|null $commentsPostId
* @param int $viewCount
* @param int $favCount
*/
public function __construct(
int $id=0,
?string $name=null,
?string $vendorName=null,
?string $description=null,
?string $appUrl=null,
?string $screenshotUrl=null,
DateTime $created=new DateTime(),
?string $createdBy=null,
DateTime $lastModified=new DateTime(),
?string $lastModifiedBy=null,
?bool $isLocked=null,
?string $ownerId=null,
?string $slug=null,
?string $details=null,
?string $detailsHtml=null,
?DateTime $lastStatusUpdate=null,
?int $organizationId=null,
?int $commentsPostId=null,
int $viewCount=0,
int $favCount=0
) {
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;
}
}
/**
* @template QueryDb2 of TechnologyStack
* @template QueryDb21 of TechnologyStackView
*/
class QueryTechStacks extends QueryDb2 implements JsonSerializable
{
/**
* @param int|null $skip
* @param int|null $take
* @param string|null $orderBy
* @param string|null $orderByDesc
* @param string|null $include
* @param string|null $fields
* @param array<string,string>|null $meta
*/
public function __construct(
?int $skip=null,
?int $take=null,
?string $orderBy=null,
?string $orderByDesc=null,
?string $include=null,
?string $fields=null,
?array $meta=null,
/** @var array<int>|null */
public ?array $ids=null,
/** @var string|null */
public ?string $name=null,
/** @var string|null */
public ?string $vendorName=null,
/** @var string|null */
public ?string $nameContains=null,
/** @var string|null */
public ?string $vendorNameContains=null,
/** @var string|null */
public ?string $descriptionContains=null
) {
parent::__construct($skip,$take,$orderBy,$orderByDesc,$include,$fields,$meta);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['ids'])) $this->ids = JsonConverters::fromArray('int', $o['ids']);
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['vendorName'])) $this->vendorName = $o['vendorName'];
if (isset($o['nameContains'])) $this->nameContains = $o['nameContains'];
if (isset($o['vendorNameContains'])) $this->vendorNameContains = $o['vendorNameContains'];
if (isset($o['descriptionContains'])) $this->descriptionContains = $o['descriptionContains'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->ids)) $o['ids'] = JsonConverters::toArray('int', $this->ids);
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->vendorName)) $o['vendorName'] = $this->vendorName;
if (isset($this->nameContains)) $o['nameContains'] = $this->nameContains;
if (isset($this->vendorNameContains)) $o['vendorNameContains'] = $this->vendorNameContains;
if (isset($this->descriptionContains)) $o['descriptionContains'] = $this->descriptionContains;
return empty($o) ? new class(){} : $o;
}
}
enum PostType : string
{
case Announcement = 'Announcement';
case Post = 'Post';
case Showcase = 'Showcase';
case Question = 'Question';
case Request = 'Request';
}
class Post implements JsonSerializable
{
public function __construct(
/** @var int */
public int $id=0,
/** @var int */
public int $organizationId=0,
/** @var int */
public int $userId=0,
/** @var PostType|null */
public ?PostType $type=null,
/** @var int */
public int $categoryId=0,
/** @var string|null */
public ?string $title=null,
/** @var string|null */
public ?string $slug=null,
/** @var string|null */
public ?string $url=null,
/** @var string|null */
public ?string $imageUrl=null,
// @StringLength(2147483647)
/** @var string|null */
public ?string $content=null,
// @StringLength(2147483647)
/** @var string|null */
public ?string $contentHtml=null,
/** @var int|null */
public ?int $pinCommentId=null,
/** @var int[]|null */
public ?array $technologyIds=null,
/** @var DateTime|null */
public ?DateTime $fromDate=null,
/** @var DateTime|null */
public ?DateTime $toDate=null,
/** @var string|null */
public ?string $location=null,
/** @var string|null */
public ?string $metaType=null,
/** @var string|null */
public ?string $meta=null,
/** @var bool|null */
public ?bool $approved=null,
/** @var int */
public int $upVotes=0,
/** @var int */
public int $downVotes=0,
/** @var int */
public int $points=0,
/** @var int */
public int $views=0,
/** @var int */
public int $favorites=0,
/** @var int */
public int $subscribers=0,
/** @var int */
public int $replyCount=0,
/** @var int */
public int $commentsCount=0,
/** @var int */
public int $wordCount=0,
/** @var int */
public int $reportCount=0,
/** @var int */
public int $linksCount=0,
/** @var int */
public int $linkedToCount=0,
/** @var int */
public int $score=0,
/** @var int */
public int $rank=0,
/** @var string[]|null */
public ?array $labels=null,
/** @var int[]|null */
public ?array $refUserIds=null,
/** @var string[]|null */
public ?array $refLinks=null,
/** @var int[]|null */
public ?array $muteUserIds=null,
/** @var DateTime|null */
public ?DateTime $lastCommentDate=null,
/** @var int|null */
public ?int $lastCommentId=null,
/** @var int|null */
public ?int $lastCommentUserId=null,
/** @var DateTime|null */
public ?DateTime $deleted=null,
/** @var string|null */
public ?string $deletedBy=null,
/** @var DateTime|null */
public ?DateTime $locked=null,
/** @var string|null */
public ?string $lockedBy=null,
/** @var DateTime|null */
public ?DateTime $hidden=null,
/** @var string|null */
public ?string $hiddenBy=null,
/** @var string|null */
public ?string $status=null,
/** @var DateTime|null */
public ?DateTime $statusDate=null,
/** @var string|null */
public ?string $statusBy=null,
/** @var bool|null */
public ?bool $archived=null,
/** @var DateTime|null */
public ?DateTime $bumped=null,
/** @var DateTime */
public DateTime $created=new DateTime(),
/** @var string|null */
public ?string $createdBy=null,
/** @var DateTime */
public DateTime $modified=new DateTime(),
/** @var string|null */
public ?string $modifiedBy=null,
/** @var int|null */
public ?int $refId=null,
/** @var string|null */
public ?string $refSource=null,
/** @var string|null */
public ?string $refUrn=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['organizationId'])) $this->organizationId = $o['organizationId'];
if (isset($o['userId'])) $this->userId = $o['userId'];
if (isset($o['type'])) $this->type = JsonConverters::from('PostType', $o['type']);
if (isset($o['categoryId'])) $this->categoryId = $o['categoryId'];
if (isset($o['title'])) $this->title = $o['title'];
if (isset($o['slug'])) $this->slug = $o['slug'];
if (isset($o['url'])) $this->url = $o['url'];
if (isset($o['imageUrl'])) $this->imageUrl = $o['imageUrl'];
if (isset($o['content'])) $this->content = $o['content'];
if (isset($o['contentHtml'])) $this->contentHtml = $o['contentHtml'];
if (isset($o['pinCommentId'])) $this->pinCommentId = $o['pinCommentId'];
if (isset($o['technologyIds'])) $this->technologyIds = JsonConverters::fromArray('int', $o['technologyIds']);
if (isset($o['fromDate'])) $this->fromDate = JsonConverters::from('DateTime', $o['fromDate']);
if (isset($o['toDate'])) $this->toDate = JsonConverters::from('DateTime', $o['toDate']);
if (isset($o['location'])) $this->location = $o['location'];
if (isset($o['metaType'])) $this->metaType = $o['metaType'];
if (isset($o['meta'])) $this->meta = $o['meta'];
if (isset($o['approved'])) $this->approved = $o['approved'];
if (isset($o['upVotes'])) $this->upVotes = $o['upVotes'];
if (isset($o['downVotes'])) $this->downVotes = $o['downVotes'];
if (isset($o['points'])) $this->points = $o['points'];
if (isset($o['views'])) $this->views = $o['views'];
if (isset($o['favorites'])) $this->favorites = $o['favorites'];
if (isset($o['subscribers'])) $this->subscribers = $o['subscribers'];
if (isset($o['replyCount'])) $this->replyCount = $o['replyCount'];
if (isset($o['commentsCount'])) $this->commentsCount = $o['commentsCount'];
if (isset($o['wordCount'])) $this->wordCount = $o['wordCount'];
if (isset($o['reportCount'])) $this->reportCount = $o['reportCount'];
if (isset($o['linksCount'])) $this->linksCount = $o['linksCount'];
if (isset($o['linkedToCount'])) $this->linkedToCount = $o['linkedToCount'];
if (isset($o['score'])) $this->score = $o['score'];
if (isset($o['rank'])) $this->rank = $o['rank'];
if (isset($o['labels'])) $this->labels = JsonConverters::fromArray('string', $o['labels']);
if (isset($o['refUserIds'])) $this->refUserIds = JsonConverters::fromArray('int', $o['refUserIds']);
if (isset($o['refLinks'])) $this->refLinks = JsonConverters::fromArray('string', $o['refLinks']);
if (isset($o['muteUserIds'])) $this->muteUserIds = JsonConverters::fromArray('int', $o['muteUserIds']);
if (isset($o['lastCommentDate'])) $this->lastCommentDate = JsonConverters::from('DateTime', $o['lastCommentDate']);
if (isset($o['lastCommentId'])) $this->lastCommentId = $o['lastCommentId'];
if (isset($o['lastCommentUserId'])) $this->lastCommentUserId = $o['lastCommentUserId'];
if (isset($o['deleted'])) $this->deleted = JsonConverters::from('DateTime', $o['deleted']);
if (isset($o['deletedBy'])) $this->deletedBy = $o['deletedBy'];
if (isset($o['locked'])) $this->locked = JsonConverters::from('DateTime', $o['locked']);
if (isset($o['lockedBy'])) $this->lockedBy = $o['lockedBy'];
if (isset($o['hidden'])) $this->hidden = JsonConverters::from('DateTime', $o['hidden']);
if (isset($o['hiddenBy'])) $this->hiddenBy = $o['hiddenBy'];
if (isset($o['status'])) $this->status = $o['status'];
if (isset($o['statusDate'])) $this->statusDate = JsonConverters::from('DateTime', $o['statusDate']);
if (isset($o['statusBy'])) $this->statusBy = $o['statusBy'];
if (isset($o['archived'])) $this->archived = $o['archived'];
if (isset($o['bumped'])) $this->bumped = JsonConverters::from('DateTime', $o['bumped']);
if (isset($o['created'])) $this->created = JsonConverters::from('DateTime', $o['created']);
if (isset($o['createdBy'])) $this->createdBy = $o['createdBy'];
if (isset($o['modified'])) $this->modified = JsonConverters::from('DateTime', $o['modified']);
if (isset($o['modifiedBy'])) $this->modifiedBy = $o['modifiedBy'];
if (isset($o['refId'])) $this->refId = $o['refId'];
if (isset($o['refSource'])) $this->refSource = $o['refSource'];
if (isset($o['refUrn'])) $this->refUrn = $o['refUrn'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->organizationId)) $o['organizationId'] = $this->organizationId;
if (isset($this->userId)) $o['userId'] = $this->userId;
if (isset($this->type)) $o['type'] = JsonConverters::to('PostType', $this->type);
if (isset($this->categoryId)) $o['categoryId'] = $this->categoryId;
if (isset($this->title)) $o['title'] = $this->title;
if (isset($this->slug)) $o['slug'] = $this->slug;
if (isset($this->url)) $o['url'] = $this->url;
if (isset($this->imageUrl)) $o['imageUrl'] = $this->imageUrl;
if (isset($this->content)) $o['content'] = $this->content;
if (isset($this->contentHtml)) $o['contentHtml'] = $this->contentHtml;
if (isset($this->pinCommentId)) $o['pinCommentId'] = $this->pinCommentId;
if (isset($this->technologyIds)) $o['technologyIds'] = JsonConverters::toArray('int', $this->technologyIds);
if (isset($this->fromDate)) $o['fromDate'] = JsonConverters::to('DateTime', $this->fromDate);
if (isset($this->toDate)) $o['toDate'] = JsonConverters::to('DateTime', $this->toDate);
if (isset($this->location)) $o['location'] = $this->location;
if (isset($this->metaType)) $o['metaType'] = $this->metaType;
if (isset($this->meta)) $o['meta'] = $this->meta;
if (isset($this->approved)) $o['approved'] = $this->approved;
if (isset($this->upVotes)) $o['upVotes'] = $this->upVotes;
if (isset($this->downVotes)) $o['downVotes'] = $this->downVotes;
if (isset($this->points)) $o['points'] = $this->points;
if (isset($this->views)) $o['views'] = $this->views;
if (isset($this->favorites)) $o['favorites'] = $this->favorites;
if (isset($this->subscribers)) $o['subscribers'] = $this->subscribers;
if (isset($this->replyCount)) $o['replyCount'] = $this->replyCount;
if (isset($this->commentsCount)) $o['commentsCount'] = $this->commentsCount;
if (isset($this->wordCount)) $o['wordCount'] = $this->wordCount;
if (isset($this->reportCount)) $o['reportCount'] = $this->reportCount;
if (isset($this->linksCount)) $o['linksCount'] = $this->linksCount;
if (isset($this->linkedToCount)) $o['linkedToCount'] = $this->linkedToCount;
if (isset($this->score)) $o['score'] = $this->score;
if (isset($this->rank)) $o['rank'] = $this->rank;
if (isset($this->labels)) $o['labels'] = JsonConverters::toArray('string', $this->labels);
if (isset($this->refUserIds)) $o['refUserIds'] = JsonConverters::toArray('int', $this->refUserIds);
if (isset($this->refLinks)) $o['refLinks'] = JsonConverters::toArray('string', $this->refLinks);
if (isset($this->muteUserIds)) $o['muteUserIds'] = JsonConverters::toArray('int', $this->muteUserIds);
if (isset($this->lastCommentDate)) $o['lastCommentDate'] = JsonConverters::to('DateTime', $this->lastCommentDate);
if (isset($this->lastCommentId)) $o['lastCommentId'] = $this->lastCommentId;
if (isset($this->lastCommentUserId)) $o['lastCommentUserId'] = $this->lastCommentUserId;
if (isset($this->deleted)) $o['deleted'] = JsonConverters::to('DateTime', $this->deleted);
if (isset($this->deletedBy)) $o['deletedBy'] = $this->deletedBy;
if (isset($this->locked)) $o['locked'] = JsonConverters::to('DateTime', $this->locked);
if (isset($this->lockedBy)) $o['lockedBy'] = $this->lockedBy;
if (isset($this->hidden)) $o['hidden'] = JsonConverters::to('DateTime', $this->hidden);
if (isset($this->hiddenBy)) $o['hiddenBy'] = $this->hiddenBy;
if (isset($this->status)) $o['status'] = $this->status;
if (isset($this->statusDate)) $o['statusDate'] = JsonConverters::to('DateTime', $this->statusDate);
if (isset($this->statusBy)) $o['statusBy'] = $this->statusBy;
if (isset($this->archived)) $o['archived'] = $this->archived;
if (isset($this->bumped)) $o['bumped'] = JsonConverters::to('DateTime', $this->bumped);
if (isset($this->created)) $o['created'] = JsonConverters::to('DateTime', $this->created);
if (isset($this->createdBy)) $o['createdBy'] = $this->createdBy;
if (isset($this->modified)) $o['modified'] = JsonConverters::to('DateTime', $this->modified);
if (isset($this->modifiedBy)) $o['modifiedBy'] = $this->modifiedBy;
if (isset($this->refId)) $o['refId'] = $this->refId;
if (isset($this->refSource)) $o['refSource'] = $this->refSource;
if (isset($this->refUrn)) $o['refUrn'] = $this->refUrn;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
/**
* @template T
*/
class QueryResponse implements JsonSerializable
{
public array $genericArgs = [];
public static function create(array $genericArgs=[]): QueryResponse {
$to = new QueryResponse();
$to->genericArgs = $genericArgs;
return $to;
}
public function __construct(
// @DataMember(Order=1)
/** @var int */
public mixed $offset=0,
// @DataMember(Order=2)
/** @var int */
public mixed $total=0,
// @DataMember(Order=3)
/** @var array<Post>|null */
public mixed $results=null,
// @DataMember(Order=4)
/** @var array<string,string>|null */
public mixed $meta=null,
// @DataMember(Order=5)
/** @var ResponseStatus|null */
public mixed $responseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['offset'])) $this->offset = $o['offset'];
if (isset($o['total'])) $this->total = $o['total'];
if (isset($o['results'])) $this->results = JsonConverters::fromArray('Post', $o['results']);
if (isset($o['meta'])) $this->meta = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['meta']);
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->offset)) $o['offset'] = $this->offset;
if (isset($this->total)) $o['total'] = $this->total;
if (isset($this->results)) $o['results'] = JsonConverters::toArray('Post', $this->results);
if (isset($this->meta)) $o['meta'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->meta);
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /techstacks/query HTTP/1.1
Host: techstacks.io
Accept: application/json
Content-Type: application/json
Content-Length: length
{"ids":[0],"name":"String","vendorName":"String","nameContains":"String","vendorNameContains":"String","descriptionContains":"String","skip":0,"take":0,"orderBy":"String","orderByDesc":"String","include":"String","fields":"String","meta":{"String":"String"}}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"offset":0,"total":0,"results":[{"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}],"meta":{"String":"String"},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}