1#include <userver/proto-structs/timestamp.hpp>
6#include <userver/proto-structs/exceptions.hpp>
7#include <userver/utils/impl/internal_tag.hpp>
11namespace proto_structs {
13Timestamp::Timestamp(utils::impl::InternalTag, std::int64_t seconds, std::int32_t nanos)
14 : Timestamp(std::chrono::seconds{seconds}, std::chrono::nanoseconds{nanos}) {}
16void Timestamp::ThrowError(
const std::chrono::seconds& seconds,
const std::chrono::nanoseconds& nanos) {
17 throw ValueError(fmt::format(
"Timestamp '{}s.{}ns' is invalid or out of range", seconds.count(), nanos.count()));
20void Timestamp::ThrowError(
const char* reason) {
throw ValueError(reason); }