Class MailboxMutationRequest
- Namespace
- MailFathom.Domain.Mutations
- Assembly
- MailFathom.Domain.dll
States one change somebody authored, in the form it is written down before any IMAP command is issued.
public sealed record MailboxMutationRequest : IEquatable<MailboxMutationRequest>
- Inheritance
-
MailboxMutationRequest
- Implements
- Inherited Members
Remarks
The request carries both identities of the email deliberately. StoredEmailId is the local email, which is what ties the record to the mail it describes and what carries the record through that mail's deletion path; Occurrence is where the email was when the change was asked for, which is what an IMAP command is actually issued against and what must not drift when a later mutation moves the email somewhere else.
The parameters a mutation takes are part of the request rather than a payload beside it, and which ones are present
is an invariant rather than a convention: a relocation and a copy name a destination folder and nothing else, a
delete names nothing, and a \Seen change names a direction. The factories are the only way to build one, so a
request naming a destination for a delete cannot be constructed at all.
Nothing here is mail content. A folder path, an account, a folder binding, a UID, and a requester identity are all MailFathom's own or the server's own names for things, which is what lets the durable record be written without the message it is about.
Properties
- DesiredSeenState
Gets which way a
\Seenchange was asked for, and null for every other mutation.
- DestinationPath
Gets the folder a relocation or a copy puts the email into, and null for every other mutation.
- Mutation
Gets the change that was asked for.
- Occurrence
Gets the remote occurrence the change was asked for, which is what the IMAP command targets.
- Requester
Gets the authored act that asked.
- StoredEmailId
Gets the local email the change is about.
Methods
- Copy(StoredEmailId, EmailOccurrenceId, MailboxMutationRequester, RemoteFolderPath)
Asks for a second live occurrence of one email to be put into another folder.
- Create(StoredEmailId, EmailOccurrenceId, MailboxMutation, MailboxMutationRequester, RemoteFolderPath?, bool?)
Restores the request a durable record was written for.
- Delete(StoredEmailId, EmailOccurrenceId, MailboxMutationRequester)
Asks for one email to be removed from the folder it is in.
- Relocate(StoredEmailId, EmailOccurrenceId, MailboxMutationRequester, RemoteFolderPath)
Asks for one email to be moved out of its folder and into another.
- SetSeen(StoredEmailId, EmailOccurrenceId, MailboxMutationRequester, bool)
Asks for the remote
\Seenflag of one email to be set or cleared.