undo_bulk_modify
Revert a bulk label change exactly by applying the undo plan returned from bulk_modify, restoring labels messages lost and removing labels they gained.
Instructions
Revert a bulk_modify exactly, from the undo plan it returned (bulk_modify with undo:true). Pass steps unchanged: each step adds back the labels its messages lost and takes off the labels they gained, so a message that was already in the target state before the bulk change is left alone. Steps name labels by id, as the plan does; a label name is refused, because an unknown name would be created rather than restored. The plan restores the state read just before the bulk change. A label changed by hand since then is changed again by the undo, and a label deleted since then makes its step fail — reported in failed, the other steps still run. A label the bulk change created stays in the mailbox, empty. Set verify:true to read the labels back afterwards — one read per affected thread, however many steps name it. USE WHEN: the user wants a bulk change taken back, and the bulk_modify result carried undo. DO NOT USE: without a plan from bulk_modify (use bulk_modify or modify_labels), or to change labels in a new way — this applies exactly the steps it is given. SIDE EFFECTS: label changes on the listed messages; reversible again by the inverse.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| steps | Yes | ||
| verify | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| failed | Yes | ||
| verified | No | ||
| submittedMessages | Yes |