1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- # Generated by the protocol buffer compiler. DO NOT EDIT!
- # source: protos/ydb_coordination.proto
- namespace Ydb\Coordination;
- use UnexpectedValueException;
- /**
- **
- * Consistency mode
- *
- * Protobuf type <code>Ydb.Coordination.ConsistencyMode</code>
- */
- class ConsistencyMode
- {
- /**
- * The default or current value
- *
- * Generated from protobuf enum <code>CONSISTENCY_MODE_UNSET = 0;</code>
- */
- const CONSISTENCY_MODE_UNSET = 0;
- /**
- * Strict mode makes sure operations may only complete on current leader
- *
- * Generated from protobuf enum <code>CONSISTENCY_MODE_STRICT = 1;</code>
- */
- const CONSISTENCY_MODE_STRICT = 1;
- /**
- * Relaxed mode allows operations to complete on stale masters
- *
- * Generated from protobuf enum <code>CONSISTENCY_MODE_RELAXED = 2;</code>
- */
- const CONSISTENCY_MODE_RELAXED = 2;
- private static $valueToName = [
- self::CONSISTENCY_MODE_UNSET => 'CONSISTENCY_MODE_UNSET',
- self::CONSISTENCY_MODE_STRICT => 'CONSISTENCY_MODE_STRICT',
- self::CONSISTENCY_MODE_RELAXED => 'CONSISTENCY_MODE_RELAXED',
- ];
- 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);
- }
- }
|