synology_apm_repo.sdk.units.saas.tree_strategy.categorized module¶
CategorizedGroupTree: a synthetic wrapper layered on top of any
other shape in this package whose own root lists named groups — a
further synthetic split on top of the two schema shapes every
service-level DB in this project expands into.
- synology_apm_repo.sdk.units.saas.tree_strategy.categorized.categories_present_in_order(categories, labels)¶
The distinct category tokens actually used in
categories(a member -> category mapping), ordered canonically bylabels’ own key order rather than by whichever member was scanned first — dropping an entirely-empty category (e.g. no “Shared Channels” in this workload) is noise, not information, the same reasoning every caller of this applies. Shared byCategorizedGroupTreebelow andteams_chat.py’s own Standard/Private/Shared channel split, which can’t sit on top ofCategorizedGroupTreeitself (that class wraps aTreeStrategy, a protocolTeamsChatProviderisn’t built on — it hands outNodevalues directly) but needs the identical dedup/ordering rule, so a fix to it can’t drift between the two.
- class synology_apm_repo.sdk.units.saas.tree_strategy.categorized.CategorizedGroupTree(inner, *, categories, labels)¶
Bases:
objectWraps any inner
TreeStrategywhose own root (children_of(())) lists named groups, adding one extra synthetic level that splits those groups into caller-supplied categories — Site’s Document Library/List split, Calendar’s My Calendars/Other Calendars split. Every key this class hands out or accepts is(category, *inner_key); the wrapped tree only ever seesinner_key, so this works identically regardless of whether the inner tree is flat (NamedGroupFlatTree) or itself recursive within each group (NamedGroupRecursiveTree) — nothing here is specific to either shape.categoriesmaps each of the inner tree’s own top-level group keys (e.g. alist_id/calendar_id) to a category token;labelsmaps each category token to its displayed name. Both are computed once by the caller’s owntree_factory(a small, bounded scan of however many groups this workload has), not by this class.- async children_of(key, *, offset=0, limit=None)¶
- row_for(key)¶