summaryrefslogtreecommitdiff
path: root/vendor/aws/aws-sdk-php/src/S3/RegionalEndpoint/Configuration.php
blob: 48dc63d783309144e89d5be5dd81a1a4a445e46f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
namespace Aws\S3\RegionalEndpoint;

class Configuration implements ConfigurationInterface
{
    private $endpointsType;
    private $isFallback;

    public function __construct($endpointsType, $isFallback = false)
    {
        $this->endpointsType = strtolower($endpointsType);
        $this->isFallback = $isFallback;
        if (!in_array($this->endpointsType, ['legacy', 'regional'])) {
            throw new \InvalidArgumentException(
                "Configuration parameter must either be 'legacy' or 'regional'."
            );
        }
    }

    /**
     * {@inheritdoc}
     */
    public function getEndpointsType()
    {
        return $this->endpointsType;
    }

    /**
     * {@inheritdoc}
     */
    public function toArray()
    {
        return [
            'endpoints_type' => $this->getEndpointsType()
        ];
    }

    public function isFallback()
    {
        return $this->isFallback;
    }
}