forked from bufbuild/protoc-gen-validate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wkt_timestamp.proto
27 lines (21 loc) · 2.04 KB
/
wkt_timestamp.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
syntax = "proto3";
package tests.harness.cases;
option go_package = "github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/go;cases";
import "validate/validate.proto";
import "google/protobuf/timestamp.proto";
message TimestampNone { google.protobuf.Timestamp val = 1; }
message TimestampRequired { google.protobuf.Timestamp val = 1 [(validate.rules).timestamp.required = true]; }
message TimestampConst { google.protobuf.Timestamp val = 1 [(validate.rules).timestamp.const = {seconds: 3}]; }
message TimestampLT { google.protobuf.Timestamp val = 1 [(validate.rules).timestamp.lt = {}]; }
message TimestampLTE { google.protobuf.Timestamp val = 1 [(validate.rules).timestamp.lte = {seconds: 1}]; }
message TimestampGT { google.protobuf.Timestamp val = 1 [(validate.rules).timestamp.gt = {nanos: 1000}]; }
message TimestampGTE { google.protobuf.Timestamp val = 1 [(validate.rules).timestamp.gte = {nanos: 1000000}]; }
message TimestampGTLT { google.protobuf.Timestamp val = 1 [(validate.rules).timestamp = {gt: {}, lt: {seconds: 1}}]; }
message TimestampExLTGT { google.protobuf.Timestamp val = 1 [(validate.rules).timestamp = {lt: {}, gt: {seconds: 1}}]; }
message TimestampGTELTE { google.protobuf.Timestamp val = 1 [(validate.rules).timestamp = {gte: {seconds: 60}, lte: {seconds: 3600}}]; }
message TimestampExGTELTE { google.protobuf.Timestamp val = 1 [(validate.rules).timestamp = {lte: {seconds: 60}, gte: {seconds: 3600}}]; }
message TimestampLTNow { google.protobuf.Timestamp val = 1 [(validate.rules).timestamp.lt_now = true]; }
message TimestampGTNow { google.protobuf.Timestamp val = 1 [(validate.rules).timestamp.gt_now = true]; }
message TimestampWithin { google.protobuf.Timestamp val = 1 [(validate.rules).timestamp.within.seconds = 3600]; }
message TimestampLTNowWithin { google.protobuf.Timestamp val = 1 [(validate.rules).timestamp = {lt_now: true, within: {seconds: 3600}}]; }
message TimestampGTNowWithin { google.protobuf.Timestamp val = 1 [(validate.rules).timestamp = {gt_now: true, within: {seconds: 3600}}]; }