<?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 CustomReportDescriptionBaseInput
 * A custom reports container base * @property null|iterable|CustomReportDataFieldInputInputType[] $activeFields = null The custom report active fields, if any
 * @property bool $canDelete The custom report can delete flag, which defines whether this user can delete the report (true), or not (false)
 * @property null|string $description = null The custom report description
 * @property mixed $id = null The custom report id
 * @property null|string $name = null The custom report name
 * @property null|ReportOwnerEnum $owner = null The custom report owner
 * @property mixed $parentId = null The custom report parent id, to use on creation
 * @property null|string $sqlQuery = null The custom report sql query, if any
 * @property null|CustomReportTypeEnum $type = null The custom report owner
 * @property mixed $userGroupId = null The custom report user group id if any, to use on creation
 */
final class CustomReportDescriptionBaseInputInputType extends InputType
{
    protected function decorate($name, $value)
    {
        if ($value === null) {
            return null;
        }

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

        if ($name === 'owner') {
            return new ReportOwnerEnum($value);
        }

        if ($name === 'type') {
            return new CustomReportTypeEnum($value);
        }

        return $value;
    }
}