State.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_table.proto
  4. namespace Ydb\Table\IndexBuildState;
  5. use UnexpectedValueException;
  6. /**
  7. * Protobuf type <code>Ydb.Table.IndexBuildState.State</code>
  8. */
  9. class State
  10. {
  11. /**
  12. * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
  13. */
  14. const STATE_UNSPECIFIED = 0;
  15. /**
  16. * Generated from protobuf enum <code>STATE_PREPARING = 1;</code>
  17. */
  18. const STATE_PREPARING = 1;
  19. /**
  20. * Generated from protobuf enum <code>STATE_TRANSFERING_DATA = 2;</code>
  21. */
  22. const STATE_TRANSFERING_DATA = 2;
  23. /**
  24. * Generated from protobuf enum <code>STATE_APPLYING = 3;</code>
  25. */
  26. const STATE_APPLYING = 3;
  27. /**
  28. * Generated from protobuf enum <code>STATE_DONE = 4;</code>
  29. */
  30. const STATE_DONE = 4;
  31. /**
  32. * Generated from protobuf enum <code>STATE_CANCELLATION = 5;</code>
  33. */
  34. const STATE_CANCELLATION = 5;
  35. /**
  36. * Generated from protobuf enum <code>STATE_CANCELLED = 6;</code>
  37. */
  38. const STATE_CANCELLED = 6;
  39. /**
  40. * Generated from protobuf enum <code>STATE_REJECTION = 7;</code>
  41. */
  42. const STATE_REJECTION = 7;
  43. /**
  44. * Generated from protobuf enum <code>STATE_REJECTED = 8;</code>
  45. */
  46. const STATE_REJECTED = 8;
  47. private static $valueToName = [
  48. self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
  49. self::STATE_PREPARING => 'STATE_PREPARING',
  50. self::STATE_TRANSFERING_DATA => 'STATE_TRANSFERING_DATA',
  51. self::STATE_APPLYING => 'STATE_APPLYING',
  52. self::STATE_DONE => 'STATE_DONE',
  53. self::STATE_CANCELLATION => 'STATE_CANCELLATION',
  54. self::STATE_CANCELLED => 'STATE_CANCELLED',
  55. self::STATE_REJECTION => 'STATE_REJECTION',
  56. self::STATE_REJECTED => 'STATE_REJECTED',
  57. ];
  58. public static function name($value)
  59. {
  60. if (!isset(self::$valueToName[$value])) {
  61. throw new UnexpectedValueException(sprintf(
  62. 'Enum %s has no name defined for value %s', __CLASS__, $value));
  63. }
  64. return self::$valueToName[$value];
  65. }
  66. public static function value($name)
  67. {
  68. $const = __CLASS__ . '::' . strtoupper($name);
  69. if (!defined($const)) {
  70. throw new UnexpectedValueException(sprintf(
  71. 'Enum %s has no value defined for name %s', __CLASS__, $name));
  72. }
  73. return constant($const);
  74. }
  75. }
  76. // Adding a class alias for backwards compatibility with the previous class name.
  77. class_alias(State::class, \Ydb\Table\IndexBuildState_State::class);