| 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 .xml suffix or ?format=xml
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: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<MappingRulesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<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>
<Rules>
<MappingRuleDto>
<Active>false</Active>
<Keyword>String</Keyword>
<Last90>0</Last90>
<MatchedTotal>0</MatchedTotal>
<RuleId>0</RuleId>
<SeriesId>0</SeriesId>
<SeriesKey>String</SeriesKey>
<SortOrder>0</SortOrder>
<UnschHits>0</UnschHits>
</MappingRuleDto>
</Rules>
</MappingRulesResponse>