Trendsic Platform Service

<back to all web services

EngineWorkflowArchivePreviewRequest

Requires Authentication
The following routes are available for this service:
GET/v1/engine/workflows/{WorkflowId}/archive
<?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 WorkflowArchivePreview implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $WorkflowId=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Status=null,
        /** @var string|null */
        public ?string $Trigger=null,
        /** @var int */
        public int $Queued=0,
        /** @var int */
        public int $Waiting=0,
        /** @var int */
        public int $Running=0,
        /** @var string|null */
        public ?string $Refusal=null,
        /** @var bool|null */
        public ?bool $HasPendingRequest=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['WorkflowId'])) $this->WorkflowId = $o['WorkflowId'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['Trigger'])) $this->Trigger = $o['Trigger'];
        if (isset($o['Queued'])) $this->Queued = $o['Queued'];
        if (isset($o['Waiting'])) $this->Waiting = $o['Waiting'];
        if (isset($o['Running'])) $this->Running = $o['Running'];
        if (isset($o['Refusal'])) $this->Refusal = $o['Refusal'];
        if (isset($o['HasPendingRequest'])) $this->HasPendingRequest = $o['HasPendingRequest'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->WorkflowId)) $o['WorkflowId'] = $this->WorkflowId;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->Trigger)) $o['Trigger'] = $this->Trigger;
        if (isset($this->Queued)) $o['Queued'] = $this->Queued;
        if (isset($this->Waiting)) $o['Waiting'] = $this->Waiting;
        if (isset($this->Running)) $o['Running'] = $this->Running;
        if (isset($this->Refusal)) $o['Refusal'] = $this->Refusal;
        if (isset($this->HasPendingRequest)) $o['HasPendingRequest'] = $this->HasPendingRequest;
        return empty($o) ? new class(){} : $o;
    }
}

class EngineWorkflowArchivePreviewResponse implements JsonSerializable
{
    public function __construct(
        /** @var WorkflowArchivePreview|null */
        public ?WorkflowArchivePreview $Preview=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

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

class EngineWorkflowArchivePreviewRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $WorkflowId=0
    ) {
    }

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

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

GET /v1/engine/workflows/{WorkflowId}/archive HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Preview: 
	{
		WorkflowId: 0,
		Name: String,
		Status: String,
		Trigger: String,
		Queued: 0,
		Waiting: 0,
		Running: 0,
		Refusal: String,
		HasPendingRequest: False
	},
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}