| GET,PUT,DELETE,OPTIONS | /v1/lobby/content/{LobbyContentId} | ||
|---|---|---|---|
| GET,POST,OPTIONS | /v1/lobby/content |
<?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 LobbyContentRequest implements JsonSerializable
{
public function __construct(
/** @var int */
public int $LobbyContentId=0,
/** @var LobbyContentItem|null */
public ?LobbyContentItem $Item=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['LobbyContentId'])) $this->LobbyContentId = $o['LobbyContentId'];
if (isset($o['Item'])) $this->Item = JsonConverters::from('LobbyContentItem', $o['Item']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->LobbyContentId)) $o['LobbyContentId'] = $this->LobbyContentId;
if (isset($this->Item)) $o['Item'] = JsonConverters::to('LobbyContentItem', $this->Item);
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/lobby/content HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<LobbyContentRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Item>
<Accent>String</Accent>
<AllBranches>false</AllBranches>
<Body>String</Body>
<BranchIds xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:guid>00000000-0000-0000-0000-000000000000</d3p1:guid>
</BranchIds>
<CreatedBy>String</CreatedBy>
<DaysMask>0</DaysMask>
<DwellSec>0</DwellSec>
<EndsAt>0001-01-01T00:00:00</EndsAt>
<HasMedia>false</HasMedia>
<Headline>String</Headline>
<HourFrom>0</HourFrom>
<HourTo>0</HourTo>
<IsThirdParty>false</IsThirdParty>
<Kind>String</Kind>
<LobbyContentId>0</LobbyContentId>
<MediaUrl>String</MediaUrl>
<OnNow>false</OnNow>
<Plays7d>0</Plays7d>
<SortOrder>0</SortOrder>
<StartsAt>0001-01-01T00:00:00</StartsAt>
<Status>String</Status>
<Title>String</Title>
<UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
<Url>String</Url>
</Item>
<LobbyContentId>0</LobbyContentId>
</LobbyContentRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<LobbyContentResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Items>
<LobbyContentItem>
<Accent>String</Accent>
<AllBranches>false</AllBranches>
<Body>String</Body>
<BranchIds xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:guid>00000000-0000-0000-0000-000000000000</d4p1:guid>
</BranchIds>
<CreatedBy>String</CreatedBy>
<DaysMask>0</DaysMask>
<DwellSec>0</DwellSec>
<EndsAt>0001-01-01T00:00:00</EndsAt>
<HasMedia>false</HasMedia>
<Headline>String</Headline>
<HourFrom>0</HourFrom>
<HourTo>0</HourTo>
<IsThirdParty>false</IsThirdParty>
<Kind>String</Kind>
<LobbyContentId>0</LobbyContentId>
<MediaUrl>String</MediaUrl>
<OnNow>false</OnNow>
<Plays7d>0</Plays7d>
<SortOrder>0</SortOrder>
<StartsAt>0001-01-01T00:00:00</StartsAt>
<Status>String</Status>
<Title>String</Title>
<UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
<Url>String</Url>
</LobbyContentItem>
</Items>
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
</LobbyContentResponse>