<?php

namespace Symfony\Config\Flysystem\StorageConfig;

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 BunnycdnConfig 
{
    private $client;
    private $pullZone;
    private $_usedProperties = [];

    /**
     * The BunnyCDN client service name
     * @default null
     * @param ParamConfigurator|mixed $value
     * @return $this
     */
    public function client($value): static
    {
        $this->_usedProperties['client'] = true;
        $this->client = $value;

        return $this;
    }

    /**
     * The BunnyCDN pull zone name
     * @param ParamConfigurator|mixed $value
     * @return $this
     */
    public function pullZone($value): static
    {
        $this->_usedProperties['pullZone'] = true;
        $this->pullZone = $value;

        return $this;
    }

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

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

        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['client'])) {
            $output['client'] = $this->client;
        }
        if (isset($this->_usedProperties['pullZone'])) {
            $output['pull_zone'] = $this->pullZone;
        }

        return $output;
    }

}
