Method SwitchAsync
- Namespace
- MailFathom.Application.Accounts.Custody
- Assembly
- MailFathom.Application.dll
SwitchAsync(MailAccountId, MailAccountCustody, CancellationToken)
Asks for one account's custody to become what was named.
public Task<MailAccountCustodySwitchOutcome?> SwitchAsync(MailAccountId account, MailAccountCustody requested, CancellationToken cancellationToken)
Parameters
accountMailAccountIdThe account.
requestedMailAccountCustodyThe custody asked for.
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task<MailAccountCustodySwitchOutcome>
What the request did, or null where the deployment holds no such account.
Remarks
Asking for the custody an account already has is accepted and writes nothing new, which is what makes the command safe to repeat: a switch is a period of work, and an operator asking again while it is under way is asking about the same period rather than starting a second one.
Exceptions
- PrincipalNotAuthorizedException
Thrown when the caller's grant omits
mailfathom.admin.custody.write.- MailboxUnavailableException
Thrown when a switch off could not read what the source server advertises.