Table of Contents

Class MailboxScope

Namespace
MailFathom.Application.Emails.Mailboxes
Assembly
MailFathom.Application.dll

Names the accounts and folder aliases a mailbox query is restricted to.

public sealed record MailboxScope : IEquatable<MailboxScope>
Inheritance
MailboxScope
Implements
Inherited Members

Remarks

A request that names no folder alias is restricted to none: an empty list of aliases means every folder of the accounts in scope. Accounts read differently once the scope reaches a query, because the accounts a deployment serves are a smaller set than the accounts a store holds rows for — an operator can remove an account whose mail is still stored. Create(IEnumerable<MailAccountId>?, IEnumerable<MailFolderAlias>?) therefore states what a request asked for, and the use case resolves an unnamed account list to the served accounts through RestrictedToServedAccounts(IEnumerable<MailAccountId>, IReadOnlyList<MailFolderAlias>) before anything is read.

Both lists are deduplicated and ordered when the scope is created, so two requests that name the same accounts in a different order are one query with one continuation cursor. The cursor's filter fingerprint is computed from this normalized form, which is what stops a client from being handed a mismatch for reordering its own input.

Fields

MaximumAccountIds

The greatest number of account identifiers one request may name.

MaximumFolderAliases

The greatest number of folder aliases one request may name, counted the same way as MaximumAccountIds.

Properties

AccountIds

Gets the accounts the query is restricted to, deduplicated and ordered, or empty when the request named none.

FolderAliases

Gets the folder aliases the query is restricted to, deduplicated and ordered, or empty for every folder.

Unrestricted

Gets the scope a request that named neither an account nor a folder produces.

Methods

Create(IEnumerable<MailAccountId>?, IEnumerable<MailFolderAlias>?)

Creates a normalized scope from what a request named.