Trendsic Platform Service

<back to all web services

DismissOnboardingRequest

Requires Authentication
The following routes are available for this service:
POST/v1/onboarding/dismiss
<?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 OnboardingLock implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Reason=null,
        /** @var string|null */
        public ?string $FeatureKey=null,
        /** @var string|null */
        public ?string $FeatureName=null,
        /** @var string|null */
        public ?string $ModuleKey=null,
        /** @var string|null */
        public ?string $ModuleName=null,
        /** @var DateTime|null */
        public ?DateTime $ExpiresAt=null,
        /** @var DateTime|null */
        public ?DateTime $RequestedAt=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Reason'])) $this->Reason = $o['Reason'];
        if (isset($o['FeatureKey'])) $this->FeatureKey = $o['FeatureKey'];
        if (isset($o['FeatureName'])) $this->FeatureName = $o['FeatureName'];
        if (isset($o['ModuleKey'])) $this->ModuleKey = $o['ModuleKey'];
        if (isset($o['ModuleName'])) $this->ModuleName = $o['ModuleName'];
        if (isset($o['ExpiresAt'])) $this->ExpiresAt = JsonConverters::from('DateTime', $o['ExpiresAt']);
        if (isset($o['RequestedAt'])) $this->RequestedAt = JsonConverters::from('DateTime', $o['RequestedAt']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Reason)) $o['Reason'] = $this->Reason;
        if (isset($this->FeatureKey)) $o['FeatureKey'] = $this->FeatureKey;
        if (isset($this->FeatureName)) $o['FeatureName'] = $this->FeatureName;
        if (isset($this->ModuleKey)) $o['ModuleKey'] = $this->ModuleKey;
        if (isset($this->ModuleName)) $o['ModuleName'] = $this->ModuleName;
        if (isset($this->ExpiresAt)) $o['ExpiresAt'] = JsonConverters::to('DateTime', $this->ExpiresAt);
        if (isset($this->RequestedAt)) $o['RequestedAt'] = JsonConverters::to('DateTime', $this->RequestedAt);
        return empty($o) ? new class(){} : $o;
    }
}

class OnboardingStep implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Key=null,
        /** @var string|null */
        public ?string $Chapter=null,
        /** @var string|null */
        public ?string $Title=null,
        /** @var string|null */
        public ?string $Why=null,
        /** @var string|null */
        public ?string $HelpHtml=null,
        /** @var string|null */
        public ?string $Icon=null,
        /** @var string|null */
        public ?string $CtaLabel=null,
        /** @var string|null */
        public ?string $CtaRoute=null,
        /** @var bool|null */
        public ?bool $Required=null,
        /** @var int */
        public int $State=0,
        /** @var bool|null */
        public ?bool $Done=null,
        /** @var bool|null */
        public ?bool $AutoDetected=null,
        /** @var int */
        public int $Count=0,
        /** @var array<string>|null */
        public ?array $Requires=null,
        /** @var bool|null */
        public ?bool $DetectsCount=null,
        /** @var string|null */
        public ?string $LockKey=null,
        /** @var OnboardingLock|null */
        public ?OnboardingLock $Locked=null,
        /** @var bool|null */
        public ?bool $InTrial=null,
        /** @var DateTime|null */
        public ?DateTime $TrialEndsAt=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Key'])) $this->Key = $o['Key'];
        if (isset($o['Chapter'])) $this->Chapter = $o['Chapter'];
        if (isset($o['Title'])) $this->Title = $o['Title'];
        if (isset($o['Why'])) $this->Why = $o['Why'];
        if (isset($o['HelpHtml'])) $this->HelpHtml = $o['HelpHtml'];
        if (isset($o['Icon'])) $this->Icon = $o['Icon'];
        if (isset($o['CtaLabel'])) $this->CtaLabel = $o['CtaLabel'];
        if (isset($o['CtaRoute'])) $this->CtaRoute = $o['CtaRoute'];
        if (isset($o['Required'])) $this->Required = $o['Required'];
        if (isset($o['State'])) $this->State = $o['State'];
        if (isset($o['Done'])) $this->Done = $o['Done'];
        if (isset($o['AutoDetected'])) $this->AutoDetected = $o['AutoDetected'];
        if (isset($o['Count'])) $this->Count = $o['Count'];
        if (isset($o['Requires'])) $this->Requires = JsonConverters::fromArray('string', $o['Requires']);
        if (isset($o['DetectsCount'])) $this->DetectsCount = $o['DetectsCount'];
        if (isset($o['LockKey'])) $this->LockKey = $o['LockKey'];
        if (isset($o['Locked'])) $this->Locked = JsonConverters::from('OnboardingLock', $o['Locked']);
        if (isset($o['InTrial'])) $this->InTrial = $o['InTrial'];
        if (isset($o['TrialEndsAt'])) $this->TrialEndsAt = JsonConverters::from('DateTime', $o['TrialEndsAt']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Key)) $o['Key'] = $this->Key;
        if (isset($this->Chapter)) $o['Chapter'] = $this->Chapter;
        if (isset($this->Title)) $o['Title'] = $this->Title;
        if (isset($this->Why)) $o['Why'] = $this->Why;
        if (isset($this->HelpHtml)) $o['HelpHtml'] = $this->HelpHtml;
        if (isset($this->Icon)) $o['Icon'] = $this->Icon;
        if (isset($this->CtaLabel)) $o['CtaLabel'] = $this->CtaLabel;
        if (isset($this->CtaRoute)) $o['CtaRoute'] = $this->CtaRoute;
        if (isset($this->Required)) $o['Required'] = $this->Required;
        if (isset($this->State)) $o['State'] = $this->State;
        if (isset($this->Done)) $o['Done'] = $this->Done;
        if (isset($this->AutoDetected)) $o['AutoDetected'] = $this->AutoDetected;
        if (isset($this->Count)) $o['Count'] = $this->Count;
        if (isset($this->Requires)) $o['Requires'] = JsonConverters::toArray('string', $this->Requires);
        if (isset($this->DetectsCount)) $o['DetectsCount'] = $this->DetectsCount;
        if (isset($this->LockKey)) $o['LockKey'] = $this->LockKey;
        if (isset($this->Locked)) $o['Locked'] = JsonConverters::to('OnboardingLock', $this->Locked);
        if (isset($this->InTrial)) $o['InTrial'] = $this->InTrial;
        if (isset($this->TrialEndsAt)) $o['TrialEndsAt'] = JsonConverters::to('DateTime', $this->TrialEndsAt);
        return empty($o) ? new class(){} : $o;
    }
}

