TimestampRules describe the rules applied exclusively to the google.protobuf.Timestamp well-known type.
TimestampRules describe the rules applied exclusively to the google.protobuf.Timestamp well-known type.
Optional[customReturns a safe value for JSON logs.
Returns a safe value for JSON logs.
Optional[unknownPreserves protobuf fields that this SDK version does not recognize.
Contains the fully qualified protobuf type name.
Optionalconstconst dictates that this field, of the google.protobuf.Timestamp type, must exactly match the specified value. If the field value doesn't correspond to the specified timestamp, an error message will be generated.
message MyTimestamp {
// value must equal 2023-05-03T10:00:00Z
google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}];
}
example specifies values that the field may have. These values SHOULD
conform to other rules. example values will not impact validation
but may be used as helpful guidance on how to populate the given field.
message MyTimestamp {
google.protobuf.Timestamp value = 1 [
(buf.validate.field).timestamp.example = { seconds: 1672444800 },
(buf.validate.field).timestamp.example = { seconds: 1672531200 },
];
}
OptionalgreaterContains the selected value for the greater_than protobuf oneof.
Contains the case.
Contains the gt.
Contains the case.
Contains the gte.
Contains the case.
Contains the gt now.
OptionallessContains the selected value for the less_than protobuf oneof.
Contains the case.
Contains the lt.
Contains the case.
Contains the lte.
Contains the case.
Contains the lt now.
Optionalwithinwithin specifies that this field, of the google.protobuf.Timestamp type, must be within the specified duration of the current time. If the field value isn't within the duration, an error message is generated.
message MyTimestamp {
// value must be within 1 hour of now
google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}];
}
TimestampRules describe the rules applied exclusively to the
google.protobuf.Timestampwell-known type.