namespace ZB.MOM.WW.ScadaBridge.DelmiaNotifier; /// Whether a single POST attempt reached the server () or never did (). internal enum AttemptKind { Connected, ConnectFailed, } /// Result of one POST attempt against a single base URL. /// Did the attempt reach the server? /// HTTP status when ; 0 otherwise. /// Parsed response body on a 2xx; null otherwise. /// Connection/exception detail when ; null otherwise. internal sealed record AttemptOutcome(AttemptKind Kind, int StatusCode, RecipeDownloadResult? Body, string? Error); /// Seam over a single recipe-download POST attempt, so the failover loop is testable without real HTTP. internal interface IRecipeSender { /// Sends the recipe download payload to a single base URL as one POST attempt. /// The base URL to POST the recipe download to. /// The recipe download payload to send. /// Cancellation token. /// The outcome of the attempt: connected (with status/body) or connect-failed (with error detail). Task SendAsync(string baseUrl, RecipeDownload payload, CancellationToken ct); }