| GET,OPTIONS | /v1/ReportManager/api/Objects/{Table}/fields |
|---|
<?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};
/**
* @template T
*/
class ReportManagerRequest implements JsonSerializable
{
public array $genericArgs = [];
public static function create(array $genericArgs=[]): ReportManagerRequest {
$to = new ReportManagerRequest();
$to->genericArgs = $genericArgs;
return $to;
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class ReportManagerObjectData implements JsonSerializable
{
public function __construct(
// @DataMember(Name="id")
/** @var string|null */
public ?string $id=null,
// @DataMember(Name="name")
/** @var string|null */
public ?string $name=null,
// @DataMember(Name="filter")
/** @var bool|null */
public ?bool $filter=null,
// @DataMember(Name="edit")
/** @var bool|null */
public ?bool $edit=null,
// @DataMember(Name="type")
/** @var string|null */
public ?string $type=null,
// @DataMember(Name="ref")
/** @var string|null */
public ?string $ref=null,
// @DataMember(Name="key")
/** @var bool|null */
public ?bool $key=null,
// @DataMember(Name="show")
/** @var bool|null */
public ?bool $show=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['filter'])) $this->filter = $o['filter'];
if (isset($o['edit'])) $this->edit = $o['edit'];
if (isset($o['type'])) $this->type = $o['type'];
if (isset($o['ref'])) $this->ref = $o['ref'];
if (isset($o['key'])) $this->key = $o['key'];
if (isset($o['show'])) $this->show = $o['show'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->filter)) $o['filter'] = $this->filter;
if (isset($this->edit)) $o['edit'] = $this->edit;
if (isset($this->type)) $o['type'] = $this->type;
if (isset($this->ref)) $o['ref'] = $this->ref;
if (isset($this->key)) $o['key'] = $this->key;
if (isset($this->show)) $o['show'] = $this->show;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class ReportManagerObjectRef implements JsonSerializable
{
public function __construct(
// @DataMember(Name="id")
/** @var int */
public int $id=0,
// @DataMember(Name="target")
/** @var string|null */
public ?string $target=null,
// @DataMember(Name="source")
/** @var string|null */
public ?string $source=null,
// @DataMember(Name="name")
/** @var string|null */
public ?string $name=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['target'])) $this->target = $o['target'];
if (isset($o['source'])) $this->source = $o['source'];
if (isset($o['name'])) $this->name = $o['name'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->target)) $o['target'] = $this->target;
if (isset($this->source)) $o['source'] = $this->source;
if (isset($this->name)) $o['name'] = $this->name;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class ReportManagerObject implements IReportManagerDocument, JsonSerializable
{
public function __construct(
// @DataMember(Name="id")
/** @var string|null */
public ?string $id=null,
// @DataMember(Name="name")
/** @var string|null */
public ?string $name=null,
// @DataMember(Name="data")
/** @var array<ReportManagerObjectData>|null */
public ?array $data=null,
// @DataMember(Name="refs")
/** @var array<ReportManagerObjectRef>|null */
public ?array $refs=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['data'])) $this->data = JsonConverters::fromArray('ReportManagerObjectData', $o['data']);
if (isset($o['refs'])) $this->refs = JsonConverters::fromArray('ReportManagerObjectRef', $o['refs']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->data)) $o['data'] = JsonConverters::toArray('ReportManagerObjectData', $this->data);
if (isset($this->refs)) $o['refs'] = JsonConverters::toArray('ReportManagerObjectRef', $this->refs);
return empty($o) ? new class(){} : $o;
}
}
/**
* @template ReportManagerRequest of ReportManagerObject
*/
class ReportManagerObjectFieldsRequest extends ReportManagerRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Table=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['Table'])) $this->Table = $o['Table'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->Table)) $o['Table'] = $this->Table;
return empty($o) ? new class(){} : $o;
}
}
PHP ReportManagerObjectFieldsRequest 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.
GET /v1/ReportManager/api/Objects/{Table}/fields HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
[{"id":"String","name":"String","data":[{"id":"String","name":"String","filter":false,"edit":false,"type":"String","ref":"String","key":false,"show":false}],"refs":[{"id":0,"target":"String","source":"String","name":"String"}]}]