Trendsic Platform Service

<back to all web services

LobbyPlayRequest

The following routes are available for this service:
GET,OPTIONS/v1/lobby/{LocationId}/play
<?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 LobbyContentItem implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $LobbyContentId=0,
        /** @var string|null */
        public ?string $Title=null,
        /** @var string|null */
        public ?string $Kind=null,
        /** @var bool|null */
        public ?bool $HasMedia=null,
        /** @var string|null */
        public ?string $MediaUrl=null,
        /** @var string|null */
        public ?string $Headline=null,
        /** @var string|null */
        public ?string $Body=null,
        /** @var string|null */
        public ?string $Accent=null,
        /** @var string|null */
        public ?string $Url=null,
        /** @var int */
        public int $DwellSec=0,
        /** @var DateTime|null */
        public ?DateTime $StartsAt=null,
        /** @var DateTime|null */
        public ?DateTime $EndsAt=null,
        /** @var int */
        public int $DaysMask=0,
        /** @var int|null */
        public ?int $HourFrom=null,
        /** @var int|null */
        public ?int $HourTo=null,
        /** @var bool|null */
        public ?bool $IsThirdParty=null,
        /** @var string|null */
        public ?string $Status=null,
        /** @var bool|null */
        public ?bool $AllBranches=null,
        /** @var array<string>|null */
        public ?array $BranchIds=null,
        /** @var int */
        public int $Plays7d=0,
        /** @var bool|null */
        public ?bool $OnNow=null,
        /** @var int */
        public int $SortOrder=0,
        /** @var string|null */
        public ?string $CreatedBy=null,
        /** @var DateTime|null */
        public ?DateTime $UpdatedAt=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['LobbyContentId'])) $this->LobbyContentId = $o['LobbyContentId'];
        if (isset($o['Title'])) $this->Title = $o['Title'];
        if (isset($o['Kind'])) $this->Kind = $o['Kind'];
        if (isset($o['HasMedia'])) $this->HasMedia = $o['HasMedia'];
        if (isset($o['MediaUrl'])) $this->MediaUrl = $o['MediaUrl'];
        if (isset($o['Headline'])) $this->Headline = $o['Headline'];
        if (isset($o['Body'])) $this->Body = $o['Body'];
        if (isset($o['Accent'])) $this->Accent = $o['Accent'];
        if (isset($o['Url'])) $this->Url = $o['Url'];
        if (isset($o['DwellSec'])) $this->DwellSec = $o['DwellSec'];
        if (isset($o['StartsAt'])) $this->StartsAt = JsonConverters::from('DateTime', $o['StartsAt']);
        if (isset($o['EndsAt'])) $this->EndsAt = JsonConverters::from('DateTime', $o['EndsAt']);
        if (isset($o['DaysMask'])) $this->DaysMask = $o['DaysMask'];
        if (isset($o['HourFrom'])) $this->HourFrom = $o['HourFrom'];
        if (isset($o['HourTo'])) $this->HourTo = $o['HourTo'];
        if (isset($o['IsThirdParty'])) $this->IsThirdParty = $o['IsThirdParty'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['AllBranches'])) $this->AllBranches = $o['AllBranches'];
        if (isset($o['BranchIds'])) $this->BranchIds = JsonConverters::fromArray('Guid', $o['BranchIds']);
        if (isset($o['Plays7d'])) $this->Plays7d = $o['Plays7d'];
        if (isset($o['OnNow'])) $this->OnNow = $o['OnNow'];
        if (isset($o['SortOrder'])) $this->SortOrder = $o['SortOrder'];
        if (isset($o['CreatedBy'])) $this->CreatedBy = $o['CreatedBy'];
        if (isset($o['UpdatedAt'])) $this->UpdatedAt = JsonConverters::from('DateTime', $o['UpdatedAt']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->LobbyContentId)) $o['LobbyContentId'] = $this->LobbyContentId;
        if (isset($this->Title)) $o['Title'] = $this->Title;
        if (isset($this->Kind)) $o['Kind'] = $this->Kind;
        if (isset($this->HasMedia)) $o['HasMedia'] = $this->HasMedia;
        if (isset($this->MediaUrl)) $o['MediaUrl'] = $this->MediaUrl;
        if (isset($this->Headline)) $o['Headline'] = $this->Headline;
        if (isset($this->Body)) $o['Body'] = $this->Body;
        if (isset($this->Accent)) $o['Accent'] = $this->Accent;
        if (isset($this->Url)) $o['Url'] = $this->Url;
        if (isset($this->DwellSec)) $o['DwellSec'] = $this->DwellSec;
        if (isset($this->StartsAt)) $o['StartsAt'] = JsonConverters::to('DateTime', $this->StartsAt);
        if (isset($this->EndsAt)) $o['EndsAt'] = JsonConverters::to('DateTime', $this->EndsAt);
        if (isset($this->DaysMask)) $o['DaysMask'] = $this->DaysMask;
        if (isset($this->HourFrom)) $o['HourFrom'] = $this->HourFrom;
        if (isset($this->HourTo)) $o['HourTo'] = $this->HourTo;
        if (isset($this->IsThirdParty)) $o['IsThirdParty'] = $this->IsThirdParty;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->AllBranches)) $o['AllBranches'] = $this->AllBranches;
        if (isset($this->BranchIds)) $o['BranchIds'] = JsonConverters::toArray('Guid', $this->BranchIds);
        if (isset($this->Plays7d)) $o['Plays7d'] = $this->Plays7d;
        if (isset($this->OnNow)) $o['OnNow'] = $this->OnNow;
        if (isset($this->SortOrder)) $o['SortOrder'] = $this->SortOrder;
        if (isset($this->CreatedBy)) $o['CreatedBy'] = $this->CreatedBy;
        if (isset($this->UpdatedAt)) $o['UpdatedAt'] = JsonConverters::to('DateTime', $this->UpdatedAt);
        return empty($o) ? new class(){} : $o;
    }
}

class LobbyPlayResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var array<LobbyContentItem>|null */
        public ?array $Items=null,
        /** @var string|null */
        public ?string $ZoneMode=null,
        /** @var int|null */
        public ?int $TakeoverEveryMin=null,
        /** @var int|null */
        public ?int $TakeoverSec=null,
        /** @var bool|null */
        public ?bool $IdleScreen=null,
        /** @var DateTime */
        public DateTime $BranchLocalNow=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
        if (isset($o['Items'])) $this->Items = JsonConverters::fromArray('LobbyContentItem', $o['Items']);
        if (isset($o['ZoneMode'])) $this->ZoneMode = $o['ZoneMode'];
        if (isset($o['TakeoverEveryMin'])) $this->TakeoverEveryMin = $o['TakeoverEveryMin'];
        if (isset($o['TakeoverSec'])) $this->TakeoverSec = $o['TakeoverSec'];
        if (isset($o['IdleScreen'])) $this->IdleScreen = $o['IdleScreen'];
        if (isset($o['BranchLocalNow'])) $this->BranchLocalNow = JsonConverters::from('DateTime', $o['BranchLocalNow']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        if (isset($this->Items)) $o['Items'] = JsonConverters::toArray('LobbyContentItem', $this->Items);
        if (isset($this->ZoneMode)) $o['ZoneMode'] = $this->ZoneMode;
        if (isset($this->TakeoverEveryMin)) $o['TakeoverEveryMin'] = $this->TakeoverEveryMin;
        if (isset($this->TakeoverSec)) $o['TakeoverSec'] = $this->TakeoverSec;
        if (isset($this->IdleScreen)) $o['IdleScreen'] = $this->IdleScreen;
        if (isset($this->BranchLocalNow)) $o['BranchLocalNow'] = JsonConverters::to('DateTime', $this->BranchLocalNow);
        return empty($o) ? new class(){} : $o;
    }
}

class LobbyPlayRequest implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $LocationId=''
    ) {
    }

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

PHP LobbyPlayRequest 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/lobby/{LocationId}/play HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
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
		}
	},
	Items: 
	[
		{
			LobbyContentId: 0,
			Title: String,
			Kind: String,
			HasMedia: False,
			MediaUrl: String,
			Headline: String,
			Body: String,
			Accent: String,
			Url: String,
			DwellSec: 0,
			StartsAt: 0001-01-01,
			EndsAt: 0001-01-01,
			DaysMask: 0,
			HourFrom: 0,
			HourTo: 0,
			IsThirdParty: False,
			Status: String,
			AllBranches: False,
			BranchIds: 
			[
				00000000000000000000000000000000
			],
			Plays7d: 0,
			OnNow: False,
			SortOrder: 0,
			CreatedBy: String,
			UpdatedAt: 0001-01-01
		}
	],
	ZoneMode: String,
	TakeoverEveryMin: 0,
	TakeoverSec: 0,
	IdleScreen: False,
	BranchLocalNow: 0001-01-01
}