<?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 DeviceArrayAttributeInput
 * a device array attribute * @property null|iterable|DeviceArrayAttributeColumnNameInputInputType[] $columnNames = null Gets the column names
 * @property null|CustomAttributeInputInputType $customAttribute = null The corresponding custom attribute definition
 * @property null|DeviceInputInputType $device = null The corresponding device
 * @property mixed $lastUpdate = null The last update timestamp.
 * @property null|string $name = null The name for device attributes which are no custom attributes.
 * @property null|iterable|DeviceArrayAttributeValueInputInputType[] $values = null The values as individual objects
 * @property null|ArrayAttributeInputInputType $array = null Gets the array attribute object with all values and column names
 */
final class DeviceArrayAttributeInputInputType extends InputType
{
    protected function decorate($name, $value)
    {
        if ($value === null) {
            return null;
        }

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

        if ($name === 'customAttribute') {
            return new CustomAttributeInputInputType($value);
        }

        if ($name === 'device') {
            return new DeviceInputInputType($value);
        }

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

        if ($name === 'array') {
            return new ArrayAttributeInputInputType($value);
        }

        return $value;
    }
}