<?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 VirtualDatacenterInput
 * A virtual datacenter (e.g. within a Vmware VCenter environment). * @property null|iterable|ClusterInputInputType[] $clusters = null The set of clusters within this datacenter.
 * @property null|string $name = null The datacenter name.
 * @property null|DatacenterTypeEnum $type = null The datacenter type
 * @property null|string $uniqueId = null A datacenter's unique id.
 */
final class VirtualDatacenterInputInputType extends InputType
{
    protected function decorate($name, $value)
    {
        if ($value === null) {
            return null;
        }

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

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

        return $value;
    }
}