Struct MailboxMutation
- Namespace
- MailFathom.Domain.Mutations
- Assembly
- MailFathom.Domain.dll
Names one change MailFathom is permitted to make to a remote mailbox.
[JsonConverter(typeof(MailboxMutationJsonConverter))]
public readonly record struct MailboxMutation : IEquatable<MailboxMutation>
- Implements
- Inherited Members
Remarks
The type is a closed enumeration of values rather than a C# enum, because the name is the identity: it is what a log line records, what a span is called, and what a counter is broken down by, so an operator reading any of the three sees the same word. An enum member's ordinal would carry no meaning outside this assembly, and a name derived from the member would change with every rename of the operation it belongs to.
The set is closed because it is the answer to a decision rather than a list that grows with call sites. Sending,
the \Answered and \Draft flags, and renaming, deleting, or unsubscribing a folder are refused, and
permitting one of them is a decision to reopen rather than a member to append. Two reopenings have happened.
Creating a folder the operator configured was permitted and is still not a member here, because it changes the shape
of a mailbox rather than a message in one, so it is a capability of its own; \Flagged and the keywords were
permitted and are members, because each is a flag on one message and therefore the same kind of act as the four
before them.
A mutation names what was asked for, never how the server was made to do it. A relocation carried by
MOVE and a relocation carried by copy, flag, and expunge are the same value here, which is what lets the
layer above be unable to tell them apart. Being a struct, default is reachable and names no
mutation; IsSpecified reports that.
Properties
- AddKeywords
Gets the mutation that puts keywords on one email, leaving the keywords it already carries alone.
- All
Gets every permitted mutation.
- Copy
Gets the mutation that puts a second live occurrence of one email into another folder.
- Delete
Gets the mutation that removes one email from the folder it is in.
- FlagWriting
Gets every mutation whose whole effect is a value a
FLAGSresponse reports back.
- IsSpecified
Gets whether this value names a permitted mutation rather than the unusable struct default.
- Name
Gets the name a log line, a span, and a counter dimension all use for the mutation.
- Relocate
Gets the mutation that moves one email out of its folder and into another.
- RemoveKeywords
Gets the mutation that takes keywords off one email, leaving the keywords it is not asked about alone.
- SetFlagged
Gets the mutation that sets or clears the remote
\Flaggedflag of one email.
- SetKeywords
Gets the mutation that makes one email's keywords exactly the set that was asked for.
- SetSeen
Gets the mutation that sets or clears the remote
\Seenflag of one email.
Methods
- ToString()
Returns the fully qualified type name of this instance.
- TryParseName(string?, out MailboxMutation)
Parses a recorded name back into the mutation it names.