From c698f85bb68d658064f3fa713d6c9f37e924ff16 Mon Sep 17 00:00:00 2001 From: Viktor Richter Date: Fri, 20 Nov 2015 11:18:39 +0100 Subject: [PATCH] Add protos for interaction with a calendaring application. * CalendarList for presenting a list of available calendars * CalendarUpdate to publish changes in a calendar * CalendarRequest to request calendar events in a specific time span * CalendarResult as a means to pack a set of Events and todos with corresponding occurances. --- proto/sandbox/rst/calendar/CalendarList.proto | 17 ++++++ proto/sandbox/rst/calendar/CalendarRequest.proto | 41 ++++++++++++++ proto/sandbox/rst/calendar/CalendarResult.proto | 68 ++++++++++++++++++++++++ proto/sandbox/rst/calendar/CalendarUpdate.proto | 35 ++++++++++++ 4 files changed, 161 insertions(+) create mode 100644 proto/sandbox/rst/calendar/CalendarList.proto create mode 100644 proto/sandbox/rst/calendar/CalendarRequest.proto create mode 100644 proto/sandbox/rst/calendar/CalendarResult.proto create mode 100644 proto/sandbox/rst/calendar/CalendarUpdate.proto diff --git a/proto/sandbox/rst/calendar/CalendarList.proto b/proto/sandbox/rst/calendar/CalendarList.proto new file mode 100644 index 0000000..a5668d0 --- /dev/null +++ b/proto/sandbox/rst/calendar/CalendarList.proto @@ -0,0 +1,17 @@ +package rst.calendar; + +option java_outer_classname = "CalendarListType"; + +/** + * A List of available calendars. + * + * @author Viktor Richter + */ +message CalendarList { + + /** + * A List of calender info objects. + */ + repeated string calendar_id = 1; + +} diff --git a/proto/sandbox/rst/calendar/CalendarRequest.proto b/proto/sandbox/rst/calendar/CalendarRequest.proto new file mode 100644 index 0000000..040699d --- /dev/null +++ b/proto/sandbox/rst/calendar/CalendarRequest.proto @@ -0,0 +1,41 @@ +package rst.calendar; + +option java_outer_classname = "CalendarRequestType"; + +import "rst/calendar/DateTime.proto"; + +/** + * A request for calendar data. + * + * @author Viktor Richter + */ +message CalendarRequest { + + /** + * Ignore calendar components before start time. + */ + optional DateTime start_time = 1; + + /** + * Ignore calendar components afrer end time. + */ + optional DateTime end_time = 2; + + /** + * Search for todo entries. + */ + optional bool search_todos = 3 [default = true]; + + /** + * Search for event entries. + */ + optional bool search_events = 4 [default = true]; + + /** + * If this is true each entry which is between start and + * end date will be additionally augmented with a list of + * time periods in which it occurs. + */ + required bool calculate_time_periods = 5 [default = false]; + +} diff --git a/proto/sandbox/rst/calendar/CalendarResult.proto b/proto/sandbox/rst/calendar/CalendarResult.proto new file mode 100644 index 0000000..2df3344 --- /dev/null +++ b/proto/sandbox/rst/calendar/CalendarResult.proto @@ -0,0 +1,68 @@ +package rst.calendar; + +option java_outer_classname = "CalendarResultType"; + +import "rst/calendar/DateTime.proto"; +import "rst/calendar/Event.proto"; +import "rst/calendar/Todo.proto"; +import "rst/calendar/TimeZone.proto"; + +/** + * The answer to a CalendarRequest. + * + * @author Viktor Richter + */ +message CalendarResult { + + /** + * Describes one specific time period. + */ + message TimePeriod { + + /** + * When the time period starts. + */ + required DateTime start = 1; + + /** + * When the time period ends. + */ + required DateTime end = 2; + } + + /** + * Describes an event and optionally all of its occurances. + */ + message EventWithTimes { + + /** + * The event description. + */ + required Event event = 1; + + /** + * Time periods where this event applies to. + */ + repeated TimePeriod time = 2; + + } + + /** + * THe obligatory list of timezones needed by the events and todos + * contained in this message. + */ + repeated TimeZone timezone = 1; + + /** + * A list of events that match the correesponding CalendarRequest + * and their occurrence times (when requested). + */ + repeated EventWithTimes event = 2; + + /** + * A list of todos that match the correesponding CalendarRequest. + */ + repeated Todo todo = 3; + + +} diff --git a/proto/sandbox/rst/calendar/CalendarUpdate.proto b/proto/sandbox/rst/calendar/CalendarUpdate.proto new file mode 100644 index 0000000..cfa9878 --- /dev/null +++ b/proto/sandbox/rst/calendar/CalendarUpdate.proto @@ -0,0 +1,35 @@ +package rst.calendar; + +option java_outer_classname = "CalendarUpdateType"; + +import "rst/calendar/Event.proto"; +import "rst/calendar/Todo.proto"; +import "rst/calendar/TimeZone.proto"; + +/** + * Describes the changes between two calendar versions. + * + * @author Viktor Richter + */ +message CalendarUpdate { + + /** + * A set of TimeZones needed by the events and todos in this message. + */ + repeated TimeZone timezones = 3; + + /** + * A set of Events which changed between the two versons. + */ + repeated Event changed_events = 4; + + /** + * A set of Todos which changed between the two versons. + */ + repeated Todo changed_todos = 5; + + /** + * A set of ids of entries (todos and events) which were removed between the two versons. + */ + repeated string removed_entry_ids = 6; +} -- 1.9.1