Trendsic Platform Service

<back to all web services

IntegrationsActionRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/integrations/{Provider}/{Action}
<?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 ProviderView implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Key=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Category=null,
        /** @var string|null */
        public ?string $Blurb=null,
        /** @var string|null */
        public ?string $Mono=null,
        /** @var string|null */
        public ?string $AuthMode=null,
        /** @var bool|null */
        public ?bool $Available=null,
        /** @var string|null */
        public ?string $Status=null,
        /** @var string|null */
        public ?string $Health=null,
        /** @var string|null */
        public ?string $StatusDetail=null,
        /** @var string|null */
        public ?string $AccountLabel=null,
        /** @var string|null */
        public ?string $Environment=null,
        /** @var DateTime|null */
        public ?DateTime $LastActivityAt=null,
        /** @var string|null */
        public ?string $ManageRoute=null,
        /** @var array<string>|null */
        public ?array $Actions=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Key'])) $this->Key = $o['Key'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Category'])) $this->Category = $o['Category'];
        if (isset($o['Blurb'])) $this->Blurb = $o['Blurb'];
        if (isset($o['Mono'])) $this->Mono = $o['Mono'];
        if (isset($o['AuthMode'])) $this->AuthMode = $o['AuthMode'];
        if (isset($o['Available'])) $this->Available = $o['Available'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['Health'])) $this->Health = $o['Health'];
        if (isset($o['StatusDetail'])) $this->StatusDetail = $o['StatusDetail'];
        if (isset($o['AccountLabel'])) $this->AccountLabel = $o['AccountLabel'];
        if (isset($o['Environment'])) $this->Environment = $o['Environment'];
        if (isset($o['LastActivityAt'])) $this->LastActivityAt = JsonConverters::from('DateTime', $o['LastActivityAt']);
        if (isset($o['ManageRoute'])) $this->ManageRoute = $o['ManageRoute'];
        if (isset($o['Actions'])) $this->Actions = JsonConverters::fromArray('string', $o['Actions']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Key)) $o['Key'] = $this->Key;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Category)) $o['Category'] = $this->Category;
        if (isset($this->Blurb)) $o['Blurb'] = $this->Blurb;
        if (isset($this->Mono)) $o['Mono'] = $this->Mono;
        if (isset($this->AuthMode)) $o['AuthMode'] = $this->AuthMode;
        if (isset($this->Available)) $o['Available'] = $this->Available;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->Health)) $o['Health'] = $this->Health;
        if (isset($this->StatusDetail)) $o['StatusDetail'] = $this->StatusDetail;
        if (isset($this->AccountLabel)) $o['AccountLabel'] = $this->AccountLabel;
        if (isset($this->Environment)) $o['Environment'] = $this->Environment;
        if (isset($this->LastActivityAt)) $o['LastActivityAt'] = JsonConverters::to('DateTime', $this->LastActivityAt);
        if (isset($this->ManageRoute)) $o['ManageRoute'] = $this->ManageRoute;
        if (isset($this->Actions)) $o['Actions'] = JsonConverters::toArray('string', $this->Actions);
        return empty($o) ? new class(){} : $o;
    }
}

class IntegrationsActionResponse implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Ok=null,
        /** @var string|null */
        public ?string $Message=null,
        /** @var string|null */
        public ?string $Url=null,
        /** @var ProviderView|null */
        public ?ProviderView $Provider=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

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

class IntegrationsActionRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Provider=null,
        /** @var string|null */
        public ?string $Action=null,
        /** @var string|null */
        public ?string $ApiKey=null,
        /** @var string|null */
        public ?string $FromDate=null,
        /** @var string|null */
        public ?string $ToDate=null
    ) {
    }

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

PHP IntegrationsActionRequest 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/integrations/{Provider}/{Action} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Provider: String,
	Action: String,
	ApiKey: String,
	FromDate: String,
	ToDate: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Ok: False,
	Message: String,
	Url: String,
	Provider: 
	{
		Key: String,
		Name: String,
		Category: String,
		Blurb: String,
		Mono: String,
		AuthMode: String,
		Available: False,
		Status: String,
		Health: String,
		StatusDetail: String,
		AccountLabel: String,
		Environment: String,
		LastActivityAt: 0001-01-01,
		ManageRoute: String,
		Actions: 
		[
			String
		]
	},
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}