Table of Contents

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

account MailAccountId

The caller's account.

parentId string

The folder to create it beneath, or null for the top of the hierarchy.

name string

The folder's name, which a creation naming a role does not need.

role MailFolderSpecialUse?

The role the folder is to play, or null for an ordinary folder.

cancellationToken CancellationToken

Propagates caller cancellation.

Returns

Task<MailFolderActOutcome>

The created folder, or the refusal.

Exceptions

PrincipalNotAuthorizedException

Thrown when the caller does not hold mailfathom.mail.folders.write and mailfathom.mail.read, both of which an act needs.