<?php

namespace Symfony\Config\PimNotification;

require_once __DIR__.\DIRECTORY_SEPARATOR.'Settings'.\DIRECTORY_SEPARATOR.'VersionUpdateConfig.php';

use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;

/**
 * This class is automatically generated to help in creating a config.
 */
class SettingsConfig 
{
    private $versionUpdate;
    private $_usedProperties = [];

    public function versionUpdate(array $value = []): \Symfony\Config\PimNotification\Settings\VersionUpdateConfig
    {
        if (null === $this->versionUpdate) {
            $this->_usedProperties['versionUpdate'] = true;
            $this->versionUpdate = new \Symfony\Config\PimNotification\Settings\VersionUpdateConfig($value);
        } elseif (0 < \func_num_args()) {
            throw new InvalidConfigurationException('The node created by "versionUpdate()" has already been initialized. You cannot pass values the second time you call versionUpdate().');
        }

        return $this->versionUpdate;
    }

    public function __construct(array $value = [])
    {
        if (array_key_exists('version_update', $value)) {
            $this->_usedProperties['versionUpdate'] = true;
            $this->versionUpdate = new \Symfony\Config\PimNotification\Settings\VersionUpdateConfig($value['version_update']);
            unset($value['version_update']);
        }

        if ([] !== $value) {
            throw new InvalidConfigurationException(sprintf('The following keys are not supported by "%s": ', __CLASS__).implode(', ', array_keys($value)));
        }
    }

    public function toArray(): array
    {
        $output = [];
        if (isset($this->_usedProperties['versionUpdate'])) {
            $output['version_update'] = $this->versionUpdate->toArray();
        }

        return $output;
    }

}
