<?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 ExportDialogPreferencesInput
 * Export dialog preferences. * @property null|CsvExportConfigInputInputType $csvExportConfig = null CSV export preferences.
 * @property null|iterable|ExportFormatEnum[] $enabledExportFormats = null The enabled export type formats.
 * @property null|ExcelExportConfigInputInputType $excelExportConfig = null Excel export preferences.
 * @property null|bool $hasConfig = null The has config flag.
 * @property null|ExportFormatEnum $lastActiveFormat = null The last active export type format.
 */
final class ExportDialogPreferencesInputInputType extends InputType
{
    protected function decorate($name, $value)
    {
        if ($value === null) {
            return null;
        }

        if ($name === 'csvExportConfig') {
            return new CsvExportConfigInputInputType($value);
        }

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

        if ($name === 'excelExportConfig') {
            return new ExcelExportConfigInputInputType($value);
        }

        if ($name === 'lastActiveFormat') {
            return new ExportFormatEnum($value);
        }

        return $value;
    }
}