DigiOffice Gateway Web Services

<back to all web services

ViewsAndExplorers

Requires Authentication
<?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 Node implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $EntityName=null,
        /** @var string|null */
        public ?string $ID=null,
        /** @var string|null */
        public ?string $ParentID=null,
        /** @var string|null */
        public ?string $Title=null,
        /** @var int|null */
        public ?int $Count=null,
        /** @var string|null */
        public ?string $ImageKey=null,
        /** @var bool|null */
        public ?bool $Expanded=null,
        /** @var bool|null */
        public ?bool $Selected=null,
        /** @var string|null */
        public ?string $DisplayPath=null,
        /** @var array<Node>|null */
        public ?array $ChildNodes=null,
        /** @var string|null */
        public ?string $RegistrationPathElement=null,
        /** @var string|null */
        public ?string $QueryPathElement=null,
        /** @var string|null */
        public ?string $Path=null,
        /** @var bool|null */
        public ?bool $IsHierarchy=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['EntityName'])) $this->EntityName = $o['EntityName'];
        if (isset($o['ID'])) $this->ID = $o['ID'];
        if (isset($o['ParentID'])) $this->ParentID = $o['ParentID'];
        if (isset($o['Title'])) $this->Title = $o['Title'];
        if (isset($o['Count'])) $this->Count = $o['Count'];
        if (isset($o['ImageKey'])) $this->ImageKey = $o['ImageKey'];
        if (isset($o['Expanded'])) $this->Expanded = $o['Expanded'];
        if (isset($o['Selected'])) $this->Selected = $o['Selected'];
        if (isset($o['DisplayPath'])) $this->DisplayPath = $o['DisplayPath'];
        if (isset($o['ChildNodes'])) $this->ChildNodes = JsonConverters::fromArray('Node', $o['ChildNodes']);
        if (isset($o['RegistrationPathElement'])) $this->RegistrationPathElement = $o['RegistrationPathElement'];
        if (isset($o['QueryPathElement'])) $this->QueryPathElement = $o['QueryPathElement'];
        if (isset($o['Path'])) $this->Path = $o['Path'];
        if (isset($o['IsHierarchy'])) $this->IsHierarchy = $o['IsHierarchy'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->EntityName)) $o['EntityName'] = $this->EntityName;
        if (isset($this->ID)) $o['ID'] = $this->ID;
        if (isset($this->ParentID)) $o['ParentID'] = $this->ParentID;
        if (isset($this->Title)) $o['Title'] = $this->Title;
        if (isset($this->Count)) $o['Count'] = $this->Count;
        if (isset($this->ImageKey)) $o['ImageKey'] = $this->ImageKey;
        if (isset($this->Expanded)) $o['Expanded'] = $this->Expanded;
        if (isset($this->Selected)) $o['Selected'] = $this->Selected;
        if (isset($this->DisplayPath)) $o['DisplayPath'] = $this->DisplayPath;
        if (isset($this->ChildNodes)) $o['ChildNodes'] = JsonConverters::toArray('Node', $this->ChildNodes);
        if (isset($this->RegistrationPathElement)) $o['RegistrationPathElement'] = $this->RegistrationPathElement;
        if (isset($this->QueryPathElement)) $o['QueryPathElement'] = $this->QueryPathElement;
        if (isset($this->Path)) $o['Path'] = $this->Path;
        if (isset($this->IsHierarchy)) $o['IsHierarchy'] = $this->IsHierarchy;
        return empty($o) ? new class(){} : $o;
    }
}

class ViewExplorerNode extends Node implements JsonSerializable
{
    /**
     * @param string|null $EntityName
     * @param string|null $ID
     * @param string|null $ParentID
     * @param string|null $Title
     * @param int|null $Count
     * @param string|null $ImageKey
     * @param bool|null $Expanded
     * @param bool|null $Selected
     * @param string|null $DisplayPath
     * @param array<Node>|null $ChildNodes
     * @param string|null $RegistrationPathElement
     * @param string|null $QueryPathElement
     * @param string|null $Path
     * @param bool|null $IsHierarchy
     */
    public function __construct(
        ?string $EntityName=null,
        ?string $ID=null,
        ?string $ParentID=null,
        ?string $Title=null,
        ?int $Count=null,
        ?string $ImageKey=null,
        ?bool $Expanded=null,
        ?bool $Selected=null,
        ?string $DisplayPath=null,
        ?array $ChildNodes=null,
        ?string $RegistrationPathElement=null,
        ?string $QueryPathElement=null,
        ?string $Path=null,
        ?bool $IsHierarchy=null,
        /** @var string|null */
        public ?string $ViewId=null,
        /** @var string|null */
        public ?string $ExplorerId=null
    ) {
        parent::__construct($EntityName,$ID,$ParentID,$Title,$Count,$ImageKey,$Expanded,$Selected,$DisplayPath,$ChildNodes,$RegistrationPathElement,$QueryPathElement,$Path,$IsHierarchy);
    }

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

class ViewsAndExplorers implements JsonSerializable
{
    public function __construct(
        /** @var array<ViewExplorerNode>|null */
        public ?array $Nodes=null
    ) {
    }

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

PHP ViewsAndExplorers DTOs

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

HTTP + 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: test-dogw.klokgroep.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
		}
	]
}