@@ -92,8 +92,8 @@ message Dispatch {
9292 // The start time in UTC
9393 google.protobuf.Timestamp start_time = 6 ;
9494
95- // The end time in UTC
96- google.protobuf.Timestamp end_time = 7 ;
95+ // Duration in seconds
96+ uint32 duration = 7 ;
9797
9898 // The component selector
9999 ComponentSelector selector = 8 ;
@@ -129,10 +129,10 @@ message TimeIntervalFilter {
129129 // Filter by start_time < this timestamp
130130 google.protobuf.Timestamp start_to = 2 ;
131131
132- // Filter by end_time >= this timestamp
132+ // Filter by recurrence. end_time >= this timestamp
133133 google.protobuf.Timestamp end_from = 3 ;
134134
135- // Filter by end_time < this timestamp
135+ // Filter by recurrence. end_time < this timestamp
136136 google.protobuf.Timestamp end_to = 4 ;
137137}
138138
@@ -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 ;
@@ -297,8 +311,8 @@ message DispatchCreateRequest {
297311 // Timestamps earlier than the current time are not allowed.
298312 google.protobuf.Timestamp start_time = 3 ;
299313
300- // The end time
301- google.protobuf.Timestamp end_time = 4 ;
314+ // Duration in seconds
315+ uint32 duration = 4 ;
302316
303317 // The component selector
304318 ComponentSelector selector = 5 ;
@@ -327,8 +341,8 @@ message DispatchUpdateRequest {
327341 // Timestamps earlier than the current time are not allowed.
328342 google.protobuf.Timestamp start_time = 2 ;
329343
330- // The end time
331- google.protobuf.Timestamp end_time = 3 ;
344+ // Duration in seconds
345+ optional uint32 duration = 3 ;
332346
333347 // The component selector
334348 ComponentSelector selector = 4 ;
0 commit comments