<?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 JDiagramDescriptionInput
 * A diagram description * @property null|DiagramEntityIdEnum $diagramEntityId = null The diagram entity id
 * @property mixed $entityId = null The entity id
 * @property null|iterable|DiagramEntityRelationInputInputType[] $relations = null The node relations to another entity
 */
final class JDiagramDescriptionInputInputType extends InputType
{
    protected function decorate($name, $value)
    {
        if ($value === null) {
            return null;
        }

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

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

        return $value;
    }
}