IAttachmentStorage
AgentPrism.Abstractions.dllThe extension point that stores attachment content in an external store (S3, Blob).
public interface IAttachmentStorageRemarks
Section titled “Remarks”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.
Methods
Section titled “Methods”DeleteAsync(Uri, CancellationToken)
Section titled “ DeleteAsync(Uri, CancellationToken)”Deletes the content in the external store.
ValueTask DeleteAsync(Uri uri, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”uri Uri
The location returned by IAttachmentStorage.WriteAsync.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”ReadAsync(Uri, CancellationToken)
Section titled “ ReadAsync(Uri, CancellationToken)”Reads the content from the external store.
ValueTask<Stream?> ReadAsync(Uri uri, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”uri Uri
The location returned by IAttachmentStorage.WriteAsync.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”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)Parameters
Section titled “Parameters”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.
Returns
Section titled “Returns”ValueTask<Uri>
The location of the content in the external store.