Table of Contents

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

storedEmailId StoredEmailId

The email the change is asked for.

seen bool?

Where to leave the \Seen flag, or null to leave it alone.

flagged bool?

Where to leave the \Flagged flag, or null to leave it alone.

keywordDirection MailKeywordChangeDirection?

What to do with keywords, or null to change no keyword.

keywords IReadOnlyList<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 STORE may carry.