<?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 ProcessInput
 * A process running on an operating system. * @property null|string $binaryName = null The binary name for this process
 * @property null|iterable|PortConnectionInputInputType[] $listeningPorts = null The list of TCP/IP ports that are in listen mode.
 * @property null|string $parameters = null The parameters that this binary is called with
 * @property null|int $parentProcessId = null The parent process id
 * @property null|string $path = null The binary's path
 * @property null|int $processId = null The process id
 * @property null|iterable|PortConnectionInputInputType[] $tcpIPConnections = null The list of listening ports and TCP/IP connections for this process.
 */
final class ProcessInputInputType extends InputType
{
    protected function decorate($name, $value)
    {
        if ($value === null) {
            return null;
        }

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

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

        return $value;
    }
}