diff options
author | Andrew Dolgov <[email protected]> | 2022-11-23 21:14:33 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2022-11-23 21:14:33 +0300 |
commit | 0c8af4992cb0f7589dcafaad65ada12753c64594 (patch) | |
tree | 18e83d068c3e7dd2499331de977782b382279396 /vendor/aws/aws-sdk-php/src/Endpoint/UseDualstackEndpoint/Configuration.php |
initial
Diffstat (limited to 'vendor/aws/aws-sdk-php/src/Endpoint/UseDualstackEndpoint/Configuration.php')
-rw-r--r-- | vendor/aws/aws-sdk-php/src/Endpoint/UseDualstackEndpoint/Configuration.php | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/vendor/aws/aws-sdk-php/src/Endpoint/UseDualstackEndpoint/Configuration.php b/vendor/aws/aws-sdk-php/src/Endpoint/UseDualstackEndpoint/Configuration.php new file mode 100644 index 0000000..5506fca --- /dev/null +++ b/vendor/aws/aws-sdk-php/src/Endpoint/UseDualstackEndpoint/Configuration.php @@ -0,0 +1,41 @@ +<?php +namespace Aws\Endpoint\UseDualstackEndpoint; + +use Aws; +use Aws\Endpoint\UseDualstackEndpoint\Exception\ConfigurationException; + +class Configuration implements ConfigurationInterface +{ + private $useDualstackEndpoint; + + public function __construct($useDualstackEndpoint, $region) + { + $this->useDualstackEndpoint = Aws\boolean_value($useDualstackEndpoint); + if (is_null($this->useDualstackEndpoint)) { + throw new ConfigurationException("'use_dual_stack_endpoint' config option" + . " must be a boolean value."); + } + if ($this->useDualstackEndpoint == true + && (strpos($region, "iso-") !== false || strpos($region, "-iso") !== false) + ) { + throw new ConfigurationException("Dual-stack is not supported in ISO regions"); } + } + + /** + * {@inheritdoc} + */ + public function isUseDualstackEndpoint() + { + return $this->useDualstackEndpoint; + } + + /** + * {@inheritdoc} + */ + public function toArray() + { + return [ + 'use_dual_stack_endpoint' => $this->isUseDualstackEndpoint(), + ]; + } +} |