openstatus.monitor.v1.TimeRange */ class TimeRange { /** * Unspecified time range. * * Generated from protobuf enum TIME_RANGE_UNSPECIFIED = 0; */ const TIME_RANGE_UNSPECIFIED = 0; /** * Last 24 hours. * * Generated from protobuf enum TIME_RANGE_1D = 1; */ const TIME_RANGE_1D = 1; /** * Last 7 days. * * Generated from protobuf enum TIME_RANGE_7D = 2; */ const TIME_RANGE_7D = 2; /** * Last 14 days. * * Generated from protobuf enum TIME_RANGE_14D = 3; */ const TIME_RANGE_14D = 3; private static $valueToName = [ self::TIME_RANGE_UNSPECIFIED => 'TIME_RANGE_UNSPECIFIED', self::TIME_RANGE_1D => 'TIME_RANGE_1D', self::TIME_RANGE_7D => 'TIME_RANGE_7D', self::TIME_RANGE_14D => 'TIME_RANGE_14D', ]; 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); } }