<?php

namespace Symfony\Config\Mcp;

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

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

    /**
     * @default false
     * @param ParamConfigurator|bool $value
     * @return $this
     */
    public function stdio($value): static
    {
        $this->_usedProperties['stdio'] = true;
        $this->stdio = $value;

        return $this;
    }

    /**
     * @default false
     * @param ParamConfigurator|bool $value
     * @return $this
     */
    public function http($value): static
    {
        $this->_usedProperties['http'] = true;
        $this->http = $value;

        return $this;
    }

    public function __construct(array $config = [])
    {
        if (array_key_exists('stdio', $config)) {
            $this->_usedProperties['stdio'] = true;
            $this->stdio = $config['stdio'];
            unset($config['stdio']);
        }

        if (array_key_exists('http', $config)) {
            $this->_usedProperties['http'] = true;
            $this->http = $config['http'];
            unset($config['http']);
        }

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

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

        return $output;
    }

}
