api.InfluxDbPrecision */ class InfluxDbPrecision { /** * Generated from protobuf enum NS = 0; */ const NS = 0; /** * Generated from protobuf enum U = 1; */ const U = 1; /** * Generated from protobuf enum MS = 2; */ const MS = 2; /** * Generated from protobuf enum S = 3; */ const S = 3; /** * Generated from protobuf enum M = 4; */ const M = 4; /** * Generated from protobuf enum H = 5; */ const H = 5; private static $valueToName = [ self::NS => 'NS', self::U => 'U', self::MS => 'MS', self::S => 'S', self::M => 'M', self::H => 'H', ]; 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); } }