TechStacks!

<back to all web services

SessionInfo

User
Requires Authentication
The following routes are available for this service:
All Verbs/my-session
<?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 */
        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;
    }
}

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 */
        public int $id=0,
        /** @var string|null */
        public ?string $name=null,
        /** @var string|null */
        public ?string $vendorName=null,
        /** @var string|null */
        public ?string $vendorUrl=null,
        /** @var string|null */
        public ?string $productUrl=null,
        /** @var string|null */
        public ?string $logoUrl=null,
        /** @var string|null */
        public ?string $description=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 string|null */
        public ?string $ownerId=null,
        /** @var string|null */
        public ?string $slug=null,
        /** @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 */
        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['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 $id
     * @param string|null $name
     * @param string|null $vendorName
     * @param string|null $vendorUrl
     * @param string|null $productUrl
     * @param string|null $logoUrl
     * @param string|null $description
     * @param DateTime $created
     * @param string|null $createdBy
     * @param DateTime $lastModified
     * @param string|null $lastModifiedBy
     * @param string|null $ownerId
     * @param string|null $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 $viewCount
     * @param int $favCount
     */
    public function __construct(
        int $id=0,
        ?string $name=null,
        ?string $vendorName=null,
        ?string $vendorUrl=null,
        ?string $productUrl=null,
        ?string $logoUrl=null,
        ?string $description=null,
        DateTime $created=new DateTime(),
        ?string $createdBy=null,
        DateTime $lastModified=new DateTime(),
        ?string $lastModifiedBy=null,
        ?string $ownerId=null,
        ?string $slug=null,
        ?bool $logoApproved=null,
        ?bool $isLocked=null,
        ?TechnologyTier $tier=null,
        ?DateTime $lastStatusUpdate=null,
        ?int $organizationId=null,
        ?int $commentsPostId=null,
        int $viewCount=0,
        int $favCount=0
    ) {
        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 */
        public int $id=0,
        /** @var string|null */
        public ?string $userName=null,
        /** @var int */
        public int $karma=0,
        /** @var int */
        public int $technologyCount=0,
        /** @var int */
        public int $techStacksCount=0,
        /** @var int */
        public int $postsCount=0,
        /** @var int */
        public int $postUpVotes=0,
        /** @var int */
        public int $postDownVotes=0,
        /** @var int */
        public int $commentUpVotes=0,
        /** @var int */
        public int $commentDownVotes=0,
        /** @var int */
        public int $postCommentsCount=0,
        /** @var int */
        public int $pinnedCommentCount=0,
        /** @var int */
        public int $postReportCount=0,
        /** @var int */
        public int $postCommentReportCount=0,
        /** @var DateTime */
        public DateTime $created=new DateTime(),
        /** @var DateTime */
        public DateTime $modified=new DateTime()
    ) {
    }

    /** @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 OrganizationMember implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $id=0,
        /** @var int */
        public int $organizationId=0,
        /** @var int */
        public int $userId=0,
        /** @var string|null */
        public ?string $userName=null,
        /** @var bool|null */
        public ?bool $isOwner=null,
        /** @var bool|null */
        public ?bool $isModerator=null,
        /** @var bool|null */
        public ?bool $denyAll=null,
        /** @var bool|null */
        public ?bool $denyPosts=null,
        /** @var bool|null */
        public ?bool $denyComments=null,
        /** @var string|null */
        public ?string $notes=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['userName'])) $this->userName = $o['userName'];
        if (isset($o['isOwner'])) $this->isOwner = $o['isOwner'];
        if (isset($o['isModerator'])) $this->isModerator = $o['isModerator'];
        if (isset($o['denyAll'])) $this->denyAll = $o['denyAll'];
        if (isset($o['denyPosts'])) $this->denyPosts = $o['denyPosts'];
        if (isset($o['denyComments'])) $this->denyComments = $o['denyComments'];
        if (isset($o['notes'])) $this->notes = $o['notes'];
    }
    
    /** @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->userName)) $o['userName'] = $this->userName;
        if (isset($this->isOwner)) $o['isOwner'] = $this->isOwner;
        if (isset($this->isModerator)) $o['isModerator'] = $this->isModerator;
        if (isset($this->denyAll)) $o['denyAll'] = $this->denyAll;
        if (isset($this->denyPosts)) $o['denyPosts'] = $this->denyPosts;
        if (isset($this->denyComments)) $o['denyComments'] = $this->denyComments;
        if (isset($this->notes)) $o['notes'] = $this->notes;
        return empty($o) ? new class(){} : $o;
    }
}

class OrganizationMemberInvite implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $id=0,
        /** @var int */
        public int $organizationId=0,
        /** @var int */
        public int $userId=0,
        /** @var string|null */
        public ?string $userName=null,
        /** @var DateTime|null */
        public ?DateTime $dismissed=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['userName'])) $this->userName = $o['userName'];
        if (isset($o['dismissed'])) $this->dismissed = JsonConverters::from('DateTime', $o['dismissed']);
    }
    
    /** @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->userName)) $o['userName'] = $this->userName;
        if (isset($this->dismissed)) $o['dismissed'] = JsonConverters::to('DateTime', $this->dismissed);
        return empty($o) ? new class(){} : $o;
    }
}

class OrganizationSubscription implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $id=0,
        /** @var int */
        public int $organizationId=0,
        /** @var int */
        public int $userId=0,
        /** @var string|null */
        public ?string $userName=null,
        /** @var string[]|null */
        public ?array $postTypes=null,
        /** @var int|null */
        public ?int $frequencyDays=null,
        /** @var int|null */
        public ?int $lastSyncedId=null,
        /** @var DateTime|null */
        public ?DateTime $lastSynced=null,
        /** @var DateTime */
        public DateTime $created=new DateTime()
    ) {
    }

    /** @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['userName'])) $this->userName = $o['userName'];
        if (isset($o['postTypes'])) $this->postTypes = JsonConverters::fromArray('string', $o['postTypes']);
        if (isset($o['frequencyDays'])) $this->frequencyDays = $o['frequencyDays'];
        if (isset($o['lastSyncedId'])) $this->lastSyncedId = $o['lastSyncedId'];
        if (isset($o['lastSynced'])) $this->lastSynced = JsonConverters::from('DateTime', $o['lastSynced']);
        if (isset($o['created'])) $this->created = JsonConverters::from('DateTime', $o['created']);
    }
    
    /** @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->userName)) $o['userName'] = $this->userName;
        if (isset($this->postTypes)) $o['postTypes'] = JsonConverters::toArray('string', $this->postTypes);
        if (isset($this->frequencyDays)) $o['frequencyDays'] = $this->frequencyDays;
        if (isset($this->lastSyncedId)) $o['lastSyncedId'] = $this->lastSyncedId;
        if (isset($this->lastSynced)) $o['lastSynced'] = JsonConverters::to('DateTime', $this->lastSynced);
        if (isset($this->created)) $o['created'] = JsonConverters::to('DateTime', $this->created);
        return empty($o) ? new class(){} : $o;
    }
}

class SessionInfoResponse implements JsonSerializable
{
    public function __construct(
        /** @var DateTime */
        public DateTime $created=new DateTime(),
        /** @var string|null */
        public ?string $id=null,
        /** @var string|null */
        public ?string $referrerUrl=null,
        /** @var string|null */
        public ?string $userAuthId=null,
        /** @var string|null */
        public ?string $userAuthName=null,
        /** @var string|null */
        public ?string $userName=null,
        /** @var string|null */
        public ?string $displayName=null,
        /** @var string|null */
        public ?string $firstName=null,
        /** @var string|null */
        public ?string $lastName=null,
        /** @var string|null */
        public ?string $email=null,
        /** @var DateTime */
        public DateTime $createdAt=new DateTime(),
        /** @var DateTime */
        public DateTime $lastModified=new DateTime(),
        /** @var array<string>|null */
        public ?array $roles=null,
        /** @var array<string>|null */
        public ?array $permissions=null,
        /** @var bool|null */
        public ?bool $isAuthenticated=null,
        /** @var string|null */
        public ?string $authProvider=null,
        /** @var string|null */
        public ?string $profileUrl=null,
        /** @var string|null */
        public ?string $githubProfileUrl=null,
        /** @var string|null */
        public ?string $twitterProfileUrl=null,
        /** @var string|null */
        public ?string $accessToken=null,
        /** @var string|null */
        public ?string $avatarUrl=null,
        /** @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 array<OrganizationMember>|null */
        public ?array $members=null,
        /** @var array<OrganizationMemberInvite>|null */
        public ?array $memberInvites=null,
        /** @var array<OrganizationSubscription>|null */
        public ?array $subscriptions=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['id'])) $this->id = $o['id'];
        if (isset($o['referrerUrl'])) $this->referrerUrl = $o['referrerUrl'];
        if (isset($o['userAuthId'])) $this->userAuthId = $o['userAuthId'];
        if (isset($o['userAuthName'])) $this->userAuthName = $o['userAuthName'];
        if (isset($o['userName'])) $this->userName = $o['userName'];
        if (isset($o['displayName'])) $this->displayName = $o['displayName'];
        if (isset($o['firstName'])) $this->firstName = $o['firstName'];
        if (isset($o['lastName'])) $this->lastName = $o['lastName'];
        if (isset($o['email'])) $this->email = $o['email'];
        if (isset($o['createdAt'])) $this->createdAt = JsonConverters::from('DateTime', $o['createdAt']);
        if (isset($o['lastModified'])) $this->lastModified = JsonConverters::from('DateTime', $o['lastModified']);
        if (isset($o['roles'])) $this->roles = JsonConverters::fromArray('string', $o['roles']);
        if (isset($o['permissions'])) $this->permissions = JsonConverters::fromArray('string', $o['permissions']);
        if (isset($o['isAuthenticated'])) $this->isAuthenticated = $o['isAuthenticated'];
        if (isset($o['authProvider'])) $this->authProvider = $o['authProvider'];
        if (isset($o['profileUrl'])) $this->profileUrl = $o['profileUrl'];
        if (isset($o['githubProfileUrl'])) $this->githubProfileUrl = $o['githubProfileUrl'];
        if (isset($o['twitterProfileUrl'])) $this->twitterProfileUrl = $o['twitterProfileUrl'];
        if (isset($o['accessToken'])) $this->accessToken = $o['accessToken'];
        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['members'])) $this->members = JsonConverters::fromArray('OrganizationMember', $o['members']);
        if (isset($o['memberInvites'])) $this->memberInvites = JsonConverters::fromArray('OrganizationMemberInvite', $o['memberInvites']);
        if (isset($o['subscriptions'])) $this->subscriptions = JsonConverters::fromArray('OrganizationSubscription', $o['subscriptions']);
        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->id)) $o['id'] = $this->id;
        if (isset($this->referrerUrl)) $o['referrerUrl'] = $this->referrerUrl;
        if (isset($this->userAuthId)) $o['userAuthId'] = $this->userAuthId;
        if (isset($this->userAuthName)) $o['userAuthName'] = $this->userAuthName;
        if (isset($this->userName)) $o['userName'] = $this->userName;
        if (isset($this->displayName)) $o['displayName'] = $this->displayName;
        if (isset($this->firstName)) $o['firstName'] = $this->firstName;
        if (isset($this->lastName)) $o['lastName'] = $this->lastName;
        if (isset($this->email)) $o['email'] = $this->email;
        if (isset($this->createdAt)) $o['createdAt'] = JsonConverters::to('DateTime', $this->createdAt);
        if (isset($this->lastModified)) $o['lastModified'] = JsonConverters::to('DateTime', $this->lastModified);
        if (isset($this->roles)) $o['roles'] = JsonConverters::toArray('string', $this->roles);
        if (isset($this->permissions)) $o['permissions'] = JsonConverters::toArray('string', $this->permissions);
        if (isset($this->isAuthenticated)) $o['isAuthenticated'] = $this->isAuthenticated;
        if (isset($this->authProvider)) $o['authProvider'] = $this->authProvider;
        if (isset($this->profileUrl)) $o['profileUrl'] = $this->profileUrl;
        if (isset($this->githubProfileUrl)) $o['githubProfileUrl'] = $this->githubProfileUrl;
        if (isset($this->twitterProfileUrl)) $o['twitterProfileUrl'] = $this->twitterProfileUrl;
        if (isset($this->accessToken)) $o['accessToken'] = $this->accessToken;
        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->members)) $o['members'] = JsonConverters::toArray('OrganizationMember', $this->members);
        if (isset($this->memberInvites)) $o['memberInvites'] = JsonConverters::toArray('OrganizationMemberInvite', $this->memberInvites);
        if (isset($this->subscriptions)) $o['subscriptions'] = JsonConverters::toArray('OrganizationSubscription', $this->subscriptions);
        if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

