| All Verbs | /api/datalist/{DataListId} |
|---|
<?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 ListItemModel implements JsonSerializable
{
public function __construct(
/** @var string */
public string $ListItemId='',
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Description=null,
/** @var string|null */
public ?string $ShortName=null,
/** @var bool|null */
public ?bool $IsDefault=null,
/** @var int */
public int $Order=0,
/** @var string */
public string $ListItemTrafficLightId='',
/** @var string */
public string $PrimaryListItemImageId='',
/** @var string|null */
public ?string $PrimaryListItemImageUrl=null,
/** @var string|null */
public ?string $PrimaryImageThumbnailUrl=null,
/** @var string */
public string $OwnerContactId='',
/** @var string|null */
public ?string $RecordStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ListItemId'])) $this->ListItemId = $o['ListItemId'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['ShortName'])) $this->ShortName = $o['ShortName'];
if (isset($o['IsDefault'])) $this->IsDefault = $o['IsDefault'];
if (isset($o['Order'])) $this->Order = $o['Order'];
if (isset($o['ListItemTrafficLightId'])) $this->ListItemTrafficLightId = $o['ListItemTrafficLightId'];
if (isset($o['PrimaryListItemImageId'])) $this->PrimaryListItemImageId = $o['PrimaryListItemImageId'];
if (isset($o['PrimaryListItemImageUrl'])) $this->PrimaryListItemImageUrl = $o['PrimaryListItemImageUrl'];
if (isset($o['PrimaryImageThumbnailUrl'])) $this->PrimaryImageThumbnailUrl = $o['PrimaryImageThumbnailUrl'];
if (isset($o['OwnerContactId'])) $this->OwnerContactId = $o['OwnerContactId'];
if (isset($o['RecordStatus'])) $this->RecordStatus = $o['RecordStatus'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ListItemId)) $o['ListItemId'] = $this->ListItemId;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->ShortName)) $o['ShortName'] = $this->ShortName;
if (isset($this->IsDefault)) $o['IsDefault'] = $this->IsDefault;
if (isset($this->Order)) $o['Order'] = $this->Order;
if (isset($this->ListItemTrafficLightId)) $o['ListItemTrafficLightId'] = $this->ListItemTrafficLightId;
if (isset($this->PrimaryListItemImageId)) $o['PrimaryListItemImageId'] = $this->PrimaryListItemImageId;
if (isset($this->PrimaryListItemImageUrl)) $o['PrimaryListItemImageUrl'] = $this->PrimaryListItemImageUrl;
if (isset($this->PrimaryImageThumbnailUrl)) $o['PrimaryImageThumbnailUrl'] = $this->PrimaryImageThumbnailUrl;
if (isset($this->OwnerContactId)) $o['OwnerContactId'] = $this->OwnerContactId;
if (isset($this->RecordStatus)) $o['RecordStatus'] = $this->RecordStatus;
return empty($o) ? new class(){} : $o;
}
}
class ListModel implements JsonSerializable
{
public function __construct(
/** @var string */
public string $ListId='',
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Description=null,
/** @var string|null */
public ?string $ShortName=null,
/** @var string */
public string $OwnerContactId='',
/** @var bool|null */
public ?bool $IsStandard=null,
/** @var string|null */
public ?string $RecordStatus=null,
/** @var string */
public string $DefaultListItemId='',
/** @var string|null */
public ?string $DefaultListItemName=null,
/** @var bool|null */
public ?bool $HasImageForListItem=null,
/** @var bool|null */
public ?bool $HasTrafficLightForListItem=null,
/** @var array<ListItemModel>|null */
public ?array $ListItems=null,
/** @var bool|null */
public ?bool $PermissionEdit=null,
/** @var bool|null */
public ?bool $PermissionAdd=null,
/** @var bool|null */
public ?bool $PermissionDelete=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ListId'])) $this->ListId = $o['ListId'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['ShortName'])) $this->ShortName = $o['ShortName'];
if (isset($o['OwnerContactId'])) $this->OwnerContactId = $o['OwnerContactId'];
if (isset($o['IsStandard'])) $this->IsStandard = $o['IsStandard'];
if (isset($o['RecordStatus'])) $this->RecordStatus = $o['RecordStatus'];
if (isset($o['DefaultListItemId'])) $this->DefaultListItemId = $o['DefaultListItemId'];
if (isset($o['DefaultListItemName'])) $this->DefaultListItemName = $o['DefaultListItemName'];
if (isset($o['HasImageForListItem'])) $this->HasImageForListItem = $o['HasImageForListItem'];
if (isset($o['HasTrafficLightForListItem'])) $this->HasTrafficLightForListItem = $o['HasTrafficLightForListItem'];
if (isset($o['ListItems'])) $this->ListItems = JsonConverters::fromArray('ListItemModel', $o['ListItems']);
if (isset($o['PermissionEdit'])) $this->PermissionEdit = $o['PermissionEdit'];
if (isset($o['PermissionAdd'])) $this->PermissionAdd = $o['PermissionAdd'];
if (isset($o['PermissionDelete'])) $this->PermissionDelete = $o['PermissionDelete'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ListId)) $o['ListId'] = $this->ListId;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->ShortName)) $o['ShortName'] = $this->ShortName;
if (isset($this->OwnerContactId)) $o['OwnerContactId'] = $this->OwnerContactId;
if (isset($this->IsStandard)) $o['IsStandard'] = $this->IsStandard;
if (isset($this->RecordStatus)) $o['RecordStatus'] = $this->RecordStatus;
if (isset($this->DefaultListItemId)) $o['DefaultListItemId'] = $this->DefaultListItemId;
if (isset($this->DefaultListItemName)) $o['DefaultListItemName'] = $this->DefaultListItemName;
if (isset($this->HasImageForListItem)) $o['HasImageForListItem'] = $this->HasImageForListItem;
if (isset($this->HasTrafficLightForListItem)) $o['HasTrafficLightForListItem'] = $this->HasTrafficLightForListItem;
if (isset($this->ListItems)) $o['ListItems'] = JsonConverters::toArray('ListItemModel', $this->ListItems);
if (isset($this->PermissionEdit)) $o['PermissionEdit'] = $this->PermissionEdit;
if (isset($this->PermissionAdd)) $o['PermissionAdd'] = $this->PermissionAdd;
if (isset($this->PermissionDelete)) $o['PermissionDelete'] = $this->PermissionDelete;
return empty($o) ? new class(){} : $o;
}
}
// @ApiResponse(Description="Details of the specified data list")
class GetDataListDetailsResponse implements JsonSerializable
{
public function __construct(
/** @var ListModel|null */
public ?ListModel $DataList=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['DataList'])) $this->DataList = JsonConverters::from('ListModel', $o['DataList']);
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->DataList)) $o['DataList'] = JsonConverters::to('ListModel', $this->DataList);
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
/** @description Get details of the specified data list */
// @Api(Description="Get details of the specified data list")
class GetDataListDetails implements JsonSerializable
{
public function __construct(
/** @description The Data List Guid. Records retrieved will belong to this data list. */
// @ApiMember(DataType="Guid", Description="The Data List Guid. Records retrieved will belong to this data list.", IsRequired=true, Name="DataListId", ParameterType="query")
/** @var string */
public string $DataListId='',
/** @description Owner Contact Id - Licensee for Custom lists, Perspective Platform for Standard ones */
// @ApiMember(DataType="Guid", Description="Owner Contact Id - Licensee for Custom lists, Perspective Platform for Standard ones", IsRequired=true, Name="OwnerContactId", ParameterType="query")
/** @var string */
public string $OwnerContactId=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['DataListId'])) $this->DataListId = $o['DataListId'];
if (isset($o['OwnerContactId'])) $this->OwnerContactId = $o['OwnerContactId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->DataListId)) $o['DataListId'] = $this->DataListId;
if (isset($this->OwnerContactId)) $o['OwnerContactId'] = $this->OwnerContactId;
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 /api/datalist/{DataListId} HTTP/1.1
Host: pfapi.pstpf.com.au
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<GetDataListDetails xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Canvara.WebAPIModel.ServiceModel">
<DataListId>00000000-0000-0000-0000-000000000000</DataListId>
<OwnerContactId>00000000-0000-0000-0000-000000000000</OwnerContactId>
</GetDataListDetails>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetDataListDetailsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Canvara.WebAPIModel.ServiceModel">
<DataList xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eros.Saguna.Common.WebAPIModel.Models">
<d2p1:DefaultListItemId>00000000-0000-0000-0000-000000000000</d2p1:DefaultListItemId>
<d2p1:DefaultListItemName>String</d2p1:DefaultListItemName>
<d2p1:Description>String</d2p1:Description>
<d2p1:HasImageForListItem>false</d2p1:HasImageForListItem>
<d2p1:HasTrafficLightForListItem>false</d2p1:HasTrafficLightForListItem>
<d2p1:IsStandard>false</d2p1:IsStandard>
<d2p1:ListId>00000000-0000-0000-0000-000000000000</d2p1:ListId>
<d2p1:ListItems>
<d2p1:ListItemModel>
<d2p1:Description>String</d2p1:Description>
<d2p1:IsDefault>false</d2p1:IsDefault>
<d2p1:ListItemId>00000000-0000-0000-0000-000000000000</d2p1:ListItemId>
<d2p1:ListItemTrafficLightId>00000000-0000-0000-0000-000000000000</d2p1:ListItemTrafficLightId>
<d2p1:Name>String</d2p1:Name>
<d2p1:Order>0</d2p1:Order>
<d2p1:OwnerContactId>00000000-0000-0000-0000-000000000000</d2p1:OwnerContactId>
<d2p1:PrimaryImageThumbnailUrl>String</d2p1:PrimaryImageThumbnailUrl>
<d2p1:PrimaryListItemImageId>00000000-0000-0000-0000-000000000000</d2p1:PrimaryListItemImageId>
<d2p1:PrimaryListItemImageUrl>String</d2p1:PrimaryListItemImageUrl>
<d2p1:RecordStatus>String</d2p1:RecordStatus>
<d2p1:ShortName>String</d2p1:ShortName>
</d2p1:ListItemModel>
</d2p1:ListItems>
<d2p1:Name>String</d2p1:Name>
<d2p1:OwnerContactId>00000000-0000-0000-0000-000000000000</d2p1:OwnerContactId>
<d2p1:PermissionAdd>false</d2p1:PermissionAdd>
<d2p1:PermissionDelete>false</d2p1:PermissionDelete>
<d2p1:PermissionEdit>false</d2p1:PermissionEdit>
<d2p1:RecordStatus>String</d2p1:RecordStatus>
<d2p1:ShortName>String</d2p1:ShortName>
</DataList>
<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>
</GetDataListDetailsResponse>