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 .jsv suffix or ?format=jsv

HTTP + JSV

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: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	PlatformRequestId: 0,
	Reason: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	Requests: 
	[
		{
			PlatformRequestId: 0,
			TenantId: 00000000000000000000000000000000,
			TenantName: String,
			Slug: String,
			Kind: String,
			Key: String,
			Message: String,
			ContactName: String,
			ContactEmail: String,
			RequestedBy: String,
			RequestedAt: 0001-01-01,
			Status: String,
			ClosedBy: String,
			ClosedAt: 0001-01-01,
			CloseNote: String
		}
	],
	Closed: 
	{
		PlatformRequestId: 0,
		TenantId: 00000000000000000000000000000000,
		TenantName: String,
		Slug: String,
		Kind: String,
		Key: String,
		Message: String,
		ContactName: String,
		ContactEmail: String,
		RequestedBy: String,
		RequestedAt: 0001-01-01,
		Status: String,
		ClosedBy: String,
		ClosedAt: 0001-01-01,
		CloseNote: String
	}
}