Method ReadAsync
- Namespace
- MailFathom.Application.Accounts
- Assembly
- MailFathom.Application.dll
ReadAsync(CancellationToken)
Reads the caller's accounts and how current each one and each of its folders is.
public Task<MailAccountFreshnessDirectory> ReadAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task<MailAccountFreshnessDirectory>
One entry per account the caller's user owns, and whether the deployment refreshes them.
Remarks
A user who owns no account is answered with an empty list rather than a refusal, because owning nothing is a state a client renders and not a failure. A caller whose grant does not carry the permission is refused instead, which is what keeps the two answers from arriving as the same empty collection.
Exceptions
- PrincipalNotAuthorizedException
Thrown when the use case was reached by anything but a caller granted MailRead that is acting for a user.
- OperationCanceledException
Thrown when the caller cancels.