Rename Concelier Source modules to Connector

This commit is contained in:
master
2025-10-18 20:11:18 +03:00
parent 89ede53cc3
commit 052da7a7d0
789 changed files with 1489 additions and 1489 deletions

View File

@@ -0,0 +1,63 @@
using System.Net;
namespace StellaOps.Concelier.Connector.Common.Fetch;
/// <summary>
/// Result of fetching raw response content without persisting a document.
/// </summary>
public sealed record SourceFetchContentResult
{
private SourceFetchContentResult(
HttpStatusCode statusCode,
byte[]? content,
bool notModified,
string? etag,
DateTimeOffset? lastModified,
string? contentType,
int attempts,
IReadOnlyDictionary<string, string>? headers)
{
StatusCode = statusCode;
Content = content;
IsNotModified = notModified;
ETag = etag;
LastModified = lastModified;
ContentType = contentType;
Attempts = attempts;
Headers = headers;
}
public HttpStatusCode StatusCode { get; }
public byte[]? Content { get; }
public bool IsSuccess => Content is not null;
public bool IsNotModified { get; }
public string? ETag { get; }
public DateTimeOffset? LastModified { get; }
public string? ContentType { get; }
public int Attempts { get; }
public IReadOnlyDictionary<string, string>? Headers { get; }
public static SourceFetchContentResult Success(
HttpStatusCode statusCode,
byte[] content,
string? etag,
DateTimeOffset? lastModified,
string? contentType,
int attempts,
IReadOnlyDictionary<string, string>? headers)
=> new(statusCode, content, notModified: false, etag, lastModified, contentType, attempts, headers);
public static SourceFetchContentResult NotModified(HttpStatusCode statusCode, int attempts)
=> new(statusCode, null, notModified: true, etag: null, lastModified: null, contentType: null, attempts, headers: null);
public static SourceFetchContentResult Skipped(HttpStatusCode statusCode, int attempts)
=> new(statusCode, null, notModified: false, etag: null, lastModified: null, contentType: null, attempts, headers: null);
}