<?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 CustomReportConfigInput
 * The report configuration when getting table data from the server * @property null|CustomReportReferenceInputType $customReportRef = null The custom report reference
 * @property null|iterable|FieldFilterInputInputType[] $filters = null The list of filters
 * @property null|PagingInputInputType $paging = null The paging configuration. When null, then it returns all data
 * @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.
 * @property null|SearchConfigurationInputInputType $searchConfig = null The paging configuration. When null, then it returns all data
 * @property null|iterable|SortEntryInputInputType[] $sortConfiguration = null The sort configuration
 */
final class CustomReportConfigInputInputType extends InputType
{
    protected function decorate($name, $value)
    {
        if ($value === null) {
            return null;
        }

        if ($name === 'customReportRef') {
            return new CustomReportReferenceInputType($value);
        }

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

        if ($name === 'paging') {
            return new PagingInputInputType($value);
        }

        if ($name === 'searchConfig') {
            return new SearchConfigurationInputInputType($value);
        }

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

        return $value;
    }
}