GET | /RestApi/ab-testing/edit-page-selector |
---|
<?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 GetABTestEditPageSelector implements IHasConnectionError, JsonSerializable
{
public function __construct(
/** @var string */
public string $PageNodeId='',
/** @var string|null */
public ?string $Culture=null,
/** @var bool|null */
public ?bool $HasConnectionConfigurationError=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['PageNodeId'])) $this->PageNodeId = $o['PageNodeId'];
if (isset($o['Culture'])) $this->Culture = $o['Culture'];
if (isset($o['HasConnectionConfigurationError'])) $this->HasConnectionConfigurationError = $o['HasConnectionConfigurationError'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->PageNodeId)) $o['PageNodeId'] = $this->PageNodeId;
if (isset($this->Culture)) $o['Culture'] = $this->Culture;
if (isset($this->HasConnectionConfigurationError)) $o['HasConnectionConfigurationError'] = $this->HasConnectionConfigurationError;
return empty($o) ? new class(){} : $o;
}
}
enum ABTestStatus : string
{
case NotStarted = 'NotStarted';
case Scheduled = 'Scheduled';
case Active = 'Active';
case Stopped = 'Stopped';
case Ended = 'Ended';
}
class ABTestVariationViewModel implements JsonSerializable
{
public function __construct(
/** @var string */
public string $VariatonId='',
/** @var string|null */
public ?string $VariationName=null,
/** @var string|null */
public ?string $VariationLink=null,
/** @var bool|null */
public ?bool $IsWinner=null,
/** @var int */
public int $Ordinal=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['VariatonId'])) $this->VariatonId = $o['VariatonId'];
if (isset($o['VariationName'])) $this->VariationName = $o['VariationName'];
if (isset($o['VariationLink'])) $this->VariationLink = $o['VariationLink'];
if (isset($o['IsWinner'])) $this->IsWinner = $o['IsWinner'];
if (isset($o['Ordinal'])) $this->Ordinal = $o['Ordinal'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->VariatonId)) $o['VariatonId'] = $this->VariatonId;
if (isset($this->VariationName)) $o['VariationName'] = $this->VariationName;
if (isset($this->VariationLink)) $o['VariationLink'] = $this->VariationLink;
if (isset($this->IsWinner)) $o['IsWinner'] = $this->IsWinner;
if (isset($this->Ordinal)) $o['Ordinal'] = $this->Ordinal;
return empty($o) ? new class(){} : $o;
}
}
class ABTestEditPageSelectorViewModel implements JsonSerializable
{
public function __construct(
/** @var string */
public string $Id='',
/** @var ABTestStatus|null */
public ?ABTestStatus $Status=null,
/** @var array<ABTestVariationViewModel>|null */
public ?array $Variations=null,
/** @var string|null */
public ?string $PreviewLink=null,
/** @var bool|null */
public ?bool $AbTestingApiServerHasConnection=null,
/** @var bool|null */
public ?bool $HasConnectionConfigurationError=null,
/** @var string|null */
public ?string $WarningMessage=null,
/** @var bool|null */
public ?bool $ApiKeyChanged=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Status'])) $this->Status = JsonConverters::from('ABTestStatus', $o['Status']);
if (isset($o['Variations'])) $this->Variations = JsonConverters::fromArray('ABTestVariationViewModel', $o['Variations']);
if (isset($o['PreviewLink'])) $this->PreviewLink = $o['PreviewLink'];
if (isset($o['AbTestingApiServerHasConnection'])) $this->AbTestingApiServerHasConnection = $o['AbTestingApiServerHasConnection'];
if (isset($o['HasConnectionConfigurationError'])) $this->HasConnectionConfigurationError = $o['HasConnectionConfigurationError'];
if (isset($o['WarningMessage'])) $this->WarningMessage = $o['WarningMessage'];
if (isset($o['ApiKeyChanged'])) $this->ApiKeyChanged = $o['ApiKeyChanged'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Status)) $o['Status'] = JsonConverters::to('ABTestStatus', $this->Status);
if (isset($this->Variations)) $o['Variations'] = JsonConverters::toArray('ABTestVariationViewModel', $this->Variations);
if (isset($this->PreviewLink)) $o['PreviewLink'] = $this->PreviewLink;
if (isset($this->AbTestingApiServerHasConnection)) $o['AbTestingApiServerHasConnection'] = $this->AbTestingApiServerHasConnection;
if (isset($this->HasConnectionConfigurationError)) $o['HasConnectionConfigurationError'] = $this->HasConnectionConfigurationError;
if (isset($this->WarningMessage)) $o['WarningMessage'] = $this->WarningMessage;
if (isset($this->ApiKeyChanged)) $o['ApiKeyChanged'] = $this->ApiKeyChanged;
return empty($o) ? new class(){} : $o;
}
}
PHP GetABTestEditPageSelector 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.
GET /RestApi/ab-testing/edit-page-selector HTTP/1.1 Host: www.asg.com.au Accept: text/jsonl
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"Status":"NotStarted","PreviewLink":"String","AbTestingApiServerHasConnection":false,"HasConnectionConfigurationError":false,"WarningMessage":"String","ApiKeyChanged":false}