Skip to content

Commit 2a72746

Browse files
committed
Add TimeIntervalFilter definition
Signed-off-by: Mathias L. Baumann <[email protected]>
1 parent 2e89add commit 2a72746

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- Added new message definitions for communication components.
1616
- Added new message `ElectricalComponentDiagnostic` to represent warnings and errors in microgrid electrical components.
1717
- The enum `ComponentErrorCode` has now been renamed to `ElectricalComponentDiagnosticCode` to better reflect its shared usage with warnings and errors.
18+
- Added a common `TimeIntervalFilter` message in `frequenz.api.common.v1.types` to standardize time interval filtering across APIs. This uses `start_time` (inclusive) and `end_time` (exclusive) fields, aligning with ISO 8601 and common programming conventions.
1819

1920
## Bug Fixes
2021

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// An arbitrary precision real number.
2+
//
3+
// Copyright 2024 Frequenz Energy-as-a-Service GmbH
4+
//
5+
// Licensed under the MIT License (the "License");
6+
// you may not use this file except in compliance with the License.
7+
8+
syntax = "proto3";
9+
10+
package frequenz.api.common.v1.types;
11+
12+
import "google/protobuf/timestamp.proto";
13+
14+
15+
// Represents a time interval filter.
16+
//
17+
// The interval includes the start time and excludes the end time.
18+
// This follows the convention used in ISO 8601 for time intervals,
19+
// Pandas slicing, and Python slicing: [start_time, end_time).
20+
//
21+
// * If `start_time` is omitted, the interval is
22+
// considered unbounded at the start.
23+
// * If `end_time` is omitted, the interval is
24+
// considered unbounded at the end.
25+
message TimeIntervalFilter {
26+
// The beginning of the time interval (inclusive).
27+
//
28+
// Must be a UTC timestamp.
29+
google.protobuf.Timestamp start_time = 1;
30+
31+
// The end of the time interval (exclusive).
32+
//
33+
// Must be a UTC timestamp.
34+
google.protobuf.Timestamp end_time = 2;
35+
}

0 commit comments

Comments
 (0)