State.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_cms.proto
  4. namespace Ydb\Cms\GetDatabaseStatusResult;
  5. use UnexpectedValueException;
  6. /**
  7. * Protobuf type <code>Ydb.Cms.GetDatabaseStatusResult.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>CREATING = 1;</code>
  17. */
  18. const CREATING = 1;
  19. /**
  20. * Generated from protobuf enum <code>RUNNING = 2;</code>
  21. */
  22. const RUNNING = 2;
  23. /**
  24. * Generated from protobuf enum <code>REMOVING = 3;</code>
  25. */
  26. const REMOVING = 3;
  27. /**
  28. * Generated from protobuf enum <code>PENDING_RESOURCES = 4;</code>
  29. */
  30. const PENDING_RESOURCES = 4;
  31. /**
  32. * Generated from protobuf enum <code>CONFIGURING = 5;</code>
  33. */
  34. const CONFIGURING = 5;
  35. private static $valueToName = [
  36. self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
  37. self::CREATING => 'CREATING',
  38. self::RUNNING => 'RUNNING',
  39. self::REMOVING => 'REMOVING',
  40. self::PENDING_RESOURCES => 'PENDING_RESOURCES',
  41. self::CONFIGURING => 'CONFIGURING',
  42. ];
  43. public static function name($value)
  44. {
  45. if (!isset(self::$valueToName[$value])) {
  46. throw new UnexpectedValueException(sprintf(
  47. 'Enum %s has no name defined for value %s', __CLASS__, $value));
  48. }
  49. return self::$valueToName[$value];
  50. }
  51. public static function value($name)
  52. {
  53. $const = __CLASS__ . '::' . strtoupper($name);
  54. if (!defined($const)) {
  55. throw new UnexpectedValueException(sprintf(
  56. 'Enum %s has no value defined for name %s', __CLASS__, $name));
  57. }
  58. return constant($const);
  59. }
  60. }
  61. // Adding a class alias for backwards compatibility with the previous class name.
  62. class_alias(State::class, \Ydb\Cms\GetDatabaseStatusResult_State::class);