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.
import 'package:servicestack/servicestack.dart';

class BaseResponse implements IConvertible
{
    int? Total;
    int? OpCode;
    String? ErrorText;
    String? RequestTime;
    String? ResponseTime;
    String? TotalExecutionTime;
    bool? CachedResponse;
    bool? PermitAccess;
    String? AccessDeniedMessage;

    BaseResponse({this.Total,this.OpCode,this.ErrorText,this.RequestTime,this.ResponseTime,this.TotalExecutionTime,this.CachedResponse,this.PermitAccess,this.AccessDeniedMessage});
    BaseResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Total = json['Total'];
        OpCode = json['OpCode'];
        ErrorText = json['ErrorText'];
        RequestTime = json['RequestTime'];
        ResponseTime = json['ResponseTime'];
        TotalExecutionTime = json['TotalExecutionTime'];
        CachedResponse = json['CachedResponse'];
        PermitAccess = json['PermitAccess'];
        AccessDeniedMessage = json['AccessDeniedMessage'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Total': Total,
        'OpCode': OpCode,
        'ErrorText': ErrorText,
        'RequestTime': RequestTime,
        'ResponseTime': ResponseTime,
        'TotalExecutionTime': TotalExecutionTime,
        'CachedResponse': CachedResponse,
        'PermitAccess': PermitAccess,
        'AccessDeniedMessage': AccessDeniedMessage
    };

    getTypeName() => "BaseResponse";
    TypeContext? context = _ctx;
}

class NodeDto implements IConvertible
{
    int? Id;
    String? Name;
    String? Description;
    String? FeaturedImageUrl;
    String? FeaturedImageAttribution;
    String? FlagCode;
    String? CountryName;
    int? SortingPosition;
    int? NodeChildrenCountLive;
    int? CollectibleChildrenCountLive;
    int? ParentNode_Id;
    int? RootNode_Id;
    List<NodeDto>? ChildNodes;

    NodeDto({this.Id,this.Name,this.Description,this.FeaturedImageUrl,this.FeaturedImageAttribution,this.FlagCode,this.CountryName,this.SortingPosition,this.NodeChildrenCountLive,this.CollectibleChildrenCountLive,this.ParentNode_Id,this.RootNode_Id,this.ChildNodes});
    NodeDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Name = json['Name'];
        Description = json['Description'];
        FeaturedImageUrl = json['FeaturedImageUrl'];
        FeaturedImageAttribution = json['FeaturedImageAttribution'];
        FlagCode = json['FlagCode'];
        CountryName = json['CountryName'];
        SortingPosition = json['SortingPosition'];
        NodeChildrenCountLive = json['NodeChildrenCountLive'];
        CollectibleChildrenCountLive = json['CollectibleChildrenCountLive'];
        ParentNode_Id = json['ParentNode_Id'];
        RootNode_Id = json['RootNode_Id'];
        ChildNodes = JsonConverters.fromJson(json['ChildNodes'],'List<NodeDto>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Name': Name,
        'Description': Description,
        'FeaturedImageUrl': FeaturedImageUrl,
        'FeaturedImageAttribution': FeaturedImageAttribution,
        'FlagCode': FlagCode,
        'CountryName': CountryName,
        'SortingPosition': SortingPosition,
        'NodeChildrenCountLive': NodeChildrenCountLive,
        'CollectibleChildrenCountLive': CollectibleChildrenCountLive,
        'ParentNode_Id': ParentNode_Id,
        'RootNode_Id': RootNode_Id,
        'ChildNodes': JsonConverters.toJson(ChildNodes,'List<NodeDto>',context!)
    };

    getTypeName() => "NodeDto";
    TypeContext? context = _ctx;
}

class NodeResponse extends BaseResponse implements IConvertible
{
    List<NodeDto>? Data;

    NodeResponse({this.Data});
    NodeResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        Data = JsonConverters.fromJson(json['Data'],'List<NodeDto>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'Data': JsonConverters.toJson(Data,'List<NodeDto>',context!)
    });

    getTypeName() => "NodeResponse";
    TypeContext? context = _ctx;
}

/**
* Retrieve node children for a given node
*/
// @Api(Description="Retrieve node children for a given node")
class GetNodeChildrenRequest implements IConvertible
{
    int? NodeId;

    GetNodeChildrenRequest({this.NodeId});
    GetNodeChildrenRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        NodeId = json['NodeId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'NodeId': NodeId
    };

    getTypeName() => "GetNodeChildrenRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'publicapiv2dev.greysheet.com', types: <String, TypeInfo> {
    'BaseResponse': TypeInfo(TypeOf.Class, create:() => BaseResponse()),
    'NodeDto': TypeInfo(TypeOf.Class, create:() => NodeDto()),
    'List<NodeDto>': TypeInfo(TypeOf.Class, create:() => <NodeDto>[]),
    'NodeResponse': TypeInfo(TypeOf.Class, create:() => NodeResponse()),
    'GetNodeChildrenRequest': TypeInfo(TypeOf.Class, create:() => GetNodeChildrenRequest()),
});

Dart 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"}