1#include <userver/protobuf/datetime.hpp>
7bool IsValidDuration(
const std::int64_t seconds,
const std::int32_t nanos)
noexcept {
8 if (seconds < kMinDurationSeconds || seconds > kMaxDurationSeconds) {
12 if (nanos < kMinDurationNanos || nanos > kMaxDurationNanos) {
16 if ((seconds > 0 && nanos < 0) || (seconds < 0 && nanos > 0)) {
23bool IsValidTimestamp(
const std::int64_t seconds,
const std::int32_t nanos)
noexcept {
24 if (seconds < kMinTimestampSeconds || seconds > kMaxTimestampSeconds) {
28 if (nanos < kMinTimestampNanos || nanos > kMaxTimestampNanos) {