class OnboardingChapter implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Color=null,
        /** @var int */
        public int $Total=0,
        /** @var int */
        public int $Satisfied=0,
        /** @var bool|null */
        public ?bool $Full=null,
        /** @var string|null */
        public ?string $Progress=null,
        /** @var string|null */
        public ?string $LockReason=null
    ) {
    }

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

class DispatchModuleView implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Key=null,
        /** @var string|null */
        public ?string $Mode=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $What=null,
        /** @var bool|null */
        public ?bool $Allowed=null,
        /** @var bool|null */
        public ?bool $Enabled=null,
        /** @var bool|null */
        public ?bool $InPack=null,
        /** @var array<string>|null */
        public ?array $Adds=null,
        /** @var string|null */
        public ?string $GoScreens=null,
        /** @var bool|null */
        public ?bool $Fleet=null,
        /** @var int */
        public int $InFlight=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Key'])) $this->Key = $o['Key'];
        if (isset($o['Mode'])) $this->Mode = $o['Mode'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['What'])) $this->What = $o['What'];
        if (isset($o['Allowed'])) $this->Allowed = $o['Allowed'];
        if (isset($o['Enabled'])) $this->Enabled = $o['Enabled'];
        if (isset($o['InPack'])) $this->InPack = $o['InPack'];
        if (isset($o['Adds'])) $this->Adds = JsonConverters::fromArray('string', $o['Adds']);
        if (isset($o['GoScreens'])) $this->GoScreens = $o['GoScreens'];
        if (isset($o['Fleet'])) $this->Fleet = $o['Fleet'];
        if (isset($o['InFlight'])) $this->InFlight = $o['InFlight'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Key)) $o['Key'] = $this->Key;
        if (isset($this->Mode)) $o['Mode'] = $this->Mode;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->What)) $o['What'] = $this->What;
        if (isset($this->Allowed)) $o['Allowed'] = $this->Allowed;
        if (isset($this->Enabled)) $o['Enabled'] = $this->Enabled;
        if (isset($this->InPack)) $o['InPack'] = $this->InPack;
        if (isset($this->Adds)) $o['Adds'] = JsonConverters::toArray('string', $this->Adds);
        if (isset($this->GoScreens)) $o['GoScreens'] = $this->GoScreens;
        if (isset($this->Fleet)) $o['Fleet'] = $this->Fleet;
        if (isset($this->InFlight)) $o['InFlight'] = $this->InFlight;
        return empty($o) ? new class(){} : $o;
    }
}

