Trendsic Platform Service

<back to all web services

GetWorkspaceModulesRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/workspace/modules
<?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 ModuleLimit implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $MeterKey=null,
        /** @var int|null */
        public ?int $Used=null,
        /** @var int|null */
        public ?int $Allowance=null,
        /** @var bool|null */
        public ?bool $IsReached=null
    ) {
    }

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

class WorkspaceModuleFeature implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Key=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var bool|null */
        public ?bool $Enabled=null,
        /** @var bool|null */
        public ?bool $InPack=null,
        /** @var string|null */
        public ?string $Group=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var bool|null */
        public ?bool $IsOn=null,
        /** @var bool|null */
        public ?bool $Entitled=null,
        /** @var string|null */
        public ?string $Reason=null,
        /** @var string|null */
        public ?string $ModuleKey=null,
        /** @var string|null */
        public ?string $ModuleName=null,
        /** @var string|null */
        public ?string $ModuleStatus=null,
        /** @var DateTime|null */
        public ?DateTime $ModuleExpiresAt=null,
        /** @var ModuleLimit|null */
        public ?ModuleLimit $Limit=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Key'])) $this->Key = $o['Key'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Enabled'])) $this->Enabled = $o['Enabled'];
        if (isset($o['InPack'])) $this->InPack = $o['InPack'];
        if (isset($o['Group'])) $this->Group = $o['Group'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['IsOn'])) $this->IsOn = $o['IsOn'];
        if (isset($o['Entitled'])) $this->Entitled = $o['Entitled'];
        if (isset($o['Reason'])) $this->Reason = $o['Reason'];
        if (isset($o['ModuleKey'])) $this->ModuleKey = $o['ModuleKey'];
        if (isset($o['ModuleName'])) $this->ModuleName = $o['ModuleName'];
        if (isset($o['ModuleStatus'])) $this->ModuleStatus = $o['ModuleStatus'];
        if (isset($o['ModuleExpiresAt'])) $this->ModuleExpiresAt = JsonConverters::from('DateTime', $o['ModuleExpiresAt']);
        if (isset($o['Limit'])) $this->Limit = JsonConverters::from('ModuleLimit', $o['Limit']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Key)) $o['Key'] = $this->Key;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Enabled)) $o['Enabled'] = $this->Enabled;
        if (isset($this->InPack)) $o['InPack'] = $this->InPack;
        if (isset($this->Group)) $o['Group'] = $this->Group;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->IsOn)) $o['IsOn'] = $this->IsOn;
        if (isset($this->Entitled)) $o['Entitled'] = $this->Entitled;
        if (isset($this->Reason)) $o['Reason'] = $this->Reason;
        if (isset($this->ModuleKey)) $o['ModuleKey'] = $this->ModuleKey;
        if (isset($this->ModuleName)) $o['ModuleName'] = $this->ModuleName;
        if (isset($this->ModuleStatus)) $o['ModuleStatus'] = $this->ModuleStatus;
        if (isset($this->ModuleExpiresAt)) $o['ModuleExpiresAt'] = JsonConverters::to('DateTime', $this->ModuleExpiresAt);
        if (isset($this->Limit)) $o['Limit'] = JsonConverters::to('ModuleLimit', $this->Limit);
        return empty($o) ? new class(){} : $o;
    }
}

class WorkspaceModule implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Key=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Letter=null,
        /** @var string|null */
        public ?string $Color=null,
        /** @var string|null */
        public ?string $Question=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var array<WorkspaceModuleFeature>|null */
        public ?array $Features=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Key'])) $this->Key = $o['Key'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Letter'])) $this->Letter = $o['Letter'];
        if (isset($o['Color'])) $this->Color = $o['Color'];
        if (isset($o['Question'])) $this->Question = $o['Question'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Features'])) $this->Features = JsonConverters::fromArray('WorkspaceModuleFeature', $o['Features']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Key)) $o['Key'] = $this->Key;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Letter)) $o['Letter'] = $this->Letter;
        if (isset($this->Color)) $o['Color'] = $this->Color;
        if (isset($this->Question)) $o['Question'] = $this->Question;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Features)) $o['Features'] = JsonConverters::toArray('WorkspaceModuleFeature', $this->Features);
        return empty($o) ? new class(){} : $o;
    }
}

class WorkspaceRequestMark implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Kind=null,
        /** @var string|null */
        public ?string $Key=null,
        /** @var array<string>|null */
        public ?array $Features=null,
        /** @var DateTime */
        public DateTime $RequestedAt=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Kind'])) $this->Kind = $o['Kind'];
        if (isset($o['Key'])) $this->Key = $o['Key'];
        if (isset($o['Features'])) $this->Features = JsonConverters::fromArray('string', $o['Features']);
        if (isset($o['RequestedAt'])) $this->RequestedAt = JsonConverters::from('DateTime', $o['RequestedAt']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Kind)) $o['Kind'] = $this->Kind;
        if (isset($this->Key)) $o['Key'] = $this->Key;
        if (isset($this->Features)) $o['Features'] = JsonConverters::toArray('string', $this->Features);
        if (isset($this->RequestedAt)) $o['RequestedAt'] = JsonConverters::to('DateTime', $this->RequestedAt);
        return empty($o) ? new class(){} : $o;
    }
}

class WorkspaceModulesResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<WorkspaceModule>|null */
        public ?array $Modules=null,
        /** @var string|null */
        public ?string $PackName=null,
        /** @var array<WorkspaceRequestMark>|null */
        public ?array $Requests=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Modules'])) $this->Modules = JsonConverters::fromArray('WorkspaceModule', $o['Modules']);
        if (isset($o['PackName'])) $this->PackName = $o['PackName'];
        if (isset($o['Requests'])) $this->Requests = JsonConverters::fromArray('WorkspaceRequestMark', $o['Requests']);
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Modules)) $o['Modules'] = JsonConverters::toArray('WorkspaceModule', $this->Modules);
        if (isset($this->PackName)) $o['PackName'] = $this->PackName;
        if (isset($this->Requests)) $o['Requests'] = JsonConverters::toArray('WorkspaceRequestMark', $this->Requests);
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class GetWorkspaceModulesRequest implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetWorkspaceModulesRequest DTOs

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

HTTP + OTHER

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

GET /v1/workspace/modules HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Modules":[{"Key":"String","Name":"String","Letter":"String","Color":"String","Question":"String","Description":"String","Features":[{"Key":"String","Name":"String","Enabled":false,"InPack":false,"Group":"String","Description":"String","IsOn":false,"Entitled":false,"Reason":"String","ModuleKey":"String","ModuleName":"String","ModuleStatus":"String","ModuleExpiresAt":"0001-01-01T00:00:00.0000000","Limit":{"MeterKey":"String","Used":0,"Allowance":0,"IsReached":true}}]}],"PackName":"String","Requests":[{"Kind":"String","Key":"String","Features":["String"],"RequestedAt":"0001-01-01T00:00:00.0000000"}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}