1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- # Generated by the protocol buffer compiler. DO NOT EDIT!
- # source: protos/ydb_coordination.proto
- namespace Ydb\Coordination;
- use UnexpectedValueException;
- /**
- **
- * Counters mode
- *
- * Protobuf type <code>Ydb.Coordination.RateLimiterCountersMode</code>
- */
- class RateLimiterCountersMode
- {
- /**
- * The default or current value
- *
- * Generated from protobuf enum <code>RATE_LIMITER_COUNTERS_MODE_UNSET = 0;</code>
- */
- const RATE_LIMITER_COUNTERS_MODE_UNSET = 0;
- /**
- * Aggregated counters for resource tree
- *
- * Generated from protobuf enum <code>RATE_LIMITER_COUNTERS_MODE_AGGREGATED = 1;</code>
- */
- const RATE_LIMITER_COUNTERS_MODE_AGGREGATED = 1;
- /**
- * Counters on every resource
- *
- * Generated from protobuf enum <code>RATE_LIMITER_COUNTERS_MODE_DETAILED = 2;</code>
- */
- const RATE_LIMITER_COUNTERS_MODE_DETAILED = 2;
- private static $valueToName = [
- self::RATE_LIMITER_COUNTERS_MODE_UNSET => 'RATE_LIMITER_COUNTERS_MODE_UNSET',
- self::RATE_LIMITER_COUNTERS_MODE_AGGREGATED => 'RATE_LIMITER_COUNTERS_MODE_AGGREGATED',
- self::RATE_LIMITER_COUNTERS_MODE_DETAILED => 'RATE_LIMITER_COUNTERS_MODE_DETAILED',
- ];
- public static function name($value)
- {
- if (!isset(self::$valueToName[$value])) {
- throw new UnexpectedValueException(sprintf(
- 'Enum %s has no name defined for value %s', __CLASS__, $value));
- }
- return self::$valueToName[$value];
- }
- public static function value($name)
- {
- $const = __CLASS__ . '::' . strtoupper($name);
- if (!defined($const)) {
- throw new UnexpectedValueException(sprintf(
- 'Enum %s has no value defined for name %s', __CLASS__, $name));
- }
- return constant($const);
- }
- }
|