class OnboardingStatus implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $TenantName=null,
        /** @var string|null */
        public ?string $PropertyTerm=null,
        /** @var array<OnboardingStep>|null */
        public ?array $Steps=null,
        /** @var int */
        public int $TotalSteps=0,
        /** @var int */
        public int $DoneSteps=0,
        /** @var int */
        public int $SatisfiedSteps=0,
        /** @var int */
        public int $RequiredTotal=0,
        /** @var int */
        public int $RequiredDone=0,
        /** @var int */
        public int $PercentComplete=0,
        /** @var bool|null */
        public ?bool $IsComplete=null,
        /** @var bool|null */
        public ?bool $Dismissed=null,
        /** @var array<OnboardingChapter>|null */
        public ?array $Chapters=null,
        /** @var array<DispatchModuleView>|null */
        public ?array $DriverServices=null,
        /** @var bool|null */
        public ?bool $DriverServicesOn=null,
        /** @var int */
        public int $ModulesOn=0,
        /** @var int */
        public int $ModulesSkipped=0,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['TenantName'])) $this->TenantName = $o['TenantName'];
        if (isset($o['PropertyTerm'])) $this->PropertyTerm = $o['PropertyTerm'];
        if (isset($o['Steps'])) $this->Steps = JsonConverters::fromArray('OnboardingStep', $o['Steps']);
        if (isset($o['TotalSteps'])) $this->TotalSteps = $o['TotalSteps'];
        if (isset($o['DoneSteps'])) $this->DoneSteps = $o['DoneSteps'];
        if (isset($o['SatisfiedSteps'])) $this->SatisfiedSteps = $o['SatisfiedSteps'];
        if (isset($o['RequiredTotal'])) $this->RequiredTotal = $o['RequiredTotal'];
        if (isset($o['RequiredDone'])) $this->RequiredDone = $o['RequiredDone'];
        if (isset($o['PercentComplete'])) $this->PercentComplete = $o['PercentComplete'];
        if (isset($o['IsComplete'])) $this->IsComplete = $o['IsComplete'];
        if (isset($o['Dismissed'])) $this->Dismissed = $o['Dismissed'];
        if (isset($o['Chapters'])) $this->Chapters = JsonConverters::fromArray('OnboardingChapter', $o['Chapters']);
        if (isset($o['DriverServices'])) $this->DriverServices = JsonConverters::fromArray('DispatchModuleView', $o['DriverServices']);
        if (isset($o['DriverServicesOn'])) $this->DriverServicesOn = $o['DriverServicesOn'];
        if (isset($o['ModulesOn'])) $this->ModulesOn = $o['ModulesOn'];
        if (isset($o['ModulesSkipped'])) $this->ModulesSkipped = $o['ModulesSkipped'];
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->TenantName)) $o['TenantName'] = $this->TenantName;
        if (isset($this->PropertyTerm)) $o['PropertyTerm'] = $this->PropertyTerm;
        if (isset($this->Steps)) $o['Steps'] = JsonConverters::toArray('OnboardingStep', $this->Steps);
        if (isset($this->TotalSteps)) $o['TotalSteps'] = $this->TotalSteps;
        if (isset($this->DoneSteps)) $o['DoneSteps'] = $this->DoneSteps;
        if (isset($this->SatisfiedSteps)) $o['SatisfiedSteps'] = $this->SatisfiedSteps;
        if (isset($this->RequiredTotal)) $o['RequiredTotal'] = $this->RequiredTotal;
        if (isset($this->RequiredDone)) $o['RequiredDone'] = $this->RequiredDone;
        if (isset($this->PercentComplete)) $o['PercentComplete'] = $this->PercentComplete;
        if (isset($this->IsComplete)) $o['IsComplete'] = $this->IsComplete;
        if (isset($this->Dismissed)) $o['Dismissed'] = $this->Dismissed;
        if (isset($this->Chapters)) $o['Chapters'] = JsonConverters::toArray('OnboardingChapter', $this->Chapters);
        if (isset($this->DriverServices)) $o['DriverServices'] = JsonConverters::toArray('DispatchModuleView', $this->DriverServices);
        if (isset($this->DriverServicesOn)) $o['DriverServicesOn'] = $this->DriverServicesOn;
        if (isset($this->ModulesOn)) $o['ModulesOn'] = $this->ModulesOn;
        if (isset($this->ModulesSkipped)) $o['ModulesSkipped'] = $this->ModulesSkipped;
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class DismissOnboardingRequest implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Dismissed=null
    ) {
    }

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

PHP DismissOnboardingRequest 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/onboarding/dismiss HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Dismissed: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	TenantName: String,
	PropertyTerm: String,
	Steps: 
	[
		{
			Key: String,
			Chapter: String,
			Title: String,
			Why: String,
			HelpHtml: String,
			Icon: String,
			CtaLabel: String,
			CtaRoute: String,
			Required: False,
			State: 0,
			Done: False,
			AutoDetected: False,
			Count: 0,
			Requires: 
			[
				String
			],
			DetectsCount: False,
			LockKey: String,
			Locked: 
			{
				Reason: String,
				FeatureKey: String,
				FeatureName: String,
				ModuleKey: String,
				ModuleName: String,
				ExpiresAt: 0001-01-01,
				RequestedAt: 0001-01-01
			},
			InTrial: False,
			TrialEndsAt: 0001-01-01
		}
	],
	TotalSteps: 0,
	DoneSteps: 0,
	SatisfiedSteps: 0,
	RequiredTotal: 0,
	RequiredDone: 0,
	PercentComplete: 0,
	IsComplete: False,
	Dismissed: False,
	Chapters: 
	[
		{
			Name: String,
			Color: String,
			Total: 0,
			Satisfied: 0,
			Full: False,
			Progress: String,
			LockReason: String
		}
	],
	DriverServices: 
	[
		{
			Key: String,
			Mode: String,
			Name: String,
			What: String,
			Allowed: False,
			Enabled: False,
			InPack: False,
			Adds: 
			[
				String
			],
			GoScreens: String,
			Fleet: False,
			InFlight: 0
		}
	],
	DriverServicesOn: False,
	ModulesOn: 0,
	ModulesSkipped: 0,
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}