Scheme.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_import.proto
  4. namespace Ydb\Import\ImportFromS3Settings;
  5. use UnexpectedValueException;
  6. /**
  7. * Protobuf type <code>Ydb.Import.ImportFromS3Settings.Scheme</code>
  8. */
  9. class Scheme
  10. {
  11. /**
  12. * Generated from protobuf enum <code>UNSPECIFIED = 0;</code>
  13. */
  14. const UNSPECIFIED = 0;
  15. /**
  16. * Generated from protobuf enum <code>HTTP = 1;</code>
  17. */
  18. const HTTP = 1;
  19. /**
  20. * Generated from protobuf enum <code>HTTPS = 2;</code>
  21. */
  22. const HTTPS = 2;
  23. private static $valueToName = [
  24. self::UNSPECIFIED => 'UNSPECIFIED',
  25. self::HTTP => 'HTTP',
  26. self::HTTPS => 'HTTPS',
  27. ];
  28. public static function name($value)
  29. {
  30. if (!isset(self::$valueToName[$value])) {
  31. throw new UnexpectedValueException(sprintf(
  32. 'Enum %s has no name defined for value %s', __CLASS__, $value));
  33. }
  34. return self::$valueToName[$value];
  35. }
  36. public static function value($name)
  37. {
  38. $const = __CLASS__ . '::' . strtoupper($name);
  39. if (!defined($const)) {
  40. throw new UnexpectedValueException(sprintf(
  41. 'Enum %s has no value defined for name %s', __CLASS__, $name));
  42. }
  43. return constant($const);
  44. }
  45. }
  46. // Adding a class alias for backwards compatibility with the previous class name.
  47. class_alias(Scheme::class, \Ydb\Import\ImportFromS3Settings_Scheme::class);