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 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
    ) {
    }

    /** @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'];
    }
    
    /** @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;
        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 WorkspaceModulesResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<WorkspaceModule>|null */
        public ?array $Modules=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['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->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 .jsv suffix or ?format=jsv

HTTP + JSV

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/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Modules: 
	[
		{
			Key: String,
			Name: String,
			Letter: String,
			Color: String,
			Question: String,
			Description: String,
			Features: 
			[
				{
					Key: String,
					Name: String,
					Enabled: False
				}
			]
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}