<?php

namespace Symfony\Config\Flysystem;

require_once __DIR__.\DIRECTORY_SEPARATOR.'StorageConfig'.\DIRECTORY_SEPARATOR.'AsyncawsConfig.php';
require_once __DIR__.\DIRECTORY_SEPARATOR.'StorageConfig'.\DIRECTORY_SEPARATOR.'AwsConfig.php';
require_once __DIR__.\DIRECTORY_SEPARATOR.'StorageConfig'.\DIRECTORY_SEPARATOR.'AzureConfig.php';
require_once __DIR__.\DIRECTORY_SEPARATOR.'StorageConfig'.\DIRECTORY_SEPARATOR.'FtpConfig.php';
require_once __DIR__.\DIRECTORY_SEPARATOR.'StorageConfig'.\DIRECTORY_SEPARATOR.'GcloudConfig.php';
require_once __DIR__.\DIRECTORY_SEPARATOR.'StorageConfig'.\DIRECTORY_SEPARATOR.'GridfsConfig.php';
require_once __DIR__.\DIRECTORY_SEPARATOR.'StorageConfig'.\DIRECTORY_SEPARATOR.'LazyConfig.php';
require_once __DIR__.\DIRECTORY_SEPARATOR.'StorageConfig'.\DIRECTORY_SEPARATOR.'LocalConfig.php';
require_once __DIR__.\DIRECTORY_SEPARATOR.'StorageConfig'.\DIRECTORY_SEPARATOR.'MemoryConfig.php';
require_once __DIR__.\DIRECTORY_SEPARATOR.'StorageConfig'.\DIRECTORY_SEPARATOR.'SftpConfig.php';
require_once __DIR__.\DIRECTORY_SEPARATOR.'StorageConfig'.\DIRECTORY_SEPARATOR.'WebdavConfig.php';
require_once __DIR__.\DIRECTORY_SEPARATOR.'StorageConfig'.\DIRECTORY_SEPARATOR.'BunnycdnConfig.php';

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 StorageConfig 
{
    private $adapter;
    private $options;
    private $asyncaws;
    private $aws;
    private $azure;
    private $ftp;
    private $gcloud;
    private $gridfs;
    private $lazy;
    private $local;
    private $memory;
    private $sftp;
    private $webdav;
    private $bunnycdn;
    private $service;
    private $visibility;
    private $directoryVisibility;
    private $retainVisibility;
    private $caseSensitive;
    private $disableAsserts;
    private $publicUrl;
    private $pathNormalizer;
    private $publicUrlGenerator;
    private $temporaryUrlGenerator;
    private $readOnly;
    private $_usedProperties = [];

    /**
     * DEPRECATED: Use the new config format instead (e.g. "local:" instead of "adapter: local")
     * @default null
     * @param ParamConfigurator|mixed $value
     * @return $this
     */
    public function adapter($value): static
    {
        $this->_usedProperties['adapter'] = true;
        $this->adapter = $value;

        return $this;
    }

    /**
     * @param ParamConfigurator|list<ParamConfigurator|mixed> $value
     *
     * @return $this
     */
    public function options(ParamConfigurator|array $value): static
    {
        $this->_usedProperties['options'] = true;
        $this->options = $value;

        return $this;
    }

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

        return $this->asyncaws;
    }

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

        return $this->aws;
    }

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

        return $this->azure;
    }

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

        return $this->ftp;
    }

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

        return $this->gcloud;
    }

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

        return $this->gridfs;
    }

    /**
     * Lazy adapter for runtime storage selection
     */
    public function lazy(array $value = []): \Symfony\Config\Flysystem\StorageConfig\LazyConfig
    {
        if (null === $this->lazy) {
            $this->_usedProperties['lazy'] = true;
            $this->lazy = new \Symfony\Config\Flysystem\StorageConfig\LazyConfig($value);
        } elseif (0 < \func_num_args()) {
            throw new InvalidConfigurationException('The node created by "lazy()" has already been initialized. You cannot pass values the second time you call lazy().');
        }

        return $this->lazy;
    }

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

        return $this->local;
    }

    /**
     * In-memory adapter for testing (no configuration options)
     */
    public function memory(array $value = []): \Symfony\Config\Flysystem\StorageConfig\MemoryConfig
    {
        if (null === $this->memory) {
            $this->_usedProperties['memory'] = true;
            $this->memory = new \Symfony\Config\Flysystem\StorageConfig\MemoryConfig($value);
        } elseif (0 < \func_num_args()) {
            throw new InvalidConfigurationException('The node created by "memory()" has already been initialized. You cannot pass values the second time you call memory().');
        }

        return $this->memory;
    }

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

        return $this->sftp;
    }

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

        return $this->webdav;
    }

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

        return $this->bunnycdn;
    }

    /**
     * Reference to a custom adapter service (alternative to registered adapter types)
     * @default null
     * @param ParamConfigurator|mixed $value
     * @return $this
     */
    public function service($value): static
    {
        $this->_usedProperties['service'] = true;
        $this->service = $value;

        return $this;
    }

    /**
     * Default visibility for files
     * @default null
     * @param ParamConfigurator|mixed $value
     * @return $this
     */
    public function visibility($value): static
    {
        $this->_usedProperties['visibility'] = true;
        $this->visibility = $value;

        return $this;
    }

    /**
     * Default visibility for directories
     * @default null
     * @param ParamConfigurator|mixed $value
     * @return $this
     */
    public function directoryVisibility($value): static
    {
        $this->_usedProperties['directoryVisibility'] = true;
        $this->directoryVisibility = $value;

        return $this;
    }

    /**
     * Keeps the original file visibility (public/private) when copying or moving.
     * @default null
     * @param ParamConfigurator|mixed $value
     * @return $this
     */
    public function retainVisibility($value): static
    {
        $this->_usedProperties['retainVisibility'] = true;
        $this->retainVisibility = $value;

        return $this;
    }

    /**
     * @default true
     * @param ParamConfigurator|bool $value
     * @deprecated Since league/flysystem-bundle 3.5: The "case_sensitive" option is deprecated and will be removed in 4.0.
     * @return $this
     */
    public function caseSensitive($value): static
    {
        $this->_usedProperties['caseSensitive'] = true;
        $this->caseSensitive = $value;

        return $this;
    }

    /**
     * @default false
     * @param ParamConfigurator|bool $value
     * @deprecated Since league/flysystem-bundle 3.5: The "disable_asserts" option is deprecated and will be removed in 4.0.
     * @return $this
     */
    public function disableAsserts($value): static
    {
        $this->_usedProperties['disableAsserts'] = true;
        $this->disableAsserts = $value;

        return $this;
    }

    /**
     * @param ParamConfigurator|list<ParamConfigurator|mixed>|mixed $value
     *
     * @return $this
     */
    public function publicUrl(mixed $value): static
    {
        $this->_usedProperties['publicUrl'] = true;
        $this->publicUrl = $value;

        return $this;
    }

    /**
     * Path normalizer service name (should implement League\Flysystem\PathNormalizer)
     * @default null
     * @param ParamConfigurator|mixed $value
     * @return $this
     */
    public function pathNormalizer($value): static
    {
        $this->_usedProperties['pathNormalizer'] = true;
        $this->pathNormalizer = $value;

        return $this;
    }

    /**
     * For adapter that do not provide public URLs or override adapter capabilities and public_url option, a public URL generator service name can be configured in the main Filesystem configuration (should implement League\Flysystem\PublicUrlGenerator)
     * @default null
     * @param ParamConfigurator|mixed $value
     * @return $this
     */
    public function publicUrlGenerator($value): static
    {
        $this->_usedProperties['publicUrlGenerator'] = true;
        $this->publicUrlGenerator = $value;

        return $this;
    }

    /**
     * For adapter that do not provide public URLs or override adapter capabilities, a temporary URL generator service name can be configured in the main Filesystem configuration (should implement League\Flysystem\TemporaryUrlGenerator)
     * @default null
     * @param ParamConfigurator|mixed $value
     * @return $this
     */
    public function temporaryUrlGenerator($value): static
    {
        $this->_usedProperties['temporaryUrlGenerator'] = true;
        $this->temporaryUrlGenerator = $value;

        return $this;
    }

    /**
     * Converts a file system to read-only
     * @default false
     * @param ParamConfigurator|bool $value
     * @return $this
     */
    public function readOnly($value): static
    {
        $this->_usedProperties['readOnly'] = true;
        $this->readOnly = $value;

        return $this;
    }

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

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

        if (array_key_exists('asyncaws', $config)) {
            $this->_usedProperties['asyncaws'] = true;
            $this->asyncaws = new \Symfony\Config\Flysystem\StorageConfig\AsyncawsConfig($config['asyncaws']);
            unset($config['asyncaws']);
        }

        if (array_key_exists('aws', $config)) {
            $this->_usedProperties['aws'] = true;
            $this->aws = new \Symfony\Config\Flysystem\StorageConfig\AwsConfig($config['aws']);
            unset($config['aws']);
        }

        if (array_key_exists('azure', $config)) {
            $this->_usedProperties['azure'] = true;
            $this->azure = new \Symfony\Config\Flysystem\StorageConfig\AzureConfig($config['azure']);
            unset($config['azure']);
        }

        if (array_key_exists('ftp', $config)) {
            $this->_usedProperties['ftp'] = true;
            $this->ftp = new \Symfony\Config\Flysystem\StorageConfig\FtpConfig($config['ftp']);
            unset($config['ftp']);
        }

        if (array_key_exists('gcloud', $config)) {
            $this->_usedProperties['gcloud'] = true;
            $this->gcloud = new \Symfony\Config\Flysystem\StorageConfig\GcloudConfig($config['gcloud']);
            unset($config['gcloud']);
        }

        if (array_key_exists('gridfs', $config)) {
            $this->_usedProperties['gridfs'] = true;
            $this->gridfs = new \Symfony\Config\Flysystem\StorageConfig\GridfsConfig($config['gridfs']);
            unset($config['gridfs']);
        }

        if (array_key_exists('lazy', $config)) {
            $this->_usedProperties['lazy'] = true;
            $this->lazy = new \Symfony\Config\Flysystem\StorageConfig\LazyConfig($config['lazy']);
            unset($config['lazy']);
        }

        if (array_key_exists('local', $config)) {
            $this->_usedProperties['local'] = true;
            $this->local = new \Symfony\Config\Flysystem\StorageConfig\LocalConfig($config['local']);
            unset($config['local']);
        }

        if (array_key_exists('memory', $config)) {
            $this->_usedProperties['memory'] = true;
            $this->memory = new \Symfony\Config\Flysystem\StorageConfig\MemoryConfig($config['memory']);
            unset($config['memory']);
        }

        if (array_key_exists('sftp', $config)) {
            $this->_usedProperties['sftp'] = true;
            $this->sftp = new \Symfony\Config\Flysystem\StorageConfig\SftpConfig($config['sftp']);
            unset($config['sftp']);
        }

        if (array_key_exists('webdav', $config)) {
            $this->_usedProperties['webdav'] = true;
            $this->webdav = new \Symfony\Config\Flysystem\StorageConfig\WebdavConfig($config['webdav']);
            unset($config['webdav']);
        }

        if (array_key_exists('bunnycdn', $config)) {
            $this->_usedProperties['bunnycdn'] = true;
            $this->bunnycdn = new \Symfony\Config\Flysystem\StorageConfig\BunnycdnConfig($config['bunnycdn']);
            unset($config['bunnycdn']);
        }

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

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

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

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

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

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

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

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

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

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

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

        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['adapter'])) {
            $output['adapter'] = $this->adapter;
        }
        if (isset($this->_usedProperties['options'])) {
            $output['options'] = $this->options;
        }
        if (isset($this->_usedProperties['asyncaws'])) {
            $output['asyncaws'] = $this->asyncaws->toArray();
        }
        if (isset($this->_usedProperties['aws'])) {
            $output['aws'] = $this->aws->toArray();
        }
        if (isset($this->_usedProperties['azure'])) {
            $output['azure'] = $this->azure->toArray();
        }
        if (isset($this->_usedProperties['ftp'])) {
            $output['ftp'] = $this->ftp->toArray();
        }
        if (isset($this->_usedProperties['gcloud'])) {
            $output['gcloud'] = $this->gcloud->toArray();
        }
        if (isset($this->_usedProperties['gridfs'])) {
            $output['gridfs'] = $this->gridfs->toArray();
        }
        if (isset($this->_usedProperties['lazy'])) {
            $output['lazy'] = $this->lazy->toArray();
        }
        if (isset($this->_usedProperties['local'])) {
            $output['local'] = $this->local->toArray();
        }
        if (isset($this->_usedProperties['memory'])) {
            $output['memory'] = $this->memory->toArray();
        }
        if (isset($this->_usedProperties['sftp'])) {
            $output['sftp'] = $this->sftp->toArray();
        }
        if (isset($this->_usedProperties['webdav'])) {
            $output['webdav'] = $this->webdav->toArray();
        }
        if (isset($this->_usedProperties['bunnycdn'])) {
            $output['bunnycdn'] = $this->bunnycdn->toArray();
        }
        if (isset($this->_usedProperties['service'])) {
            $output['service'] = $this->service;
        }
        if (isset($this->_usedProperties['visibility'])) {
            $output['visibility'] = $this->visibility;
        }
        if (isset($this->_usedProperties['directoryVisibility'])) {
            $output['directory_visibility'] = $this->directoryVisibility;
        }
        if (isset($this->_usedProperties['retainVisibility'])) {
            $output['retain_visibility'] = $this->retainVisibility;
        }
        if (isset($this->_usedProperties['caseSensitive'])) {
            $output['case_sensitive'] = $this->caseSensitive;
        }
        if (isset($this->_usedProperties['disableAsserts'])) {
            $output['disable_asserts'] = $this->disableAsserts;
        }
        if (isset($this->_usedProperties['publicUrl'])) {
            $output['public_url'] = $this->publicUrl;
        }
        if (isset($this->_usedProperties['pathNormalizer'])) {
            $output['path_normalizer'] = $this->pathNormalizer;
        }
        if (isset($this->_usedProperties['publicUrlGenerator'])) {
            $output['public_url_generator'] = $this->publicUrlGenerator;
        }
        if (isset($this->_usedProperties['temporaryUrlGenerator'])) {
            $output['temporary_url_generator'] = $this->temporaryUrlGenerator;
        }
        if (isset($this->_usedProperties['readOnly'])) {
            $output['read_only'] = $this->readOnly;
        }

        return $output;
    }

}
