Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
namespace Aws\Sts\RegionalEndpoints;
3
 
4
class Configuration implements ConfigurationInterface
5
{
6
    private $endpointsType;
7
    private $isFallback;
8
 
9
    public function __construct($endpointsType, $isFallback = false)
10
    {
11
        $this->endpointsType = strtolower($endpointsType);
12
        $this->isFallback = $isFallback;
13
        if (!in_array($this->endpointsType, ['legacy', 'regional'])) {
14
            throw new \InvalidArgumentException(
15
                "Configuration parameter must either be 'legacy' or 'regional'."
16
            );
17
        }
18
    }
19
 
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function getEndpointsType()
24
    {
25
        return $this->endpointsType;
26
    }
27
 
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function toArray()
32
    {
33
        return [
34
            'endpoints_type' => $this->getEndpointsType()
35
        ];
36
    }
37
 
38
    public function isFallback()
39
    {
40
        return $this->isFallback;
41
    }
42
}