PUT | /RestApi/lists-api/items |
---|
<?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 SpecificListsGetRequest implements JsonSerializable
{
public function __construct(
/** @var string[]|null */
public ?array $Ids=null,
/** @var string|null */
public ?string $Provider=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Ids'])) $this->Ids = JsonConverters::fromArray('string', $o['Ids']);
if (isset($o['Provider'])) $this->Provider = $o['Provider'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Ids)) $o['Ids'] = JsonConverters::toArray('string', $this->Ids);
if (isset($this->Provider)) $o['Provider'] = $this->Provider;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class Status implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string|null */
public ?string $Text=null,
// @DataMember
/** @var string|null */
public ?string $PrimaryProvider=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Text'])) $this->Text = $o['Text'];
if (isset($o['PrimaryProvider'])) $this->PrimaryProvider = $o['PrimaryProvider'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Text)) $o['Text'] = $this->Text;
if (isset($this->PrimaryProvider)) $o['PrimaryProvider'] = $this->PrimaryProvider;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class WcfContentLifecycleStatus implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var bool|null */
public ?bool $IsPublished=null,
// @DataMember
/** @var string|null */
public ?string $Message=null,
// @DataMember
/** @var string|null */
public ?string $LockedByUsername=null,
// @DataMember
/** @var bool|null */
public ?bool $IsAdmin=null,
// @DataMember
/** @var bool|null */
public ?bool $IsLocked=null,
// @DataMember
/** @var bool|null */
public ?bool $IsLockedByMe=null,
// @DataMember
/** @var bool|null */
public ?bool $SupportsContentLifecycle=null,
// @DataMember
/** @var string|null */
public ?string $ErrorMessage=null,
// @DataMember
/** @var DateTime|null */
public ?DateTime $LockedSince=null,
// @DataMember
/** @var DateTime|null */
public ?DateTime $LastModified=null,
// @DataMember
/** @var string|null */
public ?string $LastModifiedBy=null,
// @DataMember
/** @var DateTime|null */
public ?DateTime $PublicationDate=null,
// @DataMember
/** @var string|null */
public ?string $WorkflowStatus=null,
// @DataMember
/** @var bool|null */
public ?bool $HasLiveVersion=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['IsPublished'])) $this->IsPublished = $o['IsPublished'];
if (isset($o['Message'])) $this->Message = $o['Message'];
if (isset($o['LockedByUsername'])) $this->LockedByUsername = $o['LockedByUsername'];
if (isset($o['IsAdmin'])) $this->IsAdmin = $o['IsAdmin'];
if (isset($o['IsLocked'])) $this->IsLocked = $o['IsLocked'];
if (isset($o['IsLockedByMe'])) $this->IsLockedByMe = $o['IsLockedByMe'];
if (isset($o['SupportsContentLifecycle'])) $this->SupportsContentLifecycle = $o['SupportsContentLifecycle'];
if (isset($o['ErrorMessage'])) $this->ErrorMessage = $o['ErrorMessage'];
if (isset($o['LockedSince'])) $this->LockedSince = JsonConverters::from('DateTime', $o['LockedSince']);
if (isset($o['LastModified'])) $this->LastModified = JsonConverters::from('DateTime', $o['LastModified']);
if (isset($o['LastModifiedBy'])) $this->LastModifiedBy = $o['LastModifiedBy'];
if (isset($o['PublicationDate'])) $this->PublicationDate = JsonConverters::from('DateTime', $o['PublicationDate']);
if (isset($o['WorkflowStatus'])) $this->WorkflowStatus = $o['WorkflowStatus'];
if (isset($o['HasLiveVersion'])) $this->HasLiveVersion = $o['HasLiveVersion'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->IsPublished)) $o['IsPublished'] = $this->IsPublished;
if (isset($this->Message)) $o['Message'] = $this->Message;
if (isset($this->LockedByUsername)) $o['LockedByUsername'] = $this->LockedByUsername;
if (isset($this->IsAdmin)) $o['IsAdmin'] = $this->IsAdmin;
if (isset($this->IsLocked)) $o['IsLocked'] = $this->IsLocked;
if (isset($this->IsLockedByMe)) $o['IsLockedByMe'] = $this->IsLockedByMe;
if (isset($this->SupportsContentLifecycle)) $o['SupportsContentLifecycle'] = $this->SupportsContentLifecycle;
if (isset($this->ErrorMessage)) $o['ErrorMessage'] = $this->ErrorMessage;
if (isset($this->LockedSince)) $o['LockedSince'] = JsonConverters::to('DateTime', $this->LockedSince);
if (isset($this->LastModified)) $o['LastModified'] = JsonConverters::to('DateTime', $this->LastModified);
if (isset($this->LastModifiedBy)) $o['LastModifiedBy'] = $this->LastModifiedBy;
if (isset($this->PublicationDate)) $o['PublicationDate'] = JsonConverters::to('DateTime', $this->PublicationDate);
if (isset($this->WorkflowStatus)) $o['WorkflowStatus'] = $this->WorkflowStatus;
if (isset($this->HasLiveVersion)) $o['HasLiveVersion'] = $this->HasLiveVersion;
return empty($o) ? new class(){} : $o;
}
}
enum WorkflowVisualType : string
{
case Button = 'Button';
case Link = 'Link';
case Label = 'Label';
}
// @DataContract
class WorkflowVisualElement implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string|null */
public ?string $Title=null,
// @DataMember
/** @var string|null */
public ?string $OperationName=null,
// @DataMember
/** @var string|null */
public ?string $ArgumentDialogName=null,
// @DataMember
/** @var WorkflowVisualType|null */
public ?WorkflowVisualType $VisualType=null,
// @DataMember
/** @var string|null */
public ?string $DecisionType=null,
// @DataMember
/** @var bool|null */
public ?bool $PersistOnDecision=null,
// @DataMember
/** @var bool|null */
public ?bool $ClosesForm=null,
// @DataMember
/** @var string|null */
public ?string $ContentCommandName=null,
// @DataMember
/** @var string|null */
public ?string $CssClass=null,
// @DataMember
/** @var int */
public int $Ordinal=0,
// @DataMember
/** @var string|null */
public ?string $WarningMessage=null,
// @DataMember
/** @var bool|null */
public ?bool $RunAsUICommand=null,
// @DataMember
/** @var Hashtable|null */
public ?Hashtable $Parameters=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Title'])) $this->Title = $o['Title'];
if (isset($o['OperationName'])) $this->OperationName = $o['OperationName'];
if (isset($o['ArgumentDialogName'])) $this->ArgumentDialogName = $o['ArgumentDialogName'];
if (isset($o['VisualType'])) $this->VisualType = JsonConverters::from('WorkflowVisualType', $o['VisualType']);
if (isset($o['DecisionType'])) $this->DecisionType = $o['DecisionType'];
if (isset($o['PersistOnDecision'])) $this->PersistOnDecision = $o['PersistOnDecision'];
if (isset($o['ClosesForm'])) $this->ClosesForm = $o['ClosesForm'];
if (isset($o['ContentCommandName'])) $this->ContentCommandName = $o['ContentCommandName'];
if (isset($o['CssClass'])) $this->CssClass = $o['CssClass'];
if (isset($o['Ordinal'])) $this->Ordinal = $o['Ordinal'];
if (isset($o['WarningMessage'])) $this->WarningMessage = $o['WarningMessage'];
if (isset($o['RunAsUICommand'])) $this->RunAsUICommand = $o['RunAsUICommand'];
if (isset($o['Parameters'])) $this->Parameters = JsonConverters::from('Hashtable', $o['Parameters']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Title)) $o['Title'] = $this->Title;
if (isset($this->OperationName)) $o['OperationName'] = $this->OperationName;
if (isset($this->ArgumentDialogName)) $o['ArgumentDialogName'] = $this->ArgumentDialogName;
if (isset($this->VisualType)) $o['VisualType'] = JsonConverters::to('WorkflowVisualType', $this->VisualType);
if (isset($this->DecisionType)) $o['DecisionType'] = $this->DecisionType;
if (isset($this->PersistOnDecision)) $o['PersistOnDecision'] = $this->PersistOnDecision;
if (isset($this->ClosesForm)) $o['ClosesForm'] = $this->ClosesForm;
if (isset($this->ContentCommandName)) $o['ContentCommandName'] = $this->ContentCommandName;
if (isset($this->CssClass)) $o['CssClass'] = $this->CssClass;
if (isset($this->Ordinal)) $o['Ordinal'] = $this->Ordinal;
if (isset($this->WarningMessage)) $o['WarningMessage'] = $this->WarningMessage;
if (isset($this->RunAsUICommand)) $o['RunAsUICommand'] = $this->RunAsUICommand;
if (isset($this->Parameters)) $o['Parameters'] = JsonConverters::to('Hashtable', $this->Parameters);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class WcfItemBase implements JsonSerializable
{
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class WcfChange extends WcfItemBase implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string */
public string $Id='',
// @DataMember
/** @var int */
public int $NextVersionNumber=0,
// @DataMember
/** @var int */
public int $PrevVersionNumber=0,
// @DataMember
/** @var string */
public string $ItemId='',
// @DataMember
/** @var int */
public int $VersionNumber=0,
// @DataMember
/** @var string|null */
public ?string $Version=null,
// @DataMember
/** @var string */
public string $Owner='',
// @DataMember
/** @var string|null */
public ?string $Comment=null,
// @DataMember
/** @var string|null */
public ?string $Label=null,
// @DataMember
/** @var string|null */
public ?string $ChangeType=null,
// @DataMember
/** @var bool|null */
public ?bool $IsPublishedVersion=null,
// @DataMember
/** @var bool|null */
public ?bool $IsLastPublishedVersion=null,
// @DataMember
/** @var string|null */
public ?string $ChangeDescription=null,
// @DataMember
/** @var DateTime */
public DateTime $LastModified=new DateTime(),
// @DataMember
/** @var DateTime */
public DateTime $DateCreated=new DateTime(),
// @DataMember
/** @var string|null */
public ?string $CreatedByUserName=null,
// @DataMember
/** @var string|null */
public ?string $PreviousId=null,
// @DataMember
/** @var string|null */
public ?string $NextId=null,
// @DataMember
/** @var string|null */
public ?string $Metadata=null,
// @DataMember
/** @var string|null */
public ?string $AdditionalInfo=null,
// @DataMember
/** @var string|null */
public ?string $Culture=null,
// @DataMember
/** @var array<string>|null */
public ?array $AvailableLanguages=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['NextVersionNumber'])) $this->NextVersionNumber = $o['NextVersionNumber'];
if (isset($o['PrevVersionNumber'])) $this->PrevVersionNumber = $o['PrevVersionNumber'];
if (isset($o['ItemId'])) $this->ItemId = $o['ItemId'];
if (isset($o['VersionNumber'])) $this->VersionNumber = $o['VersionNumber'];
if (isset($o['Version'])) $this->Version = $o['Version'];
if (isset($o['Owner'])) $this->Owner = $o['Owner'];
if (isset($o['Comment'])) $this->Comment = $o['Comment'];
if (isset($o['Label'])) $this->Label = $o['Label'];
if (isset($o['ChangeType'])) $this->ChangeType = $o['ChangeType'];
if (isset($o['IsPublishedVersion'])) $this->IsPublishedVersion = $o['IsPublishedVersion'];
if (isset($o['IsLastPublishedVersion'])) $this->IsLastPublishedVersion = $o['IsLastPublishedVersion'];
if (isset($o['ChangeDescription'])) $this->ChangeDescription = $o['ChangeDescription'];
if (isset($o['LastModified'])) $this->LastModified = JsonConverters::from('DateTime', $o['LastModified']);
if (isset($o['DateCreated'])) $this->DateCreated = JsonConverters::from('DateTime', $o['DateCreated']);
if (isset($o['CreatedByUserName'])) $this->CreatedByUserName = $o['CreatedByUserName'];
if (isset($o['PreviousId'])) $this->PreviousId = $o['PreviousId'];
if (isset($o['NextId'])) $this->NextId = $o['NextId'];
if (isset($o['Metadata'])) $this->Metadata = $o['Metadata'];
if (isset($o['AdditionalInfo'])) $this->AdditionalInfo = $o['AdditionalInfo'];
if (isset($o['Culture'])) $this->Culture = $o['Culture'];
if (isset($o['AvailableLanguages'])) $this->AvailableLanguages = JsonConverters::fromArray('string', $o['AvailableLanguages']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->NextVersionNumber)) $o['NextVersionNumber'] = $this->NextVersionNumber;
if (isset($this->PrevVersionNumber)) $o['PrevVersionNumber'] = $this->PrevVersionNumber;
if (isset($this->ItemId)) $o['ItemId'] = $this->ItemId;
if (isset($this->VersionNumber)) $o['VersionNumber'] = $this->VersionNumber;
if (isset($this->Version)) $o['Version'] = $this->Version;
if (isset($this->Owner)) $o['Owner'] = $this->Owner;
if (isset($this->Comment)) $o['Comment'] = $this->Comment;
if (isset($this->Label)) $o['Label'] = $this->Label;
if (isset($this->ChangeType)) $o['ChangeType'] = $this->ChangeType;
if (isset($this->IsPublishedVersion)) $o['IsPublishedVersion'] = $this->IsPublishedVersion;
if (isset($this->IsLastPublishedVersion)) $o['IsLastPublishedVersion'] = $this->IsLastPublishedVersion;
if (isset($this->ChangeDescription)) $o['ChangeDescription'] = $this->ChangeDescription;
if (isset($this->LastModified)) $o['LastModified'] = JsonConverters::to('DateTime', $this->LastModified);
if (isset($this->DateCreated)) $o['DateCreated'] = JsonConverters::to('DateTime', $this->DateCreated);
if (isset($this->CreatedByUserName)) $o['CreatedByUserName'] = $this->CreatedByUserName;
if (isset($this->PreviousId)) $o['PreviousId'] = $this->PreviousId;
if (isset($this->NextId)) $o['NextId'] = $this->NextId;
if (isset($this->Metadata)) $o['Metadata'] = $this->Metadata;
if (isset($this->AdditionalInfo)) $o['AdditionalInfo'] = $this->AdditionalInfo;
if (isset($this->Culture)) $o['Culture'] = $this->Culture;
if (isset($this->AvailableLanguages)) $o['AvailableLanguages'] = JsonConverters::toArray('string', $this->AvailableLanguages);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class WcfApprovalTrackingRecord implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var DateTime */
public DateTime $DateCreated=new DateTime(),
// @DataMember
/** @var string|null */
public ?string $Note=null,
// @DataMember
/** @var string|null */
public ?string $Status=null,
// @DataMember
/** @var string|null */
public ?string $UIStatus=null,
// @DataMember
/** @var string|null */
public ?string $UserName=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['DateCreated'])) $this->DateCreated = JsonConverters::from('DateTime', $o['DateCreated']);
if (isset($o['Note'])) $this->Note = $o['Note'];
if (isset($o['Status'])) $this->Status = $o['Status'];
if (isset($o['UIStatus'])) $this->UIStatus = $o['UIStatus'];
if (isset($o['UserName'])) $this->UserName = $o['UserName'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->DateCreated)) $o['DateCreated'] = JsonConverters::to('DateTime', $this->DateCreated);
if (isset($this->Note)) $o['Note'] = $this->Note;
if (isset($this->Status)) $o['Status'] = $this->Status;
if (isset($this->UIStatus)) $o['UIStatus'] = $this->UIStatus;
if (isset($this->UserName)) $o['UserName'] = $this->UserName;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class ContentViewModelBase implements ILocalizable, JsonSerializable
{
public function __construct(
// @DataMember
/** @var string|null */
public ?string $ParentUrl=null,
// @DataMember
/** @var bool|null */
public ?bool $IsEditable=null,
// @DataMember
/** @var bool|null */
public ?bool $IsDeletable=null,
// @DataMember
/** @var bool|null */
public ?bool $IsUnlockable=null,
// @DataMember
/** @var string|null */
public ?string $UIStatus=null,
// @DataMember
/** @var Status|null */
public ?Status $AdditionalStatus=null,
// @DataMember
/** @var int */
public int $ItemsCount=0,
// @DataMember
/** @var string */
public string $Id='',
// @DataMember
/** @var string|null */
public ?string $LiveContentId=null,
// @DataMember
/** @var string|null */
public ?string $Title=null,
// @DataMember
/** @var string|null */
public ?string $Owner=null,
// @DataMember
/** @var string|null */
public ?string $Author=null,
// @DataMember
/** @var DateTime */
public DateTime $DateCreated=new DateTime(),
// @DataMember
/** @var DateTime */
public DateTime $DateModified=new DateTime(),
// @DataMember
/** @var DateTime */
public DateTime $PublicationDate=new DateTime(),
// @DataMember
/** @var string|null */
public ?string $ProviderName=null,
// @DataMember
/** @var DateTime */
public DateTime $ExpirationDate=new DateTime(),
// @DataMember
/** @var string|null */
public ?string $Status=null,
// @DataMember
/** @var int */
public int $CommentsCount=0,
// @DataMember
/** @var WcfContentLifecycleStatus|null */
public ?WcfContentLifecycleStatus $LifecycleStatus=null,
// @DataMember
/** @var array<WorkflowVisualElement>|null */
public ?array $WorkflowOperations=null,
// @DataMember
/** @var WcfChange|null */
public ?WcfChange $VersionInfo=null,
// @DataMember
/** @var string|null */
public ?string $DefaultPageId=null,
// @DataMember
/** @var WcfApprovalTrackingRecord|null */
public ?WcfApprovalTrackingRecord $LastApprovalTrackingRecord=null,
// @DataMember
/** @var int */
public int $Version=0,
// @DataMember
/** @var string[]|null */
public ?array $AvailableLanguages=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ParentUrl'])) $this->ParentUrl = $o['ParentUrl'];
if (isset($o['IsEditable'])) $this->IsEditable = $o['IsEditable'];
if (isset($o['IsDeletable'])) $this->IsDeletable = $o['IsDeletable'];
if (isset($o['IsUnlockable'])) $this->IsUnlockable = $o['IsUnlockable'];
if (isset($o['UIStatus'])) $this->UIStatus = $o['UIStatus'];
if (isset($o['AdditionalStatus'])) $this->AdditionalStatus = JsonConverters::from('Status', $o['AdditionalStatus']);
if (isset($o['ItemsCount'])) $this->ItemsCount = $o['ItemsCount'];
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['LiveContentId'])) $this->LiveContentId = $o['LiveContentId'];
if (isset($o['Title'])) $this->Title = $o['Title'];
if (isset($o['Owner'])) $this->Owner = $o['Owner'];
if (isset($o['Author'])) $this->Author = $o['Author'];
if (isset($o['DateCreated'])) $this->DateCreated = JsonConverters::from('DateTime', $o['DateCreated']);
if (isset($o['DateModified'])) $this->DateModified = JsonConverters::from('DateTime', $o['DateModified']);
if (isset($o['PublicationDate'])) $this->PublicationDate = JsonConverters::from('DateTime', $o['PublicationDate']);
if (isset($o['ProviderName'])) $this->ProviderName = $o['ProviderName'];
if (isset($o['ExpirationDate'])) $this->ExpirationDate = JsonConverters::from('DateTime', $o['ExpirationDate']);
if (isset($o['Status'])) $this->Status = $o['Status'];
if (isset($o['CommentsCount'])) $this->CommentsCount = $o['CommentsCount'];
if (isset($o['LifecycleStatus'])) $this->LifecycleStatus = JsonConverters::from('WcfContentLifecycleStatus', $o['LifecycleStatus']);
if (isset($o['WorkflowOperations'])) $this->WorkflowOperations = JsonConverters::fromArray('WorkflowVisualElement', $o['WorkflowOperations']);
if (isset($o['VersionInfo'])) $this->VersionInfo = JsonConverters::from('WcfChange', $o['VersionInfo']);
if (isset($o['DefaultPageId'])) $this->DefaultPageId = $o['DefaultPageId'];
if (isset($o['LastApprovalTrackingRecord'])) $this->LastApprovalTrackingRecord = JsonConverters::from('WcfApprovalTrackingRecord', $o['LastApprovalTrackingRecord']);
if (isset($o['Version'])) $this->Version = $o['Version'];
if (isset($o['AvailableLanguages'])) $this->AvailableLanguages = JsonConverters::fromArray('string', $o['AvailableLanguages']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ParentUrl)) $o['ParentUrl'] = $this->ParentUrl;
if (isset($this->IsEditable)) $o['IsEditable'] = $this->IsEditable;
if (isset($this->IsDeletable)) $o['IsDeletable'] = $this->IsDeletable;
if (isset($this->IsUnlockable)) $o['IsUnlockable'] = $this->IsUnlockable;
if (isset($this->UIStatus)) $o['UIStatus'] = $this->UIStatus;
if (isset($this->AdditionalStatus)) $o['AdditionalStatus'] = JsonConverters::to('Status', $this->AdditionalStatus);
if (isset($this->ItemsCount)) $o['ItemsCount'] = $this->ItemsCount;
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->LiveContentId)) $o['LiveContentId'] = $this->LiveContentId;
if (isset($this->Title)) $o['Title'] = $this->Title;
if (isset($this->Owner)) $o['Owner'] = $this->Owner;
if (isset($this->Author)) $o['Author'] = $this->Author;
if (isset($this->DateCreated)) $o['DateCreated'] = JsonConverters::to('DateTime', $this->DateCreated);
if (isset($this->DateModified)) $o['DateModified'] = JsonConverters::to('DateTime', $this->DateModified);
if (isset($this->PublicationDate)) $o['PublicationDate'] = JsonConverters::to('DateTime', $this->PublicationDate);
if (isset($this->ProviderName)) $o['ProviderName'] = $this->ProviderName;
if (isset($this->ExpirationDate)) $o['ExpirationDate'] = JsonConverters::to('DateTime', $this->ExpirationDate);
if (isset($this->Status)) $o['Status'] = $this->Status;
if (isset($this->CommentsCount)) $o['CommentsCount'] = $this->CommentsCount;
if (isset($this->LifecycleStatus)) $o['LifecycleStatus'] = JsonConverters::to('WcfContentLifecycleStatus', $this->LifecycleStatus);
if (isset($this->WorkflowOperations)) $o['WorkflowOperations'] = JsonConverters::toArray('WorkflowVisualElement', $this->WorkflowOperations);
if (isset($this->VersionInfo)) $o['VersionInfo'] = JsonConverters::to('WcfChange', $this->VersionInfo);
if (isset($this->DefaultPageId)) $o['DefaultPageId'] = $this->DefaultPageId;
if (isset($this->LastApprovalTrackingRecord)) $o['LastApprovalTrackingRecord'] = JsonConverters::to('WcfApprovalTrackingRecord', $this->LastApprovalTrackingRecord);
if (isset($this->Version)) $o['Version'] = $this->Version;
if (isset($this->AvailableLanguages)) $o['AvailableLanguages'] = JsonConverters::toArray('string', $this->AvailableLanguages);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class HierarchicalContentViewModelBase extends ContentViewModelBase implements JsonSerializable
{
/**
* @param string|null $ParentUrl
* @param bool|null $IsEditable
* @param bool|null $IsDeletable
* @param bool|null $IsUnlockable
* @param string|null $UIStatus
* @param Status|null $AdditionalStatus
* @param int $ItemsCount
* @param string $Id
* @param string|null $LiveContentId
* @param string|null $Title
* @param string|null $Owner
* @param string|null $Author
* @param DateTime $DateCreated
* @param DateTime $DateModified
* @param DateTime $PublicationDate
* @param string|null $ProviderName
* @param DateTime $ExpirationDate
* @param string|null $Status
* @param int $CommentsCount
* @param WcfContentLifecycleStatus|null $LifecycleStatus
* @param array<WorkflowVisualElement>|null $WorkflowOperations
* @param WcfChange|null $VersionInfo
* @param string|null $DefaultPageId
* @param WcfApprovalTrackingRecord|null $LastApprovalTrackingRecord
* @param int $Version
* @param string[]|null $AvailableLanguages
*/
public function __construct(
?string $ParentUrl=null,
?bool $IsEditable=null,
?bool $IsDeletable=null,
?bool $IsUnlockable=null,
?string $UIStatus=null,
?Status $AdditionalStatus=null,
int $ItemsCount=0,
string $Id='',
?string $LiveContentId=null,
?string $Title=null,
?string $Owner=null,
?string $Author=null,
DateTime $DateCreated=new DateTime(),
DateTime $DateModified=new DateTime(),
DateTime $PublicationDate=new DateTime(),
?string $ProviderName=null,
DateTime $ExpirationDate=new DateTime(),
?string $Status=null,
int $CommentsCount=0,
?WcfContentLifecycleStatus $LifecycleStatus=null,
?array $WorkflowOperations=null,
?WcfChange $VersionInfo=null,
?string $DefaultPageId=null,
?WcfApprovalTrackingRecord $LastApprovalTrackingRecord=null,
int $Version=0,
?array $AvailableLanguages=null,
// @DataMember
/** @var string|null */
public ?string $Url=null
) {
parent::__construct($ParentUrl,$IsEditable,$IsDeletable,$IsUnlockable,$UIStatus,$AdditionalStatus,$ItemsCount,$Id,$LiveContentId,$Title,$Owner,$Author,$DateCreated,$DateModified,$PublicationDate,$ProviderName,$ExpirationDate,$Status,$CommentsCount,$LifecycleStatus,$WorkflowOperations,$VersionInfo,$DefaultPageId,$LastApprovalTrackingRecord,$Version,$AvailableLanguages);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['Url'])) $this->Url = $o['Url'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->Url)) $o['Url'] = $this->Url;
return empty($o) ? new class(){} : $o;
}
}
class ListViewModel extends HierarchicalContentViewModelBase implements JsonSerializable
{
/**
* @param string|null $ParentUrl
* @param bool|null $IsEditable
* @param bool|null $IsDeletable
* @param bool|null $IsUnlockable
* @param string|null $UIStatus
* @param Status|null $AdditionalStatus
* @param int $ItemsCount
* @param string $Id
* @param string|null $LiveContentId
* @param string|null $Title
* @param string|null $Owner
* @param string|null $Author
* @param DateTime $DateCreated
* @param DateTime $DateModified
* @param DateTime $PublicationDate
* @param string|null $ProviderName
* @param DateTime $ExpirationDate
* @param string|null $Status
* @param int $CommentsCount
* @param WcfContentLifecycleStatus|null $LifecycleStatus
* @param array<WorkflowVisualElement>|null $WorkflowOperations
* @param WcfChange|null $VersionInfo
* @param string|null $DefaultPageId
* @param WcfApprovalTrackingRecord|null $LastApprovalTrackingRecord
* @param int $Version
* @param string[]|null $AvailableLanguages
* @param string|null $Url
*/
public function __construct(
?string $ParentUrl=null,
?bool $IsEditable=null,
?bool $IsDeletable=null,
?bool $IsUnlockable=null,
?string $UIStatus=null,
?Status $AdditionalStatus=null,
int $ItemsCount=0,
string $Id='',
?string $LiveContentId=null,
?string $Title=null,
?string $Owner=null,
?string $Author=null,
DateTime $DateCreated=new DateTime(),
DateTime $DateModified=new DateTime(),
DateTime $PublicationDate=new DateTime(),
?string $ProviderName=null,
DateTime $ExpirationDate=new DateTime(),
?string $Status=null,
int $CommentsCount=0,
?WcfContentLifecycleStatus $LifecycleStatus=null,
?array $WorkflowOperations=null,
?WcfChange $VersionInfo=null,
?string $DefaultPageId=null,
?WcfApprovalTrackingRecord $LastApprovalTrackingRecord=null,
int $Version=0,
?array $AvailableLanguages=null,
?string $Url=null,
// @DataMember
/** @var int */
public int $ListItemCount=0,
// @DataMember
/** @var DateTime|null */
public ?DateTime $LastItemDate=null
) {
parent::__construct($ParentUrl,$IsEditable,$IsDeletable,$IsUnlockable,$UIStatus,$AdditionalStatus,$ItemsCount,$Id,$LiveContentId,$Title,$Owner,$Author,$DateCreated,$DateModified,$PublicationDate,$ProviderName,$ExpirationDate,$Status,$CommentsCount,$LifecycleStatus,$WorkflowOperations,$VersionInfo,$DefaultPageId,$LastApprovalTrackingRecord,$Version,$AvailableLanguages,$Url);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['ListItemCount'])) $this->ListItemCount = $o['ListItemCount'];
if (isset($o['LastItemDate'])) $this->LastItemDate = JsonConverters::from('DateTime', $o['LastItemDate']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->ListItemCount)) $o['ListItemCount'] = $this->ListItemCount;
if (isset($this->LastItemDate)) $o['LastItemDate'] = JsonConverters::to('DateTime', $this->LastItemDate);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
/**
* @template ListViewModel
*/
class CollectionContext implements JsonSerializable
{
public array $genericArgs = [];
public static function create(array $genericArgs=[]): CollectionContext {
$to = new CollectionContext();
$to->genericArgs = $genericArgs;
return $to;
}
public function __construct(
// @DataMember
/** @var int */
public mixed $TotalCount=0,
// @DataMember
/** @var bool|null */
public mixed $IsGeneric=null,
// @DataMember
/** @var array<string,string>|null */
public mixed $Context=null,
// @DataMember
/** @var array<ListViewModel>|null */
public mixed $Items=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['TotalCount'])) $this->TotalCount = $o['TotalCount'];
if (isset($o['IsGeneric'])) $this->IsGeneric = $o['IsGeneric'];
if (isset($o['Context'])) $this->Context = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['Context']);
if (isset($o['Items'])) $this->Items = JsonConverters::fromArray($this->genericArgs[0], $o['Items']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->TotalCount)) $o['TotalCount'] = $this->TotalCount;
if (isset($this->IsGeneric)) $o['IsGeneric'] = $this->IsGeneric;
if (isset($this->Context)) $o['Context'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->Context);
if (isset($this->Items)) $o['Items'] = JsonConverters::toArray($this->genericArgs[0], $this->Items);
return empty($o) ? new class(){} : $o;
}
}
PHP SpecificListsGetRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /RestApi/lists-api/items HTTP/1.1
Host: www.asg.com.au
Accept: application/json
Content-Type: application/json
Content-Length: length
{"Ids":["00000000-0000-0000-0000-000000000000"],"Provider":"String"}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"TotalCount":0,"IsGeneric":false,"Items":[]}