synology_apm_repo.sdk.units.saas.calendar module

CalendarProvider: M365/GWS Calendar via calendar_table + calendar_event_table, built as a SaasWorkloadProvider + NamedGroupFlatTree config, wrapped in one extra synthetic level (tree_strategy.CategorizedGroupTree) that splits the root into “My Calendars” and “Other Calendars” by each calendar’s own ownership (see _is_other_calendar for the calendar_type split rule).

Unlike Drive (one service DB), Calendar has two separate service-level DB snapshots in the same ObjectDB sequence — calendar_table (the calendar list) and calendar_event_table (its events), each named independently in the object-name index; SaasWorkloadConfig’s two-table case locates and opens both independently.

  • Tree: My/Other Calendars → calendar → event, grouped by calendar_id (the “grouped flat list” strategy), via NamedGroupFlatTree.

  • Content: calendar_event_table.meta_object_id → a META JSON object; the spec’s additional modified_date_list/exdate_list keys are never read here. build_ics assembles the .ics from client_metadata alone — each platform’s own calendar API event resource, verbatim, for both GWS and M365.

  • Detached occurrences are real data (see build_ics for how RECURRENCE-ID is derived); undetached occurrences are covered by the exported RRULE, which the importing calendar app expands on its own.

  • A calendar’s own displayed name isn’t always calendar_name verbatim — _group_name_override corrects for two real cases: a user’s own relabeling, and GWS’s bare-email default for an unrenamed primary calendar.

synology_apm_repo.sdk.units.saas.calendar.CALENDAR_CONFIG = SaasWorkloadConfig(root_name='Calendars', leaf_kind=<UnitKind.CALENDAR_EVENT: 'calendar_event'>, tables=('calendar_table', 'calendar_event_table'), tree_factory=<function _build_tree>, assemble=<function _assemble>, object_names={'calendar_table': ('calendar_db', 'group_calendar_db'), 'calendar_event_table': ('calendar_event_db', 'group_calendar_event_db')}, extra_attrs=<function _event_extra_attrs>, group_attrs=<function _group_attrs>, leaf_size=<function SaasWorkloadConfig.<lambda>>)

SaasWorkloadConfig behind CalendarProvider — the two-table (calendar_table/calendar_event_table) case described above.

async synology_apm_repo.sdk.units.saas.calendar.CalendarProvider(repo, version, saas_streams, *, shared=None)

Constructor-style factory over CALENDAR_CONFIG — callable exactly like a constructor (await CalendarProvider(repo, version, saas_streams)), with an optional shared context passed straight through to SaasWorkloadProvider.create for M365’s multi-candidate USER_EXCHANGE/GROUP_EXCHANGE dispatch.