Table of Contents

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

account MailAccountId

The account.

requested MailAccountCustody

The custody asked for.

cancellationToken CancellationToken

Propagates 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.