Result.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_monitoring.proto
  4. namespace Ydb\Monitoring\SelfCheck;
  5. use UnexpectedValueException;
  6. /**
  7. * Describes the result of self-check performed.
  8. *
  9. * Protobuf type <code>Ydb.Monitoring.SelfCheck.Result</code>
  10. */
  11. class Result
  12. {
  13. /**
  14. * Generated from protobuf enum <code>UNSPECIFIED = 0;</code>
  15. */
  16. const UNSPECIFIED = 0;
  17. /**
  18. * Generated from protobuf enum <code>GOOD = 1;</code>
  19. */
  20. const GOOD = 1;
  21. /**
  22. * Generated from protobuf enum <code>DEGRADED = 2;</code>
  23. */
  24. const DEGRADED = 2;
  25. /**
  26. * Generated from protobuf enum <code>MAINTENANCE_REQUIRED = 3;</code>
  27. */
  28. const MAINTENANCE_REQUIRED = 3;
  29. /**
  30. * Generated from protobuf enum <code>EMERGENCY = 4;</code>
  31. */
  32. const EMERGENCY = 4;
  33. private static $valueToName = [
  34. self::UNSPECIFIED => 'UNSPECIFIED',
  35. self::GOOD => 'GOOD',
  36. self::DEGRADED => 'DEGRADED',
  37. self::MAINTENANCE_REQUIRED => 'MAINTENANCE_REQUIRED',
  38. self::EMERGENCY => 'EMERGENCY',
  39. ];
  40. public static function name($value)
  41. {
  42. if (!isset(self::$valueToName[$value])) {
  43. throw new UnexpectedValueException(sprintf(
  44. 'Enum %s has no name defined for value %s', __CLASS__, $value));
  45. }
  46. return self::$valueToName[$value];
  47. }
  48. public static function value($name)
  49. {
  50. $const = __CLASS__ . '::' . strtoupper($name);
  51. if (!defined($const)) {
  52. throw new UnexpectedValueException(sprintf(
  53. 'Enum %s has no value defined for name %s', __CLASS__, $name));
  54. }
  55. return constant($const);
  56. }
  57. }
  58. // Adding a class alias for backwards compatibility with the previous class name.
  59. class_alias(Result::class, \Ydb\Monitoring\SelfCheck_Result::class);