| POST,OPTIONS | /v1/lobby/content/{LobbyContentId}/media |
|---|
<?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 LobbyContentResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<LobbyContentItem>|null */
public ?array $Items=null
) {
}
/** @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']);
}
/** @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);
return empty($o) ? new class(){} : $o;
}
}
class LobbyContentMediaRequest implements JsonSerializable
{
public function __construct(
/** @var int */
public int $LobbyContentId=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['LobbyContentId'])) $this->LobbyContentId = $o['LobbyContentId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->LobbyContentId)) $o['LobbyContentId'] = $this->LobbyContentId;
return empty($o) ? new class(){} : $o;
}
}
PHP LobbyContentMediaRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/lobby/content/{LobbyContentId}/media HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"LobbyContentId":0}
HTTP/1.1 200 OK
Content-Type: text/jsonl
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-01T00:00:00.0000000","EndsAt":"0001-01-01T00:00:00.0000000","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-01T00:00:00.0000000"}]}