Trendsic Platform Service

<back to all web services

HoldsRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/records/holds
<?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 HoldMatchDto implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $RecordKey=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Tag=null,
        /** @var bool|null */
        public ?bool $Warn=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['RecordKey'])) $this->RecordKey = $o['RecordKey'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Tag'])) $this->Tag = $o['Tag'];
        if (isset($o['Warn'])) $this->Warn = $o['Warn'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->RecordKey)) $o['RecordKey'] = $this->RecordKey;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Tag)) $o['Tag'] = $this->Tag;
        if (isset($this->Warn)) $o['Warn'] = $this->Warn;
        return empty($o) ? new class(){} : $o;
    }
}

class LegalHoldDto implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $HoldId=0,
        /** @var string|null */
        public ?string $HoldKey=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Matter=null,
        /** @var string|null */
        public ?string $ScopeDim=null,
        /** @var string|null */
        public ?string $ScopeVal=null,
        /** @var string|null */
        public ?string $ScopeLabel=null,
        /** @var string|null */
        public ?string $ScopeNote=null,
        /** @var string|null */
        public ?string $PlacedBy=null,
        /** @var string|null */
        public ?string $PlacedLabel=null,
        /** @var bool|null */
        public ?bool $Released=null,
        /** @var string|null */
        public ?string $ReleasedLabel=null,
        /** @var string|null */
        public ?string $FrozenJson=null,
        /** @var string|null */
        public ?string $LogJson=null,
        /** @var array<HoldMatchDto>|null */
        public ?array $Matches=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['HoldId'])) $this->HoldId = $o['HoldId'];
        if (isset($o['HoldKey'])) $this->HoldKey = $o['HoldKey'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Matter'])) $this->Matter = $o['Matter'];
        if (isset($o['ScopeDim'])) $this->ScopeDim = $o['ScopeDim'];
        if (isset($o['ScopeVal'])) $this->ScopeVal = $o['ScopeVal'];
        if (isset($o['ScopeLabel'])) $this->ScopeLabel = $o['ScopeLabel'];
        if (isset($o['ScopeNote'])) $this->ScopeNote = $o['ScopeNote'];
        if (isset($o['PlacedBy'])) $this->PlacedBy = $o['PlacedBy'];
        if (isset($o['PlacedLabel'])) $this->PlacedLabel = $o['PlacedLabel'];
        if (isset($o['Released'])) $this->Released = $o['Released'];
        if (isset($o['ReleasedLabel'])) $this->ReleasedLabel = $o['ReleasedLabel'];
        if (isset($o['FrozenJson'])) $this->FrozenJson = $o['FrozenJson'];
        if (isset($o['LogJson'])) $this->LogJson = $o['LogJson'];
        if (isset($o['Matches'])) $this->Matches = JsonConverters::fromArray('HoldMatchDto', $o['Matches']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->HoldId)) $o['HoldId'] = $this->HoldId;
        if (isset($this->HoldKey)) $o['HoldKey'] = $this->HoldKey;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Matter)) $o['Matter'] = $this->Matter;
        if (isset($this->ScopeDim)) $o['ScopeDim'] = $this->ScopeDim;
        if (isset($this->ScopeVal)) $o['ScopeVal'] = $this->ScopeVal;
        if (isset($this->ScopeLabel)) $o['ScopeLabel'] = $this->ScopeLabel;
        if (isset($this->ScopeNote)) $o['ScopeNote'] = $this->ScopeNote;
        if (isset($this->PlacedBy)) $o['PlacedBy'] = $this->PlacedBy;
        if (isset($this->PlacedLabel)) $o['PlacedLabel'] = $this->PlacedLabel;
        if (isset($this->Released)) $o['Released'] = $this->Released;
        if (isset($this->ReleasedLabel)) $o['ReleasedLabel'] = $this->ReleasedLabel;
        if (isset($this->FrozenJson)) $o['FrozenJson'] = $this->FrozenJson;
        if (isset($this->LogJson)) $o['LogJson'] = $this->LogJson;
        if (isset($this->Matches)) $o['Matches'] = JsonConverters::toArray('HoldMatchDto', $this->Matches);
        return empty($o) ? new class(){} : $o;
    }
}

class HoldsResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var array<LegalHoldDto>|null */
        public ?array $Holds=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
        if (isset($o['Holds'])) $this->Holds = JsonConverters::fromArray('LegalHoldDto', $o['Holds']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        if (isset($this->Holds)) $o['Holds'] = JsonConverters::toArray('LegalHoldDto', $this->Holds);
        return empty($o) ? new class(){} : $o;
    }
}

class HoldsRequest implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

PHP HoldsRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /v1/records/holds HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<HoldsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Holds>
    <LegalHoldDto>
      <FrozenJson>String</FrozenJson>
      <HoldId>0</HoldId>
      <HoldKey>String</HoldKey>
      <LogJson>String</LogJson>
      <Matches>
        <HoldMatchDto>
          <Name>String</Name>
          <RecordKey>String</RecordKey>
          <Tag>String</Tag>
          <Warn>false</Warn>
        </HoldMatchDto>
      </Matches>
      <Matter>String</Matter>
      <Name>String</Name>
      <PlacedBy>String</PlacedBy>
      <PlacedLabel>String</PlacedLabel>
      <Released>false</Released>
      <ReleasedLabel>String</ReleasedLabel>
      <ScopeDim>String</ScopeDim>
      <ScopeLabel>String</ScopeLabel>
      <ScopeNote>String</ScopeNote>
      <ScopeVal>String</ScopeVal>
    </LegalHoldDto>
  </Holds>
  <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>
</HoldsResponse>