| 1 |
<?php |
| 2 |
|
| 3 |
namespace Dudlewebs\WPMCS\s3\Aws\Api; |
| 4 |
|
| 5 |
/** |
| 6 |
* Priority ordered collection of supported AWS protocols. |
| 7 |
*/ |
| 8 |
enum SupportedProtocols : string |
| 9 |
{ |
| 10 |
case JSON = 'json'; |
| 11 |
case REST_JSON = 'rest-json'; |
| 12 |
case REST_XML = 'rest-xml'; |
| 13 |
case QUERY = 'query'; |
| 14 |
case EC2 = 'ec2'; |
| 15 |
/** |
| 16 |
* Check if a protocol is valid. |
| 17 |
* |
| 18 |
* @param string $protocol |
| 19 |
* @return bool True if the protocol is supported, otherwise false. |
| 20 |
*/ |
| 21 |
public static function isSupported(string $protocol) : bool |
| 22 |
{ |
| 23 |
return self::tryFrom($protocol) !== null; |
| 24 |
} |
| 25 |
} |
| 26 |
|