AIM Web Services

<back to all web services

WebCategoriesRequest

WebCategories
Requires active-e Inventory Service

The following routes are available for this service:
GET/api/WebCategories
<?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 BaseRequest implements JsonSerializable
{
    public function __construct(
        /** @description This is your AIM API Key provided by Tri-Tech */
        // @DataMember
        // @ApiMember(DataType="string", Description="This is your AIM API Key provided by Tri-Tech", IsRequired=true, Name="ApiKey", ParameterType="header")
        /** @var string */
        public string $ApiKey='',

        // @DataMember
        // @ApiMember(DataType="string", Name="OAuthToken", ParameterType="header")
        /** @var string|null */
        public ?string $OAuthToken=null
    ) {
    }

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

// @DataContract
class BaseSecureRequest extends BaseRequest implements JsonSerializable
{
    /**
     * @param string $ApiKey
     * @param string|null $OAuthToken
     */
    public function __construct(
        string $ApiKey='',
        ?string $OAuthToken=null,
        /** @description  */
        // @DataMember
        // @ApiMember(DataType="string", Description="", Name="Token", ParameterType="Header")
        /** @var string|null */
        public ?string $Token=null,

        /** @description  */
        // @DataMember
        // @ApiMember(DataType="string", Description="", Name="DeviceId", ParameterType="Header")
        /** @var string|null */
        public ?string $DeviceId=null,

        /** @description  */
        // @DataMember
        // @ApiMember(DataType="string", Description="", IsRequired=true, Name="AppId", ParameterType="Header")
        /** @var string */
        public string $AppId=''
    ) {
        parent::__construct($ApiKey,$OAuthToken);
    }

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

// @DataContract
class BaseResponseResult implements JsonSerializable
{
    public function __construct(
        /** @description  */
        // @DataMember
        // @ApiMember(DataType="string", Description="", Name="StatusCode", ParameterType="body")
        /** @var string|null */
        public ?string $StatusCode=null,

        /** @description  */
        // @DataMember
        // @ApiMember(DataType="string", Description="", Name="Login", ParameterType="body")
        /** @var string|null */
        public ?string $Login=null,

        /** @description  */
        // @DataMember
        // @ApiMember(DataType="string", Description="", Name="ErrorCode", ParameterType="body")
        /** @var string|null */
        public ?string $ErrorCode=null,

        /** @description  */
        // @DataMember
        // @ApiMember(DataType="string", Description="", Name="ErrorDisplayText", ParameterType="body")
        /** @var string|null */
        public ?string $ErrorDisplayText=null,

        /** @description  */
        // @DataMember
        // @ApiMember(DataType="string", Description="", Name="ErrorMessage", ParameterType="body")
        /** @var string|null */
        public ?string $ErrorMessage=null,

        /** @description  */
        // @DataMember
        // @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="DomainName", ParameterType="body")
        /** @var string|null */
        public ?string $DomainName=null,

        /** @description  */
        // @DataMember
        // @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="IPAddress", ParameterType="body")
        /** @var string|null */
        public ?string $IpAddress=null
    ) {
    }

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

// @DataContract
class BaseResponse implements JsonSerializable
{
    public function __construct(
        /** @description  */
        // @DataMember
        // @ApiMember(DataType="BaseResponseResult", Description="", Name="Status", ParameterType="body")
        /** @var BaseResponseResult|null */
        public ?BaseResponseResult $Status=null
    ) {
    }

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

// @DataContract
class ImageInfo implements JsonSerializable
{
    public function __construct(
        // @DataMember
        /** @var string|null */
        public ?string $Url=null,

        // @DataMember
        /** @var string|null */
        public ?string $ImageStream=null,

        // @DataMember
        /** @var string|null */
        public ?string $ImageSize=null,

        // @DataMember
        /** @var string|null */
        public ?string $ErrorMessage=null,

        // @DataMember
        /** @var int|null */
        public ?int $UriPk=null
    ) {
    }

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

// @DataContract
class WebCategory implements JsonSerializable
{
    public function __construct(
        // @DataMember
        /** @var int */
        public int $Id=0,

        // @DataMember
        /** @var int|null */
        public ?int $ParentId=null,

        // @DataMember
        /** @var string|null */
        public ?string $Name=null,

        // @DataMember
        /** @var string|null */
        public ?string $Description=null,

        // @DataMember
        /** @var string|null */
        public ?string $FullPath=null,

        // @DataMember
        /** @var string|null */
        public ?string $ShortDescription=null,

        // @DataMember
        /** @var string|null */
        public ?string $SETitle=null,

        // @DataMember
        /** @var string|null */
        public ?string $SEKeywords=null,

        // @DataMember
        /** @var string|null */
        public ?string $SEDescription=null,

        // @DataMember
        /** @var string|null */
        public ?string $SEAltText=null,

        // @DataMember
        /** @var array<string>|null */
        public ?array $PossibleAttributes=null,

        // @DataMember
        /** @var ImageInfo|null */
        public ?ImageInfo $Image=null,

        // @DataMember
        /** @var bool|null */
        public ?bool $Unpublished=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['ParentId'])) $this->ParentId = $o['ParentId'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['FullPath'])) $this->FullPath = $o['FullPath'];
        if (isset($o['ShortDescription'])) $this->ShortDescription = $o['ShortDescription'];
        if (isset($o['SETitle'])) $this->SETitle = $o['SETitle'];
        if (isset($o['SEKeywords'])) $this->SEKeywords = $o['SEKeywords'];
        if (isset($o['SEDescription'])) $this->SEDescription = $o['SEDescription'];
        if (isset($o['SEAltText'])) $this->SEAltText = $o['SEAltText'];
        if (isset($o['PossibleAttributes'])) $this->PossibleAttributes = JsonConverters::fromArray('string', $o['PossibleAttributes']);
        if (isset($o['Image'])) $this->Image = JsonConverters::from('ImageInfo', $o['Image']);
        if (isset($o['Unpublished'])) $this->Unpublished = $o['Unpublished'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->ParentId)) $o['ParentId'] = $this->ParentId;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->FullPath)) $o['FullPath'] = $this->FullPath;
        if (isset($this->ShortDescription)) $o['ShortDescription'] = $this->ShortDescription;
        if (isset($this->SETitle)) $o['SETitle'] = $this->SETitle;
        if (isset($this->SEKeywords)) $o['SEKeywords'] = $this->SEKeywords;
        if (isset($this->SEDescription)) $o['SEDescription'] = $this->SEDescription;
        if (isset($this->SEAltText)) $o['SEAltText'] = $this->SEAltText;
        if (isset($this->PossibleAttributes)) $o['PossibleAttributes'] = JsonConverters::toArray('string', $this->PossibleAttributes);
        if (isset($this->Image)) $o['Image'] = JsonConverters::to('ImageInfo', $this->Image);
        if (isset($this->Unpublished)) $o['Unpublished'] = $this->Unpublished;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class WebCategoriesResponse extends BaseResponse implements JsonSerializable
{
    /**
     * @param BaseResponseResult|null $Status
     */
    public function __construct(
        ?BaseResponseResult $Status=null,
        // @DataMember
        /** @var array<WebCategory>|null */
        public ?array $WebCategories=null
    ) {
        parent::__construct($Status);
    }

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

/** @description WebCategoriesRequires active-e Inventory Service */
// @DataContract
class WebCategoriesRequest extends BaseSecureRequest implements JsonSerializable
{
    /**
     * @param string $ApiKey
     * @param string|null $OAuthToken
     * @param string|null $Token
     * @param string|null $DeviceId
     * @param string $AppId
     */
    public function __construct(
        string $ApiKey='',
        ?string $OAuthToken=null,
        ?string $Token=null,
        ?string $DeviceId=null,
        string $AppId='',
        // @DataMember
        /** @var bool|null */
        public ?bool $IncludePossibleAttributes=null,

        // @DataMember
        /** @var bool|null */
        public ?bool $IncludeImage=null
    ) {
        parent::__construct($ApiKey,$OAuthToken,$Token,$DeviceId,$AppId);
    }

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

PHP WebCategoriesRequest DTOs

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

HTTP + JSON

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

GET /api/WebCategories HTTP/1.1 
Host: active-ewebservice.biz 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"WebCategories":[{"Id":0,"ParentId":0,"Name":"String","Description":"String","FullPath":"String","ShortDescription":"String","SETitle":"String","SEKeywords":"String","SEDescription":"String","SEAltText":"String","PossibleAttributes":["String"],"Image":{"Url":"String","ImageStream":"String","ImageSize":"String","ErrorMessage":"String","UriPk":0},"Unpublished":false}],"Status":{"StatusCode":"String","Login":"String","ErrorCode":"String","ErrorDisplayText":"String","ErrorMessage":"String","DomainName":"String","IpAddress":"String"}}