<?php

namespace Symfony\Config\Lti1p3;


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 PlatformConfig 
{
    private $name;
    private $audience;
    private $oidcAuthenticationUrl;
    private $oauth2AccessTokenUrl;
    
    /**
     * @default null
     * @param ParamConfigurator|mixed $value
     * @return $this
     */
    public function name($value): self
    {
        $this->name = $value;
    
        return $this;
    }
    
    /**
     * @default null
     * @param ParamConfigurator|mixed $value
     * @return $this
     */
    public function audience($value): self
    {
        $this->audience = $value;
    
        return $this;
    }
    
    /**
     * @default null
     * @param ParamConfigurator|mixed $value
     * @return $this
     */
    public function oidcAuthenticationUrl($value): self
    {
        $this->oidcAuthenticationUrl = $value;
    
        return $this;
    }
    
    /**
     * @default null
     * @param ParamConfigurator|mixed $value
     * @return $this
     */
    public function oauth2AccessTokenUrl($value): self
    {
        $this->oauth2AccessTokenUrl = $value;
    
        return $this;
    }
    
    public function __construct(array $value = [])
    {
    
        if (isset($value['name'])) {
            $this->name = $value['name'];
            unset($value['name']);
        }
    
        if (isset($value['audience'])) {
            $this->audience = $value['audience'];
            unset($value['audience']);
        }
    
        if (isset($value['oidc_authentication_url'])) {
            $this->oidcAuthenticationUrl = $value['oidc_authentication_url'];
            unset($value['oidc_authentication_url']);
        }
    
        if (isset($value['oauth2_access_token_url'])) {
            $this->oauth2AccessTokenUrl = $value['oauth2_access_token_url'];
            unset($value['oauth2_access_token_url']);
        }
    
        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->name) {
            $output['name'] = $this->name;
        }
        if (null !== $this->audience) {
            $output['audience'] = $this->audience;
        }
        if (null !== $this->oidcAuthenticationUrl) {
            $output['oidc_authentication_url'] = $this->oidcAuthenticationUrl;
        }
        if (null !== $this->oauth2AccessTokenUrl) {
            $output['oauth2_access_token_url'] = $this->oauth2AccessTokenUrl;
        }
    
        return $output;
    }
    

}
