// This proto file was generated from global.yml.
// Care should be taken while both files exist to maintain backwards compatibility with the Conjure generated code.

syntax = "proto3";

// Ignore buf linting rule that adds version suffix for shared global types
// buf:lint:ignore PACKAGE_VERSION_SUFFIX
package nominal.types.time;

option java_multiple_files = true;
option java_package = "io.nominal.types.time";

// buf:lint:ignore ENUM_VALUE_PREFIX
enum TimeUnit {
  TIME_UNIT_UNSPECIFIED = 0;
  DAYS = 1;
  HOURS = 2;
  MINUTES = 3;
  SECONDS = 4;
  MILLISECONDS = 5;
  MICROSECONDS = 6;
  NANOSECONDS = 7;
  PICOSECONDS = 8;
}

message Range {
  optional Timestamp start = 1;

  optional Timestamp end = 2;
}

// Picosecond precision timestamp type, represented by an epoch time in seconds, a nanosecond offset, and optional
// picosecond offset. The nanosecond offset is from the start of the epoch second, so must be less than 1 billion. The
// optional picosecond offset is only used for picosecond-precision data sources and is from the start of the
// nanosecond, so must be less than 1000.
message Timestamp {
  optional int64 seconds = 1;

  optional int64 nanos = 2;

  optional int32 picos = 3;
}
