| GET,OPTIONS | /v1/records/mapping-rules |
|---|
<?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 MappingRuleDto implements JsonSerializable
{
public function __construct(
/** @var int */
public int $RuleId=0,
/** @var int */
public int $SortOrder=0,
/** @var string|null */
public ?string $Keyword=null,
/** @var int */
public int $SeriesId=0,
/** @var string|null */
public ?string $SeriesKey=null,
/** @var bool|null */
public ?bool $Active=null,
/** @var int */
public int $MatchedTotal=0,
/** @var int */
public int $Last90=0,
/** @var int */
public int $UnschHits=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['RuleId'])) $this->RuleId = $o['RuleId'];
if (isset($o['SortOrder'])) $this->SortOrder = $o['SortOrder'];
if (isset($o['Keyword'])) $this->Keyword = $o['Keyword'];
if (isset($o['SeriesId'])) $this->SeriesId = $o['SeriesId'];
if (isset($o['SeriesKey'])) $this->SeriesKey = $o['SeriesKey'];
if (isset($o['Active'])) $this->Active = $o['Active'];
if (isset($o['MatchedTotal'])) $this->MatchedTotal = $o['MatchedTotal'];
if (isset($o['Last90'])) $this->Last90 = $o['Last90'];
if (isset($o['UnschHits'])) $this->UnschHits = $o['UnschHits'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->RuleId)) $o['RuleId'] = $this->RuleId;
if (isset($this->SortOrder)) $o['SortOrder'] = $this->SortOrder;
if (isset($this->Keyword)) $o['Keyword'] = $this->Keyword;
if (isset($this->SeriesId)) $o['SeriesId'] = $this->SeriesId;
if (isset($this->SeriesKey)) $o['SeriesKey'] = $this->SeriesKey;
if (isset($this->Active)) $o['Active'] = $this->Active;
if (isset($this->MatchedTotal)) $o['MatchedTotal'] = $this->MatchedTotal;
if (isset($this->Last90)) $o['Last90'] = $this->Last90;
if (isset($this->UnschHits)) $o['UnschHits'] = $this->UnschHits;
return empty($o) ? new class(){} : $o;
}
}
class MappingRulesResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<MappingRuleDto>|null */
public ?array $Rules=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['Rules'])) $this->Rules = JsonConverters::fromArray('MappingRuleDto', $o['Rules']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->Rules)) $o['Rules'] = JsonConverters::toArray('MappingRuleDto', $this->Rules);
return empty($o) ? new class(){} : $o;
}
}
class MappingRulesRequest implements JsonSerializable
{
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/records/mapping-rules 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"}},"Rules":[{"RuleId":0,"SortOrder":0,"Keyword":"String","SeriesId":0,"SeriesKey":"String","Active":false,"MatchedTotal":0,"Last90":0,"UnschHits":0}]}