s365b.modules.exchange.tasks ============================ .. py:module:: s365b.modules.exchange.tasks .. autoapi-nested-parse:: Tasks (Microsoft To Do) of a mailbox. Read with the To Do API (``/users/{id}/todo/lists``), which allows reading with an application permission (``Tasks.Read.All``) but not writing. Each run lists every task of the mailbox's own lists, with their checklist steps, as Graph's JSON; the catalog stores only what changed. A task found in none of the lists is a deletion. Moving a task to another list changes its ID (Microsoft's default for To Do), so its history starts again there: the old task shows as deleted from its list, and both can be restored. Left out: lists other people share with the mailbox (theirs to back up) and "Flagged email", which only mirrors flagged messages (backed up with the mail). Restore imports the task's restore copy (as for mail) into a task folder; see :mod:`s365b.modules.exchange.restore`. Attributes ---------- .. autoapisummary:: s365b.modules.exchange.tasks.ITEM_TYPE s365b.modules.exchange.tasks.STATE_KEY s365b.modules.exchange.tasks.PAGE Functions --------- .. autoapisummary:: s365b.modules.exchange.tasks.task_lists s365b.modules.exchange.tasks.task_metadata s365b.modules.exchange.tasks.task_version s365b.modules.exchange.tasks.backup_tasks Module Contents --------------- .. py:data:: ITEM_TYPE :value: 'task' .. py:data:: STATE_KEY :value: 'task_lists' .. py:data:: PAGE :value: '100' .. py:function:: task_lists(ctx: s365b.modules.sdk.ModuleContext, user: str) -> dict[str, str] :async: The mailbox's own To Do lists: ID → name. :param ctx: Module context. :param user: The mailbox's user ID. :returns: List names by ID. .. py:function:: task_metadata(task: dict[str, Any], list_id: str) -> dict[str, Any] Fields shown and searched in the browse view. :param task: Task from Graph. :param list_id: Its list. :returns: Metadata for the item version. .. py:function:: task_version(task: dict[str, Any], list_id: str, path: str) -> s365b.modules.sdk.ItemVersion The item version for a task. :param task: The task from Graph. :param list_id: Its list. :param path: The list's name. :returns: The version to store. .. py:function:: backup_tasks(ctx: s365b.modules.sdk.ModuleContext, user: str, lists: dict[str, str], saved: dict[str, Any]) -> collections.abc.AsyncIterator[s365b.modules.sdk.ItemVersion | s365b.modules.sdk.GroupChange | None] :async: Back up To Do lists. ``None`` means "checkpoint now". :param ctx: Module context (with ``current_items``). :param user: The mailbox's user ID. :param lists: The lists now, ID → name. :param saved: The lists at the last run, ID → name; updated in place. :Yields: Every task (unchanged ones are recognised by the catalog), deletions, list renames and removals.