Trendsic Platform Service

<back to all web services

ReportDefinitionGetRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
GET,OPTIONS/v1/report/definitions/{Uid}
<?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 SavedReportDefinition implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ReportDefinitionID=0,
        /** @var string */
        public string $ReportDefinitionUID='',
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Folder=null,
        /** @var string|null */
        public ?string $Kind=null,
        /** @var string|null */
        public ?string $ChartType=null,
        /** @var string|null */
        public ?string $DefinitionJson=null,
        /** @var bool|null */
        public ?bool $IsShared=null,
        /** @var bool|null */
        public ?bool $IsSystem=null,
        /** @var string|null */
        public ?string $OwnerUserId=null,
        /** @var bool|null */
        public ?bool $IsMine=null,
        /** @var DateTime|null */
        public ?DateTime $CreatedAt=null,
        /** @var DateTime|null */
        public ?DateTime $UpdatedAt=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ReportDefinitionID'])) $this->ReportDefinitionID = $o['ReportDefinitionID'];
        if (isset($o['ReportDefinitionUID'])) $this->ReportDefinitionUID = $o['ReportDefinitionUID'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Folder'])) $this->Folder = $o['Folder'];
        if (isset($o['Kind'])) $this->Kind = $o['Kind'];
        if (isset($o['ChartType'])) $this->ChartType = $o['ChartType'];
        if (isset($o['DefinitionJson'])) $this->DefinitionJson = $o['DefinitionJson'];
        if (isset($o['IsShared'])) $this->IsShared = $o['IsShared'];
        if (isset($o['IsSystem'])) $this->IsSystem = $o['IsSystem'];
        if (isset($o['OwnerUserId'])) $this->OwnerUserId = $o['OwnerUserId'];
        if (isset($o['IsMine'])) $this->IsMine = $o['IsMine'];
        if (isset($o['CreatedAt'])) $this->CreatedAt = JsonConverters::from('DateTime', $o['CreatedAt']);
        if (isset($o['UpdatedAt'])) $this->UpdatedAt = JsonConverters::from('DateTime', $o['UpdatedAt']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ReportDefinitionID)) $o['ReportDefinitionID'] = $this->ReportDefinitionID;
        if (isset($this->ReportDefinitionUID)) $o['ReportDefinitionUID'] = $this->ReportDefinitionUID;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Folder)) $o['Folder'] = $this->Folder;
        if (isset($this->Kind)) $o['Kind'] = $this->Kind;
        if (isset($this->ChartType)) $o['ChartType'] = $this->ChartType;
        if (isset($this->DefinitionJson)) $o['DefinitionJson'] = $this->DefinitionJson;
        if (isset($this->IsShared)) $o['IsShared'] = $this->IsShared;
        if (isset($this->IsSystem)) $o['IsSystem'] = $this->IsSystem;
        if (isset($this->OwnerUserId)) $o['OwnerUserId'] = $this->OwnerUserId;
        if (isset($this->IsMine)) $o['IsMine'] = $this->IsMine;
        if (isset($this->CreatedAt)) $o['CreatedAt'] = JsonConverters::to('DateTime', $this->CreatedAt);
        if (isset($this->UpdatedAt)) $o['UpdatedAt'] = JsonConverters::to('DateTime', $this->UpdatedAt);
        return empty($o) ? new class(){} : $o;
    }
}

class ReportDefinitionResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var SavedReportDefinition|null */
        public ?SavedReportDefinition $Definition=null
    ) {
    }

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

class ReportDefinitionGetRequest implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Uid=''
    ) {
    }

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

PHP ReportDefinitionGetRequest DTOs

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

HTTP + CSV

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

GET /v1/report/definitions/{Uid} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Definition":{"ReportDefinitionID":0,"ReportDefinitionUID":"00000000000000000000000000000000","Name":"String","Folder":"String","Kind":"String","ChartType":"String","DefinitionJson":"String","IsShared":false,"IsSystem":false,"OwnerUserId":"String","IsMine":false,"CreatedAt":"0001-01-01T00:00:00.0000000","UpdatedAt":"0001-01-01T00:00:00.0000000"}}