Status.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_monitoring.proto
  4. namespace Ydb\Monitoring\StatusFlag;
  5. use UnexpectedValueException;
  6. /**
  7. * Describes the general state of a component.
  8. * From GREEN to RED, where GREEN is good, and RED is bad.
  9. * GREY means that the corresponding status is unknown.
  10. *
  11. * Protobuf type <code>Ydb.Monitoring.StatusFlag.Status</code>
  12. */
  13. class Status
  14. {
  15. /**
  16. * Generated from protobuf enum <code>UNSPECIFIED = 0;</code>
  17. */
  18. const UNSPECIFIED = 0;
  19. /**
  20. * Generated from protobuf enum <code>GREY = 1;</code>
  21. */
  22. const GREY = 1;
  23. /**
  24. * Generated from protobuf enum <code>GREEN = 2;</code>
  25. */
  26. const GREEN = 2;
  27. /**
  28. * Generated from protobuf enum <code>BLUE = 3;</code>
  29. */
  30. const BLUE = 3;
  31. /**
  32. * Generated from protobuf enum <code>YELLOW = 4;</code>
  33. */
  34. const YELLOW = 4;
  35. /**
  36. * Generated from protobuf enum <code>ORANGE = 5;</code>
  37. */
  38. const ORANGE = 5;
  39. /**
  40. * Generated from protobuf enum <code>RED = 6;</code>
  41. */
  42. const RED = 6;
  43. private static $valueToName = [
  44. self::UNSPECIFIED => 'UNSPECIFIED',
  45. self::GREY => 'GREY',
  46. self::GREEN => 'GREEN',
  47. self::BLUE => 'BLUE',
  48. self::YELLOW => 'YELLOW',
  49. self::ORANGE => 'ORANGE',
  50. self::RED => 'RED',
  51. ];
  52. public static function name($value)
  53. {
  54. if (!isset(self::$valueToName[$value])) {
  55. throw new UnexpectedValueException(sprintf(
  56. 'Enum %s has no name defined for value %s', __CLASS__, $value));
  57. }
  58. return self::$valueToName[$value];
  59. }
  60. public static function value($name)
  61. {
  62. $const = __CLASS__ . '::' . strtoupper($name);
  63. if (!defined($const)) {
  64. throw new UnexpectedValueException(sprintf(
  65. 'Enum %s has no value defined for name %s', __CLASS__, $name));
  66. }
  67. return constant($const);
  68. }
  69. }
  70. // Adding a class alias for backwards compatibility with the previous class name.
  71. class_alias(Status::class, \Ydb\Monitoring\StatusFlag_Status::class);