Method CreateAsync
- Namespace
- MailFathom.Application.Folders
- Assembly
- MailFathom.Application.dll
CreateAsync(MailAccountId, string?, string?, MailFolderSpecialUse?, CancellationToken)
Creates a folder, either by naming it or by naming the role it is to play.
public Task<MailFolderActOutcome> CreateAsync(MailAccountId account, string? parentId, string? name, MailFolderSpecialUse? role, CancellationToken cancellationToken)
Parameters
accountMailAccountIdThe caller's account.
parentIdstringThe folder to create it beneath, or null for the top of the hierarchy.
namestringThe folder's name, which a creation naming a role does not need.
roleMailFolderSpecialUse?The role the folder is to play, or null for an ordinary folder.
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task<MailFolderActOutcome>
The created folder, or the refusal.
Exceptions
- PrincipalNotAuthorizedException
Thrown when the caller does not hold
mailfathom.mail.folders.writeandmailfathom.mail.read, both of which an act needs.