<?php

declare (strict_types=1);
namespace idoit\Module\JDisc\Graphql\Schema\Model;

use Axtiva\FlexibleGraphql\Type\InputType;

/**
 * This code is @generated by axtiva/flexible-graphql-php do not edit it
 * PHP representation of graphql type JDiagramNodeDataInput
 * A diagram node data type * @property null|int $currentDepth = null The node current depth
 * @property null|DiagramEntityIdEnum $diagramEntityId = null The entity id related to the node
 * @property mixed $entityId = null The object db id related to the node
 * @property null|iterable|DiagramRelationIdEnum[] $fetchedRelations = null The immediate relations fetched after the current node
 * @property null|BuiltInReportEnum $infoReportId = null The builtInReport to show info related to the node
 * @property null|iterable|DiagramRelationIdEnum[] $relationsPath = null The relations path to the current node
 */
final class JDiagramNodeDataInputInputType extends InputType
{
    protected function decorate($name, $value)
    {
        if ($value === null) {
            return null;
        }

        if ($name === 'diagramEntityId') {
            return new DiagramEntityIdEnum($value);
        }

        if ($name === 'fetchedRelations') {
            return (function($value) {foreach($value as $v) yield ($v === null ? null : new DiagramRelationIdEnum($v)); })($value);
        }

        if ($name === 'infoReportId') {
            return new BuiltInReportEnum($value);
        }

        if ($name === 'relationsPath') {
            return (function($value) {foreach($value as $v) yield ($v === null ? null : new DiagramRelationIdEnum($v)); })($value);
        }

        return $value;
    }
}