Cdn Public Collector's Pricing Guide (CPG) API V2

<back to all web services

GetNodeChildrenRequest

Catalog

Retrieve node children for a given node

The following routes are available for this service:
GET/GetNodeChildrenRequestThis will return no data for those nodes with collectible children. There is no advanced APi version for this call.
<?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 BaseResponse implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Total=0,
        /** @var int */
        public int $OpCode=0,
        /** @var string|null */
        public ?string $ErrorText=null,
        /** @var string|null */
        public ?string $RequestTime=null,
        /** @var string|null */
        public ?string $ResponseTime=null,
        /** @var string|null */
        public ?string $TotalExecutionTime=null,
        /** @var bool|null */
        public ?bool $CachedResponse=null,
        /** @var bool|null */
        public ?bool $PermitAccess=null,
        /** @var string|null */
        public ?string $AccessDeniedMessage=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Total'])) $this->Total = $o['Total'];
        if (isset($o['OpCode'])) $this->OpCode = $o['OpCode'];
        if (isset($o['ErrorText'])) $this->ErrorText = $o['ErrorText'];
        if (isset($o['RequestTime'])) $this->RequestTime = $o['RequestTime'];
        if (isset($o['ResponseTime'])) $this->ResponseTime = $o['ResponseTime'];
        if (isset($o['TotalExecutionTime'])) $this->TotalExecutionTime = $o['TotalExecutionTime'];
        if (isset($o['CachedResponse'])) $this->CachedResponse = $o['CachedResponse'];
        if (isset($o['PermitAccess'])) $this->PermitAccess = $o['PermitAccess'];
        if (isset($o['AccessDeniedMessage'])) $this->AccessDeniedMessage = $o['AccessDeniedMessage'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Total)) $o['Total'] = $this->Total;
        if (isset($this->OpCode)) $o['OpCode'] = $this->OpCode;
        if (isset($this->ErrorText)) $o['ErrorText'] = $this->ErrorText;
        if (isset($this->RequestTime)) $o['RequestTime'] = $this->RequestTime;
        if (isset($this->ResponseTime)) $o['ResponseTime'] = $this->ResponseTime;
        if (isset($this->TotalExecutionTime)) $o['TotalExecutionTime'] = $this->TotalExecutionTime;
        if (isset($this->CachedResponse)) $o['CachedResponse'] = $this->CachedResponse;
        if (isset($this->PermitAccess)) $o['PermitAccess'] = $this->PermitAccess;
        if (isset($this->AccessDeniedMessage)) $o['AccessDeniedMessage'] = $this->AccessDeniedMessage;
        return empty($o) ? new class(){} : $o;
    }
}

class NodeDto implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var string|null */
        public ?string $FeaturedImageUrl=null,
        /** @var string|null */
        public ?string $FeaturedImageAttribution=null,
        /** @var string|null */
        public ?string $FlagCode=null,
        /** @var string|null */
        public ?string $CountryName=null,
        /** @var int */
        public int $SortingPosition=0,
        /** @var int */
        public int $NodeChildrenCountLive=0,
        /** @var int */
        public int $CollectibleChildrenCountLive=0,
        /** @var int|null */
        public ?int $ParentNode_Id=null,
        /** @var int|null */
        public ?int $RootNode_Id=null,
        /** @var array<NodeDto>|null */
        public ?array $ChildNodes=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['FeaturedImageUrl'])) $this->FeaturedImageUrl = $o['FeaturedImageUrl'];
        if (isset($o['FeaturedImageAttribution'])) $this->FeaturedImageAttribution = $o['FeaturedImageAttribution'];
        if (isset($o['FlagCode'])) $this->FlagCode = $o['FlagCode'];
        if (isset($o['CountryName'])) $this->CountryName = $o['CountryName'];
        if (isset($o['SortingPosition'])) $this->SortingPosition = $o['SortingPosition'];
        if (isset($o['NodeChildrenCountLive'])) $this->NodeChildrenCountLive = $o['NodeChildrenCountLive'];
        if (isset($o['CollectibleChildrenCountLive'])) $this->CollectibleChildrenCountLive = $o['CollectibleChildrenCountLive'];
        if (isset($o['ParentNode_Id'])) $this->ParentNode_Id = $o['ParentNode_Id'];
        if (isset($o['RootNode_Id'])) $this->RootNode_Id = $o['RootNode_Id'];
        if (isset($o['ChildNodes'])) $this->ChildNodes = JsonConverters::fromArray('NodeDto', $o['ChildNodes']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->FeaturedImageUrl)) $o['FeaturedImageUrl'] = $this->FeaturedImageUrl;
        if (isset($this->FeaturedImageAttribution)) $o['FeaturedImageAttribution'] = $this->FeaturedImageAttribution;
        if (isset($this->FlagCode)) $o['FlagCode'] = $this->FlagCode;
        if (isset($this->CountryName)) $o['CountryName'] = $this->CountryName;
        if (isset($this->SortingPosition)) $o['SortingPosition'] = $this->SortingPosition;
        if (isset($this->NodeChildrenCountLive)) $o['NodeChildrenCountLive'] = $this->NodeChildrenCountLive;
        if (isset($this->CollectibleChildrenCountLive)) $o['CollectibleChildrenCountLive'] = $this->CollectibleChildrenCountLive;
        if (isset($this->ParentNode_Id)) $o['ParentNode_Id'] = $this->ParentNode_Id;
        if (isset($this->RootNode_Id)) $o['RootNode_Id'] = $this->RootNode_Id;
        if (isset($this->ChildNodes)) $o['ChildNodes'] = JsonConverters::toArray('NodeDto', $this->ChildNodes);
        return empty($o) ? new class(){} : $o;
    }
}

