<?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 JDiagramInstanceInput
 * A diagram instance * @property bool $builtIn The diagram instance built-in flag
 * @property null|string $description = null The diagram instance description
 * @property null|iterable|JDiagramAggregationNodePropertiesInputInputType[] $diagramAggregationNodeProperties = null The diagram instance aggregation nodes properties
 * @property null|JDiagramDescriptionInputInputType $diagramDescription = null The diagram instance description
 * @property null|iterable|JDiagramNodePropertiesInputInputType[] $diagramNodeProperties = null The diagram instance nodes properties
 * @property null|DiagramPreferencesInputInputType $diagramPreferences = null The diagram instance preferences
 * @property bool $folder The diagram instance folder flag
 * @property bool $global The diagram instance public visibility flag
 * @property mixed $id = null The diagram instance id
 * @property null|JDiagramLayoutEnum $layout = null The diagram instance layout
 * @property null|string $name = null The diagram instance name
 * @property mixed $parentId = null The diagram parent instance id
 */
final class JDiagramInstanceInputInputType extends InputType
{
    protected function decorate($name, $value)
    {
        if ($value === null) {
            return null;
        }

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

        if ($name === 'diagramDescription') {
            return new JDiagramDescriptionInputInputType($value);
        }

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

        if ($name === 'diagramPreferences') {
            return new DiagramPreferencesInputInputType($value);
        }

        if ($name === 'layout') {
            return new JDiagramLayoutEnum($value);
        }

        return $value;
    }
}