SessionStatus.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_table.proto
  4. namespace Ydb\Table\KeepAliveResult;
  5. use UnexpectedValueException;
  6. /**
  7. * Protobuf type <code>Ydb.Table.KeepAliveResult.SessionStatus</code>
  8. */
  9. class SessionStatus
  10. {
  11. /**
  12. * Generated from protobuf enum <code>SESSION_STATUS_UNSPECIFIED = 0;</code>
  13. */
  14. const SESSION_STATUS_UNSPECIFIED = 0;
  15. /**
  16. * Generated from protobuf enum <code>SESSION_STATUS_READY = 1;</code>
  17. */
  18. const SESSION_STATUS_READY = 1;
  19. /**
  20. * Generated from protobuf enum <code>SESSION_STATUS_BUSY = 2;</code>
  21. */
  22. const SESSION_STATUS_BUSY = 2;
  23. private static $valueToName = [
  24. self::SESSION_STATUS_UNSPECIFIED => 'SESSION_STATUS_UNSPECIFIED',
  25. self::SESSION_STATUS_READY => 'SESSION_STATUS_READY',
  26. self::SESSION_STATUS_BUSY => 'SESSION_STATUS_BUSY',
  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(SessionStatus::class, \Ydb\Table\KeepAliveResult_SessionStatus::class);