using System.Net;
using AIStudio.Provider;
namespace AIStudio.Tools.Services;
///
/// One input which could not be embedded, together with everything known about why.
///
///
/// The reason alone used to be all we kept, which made every failure look alike in the UI: a
/// rejected API key, an unreachable provider, and a file nobody may read were one and the same
/// list entry. The surrounding fields are what lets the UI offer the matching way out.
///
/// The file that failed or the name of the data source when the failure was not about one file.
/// What to tell the user about it, ready to show.
/// When it happened, so the list still makes sense when the user looks at it later.
/// What kind of failure it was. Everything that did not come from a provider stays at NONE.
/// What the provider answered, where it answered at all.
/// The embedding provider that was asked.
/// Why reading the file failed, where the failure was about reading it at all.
/// Whether the file stays out of the index until it changes.
public sealed record DataSourceEmbeddingFailure(string FilePath, string Reason, DateTimeOffset OccurredAtUtc, ProviderRequestFailureReason FailureReason = ProviderRequestFailureReason.NONE,
HttpStatusCode? StatusCode = null, string EmbeddingProviderName = "", FileExtractionErrorCode ExtractionCode = FileExtractionErrorCode.NONE, bool IsPermanent = false);