Method RecordAsync
- Namespace
- MailFathom.Application.Mail.Mutations.Authoring
- Assembly
- MailFathom.Application.dll
RecordAsync(AuthoredMailFlagChange, MailboxMutationRequester, CancellationToken)
Writes down every value one change asks for, against the email it names.
public Task<AuthoredMailFlagChangeResult> RecordAsync(AuthoredMailFlagChange change, MailboxMutationRequester requester, CancellationToken cancellationToken)
Parameters
changeAuthoredMailFlagChangeWhat the caller asked for.
requesterMailboxMutationRequesterThe invocation asking, which is what decides whether asking again is the same request.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<AuthoredMailFlagChangeResult>
The record opened for each value, in the order the change states them.
Remarks
A change asked for twice under one requester identity is one change: the record store admits one record per occurrence, requester, and mutation, and the second call is answered with the record the first opened. That is what makes a retried call safe to make, and it is why the identity is the invocation's rather than the change's — a caller that starred a message, unstarred it, and starred it again has made three requests and means all three. A second call is a retry only when it asks for what the first asked for, which is why the terms are compared rather than assumed from the identity.
Exceptions
- ArgumentNullException
Thrown when
changeorrequesteris null.- PrincipalNotAuthorizedException
Thrown when the caller does not hold the writing grant.
- MailFlagChangeTargetNotFoundException
Thrown when this deployment serves no readable email under that identity, or when the email it serves names a remote occurrence the mail server no longer holds.
- MailFlagChangeInvalidException
Thrown when the requester identity already names one of these mutations on this occurrence with a different value.