import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class Node implements IConvertible
{
String? EntityName;
String? ID;
String? ParentID;
String? Title;
int? Count;
String? ImageKey;
bool? Expanded;
bool? Selected;
String? DisplayPath;
List<Node>? ChildNodes;
String? RegistrationPathElement;
String? QueryPathElement;
String? Path;
bool? IsHierarchy;
Node({this.EntityName,this.ID,this.ParentID,this.Title,this.Count,this.ImageKey,this.Expanded,this.Selected,this.DisplayPath,this.ChildNodes,this.RegistrationPathElement,this.QueryPathElement,this.Path,this.IsHierarchy});
Node.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
EntityName = json['EntityName'];
ID = json['ID'];
ParentID = json['ParentID'];
Title = json['Title'];
Count = json['Count'];
ImageKey = json['ImageKey'];
Expanded = json['Expanded'];
Selected = json['Selected'];
DisplayPath = json['DisplayPath'];
ChildNodes = JsonConverters.fromJson(json['ChildNodes'],'List<Node>',context!);
RegistrationPathElement = json['RegistrationPathElement'];
QueryPathElement = json['QueryPathElement'];
Path = json['Path'];
IsHierarchy = json['IsHierarchy'];
return this;
}
Map<String, dynamic> toJson() => {
'EntityName': EntityName,
'ID': ID,
'ParentID': ParentID,
'Title': Title,
'Count': Count,
'ImageKey': ImageKey,
'Expanded': Expanded,
'Selected': Selected,
'DisplayPath': DisplayPath,
'ChildNodes': JsonConverters.toJson(ChildNodes,'List<Node>',context!),
'RegistrationPathElement': RegistrationPathElement,
'QueryPathElement': QueryPathElement,
'Path': Path,
'IsHierarchy': IsHierarchy
};
getTypeName() => "Node";
TypeContext? context = _ctx;
}
class ViewExplorerNode extends Node implements IConvertible
{
String? ViewId;
String? ExplorerId;
List<ViewExplorerNode>? ChildNodes;
ViewExplorerNode({this.ViewId,this.ExplorerId,this.ChildNodes});
ViewExplorerNode.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
ViewId = json['ViewId'];
ExplorerId = json['ExplorerId'];
ChildNodes = JsonConverters.fromJson(json['ChildNodes'],'List<ViewExplorerNode>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'ViewId': ViewId,
'ExplorerId': ExplorerId,
'ChildNodes': JsonConverters.toJson(ChildNodes,'List<ViewExplorerNode>',context!)
});
getTypeName() => "ViewExplorerNode";
TypeContext? context = _ctx;
}
class ViewsAndExplorers implements IConvertible
{
List<ViewExplorerNode>? Nodes;
ViewsAndExplorers({this.Nodes});
ViewsAndExplorers.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Nodes = JsonConverters.fromJson(json['Nodes'],'List<ViewExplorerNode>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Nodes': JsonConverters.toJson(Nodes,'List<ViewExplorerNode>',context!)
};
getTypeName() => "ViewsAndExplorers";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'digiofficeapigateway.deltares.nl', types: <String, TypeInfo> {
'Node': TypeInfo(TypeOf.Class, create:() => Node()),
'List<Node>': TypeInfo(TypeOf.Class, create:() => <Node>[]),
'ViewExplorerNode': TypeInfo(TypeOf.Class, create:() => ViewExplorerNode()),
'List<ViewExplorerNode>': TypeInfo(TypeOf.Class, create:() => <ViewExplorerNode>[]),
'ViewsAndExplorers': TypeInfo(TypeOf.Class, create:() => ViewsAndExplorers()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /jsv/reply/ViewsAndExplorers HTTP/1.1
Host: digiofficeapigateway.deltares.nl
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
Nodes:
[
{
ViewId: 00000000-0000-0000-0000-000000000000,
ExplorerId: 00000000-0000-0000-0000-000000000000,
ChildNodes:
[
{
ViewId: 00000000-0000-0000-0000-000000000000,
ExplorerId: 00000000-0000-0000-0000-000000000000,
ChildNodes:
[
{
ViewId: 00000000-0000-0000-0000-000000000000,
ExplorerId: 00000000-0000-0000-0000-000000000000,
EntityName: String,
ID: String,
ParentID: String,
Title: String,
Count: 0,
ImageKey: String,
Expanded: False,
Selected: False,
DisplayPath: String,
ChildNodes:
[
{
EntityName: String,
ID: String,
ParentID: String,
Title: String,
Count: 0,
ImageKey: String,
Expanded: False,
Selected: False,
DisplayPath: String,
ChildNodes:
[
{
EntityName: String,
ID: String,
ParentID: String,
Title: String,
Count: 0,
ImageKey: String,
Expanded: False,
Selected: False,
DisplayPath: String,
ChildNodes:
[
{
EntityName: String,
ID: String,
ParentID: String,
Title: String,
Count: 0,
ImageKey: String,
Expanded: False,
Selected: False,
DisplayPath: String,
RegistrationPathElement: String,
QueryPathElement: String,
Path: String,
IsHierarchy: False
}
],
RegistrationPathElement: String,
QueryPathElement: String,
Path: String,
IsHierarchy: False
}
],
RegistrationPathElement: String,
QueryPathElement: String,
Path: String,
IsHierarchy: False
}
],
RegistrationPathElement: String,
QueryPathElement: String,
Path: String,
IsHierarchy: False
}
],
EntityName: String,
ID: String,
ParentID: String,
Title: String,
Count: 0,
ImageKey: String,
Expanded: False,
Selected: False,
DisplayPath: String,
ChildNodes:
[
{
EntityName: String,
ID: String,
ParentID: String,
Title: String,
Count: 0,
ImageKey: String,
Expanded: False,
Selected: False,
DisplayPath: String,
ChildNodes:
[
{
EntityName: String,
ID: String,
ParentID: String,
Title: String,
Count: 0,
ImageKey: String,
Expanded: False,
Selected: False,
DisplayPath: String,
ChildNodes:
[
{
EntityName: String,
ID: String,
ParentID: String,
Title: String,
Count: 0,
ImageKey: String,
Expanded: False,
Selected: False,
DisplayPath: String,
RegistrationPathElement: String,
QueryPathElement: String,
Path: String,
IsHierarchy: False
}
],
RegistrationPathElement: String,
QueryPathElement: String,
Path: String,
IsHierarchy: False
}
],
RegistrationPathElement: String,
QueryPathElement: String,
Path: String,
IsHierarchy: False
}
],
RegistrationPathElement: String,
QueryPathElement: String,
Path: String,
IsHierarchy: False
}
],
EntityName: String,
ID: String,
ParentID: String,
Title: String,
Count: 0,
ImageKey: String,
Expanded: False,
Selected: False,
DisplayPath: String,
ChildNodes:
[
{
EntityName: String,
ID: String,
ParentID: String,
Title: String,
Count: 0,
ImageKey: String,
Expanded: False,
Selected: False,
DisplayPath: String,
ChildNodes:
[
{
EntityName: String,
ID: String,
ParentID: String,
Title: String,
Count: 0,
ImageKey: String,
Expanded: False,
Selected: False,
DisplayPath: String,
ChildNodes:
[
{
EntityName: String,
ID: String,
ParentID: String,
Title: String,
Count: 0,
ImageKey: String,
Expanded: False,
Selected: False,
DisplayPath: String,
RegistrationPathElement: String,
QueryPathElement: String,
Path: String,
IsHierarchy: False
}
],
RegistrationPathElement: String,
QueryPathElement: String,
Path: String,
IsHierarchy: False
}
],
RegistrationPathElement: String,
QueryPathElement: String,
Path: String,
IsHierarchy: False
}
],
RegistrationPathElement: String,
QueryPathElement: String,
Path: String,
IsHierarchy: False
}
]
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Nodes: [ { ViewId: 00000000-0000-0000-0000-000000000000, ExplorerId: 00000000-0000-0000-0000-000000000000, ChildNodes: [ { ViewId: 00000000-0000-0000-0000-000000000000, ExplorerId: 00000000-0000-0000-0000-000000000000, ChildNodes: [ { ViewId: 00000000-0000-0000-0000-000000000000, ExplorerId: 00000000-0000-0000-0000-000000000000, EntityName: String, ID: String, ParentID: String, Title: String, Count: 0, ImageKey: String, Expanded: False, Selected: False, DisplayPath: String, ChildNodes: [ { EntityName: String, ID: String, ParentID: String, Title: String, Count: 0, ImageKey: String, Expanded: False, Selected: False, DisplayPath: String, ChildNodes: [ { EntityName: String, ID: String, ParentID: String, Title: String, Count: 0, ImageKey: String, Expanded: False, Selected: False, DisplayPath: String, ChildNodes: [ { EntityName: String, ID: String, ParentID: String, Title: String, Count: 0, ImageKey: String, Expanded: False, Selected: False, DisplayPath: String, RegistrationPathElement: String, QueryPathElement: String, Path: String, IsHierarchy: False } ], RegistrationPathElement: String, QueryPathElement: String, Path: String, IsHierarchy: False } ], RegistrationPathElement: String, QueryPathElement: String, Path: String, IsHierarchy: False } ], RegistrationPathElement: String, QueryPathElement: String, Path: String, IsHierarchy: False } ], EntityName: String, ID: String, ParentID: String, Title: String, Count: 0, ImageKey: String, Expanded: False, Selected: False, DisplayPath: String, ChildNodes: [ { EntityName: String, ID: String, ParentID: String, Title: String, Count: 0, ImageKey: String, Expanded: False, Selected: False, DisplayPath: String, ChildNodes: [ { EntityName: String, ID: String, ParentID: String, Title: String, Count: 0, ImageKey: String, Expanded: False, Selected: False, DisplayPath: String, ChildNodes: [ { EntityName: String, ID: String, ParentID: String, Title: String, Count: 0, ImageKey: String, Expanded: False, Selected: False, DisplayPath: String, RegistrationPathElement: String, QueryPathElement: String, Path: String, IsHierarchy: False } ], RegistrationPathElement: String, QueryPathElement: String, Path: String, IsHierarchy: False } ], RegistrationPathElement: String, QueryPathElement: String, Path: String, IsHierarchy: False } ], RegistrationPathElement: String, QueryPathElement: String, Path: String, IsHierarchy: False } ], EntityName: String, ID: String, ParentID: String, Title: String, Count: 0, ImageKey: String, Expanded: False, Selected: False, DisplayPath: String, ChildNodes: [ { EntityName: String, ID: String, ParentID: String, Title: String, Count: 0, ImageKey: String, Expanded: False, Selected: False, DisplayPath: String, ChildNodes: [ { EntityName: String, ID: String, ParentID: String, Title: String, Count: 0, ImageKey: String, Expanded: False, Selected: False, DisplayPath: String, ChildNodes: [ { EntityName: String, ID: String, ParentID: String, Title: String, Count: 0, ImageKey: String, Expanded: False, Selected: False, DisplayPath: String, RegistrationPathElement: String, QueryPathElement: String, Path: String, IsHierarchy: False } ], RegistrationPathElement: String, QueryPathElement: String, Path: String, IsHierarchy: False } ], RegistrationPathElement: String, QueryPathElement: String, Path: String, IsHierarchy: False } ], RegistrationPathElement: String, QueryPathElement: String, Path: String, IsHierarchy: False } ] }