Platform API

<back to all web services

GetRelatedItemLevels

Get related item levels lists for e.g. Significant, All etc.

Requires Authentication
The following routes are available for this service:
All Verbs/api/lists/relateditems/levels
<?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;
    }
}

// @ApiResponse(Description="List items for a list")
class GetListItemsResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<ListItemModel>|null */
        public ?array $ListItems=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ListItems'])) $this->ListItems = JsonConverters::fromArray('ListItemModel', $o['ListItems']);
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ListItems)) $o['ListItems'] = JsonConverters::toArray('ListItemModel', $this->ListItems);
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

/** @description Get related item levels lists for e.g. Significant, All etc. */
// @Api(Description="Get related item levels lists for e.g. Significant, All etc.")
class GetRelatedItemLevels implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetRelatedItemLevels DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/lists/relateditems/levels HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<GetRelatedItemLevels xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Canvara.WebAPIModel.ServiceModel" />
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<GetListItemsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Canvara.WebAPIModel.ServiceModel">
  <ListItems xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eros.Saguna.Common.WebAPIModel.Models">
    <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>
  </ListItems>
  <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>
</GetListItemsResponse>