TechStacks!

<back to all web services

GetTechnologyPreviousVersions

Tech
The following routes are available for this service:
GET/technology/{Slug}/previous-versions
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


enum TechnologyTier : string
{
    case ProgrammingLanguage = 'ProgrammingLanguage';
    case Client = 'Client';
    case Http = 'Http';
    case Server = 'Server';
    case Data = 'Data';
    case SoftwareInfrastructure = 'SoftwareInfrastructure';
    case OperatingSystem = 'OperatingSystem';
    case HardwareInfrastructure = 'HardwareInfrastructure';
    case ThirdPartyServices = 'ThirdPartyServices';
}

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 TechnologyHistory 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,
        /** @var int */
        public int $technologyId=0,
        /** @var string|null */
        public ?string $operation=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);
        if (isset($o['technologyId'])) $this->technologyId = $o['technologyId'];
        if (isset($o['operation'])) $this->operation = $o['operation'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->technologyId)) $o['technologyId'] = $this->technologyId;
        if (isset($this->operation)) $o['operation'] = $this->operation;
        return empty($o) ? new class(){} : $o;
    }
}

class GetTechnologyPreviousVersionsResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<TechnologyHistory>|null */
        public ?array $results=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['results'])) $this->results = JsonConverters::fromArray('TechnologyHistory', $o['results']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->results)) $o['results'] = JsonConverters::toArray('TechnologyHistory', $this->results);
        return empty($o) ? new class(){} : $o;
    }
}

class GetTechnologyPreviousVersions implements IGet, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $slug=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['slug'])) $this->slug = $o['slug'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->slug)) $o['slug'] = $this->slug;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetTechnologyPreviousVersions 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.

GET /technology/{Slug}/previous-versions HTTP/1.1 
Host: techstacks.io 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<GetTechnologyPreviousVersionsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TechStacks.ServiceModel">
  <Results xmlns:d2p1="http://schemas.datacontract.org/2004/07/TechStacks.ServiceModel.Types">
    <d2p1:TechnologyHistory>
      <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:Operation>String</d2p1:Operation>
      <d2p1:TechnologyId>0</d2p1:TechnologyId>
    </d2p1:TechnologyHistory>
  </Results>
</GetTechnologyPreviousVersionsResponse>