@@ -219,6 +219,19 @@ message RecurrenceRule {
219219 FREQUENCY_MONTHLY = 5 ;
220220 }
221221
222+ // Controls when a recurring dispatch should end
223+ message EndCriteria {
224+ oneof count_or_until {
225+ // The number of times this dispatch should recur.
226+ // If this field is set, the dispatch will recur the given number of times.
227+ uint32 count = 1 ;
228+
229+ // The end time of this dispatch in UTC.
230+ // If this field is set, the dispatch will recur until the given timestamp.
231+ google.protobuf.Timestamp until = 2 ;
232+ }
233+ }
234+
222235 // The frequency specifier of this recurring dispatch
223236 Frequency freq = 1 ;
224237
@@ -229,9 +242,10 @@ message RecurrenceRule {
229242 // interval = 2
230243 uint32 interval = 2 ;
231244
232- // (Optional) limit the number of occurences
233- // If this field is not set, the dispatch will recur indefinitely
234- optional uint32 count = 3 ;
245+ // When this dispatch should end.
246+ // A dispatch can either recur a fixed number of times, or until a given timestamp.
247+ // If this field is not set, the dispatch will recur indefinitely.bool
248+ EndCriteria end_criteria = 3 ;
235249
236250 // On which minute(s) of the hour does the event occur
237251 repeated uint32 byminutes = 4 ;
@@ -247,9 +261,6 @@ message RecurrenceRule {
247261
248262 // On which month(s) of the year does the event occur
249263 repeated uint32 bymonths = 8 ;
250-
251- // The end time in UTC
252- google.protobuf.Timestamp end_time = 9 ;
253264}
254265
255266// Message for listing dispatches for a given microgrid, and an optional filter
0 commit comments