<?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 CyberarkSafeInput
 * This cyberark safe. * @property null|iterable|CyberarkAccountInputInputType[] $accounts = null This cyberark safe accounts.
 * @property null|string $description = null This cyberark safe description.
 * @property null|iterable|CyberarkGroupInputInputType[] $groups = null This cyberark safe groups.
 * @property null|string $name = null This cyberark safe name.
 * @property null|string $urlId = null This cyberark safe url id.
 * @property null|iterable|CyberarkAccountInputInputType[] $allAccounts = null All cyberark safe accounts, including those that belong in groups.
 */
final class CyberarkSafeInputInputType extends InputType
{
    protected function decorate($name, $value)
    {
        if ($value === null) {
            return null;
        }

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

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

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

        return $value;
    }
}