Method Create
- Namespace
- MailFathom.Application.Mail.Mutations.Authoring
- Assembly
- MailFathom.Application.dll
Create(StoredEmailId, bool?, bool?, MailKeywordChangeDirection?, IReadOnlyList<string>?)
Reads one request, refusing anything that does not state a change a server could be asked for.
public static AuthoredMailFlagChange Create(StoredEmailId storedEmailId, bool? seen, bool? flagged, MailKeywordChangeDirection? keywordDirection, IReadOnlyList<string>? keywords)
Parameters
storedEmailIdStoredEmailIdThe email the change is asked for.
seenbool?Where to leave the
\Seenflag, or null to leave it alone.flaggedbool?Where to leave the
\Flaggedflag, or null to leave it alone.keywordDirectionMailKeywordChangeDirection?What to do with
keywords, or null to change no keyword.keywordsIReadOnlyList<string>The keywords the change names, as the caller wrote them.
Returns
- AuthoredMailFlagChange
The request, with every value it names usable.
Remarks
The keyword list is validated here rather than dropped, which is the rule ADR 0007 states for anything authored: reading a server's answer drops a keyword it cannot use, and writing refuses one, because a caller that asked for a label needs to learn it was unusable rather than to be told the change succeeded without it.
Exceptions
- MailFlagChangeInvalidException
Thrown when the request names no change at all, when a keyword list arrives without a direction or a direction without a list, when an addition or a removal names no keyword, or when a keyword is not one a
STOREmay carry.