GET | /RestApi/Sitefinity/mobile-formats/preview |
---|
<?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};
enum ContentLifecycleStatus : int
{
case Master = 0;
case Temp = 1;
case Live = 2;
case Deleted = 4;
case PartialTemp = 8;
}
class MobileFormatPreviewDto implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $MobileFormatSettingName=null,
/** @var string|null */
public ?string $ContentTypeFullname=null,
/** @var string|null */
public ?string $ProviderName=null,
/** @var string|null */
public ?string $ItemUrlName=null,
/** @var ContentLifecycleStatus|null */
public ?ContentLifecycleStatus $Status=null,
/** @var string|null */
public ?string $SiteId=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['MobileFormatSettingName'])) $this->MobileFormatSettingName = $o['MobileFormatSettingName'];
if (isset($o['ContentTypeFullname'])) $this->ContentTypeFullname = $o['ContentTypeFullname'];
if (isset($o['ProviderName'])) $this->ProviderName = $o['ProviderName'];
if (isset($o['ItemUrlName'])) $this->ItemUrlName = $o['ItemUrlName'];
if (isset($o['Status'])) $this->Status = JsonConverters::from('ContentLifecycleStatus', $o['Status']);
if (isset($o['SiteId'])) $this->SiteId = $o['SiteId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->MobileFormatSettingName)) $o['MobileFormatSettingName'] = $this->MobileFormatSettingName;
if (isset($this->ContentTypeFullname)) $o['ContentTypeFullname'] = $this->ContentTypeFullname;
if (isset($this->ProviderName)) $o['ProviderName'] = $this->ProviderName;
if (isset($this->ItemUrlName)) $o['ItemUrlName'] = $this->ItemUrlName;
if (isset($this->Status)) $o['Status'] = JsonConverters::to('ContentLifecycleStatus', $this->Status);
if (isset($this->SiteId)) $o['SiteId'] = $this->SiteId;
return empty($o) ? new class(){} : $o;
}
}
class MobileFormatPreviewUrlDto implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $ItemTitle=null,
/** @var string|null */
public ?string $MobileFormatUrl=null,
/** @var string|null */
public ?string $MobileFormatPreviewUrl=null,
/** @var string|null */
public ?string $ErrorMessage=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ItemTitle'])) $this->ItemTitle = $o['ItemTitle'];
if (isset($o['MobileFormatUrl'])) $this->MobileFormatUrl = $o['MobileFormatUrl'];
if (isset($o['MobileFormatPreviewUrl'])) $this->MobileFormatPreviewUrl = $o['MobileFormatPreviewUrl'];
if (isset($o['ErrorMessage'])) $this->ErrorMessage = $o['ErrorMessage'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ItemTitle)) $o['ItemTitle'] = $this->ItemTitle;
if (isset($this->MobileFormatUrl)) $o['MobileFormatUrl'] = $this->MobileFormatUrl;
if (isset($this->MobileFormatPreviewUrl)) $o['MobileFormatPreviewUrl'] = $this->MobileFormatPreviewUrl;
if (isset($this->ErrorMessage)) $o['ErrorMessage'] = $this->ErrorMessage;
return empty($o) ? new class(){} : $o;
}
}
PHP MobileFormatPreviewDto DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /RestApi/Sitefinity/mobile-formats/preview HTTP/1.1 Host: www.asg.com.au Accept: text/csv
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"ItemTitle":"String","MobileFormatUrl":"String","MobileFormatPreviewUrl":"String","ErrorMessage":"String"}