Table of Contents

Method ActivateAsync

Namespace
MailFathom.Application.Emails.Embeddings.Administration
Assembly
MailFathom.Application.dll

ActivateAsync(EmbeddingProfileIdentity, CancellationToken)

Weighs the declared geometry and activates it unless the spend ceiling refuses.

public Task<CountedEmbeddingActivationResult> ActivateAsync(EmbeddingProfileIdentity declared, CancellationToken cancellationToken)

Parameters

declared EmbeddingProfileIdentity

The geometry configuration declares.

cancellationToken CancellationToken

Cancels the reads and the registration.

Returns

Task<CountedEmbeddingActivationResult>

What was weighed, and what the activation did where it ran.

Remarks

The assessment is taken again here rather than accepted from the caller, so what refuses a spend is the state of the deployment at the moment it would happen rather than a figure a client read earlier and may have edited on the way back. Every other failure of the activation itself — a lost registration race, an index the database refused — is EmbeddingProfileActivation's and reaches the caller unchanged.

This is the one operation on the administrative surface that starts a provider bill, which is why it is the only one asking for AdminSpend and why holding the read permission does not reach it.

Exceptions

ArgumentNullException

Thrown when declared is null.

PrincipalNotAuthorizedException

Thrown when the use case was reached by anything but a caller granted AdminSpend.

OperationCanceledException

Thrown when the caller cancels.