// @ValidateRequest(Validator="IsAuthenticated")
class SessionInfo implements IGet, JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

PHP SessionInfo DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /my-session HTTP/1.1 
Host: techstacks.io 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<SessionInfo xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TechStacks.ServiceModel" />
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<SessionInfoResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TechStacks.ServiceModel">
  <AccessToken>String</AccessToken>
  <AuthProvider>String</AuthProvider>
  <AvatarUrl>String</AvatarUrl>
  <Created>0001-01-01T00:00:00</Created>
  <CreatedAt>0001-01-01T00:00:00</CreatedAt>
  <DisplayName>String</DisplayName>
  <Email>String</Email>
  <FavoriteTechStacks xmlns:d2p1="http://schemas.datacontract.org/2004/07/TechStacks.ServiceModel.Types">
    <d2p1:TechnologyStack>
      <d2p1:AppUrl>String</d2p1:AppUrl>
      <d2p1:CommentsPostId>0</d2p1:CommentsPostId>
      <d2p1:Created>0001-01-01T00:00:00</d2p1:Created>
      <d2p1:CreatedBy>String</d2p1:CreatedBy>
      <d2p1:Description>String</d2p1:Description>
      <d2p1:Details>String</d2p1:Details>
      <d2p1:DetailsHtml>String</d2p1:DetailsHtml>
      <d2p1:FavCount>0</d2p1:FavCount>
      <d2p1:Id>0</d2p1:Id>
      <d2p1:IsLocked>false</d2p1:IsLocked>
      <d2p1:LastModified>0001-01-01T00:00:00</d2p1:LastModified>
      <d2p1:LastModifiedBy>String</d2p1:LastModifiedBy>
      <d2p1:LastStatusUpdate>0001-01-01T00:00:00</d2p1:LastStatusUpdate>
      <d2p1:Name>String</d2p1:Name>
      <d2p1:OrganizationId>0</d2p1:OrganizationId>
      <d2p1:OwnerId>String</d2p1:OwnerId>
      <d2p1:ScreenshotUrl>String</d2p1:ScreenshotUrl>
      <d2p1:Slug>String</d2p1:Slug>
      <d2p1:VendorName>String</d2p1:VendorName>
      <d2p1:ViewCount>0</d2p1:ViewCount>
    </d2p1:TechnologyStack>
  </FavoriteTechStacks>
  <FavoriteTechnologies xmlns:d2p1="http://schemas.datacontract.org/2004/07/TechStacks.ServiceModel.Types">
    <d2p1:Technology>
      <d2p1:CommentsPostId>0</d2p1:CommentsPostId>
      <d2p1:Created>0001-01-01T00:00:00</d2p1:Created>
      <d2p1:CreatedBy>String</d2p1:CreatedBy>
      <d2p1:Description>String</d2p1:Description>
      <d2p1:FavCount>0</d2p1:FavCount>
      <d2p1:Id>0</d2p1:Id>
      <d2p1:IsLocked>false</d2p1:IsLocked>
      <d2p1:LastModified>0001-01-01T00:00:00</d2p1:LastModified>
      <d2p1:LastModifiedBy>String</d2p1:LastModifiedBy>
      <d2p1:LastStatusUpdate>0001-01-01T00:00:00</d2p1:LastStatusUpdate>
      <d2p1:LogoApproved>false</d2p1:LogoApproved>
      <d2p1:LogoUrl>String</d2p1:LogoUrl>
      <d2p1:Name>String</d2p1:Name>
      <d2p1:OrganizationId>0</d2p1:OrganizationId>
      <d2p1:OwnerId>String</d2p1:OwnerId>
      <d2p1:ProductUrl>String</d2p1:ProductUrl>
      <d2p1:Slug>String</d2p1:Slug>
      <d2p1:Tier>ProgrammingLanguage</d2p1:Tier>
      <d2p1:VendorName>String</d2p1:VendorName>
      <d2p1:VendorUrl>String</d2p1:VendorUrl>
      <d2p1:ViewCount>0</d2p1:ViewCount>
    </d2p1:Technology>
  </FavoriteTechnologies>
  <FirstName>String</FirstName>
  <GithubProfileUrl>String</GithubProfileUrl>
  <Id>String</Id>
  <IsAuthenticated>false</IsAuthenticated>
  <LastModified>0001-01-01T00:00:00</LastModified>
  <LastName>String</LastName>
  <MemberInvites xmlns:d2p1="http://schemas.datacontract.org/2004/07/TechStacks.ServiceModel.Types">
    <d2p1:OrganizationMemberInvite>
      <d2p1:Dismissed>0001-01-01T00:00:00</d2p1:Dismissed>
      <d2p1:Id>0</d2p1:Id>
      <d2p1:OrganizationId>0</d2p1:OrganizationId>
      <d2p1:UserId>0</d2p1:UserId>
      <d2p1:UserName>String</d2p1:UserName>
    </d2p1:OrganizationMemberInvite>
  </MemberInvites>
  <Members xmlns:d2p1="http://schemas.datacontract.org/2004/07/TechStacks.ServiceModel.Types">
    <d2p1:OrganizationMember>
      <d2p1:DenyAll>false</d2p1:DenyAll>
      <d2p1:DenyComments>false</d2p1:DenyComments>
      <d2p1:DenyPosts>false</d2p1:DenyPosts>
      <d2p1:Id>0</d2p1:Id>
      <d2p1:IsModerator>false</d2p1:IsModerator>
      <d2p1:IsOwner>false</d2p1:IsOwner>
      <d2p1:Notes>String</d2p1:Notes>
      <d2p1:OrganizationId>0</d2p1:OrganizationId>
      <d2p1:UserId>0</d2p1:UserId>
      <d2p1:UserName>String</d2p1:UserName>
    </d2p1:OrganizationMember>
  </Members>
  <Permissions xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>String</d2p1:string>
  </Permissions>
  <ProfileUrl>String</ProfileUrl>
  <ReferrerUrl>String</ReferrerUrl>
  <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>
  <Roles xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>String</d2p1:string>
  </Roles>
  <Subscriptions xmlns:d2p1="http://schemas.datacontract.org/2004/07/TechStacks.ServiceModel.Types">
    <d2p1:OrganizationSubscription>
      <d2p1:Created>0001-01-01T00:00:00</d2p1:Created>
      <d2p1:FrequencyDays>0</d2p1:FrequencyDays>
      <d2p1:Id>0</d2p1:Id>
      <d2p1:LastSynced>0001-01-01T00:00:00</d2p1:LastSynced>
      <d2p1:LastSyncedId>0</d2p1:LastSyncedId>
      <d2p1:OrganizationId>0</d2p1:OrganizationId>
      <d2p1:PostTypes xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </d2p1:PostTypes>
      <d2p1:UserId>0</d2p1:UserId>
      <d2p1:UserName>String</d2p1:UserName>
    </d2p1:OrganizationSubscription>
  </Subscriptions>
  <TechStacks xmlns:d2p1="http://schemas.datacontract.org/2004/07/TechStacks.ServiceModel.Types">
    <d2p1:TechnologyStack>
      <d2p1:AppUrl>String</d2p1:AppUrl>
      <d2p1:CommentsPostId>0</d2p1:CommentsPostId>
      <d2p1:Created>0001-01-01T00:00:00</d2p1:Created>
      <d2p1:CreatedBy>String</d2p1:CreatedBy>
      <d2p1:Description>String</d2p1:Description>
      <d2p1:Details>String</d2p1:Details>
      <d2p1:DetailsHtml>String</d2p1:DetailsHtml>
      <d2p1:FavCount>0</d2p1:FavCount>
      <d2p1:Id>0</d2p1:Id>
      <d2p1:IsLocked>false</d2p1:IsLocked>
      <d2p1:LastModified>0001-01-01T00:00:00</d2p1:LastModified>
      <d2p1:LastModifiedBy>String</d2p1:LastModifiedBy>
      <d2p1:LastStatusUpdate>0001-01-01T00:00:00</d2p1:LastStatusUpdate>
      <d2p1:Name>String</d2p1:Name>
      <d2p1:OrganizationId>0</d2p1:OrganizationId>
      <d2p1:OwnerId>String</d2p1:OwnerId>
      <d2p1:ScreenshotUrl>String</d2p1:ScreenshotUrl>
      <d2p1:Slug>String</d2p1:Slug>
      <d2p1:VendorName>String</d2p1:VendorName>
      <d2p1:ViewCount>0</d2p1:ViewCount>
    </d2p1:TechnologyStack>
  </TechStacks>
  <TwitterProfileUrl>String</TwitterProfileUrl>
  <UserActivity xmlns:d2p1="http://schemas.datacontract.org/2004/07/TechStacks.ServiceModel.Types">
    <d2p1:CommentDownVotes>0</d2p1:CommentDownVotes>
    <d2p1:CommentUpVotes>0</d2p1:CommentUpVotes>
    <d2p1:Created>0001-01-01T00:00:00</d2p1:Created>
    <d2p1:Id>0</d2p1:Id>
    <d2p1:Karma>0</d2p1:Karma>
    <d2p1:Modified>0001-01-01T00:00:00</d2p1:Modified>
    <d2p1:PinnedCommentCount>0</d2p1:PinnedCommentCount>
    <d2p1:PostCommentReportCount>0</d2p1:PostCommentReportCount>
    <d2p1:PostCommentsCount>0</d2p1:PostCommentsCount>
    <d2p1:PostDownVotes>0</d2p1:PostDownVotes>
    <d2p1:PostReportCount>0</d2p1:PostReportCount>
    <d2p1:PostUpVotes>0</d2p1:PostUpVotes>
    <d2p1:PostsCount>0</d2p1:PostsCount>
    <d2p1:TechStacksCount>0</d2p1:TechStacksCount>
    <d2p1:TechnologyCount>0</d2p1:TechnologyCount>
    <d2p1:UserName>String</d2p1:UserName>
  </UserActivity>
  <UserAuthId>String</UserAuthId>
  <UserAuthName>String</UserAuthName>
  <UserName>String</UserName>
</SessionInfoResponse>