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 .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 /v1/workspace/modules HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<WorkspaceModulesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Modules>
    <WorkspaceModule>
      <Color>String</Color>
      <Description>String</Description>
      <Features>
        <WorkspaceModuleFeature>
          <Description>String</Description>
          <Enabled>false</Enabled>
          <Entitled>false</Entitled>
          <Group>String</Group>
          <InPack>false</InPack>
          <IsOn>false</IsOn>
          <Key>String</Key>
          <Limit>
            <Allowance>0</Allowance>
            <MeterKey>String</MeterKey>
            <Used>0</Used>
          </Limit>
          <ModuleExpiresAt>0001-01-01T00:00:00</ModuleExpiresAt>
          <ModuleKey>String</ModuleKey>
          <ModuleName>String</ModuleName>
          <ModuleStatus>String</ModuleStatus>
          <Name>String</Name>
          <Reason>String</Reason>
        </WorkspaceModuleFeature>
      </Features>
      <Key>String</Key>
      <Letter>String</Letter>
      <Name>String</Name>
      <Question>String</Question>
    </WorkspaceModule>
  </Modules>
  <PackName>String</PackName>
  <Requests>
    <WorkspaceRequestMark>
      <Features xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </Features>
      <Key>String</Key>
      <Kind>String</Kind>
      <RequestedAt>0001-01-01T00:00:00</RequestedAt>
    </WorkspaceRequestMark>
  </Requests>
  <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>
</WorkspaceModulesResponse>