Trendsic Platform Service

<back to all web services

DeclinePlatformRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/platform/requests/{PlatformRequestId}/decline
<?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 PlatformRequestRow implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $PlatformRequestId=0,
        /** @var string */
        public string $TenantId='',
        /** @var string|null */
        public ?string $TenantName=null,
        /** @var string|null */
        public ?string $Slug=null,
        /** @var string|null */
        public ?string $Kind=null,
        /** @var string|null */
        public ?string $Key=null,
        /** @var string|null */
        public ?string $Message=null,
        /** @var string|null */
        public ?string $ContactName=null,
        /** @var string|null */
        public ?string $ContactEmail=null,
        /** @var string|null */
        public ?string $RequestedBy=null,
        /** @var DateTime */
        public DateTime $RequestedAt=new DateTime(),
        /** @var string|null */
        public ?string $Status=null,
        /** @var string|null */
        public ?string $ClosedBy=null,
        /** @var DateTime|null */
        public ?DateTime $ClosedAt=null,
        /** @var string|null */
        public ?string $CloseNote=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['PlatformRequestId'])) $this->PlatformRequestId = $o['PlatformRequestId'];
        if (isset($o['TenantId'])) $this->TenantId = $o['TenantId'];
        if (isset($o['TenantName'])) $this->TenantName = $o['TenantName'];
        if (isset($o['Slug'])) $this->Slug = $o['Slug'];
        if (isset($o['Kind'])) $this->Kind = $o['Kind'];
        if (isset($o['Key'])) $this->Key = $o['Key'];
        if (isset($o['Message'])) $this->Message = $o['Message'];
        if (isset($o['ContactName'])) $this->ContactName = $o['ContactName'];
        if (isset($o['ContactEmail'])) $this->ContactEmail = $o['ContactEmail'];
        if (isset($o['RequestedBy'])) $this->RequestedBy = $o['RequestedBy'];
        if (isset($o['RequestedAt'])) $this->RequestedAt = JsonConverters::from('DateTime', $o['RequestedAt']);
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['ClosedBy'])) $this->ClosedBy = $o['ClosedBy'];
        if (isset($o['ClosedAt'])) $this->ClosedAt = JsonConverters::from('DateTime', $o['ClosedAt']);
        if (isset($o['CloseNote'])) $this->CloseNote = $o['CloseNote'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->PlatformRequestId)) $o['PlatformRequestId'] = $this->PlatformRequestId;
        if (isset($this->TenantId)) $o['TenantId'] = $this->TenantId;
        if (isset($this->TenantName)) $o['TenantName'] = $this->TenantName;
        if (isset($this->Slug)) $o['Slug'] = $this->Slug;
        if (isset($this->Kind)) $o['Kind'] = $this->Kind;
        if (isset($this->Key)) $o['Key'] = $this->Key;
        if (isset($this->Message)) $o['Message'] = $this->Message;
        if (isset($this->ContactName)) $o['ContactName'] = $this->ContactName;
        if (isset($this->ContactEmail)) $o['ContactEmail'] = $this->ContactEmail;
        if (isset($this->RequestedBy)) $o['RequestedBy'] = $this->RequestedBy;
        if (isset($this->RequestedAt)) $o['RequestedAt'] = JsonConverters::to('DateTime', $this->RequestedAt);
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->ClosedBy)) $o['ClosedBy'] = $this->ClosedBy;
        if (isset($this->ClosedAt)) $o['ClosedAt'] = JsonConverters::to('DateTime', $this->ClosedAt);
        if (isset($this->CloseNote)) $o['CloseNote'] = $this->CloseNote;
        return empty($o) ? new class(){} : $o;
    }
}

class PlatformRequestsResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var array<PlatformRequestRow>|null */
        public ?array $Requests=null,
        /** @var PlatformRequestRow|null */
        public ?PlatformRequestRow $Closed=null
    ) {
    }

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

class DeclinePlatformRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $PlatformRequestId=0,
        /** @var string|null */
        public ?string $Reason=null
    ) {
    }

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

PHP DeclinePlatformRequest 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.

POST /v1/platform/requests/{PlatformRequestId}/decline HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<DeclinePlatformRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <PlatformRequestId>0</PlatformRequestId>
  <Reason>String</Reason>
</DeclinePlatformRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<PlatformRequestsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Closed>
    <CloseNote>String</CloseNote>
    <ClosedAt>0001-01-01T00:00:00</ClosedAt>
    <ClosedBy>String</ClosedBy>
    <ContactEmail>String</ContactEmail>
    <ContactName>String</ContactName>
    <Key>String</Key>
    <Kind>String</Kind>
    <Message>String</Message>
    <PlatformRequestId>0</PlatformRequestId>
    <RequestedAt>0001-01-01T00:00:00</RequestedAt>
    <RequestedBy>String</RequestedBy>
    <Slug>String</Slug>
    <Status>String</Status>
    <TenantId>00000000-0000-0000-0000-000000000000</TenantId>
    <TenantName>String</TenantName>
  </Closed>
  <Requests>
    <PlatformRequestRow>
      <CloseNote>String</CloseNote>
      <ClosedAt>0001-01-01T00:00:00</ClosedAt>
      <ClosedBy>String</ClosedBy>
      <ContactEmail>String</ContactEmail>
      <ContactName>String</ContactName>
      <Key>String</Key>
      <Kind>String</Kind>
      <Message>String</Message>
      <PlatformRequestId>0</PlatformRequestId>
      <RequestedAt>0001-01-01T00:00:00</RequestedAt>
      <RequestedBy>String</RequestedBy>
      <Slug>String</Slug>
      <Status>String</Status>
      <TenantId>00000000-0000-0000-0000-000000000000</TenantId>
      <TenantName>String</TenantName>
    </PlatformRequestRow>
  </Requests>
  <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>
</PlatformRequestsResponse>