| GET,POST,OPTIONS | /v1/ReportManager/api/Objects/{Table}/data |
|---|
<?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 JToken implements IJsonLineInfo, JsonSerializable
{
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
return empty($o) ? new class(){} : $o;
}
}
class JValue extends JToken implements JsonSerializable
{
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
return empty($o) ? new class(){} : $o;
}
}
class GetSqlResult implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Sql=null,
/** @var array<string,JValue>|null */
public ?array $Values=null,
/** @var string|null */
public ?string $Error=null,
/** @var bool|null */
public ?bool $HasError=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Sql'])) $this->Sql = $o['Sql'];
if (isset($o['Values'])) $this->Values = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','JValue']), $o['Values']);
if (isset($o['Error'])) $this->Error = $o['Error'];
if (isset($o['HasError'])) $this->HasError = $o['HasError'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Sql)) $o['Sql'] = $this->Sql;
if (isset($this->Values)) $o['Values'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','JValue']), $this->Values);
if (isset($this->Error)) $o['Error'] = $this->Error;
if (isset($this->HasError)) $o['HasError'] = $this->HasError;
return empty($o) ? new class(){} : $o;
}
}
class ReportManagerDataJoin implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Source=null,
/** @var string|null */
public ?string $Target=null,
/** @var string|null */
public ?string $SourceField=null,
/** @var string|null */
public ?string $TargetField=null,
/** @var string|null */
public ?string $id=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Source'])) $this->Source = $o['Source'];
if (isset($o['Target'])) $this->Target = $o['Target'];
if (isset($o['SourceField'])) $this->SourceField = $o['SourceField'];
if (isset($o['TargetField'])) $this->TargetField = $o['TargetField'];
if (isset($o['id'])) $this->id = $o['id'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Source)) $o['Source'] = $this->Source;
if (isset($this->Target)) $o['Target'] = $this->Target;
if (isset($this->SourceField)) $o['SourceField'] = $this->SourceField;
if (isset($this->TargetField)) $o['TargetField'] = $this->TargetField;
if (isset($this->id)) $o['id'] = $this->id;
return empty($o) ? new class(){} : $o;
}
}
class ReportManagerDataSort implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Field=null,
/** @var string|null */
public ?string $Direction=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Field'])) $this->Field = $o['Field'];
if (isset($o['Direction'])) $this->Direction = $o['Direction'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Field)) $o['Field'] = $this->Field;
if (isset($this->Direction)) $o['Direction'] = $this->Direction;
return empty($o) ? new class(){} : $o;
}
}
class ReportManagerDataBucketOption implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Id=null,
/** @var array<Object>|null */
public ?array $Values=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Values'])) $this->Values = JsonConverters::fromArray('Object', $o['Values']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Values)) $o['Values'] = JsonConverters::toArray('Object', $this->Values);
return empty($o) ? new class(){} : $o;
}
}
class ReportManagerDataBucket implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $BucketColumn=null,
/** @var array<ReportManagerDataBucketOption>|null */
public ?array $Options=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['BucketColumn'])) $this->BucketColumn = $o['BucketColumn'];
if (isset($o['Options'])) $this->Options = JsonConverters::fromArray('ReportManagerDataBucketOption', $o['Options']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->BucketColumn)) $o['BucketColumn'] = $this->BucketColumn;
if (isset($this->Options)) $o['Options'] = JsonConverters::toArray('ReportManagerDataBucketOption', $this->Options);
return empty($o) ? new class(){} : $o;
}
}
class ReportManagerDataRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Table=null,
/** @var string|null */
public ?string $TableKey=null,
/** @var string|null */
public ?string $Query=null,
/** @var GetSqlResult|null */
public ?GetSqlResult $QueryCast=null,
/** @var array<string>|null */
public ?array $Columns=null,
/** @var string|null */
public ?string $Joins=null,
/** @var array<ReportManagerDataJoin>|null */
public ?array $JoinsCast=null,
/** @var string|null */
public ?string $Limit=null,
/** @var string|null */
public ?string $Sort=null,
/** @var array<ReportManagerDataSort>|null */
public ?array $SortCast=null,
/** @var array<string>|null */
public ?array $Group=null,
/** @var string|null */
public ?string $Buckets=null,
/** @var array<ReportManagerDataBucket>|null */
public ?array $BucketsCast=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Table'])) $this->Table = $o['Table'];
if (isset($o['TableKey'])) $this->TableKey = $o['TableKey'];
if (isset($o['Query'])) $this->Query = $o['Query'];
if (isset($o['QueryCast'])) $this->QueryCast = JsonConverters::from('GetSqlResult', $o['QueryCast']);
if (isset($o['Columns'])) $this->Columns = JsonConverters::fromArray('string', $o['Columns']);
if (isset($o['Joins'])) $this->Joins = $o['Joins'];
if (isset($o['JoinsCast'])) $this->JoinsCast = JsonConverters::fromArray('ReportManagerDataJoin', $o['JoinsCast']);
if (isset($o['Limit'])) $this->Limit = $o['Limit'];
if (isset($o['Sort'])) $this->Sort = $o['Sort'];
if (isset($o['SortCast'])) $this->SortCast = JsonConverters::fromArray('ReportManagerDataSort', $o['SortCast']);
if (isset($o['Group'])) $this->Group = JsonConverters::fromArray('string', $o['Group']);
if (isset($o['Buckets'])) $this->Buckets = $o['Buckets'];
if (isset($o['BucketsCast'])) $this->BucketsCast = JsonConverters::fromArray('ReportManagerDataBucket', $o['BucketsCast']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Table)) $o['Table'] = $this->Table;
if (isset($this->TableKey)) $o['TableKey'] = $this->TableKey;
if (isset($this->Query)) $o['Query'] = $this->Query;
if (isset($this->QueryCast)) $o['QueryCast'] = JsonConverters::to('GetSqlResult', $this->QueryCast);
if (isset($this->Columns)) $o['Columns'] = JsonConverters::toArray('string', $this->Columns);
if (isset($this->Joins)) $o['Joins'] = $this->Joins;
if (isset($this->JoinsCast)) $o['JoinsCast'] = JsonConverters::toArray('ReportManagerDataJoin', $this->JoinsCast);
if (isset($this->Limit)) $o['Limit'] = $this->Limit;
if (isset($this->Sort)) $o['Sort'] = $this->Sort;
if (isset($this->SortCast)) $o['SortCast'] = JsonConverters::toArray('ReportManagerDataSort', $this->SortCast);
if (isset($this->Group)) $o['Group'] = JsonConverters::toArray('string', $this->Group);
if (isset($this->Buckets)) $o['Buckets'] = $this->Buckets;
if (isset($this->BucketsCast)) $o['BucketsCast'] = JsonConverters::toArray('ReportManagerDataBucket', $this->BucketsCast);
return empty($o) ? new class(){} : $o;
}
}
PHP ReportManagerDataRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/ReportManager/api/Objects/{Table}/data HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{Unable to show example output for type 'ReportManagerDataRequest' using the custom 'other' filter}One or more errors occurred.
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
[{"String":{}}]