using System.Net;
using Cleanuparr.Domain.Enums;
namespace Cleanuparr.Infrastructure.Http.DynamicHttpClientSystem;
///
/// Configuration for a dynamic HTTP client
///
public class HttpClientConfig
{
public string Name { get; set; } = string.Empty;
public int Timeout { get; set; }
public HttpClientType Type { get; set; }
public RetryConfig? RetryConfig { get; set; }
// Deluge-specific settings
public bool AllowAutoRedirect { get; set; } = true;
public DecompressionMethods AutomaticDecompression { get; set; } = DecompressionMethods.GZip | DecompressionMethods.Deflate;
public CertificateValidationType CertificateValidationType { get; set; } = CertificateValidationType.Enabled;
}
///
/// Retry configuration for HTTP clients
///
public class RetryConfig
{
public int MaxRetries { get; set; }
public bool ExcludeUnauthorized { get; set; } = true;
}
///
/// Types of HTTP clients that can be configured
///
public enum HttpClientType
{
Default,
WithRetry,
Deluge
}