| GET,OPTIONS | /v1/records/search |
|---|
<?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 RecordDto implements JsonSerializable
{
public function __construct(
/** @var int */
public int $RecordId=0,
/** @var string|null */
public ?string $RecordKey=null,
/** @var string|null */
public ?string $Name=null,
/** @var int|null */
public ?int $SeriesId=null,
/** @var string|null */
public ?string $SeriesKey=null,
/** @var string|null */
public ?string $Classification=null,
/** @var string|null */
public ?string $Format=null,
/** @var string|null */
public ?string $Phase=null,
/** @var string|null */
public ?string $TriggerDate=null,
/** @var bool|null */
public ?bool $Staged=null,
/** @var int|null */
public ?int $HoldId=null,
/** @var string|null */
public ?string $HoldKey=null,
/** @var string|null */
public ?string $OwnerName=null,
/** @var string|null */
public ?string $Branch=null,
/** @var string|null */
public ?string $Barcode=null,
/** @var string|null */
public ?string $LocJson=null,
/** @var string|null */
public ?string $MetaJson=null,
/** @var string|null */
public ?string $FilesJson=null,
/** @var string|null */
public ?string $VersionsJson=null,
/** @var string|null */
public ?string $RelatedJson=null,
/** @var string|null */
public ?string $DisposedJson=null,
/** @var string|null */
public ?string $CreatedLabel=null,
/** @var string|null */
public ?string $UpdatedLabel=null,
/** @var string|null */
public ?string $Lifecycle=null,
/** @var string|null */
public ?string $RetKind=null,
/** @var string|null */
public ?string $EligibleDate=null,
/** @var int */
public int $MonthsLeft=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['RecordId'])) $this->RecordId = $o['RecordId'];
if (isset($o['RecordKey'])) $this->RecordKey = $o['RecordKey'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['SeriesId'])) $this->SeriesId = $o['SeriesId'];
if (isset($o['SeriesKey'])) $this->SeriesKey = $o['SeriesKey'];
if (isset($o['Classification'])) $this->Classification = $o['Classification'];
if (isset($o['Format'])) $this->Format = $o['Format'];
if (isset($o['Phase'])) $this->Phase = $o['Phase'];
if (isset($o['TriggerDate'])) $this->TriggerDate = $o['TriggerDate'];
if (isset($o['Staged'])) $this->Staged = $o['Staged'];
if (isset($o['HoldId'])) $this->HoldId = $o['HoldId'];
if (isset($o['HoldKey'])) $this->HoldKey = $o['HoldKey'];
if (isset($o['OwnerName'])) $this->OwnerName = $o['OwnerName'];
if (isset($o['Branch'])) $this->Branch = $o['Branch'];
if (isset($o['Barcode'])) $this->Barcode = $o['Barcode'];
if (isset($o['LocJson'])) $this->LocJson = $o['LocJson'];
if (isset($o['MetaJson'])) $this->MetaJson = $o['MetaJson'];
if (isset($o['FilesJson'])) $this->FilesJson = $o['FilesJson'];
if (isset($o['VersionsJson'])) $this->VersionsJson = $o['VersionsJson'];
if (isset($o['RelatedJson'])) $this->RelatedJson = $o['RelatedJson'];
if (isset($o['DisposedJson'])) $this->DisposedJson = $o['DisposedJson'];
if (isset($o['CreatedLabel'])) $this->CreatedLabel = $o['CreatedLabel'];
if (isset($o['UpdatedLabel'])) $this->UpdatedLabel = $o['UpdatedLabel'];
if (isset($o['Lifecycle'])) $this->Lifecycle = $o['Lifecycle'];
if (isset($o['RetKind'])) $this->RetKind = $o['RetKind'];
if (isset($o['EligibleDate'])) $this->EligibleDate = $o['EligibleDate'];
if (isset($o['MonthsLeft'])) $this->MonthsLeft = $o['MonthsLeft'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->RecordId)) $o['RecordId'] = $this->RecordId;
if (isset($this->RecordKey)) $o['RecordKey'] = $this->RecordKey;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->SeriesId)) $o['SeriesId'] = $this->SeriesId;
if (isset($this->SeriesKey)) $o['SeriesKey'] = $this->SeriesKey;
if (isset($this->Classification)) $o['Classification'] = $this->Classification;
if (isset($this->Format)) $o['Format'] = $this->Format;
if (isset($this->Phase)) $o['Phase'] = $this->Phase;
if (isset($this->TriggerDate)) $o['TriggerDate'] = $this->TriggerDate;
if (isset($this->Staged)) $o['Staged'] = $this->Staged;
if (isset($this->HoldId)) $o['HoldId'] = $this->HoldId;
if (isset($this->HoldKey)) $o['HoldKey'] = $this->HoldKey;
if (isset($this->OwnerName)) $o['OwnerName'] = $this->OwnerName;
if (isset($this->Branch)) $o['Branch'] = $this->Branch;
if (isset($this->Barcode)) $o['Barcode'] = $this->Barcode;
if (isset($this->LocJson)) $o['LocJson'] = $this->LocJson;
if (isset($this->MetaJson)) $o['MetaJson'] = $this->MetaJson;
if (isset($this->FilesJson)) $o['FilesJson'] = $this->FilesJson;
if (isset($this->VersionsJson)) $o['VersionsJson'] = $this->VersionsJson;
if (isset($this->RelatedJson)) $o['RelatedJson'] = $this->RelatedJson;
if (isset($this->DisposedJson)) $o['DisposedJson'] = $this->DisposedJson;
if (isset($this->CreatedLabel)) $o['CreatedLabel'] = $this->CreatedLabel;
if (isset($this->UpdatedLabel)) $o['UpdatedLabel'] = $this->UpdatedLabel;
if (isset($this->Lifecycle)) $o['Lifecycle'] = $this->Lifecycle;
if (isset($this->RetKind)) $o['RetKind'] = $this->RetKind;
if (isset($this->EligibleDate)) $o['EligibleDate'] = $this->EligibleDate;
if (isset($this->MonthsLeft)) $o['MonthsLeft'] = $this->MonthsLeft;
return empty($o) ? new class(){} : $o;
}
}
class RecordsSearchResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<RecordDto>|null */
public ?array $Records=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['Records'])) $this->Records = JsonConverters::fromArray('RecordDto', $o['Records']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->Records)) $o['Records'] = JsonConverters::toArray('RecordDto', $this->Records);
return empty($o) ? new class(){} : $o;
}
}
class RecordsSearchRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Q=null,
/** @var int */
public int $Page=0,
/** @var int */
public int $PageSize=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Q'])) $this->Q = $o['Q'];
if (isset($o['Page'])) $this->Page = $o['Page'];
if (isset($o['PageSize'])) $this->PageSize = $o['PageSize'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Q)) $o['Q'] = $this->Q;
if (isset($this->Page)) $o['Page'] = $this->Page;
if (isset($this->PageSize)) $o['PageSize'] = $this->PageSize;
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/search HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<RecordsSearchResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Records>
<RecordDto>
<Barcode>String</Barcode>
<Branch>String</Branch>
<Classification>String</Classification>
<CreatedLabel>String</CreatedLabel>
<DisposedJson>String</DisposedJson>
<EligibleDate>String</EligibleDate>
<FilesJson>String</FilesJson>
<Format>String</Format>
<HoldId>0</HoldId>
<HoldKey>String</HoldKey>
<Lifecycle>String</Lifecycle>
<LocJson>String</LocJson>
<MetaJson>String</MetaJson>
<MonthsLeft>0</MonthsLeft>
<Name>String</Name>
<OwnerName>String</OwnerName>
<Phase>String</Phase>
<RecordId>0</RecordId>
<RecordKey>String</RecordKey>
<RelatedJson>String</RelatedJson>
<RetKind>String</RetKind>
<SeriesId>0</SeriesId>
<SeriesKey>String</SeriesKey>
<Staged>false</Staged>
<TriggerDate>String</TriggerDate>
<UpdatedLabel>String</UpdatedLabel>
<VersionsJson>String</VersionsJson>
</RecordDto>
</Records>
<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>
</RecordsSearchResponse>