<?php

namespace Symfony\Config\LightSamlSymfonyBridge\Own;


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


/**
 * This class is automatically generated to help creating config.
 *
 * @experimental in 5.3
 */
class CredentialsConfig 
{
    private $certificate;
    private $key;
    private $password;
    
    /**
     * @default null
     * @param ParamConfigurator|mixed $value
     * @return $this
     */
    public function certificate($value): self
    {
        $this->certificate = $value;
    
        return $this;
    }
    
    /**
     * @default null
     * @param ParamConfigurator|mixed $value
     * @return $this
     */
    public function key($value): self
    {
        $this->key = $value;
    
        return $this;
    }
    
    /**
     * @default null
     * @param ParamConfigurator|mixed $value
     * @return $this
     */
    public function password($value): self
    {
        $this->password = $value;
    
        return $this;
    }
    
    public function __construct(array $value = [])
    {
    
        if (isset($value['certificate'])) {
            $this->certificate = $value['certificate'];
            unset($value['certificate']);
        }
    
        if (isset($value['key'])) {
            $this->key = $value['key'];
            unset($value['key']);
        }
    
        if (isset($value['password'])) {
            $this->password = $value['password'];
            unset($value['password']);
        }
    
        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 (null !== $this->certificate) {
            $output['certificate'] = $this->certificate;
        }
        if (null !== $this->key) {
            $output['key'] = $this->key;
        }
        if (null !== $this->password) {
            $output['password'] = $this->password;
        }
    
        return $output;
    }
    

}
