<?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 DatabaseSchemaInput
 * A database schema * @property mixed $creationTime = null The time when the service was detected for the first time.
 * @property null|DatabaseInputInputType $database = null The owning database
 * @property null|iterable|DatabaseTableInputInputType[] $databaseTables = null The list of database tables within this database schema
 * @property mixed $maxSize = null The database max size in bytes
 * @property null|string $name = null The database name
 * @property mixed $size = null The database size in bytes
 */
final class DatabaseSchemaInputInputType extends InputType
{
    protected function decorate($name, $value)
    {
        if ($value === null) {
            return null;
        }

        if ($name === 'database') {
            return new DatabaseInputInputType($value);
        }

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

        return $value;
    }
}