class NodeResponse extends BaseResponse implements JsonSerializable
{
    /**
     * @param int $Total
     * @param int $OpCode
     * @param string|null $ErrorText
     * @param string|null $RequestTime
     * @param string|null $ResponseTime
     * @param string|null $TotalExecutionTime
     * @param bool|null $CachedResponse
     * @param bool|null $PermitAccess
     * @param string|null $AccessDeniedMessage
     */
    public function __construct(
        int $Total=0,
        int $OpCode=0,
        ?string $ErrorText=null,
        ?string $RequestTime=null,
        ?string $ResponseTime=null,
        ?string $TotalExecutionTime=null,
        ?bool $CachedResponse=null,
        ?bool $PermitAccess=null,
        ?string $AccessDeniedMessage=null,
        /** @var array<NodeDto>|null */
        public ?array $Data=null
    ) {
        parent::__construct($Total,$OpCode,$ErrorText,$RequestTime,$ResponseTime,$TotalExecutionTime,$CachedResponse,$PermitAccess,$AccessDeniedMessage);
    }

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

/** @description Retrieve node children for a given node */
// @Api(Description="Retrieve node children for a given node")
class GetNodeChildrenRequest implements JsonSerializable
{
    public function __construct(
        /** @var int|null */
        public ?int $NodeId=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['NodeId'])) $this->NodeId = $o['NodeId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->NodeId)) $o['NodeId'] = $this->NodeId;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetNodeChildrenRequest 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

HTTP + JSON

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

GET /GetNodeChildrenRequest HTTP/1.1 
Host: publicapiv2dev.greysheet.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"Data":[{"Id":0,"Name":"String","Description":"String","FeaturedImageUrl":"String","FeaturedImageAttribution":"String","FlagCode":"String","CountryName":"String","SortingPosition":0,"NodeChildrenCountLive":0,"CollectibleChildrenCountLive":0,"ParentNode_Id":0,"RootNode_Id":0,"ChildNodes":[{"Id":0,"Name":"String","Description":"String","FeaturedImageUrl":"String","FeaturedImageAttribution":"String","FlagCode":"String","CountryName":"String","SortingPosition":0,"NodeChildrenCountLive":0,"CollectibleChildrenCountLive":0,"ParentNode_Id":0,"RootNode_Id":0,"ChildNodes":[{"Id":0,"Name":"String","Description":"String","FeaturedImageUrl":"String","FeaturedImageAttribution":"String","FlagCode":"String","CountryName":"String","SortingPosition":0,"NodeChildrenCountLive":0,"CollectibleChildrenCountLive":0,"ParentNode_Id":0,"RootNode_Id":0}]}]}],"Total":0,"OpCode":0,"ErrorText":"String","RequestTime":"String","ResponseTime":"String","TotalExecutionTime":"String","CachedResponse":false,"PermitAccess":false,"AccessDeniedMessage":"String"}