<?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 TreeReportConfigInput
 * The report config when getting tree reports from the server * @property null|iterable|FieldFilterInputInputType[] $filters = null The list of filters
 * @property null|BuiltInReportEnum $report = null The report id
 * @property null|string $reportCacheId = null The report cache id. Reports can be cached. When using the cacheId, then the server gets the cached report. Otherwise, it gets the report from the database.
 */
final class TreeReportConfigInputInputType extends InputType
{
    protected function decorate($name, $value)
    {
        if ($value === null) {
            return null;
        }

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

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

        return $value;
    }
}