AutoPartitioningPolicy.php 1.8 KB

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