Skip to content

IAttachmentStorage

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

The extension point that stores attachment content in an external store (S3, Blob).

public interface IAttachmentStorage

When it is not registered the content lives in the database, so nothing has to be set up first. AgentPrism takes no dependency on any cloud SDK; the consumer writes the implementation.

Deletes the content in the external store.

ValueTask DeleteAsync(Uri uri, CancellationToken cancellationToken = default)

uri Uri

The location returned by IAttachmentStorage.WriteAsync.

cancellationToken CancellationToken

The cancellation token.

ValueTask

Reads the content from the external store.

ValueTask<Stream?> ReadAsync(Uri uri, CancellationToken cancellationToken = default)

uri Uri

The location returned by IAttachmentStorage.WriteAsync.

cancellationToken CancellationToken

The cancellation token.

ValueTask<Stream?>

A readable stream, or null when the location no longer exists.

WriteAsync(string, Guid, Stream, string, CancellationToken)

Section titled “ WriteAsync(string, Guid, Stream, string, CancellationToken)”

Writes the content to the external store.

ValueTask<Uri> WriteAsync(string tenantId, Guid id, Stream content, string mediaType, CancellationToken cancellationToken = default)

tenantId string

The tenant id.

id Guid

The attachment id.

content Stream

The content to write.

mediaType string

The MIME type of the content.

cancellationToken CancellationToken

The cancellation token.

ValueTask<Uri>

The location of the content in the external store.