namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications;
public class SmtpConfiguration
{
/// Gets or sets the primary key.
public int Id { get; set; }
/// Gets or sets the SMTP server hostname or IP address.
public string Host { get; set; }
/// Gets or sets the SMTP server port number.
public int Port { get; set; }
/// Gets or sets the authentication type (e.g. Basic, OAuth2ClientCredentials).
public string AuthType { get; set; }
/// Gets or sets the serialized credentials (password or OAuth2 client secret), or null when not applicable.
public string? Credentials { get; set; }
/// Gets or sets the TLS mode (None, StartTLS, or SSL), or null to use the provider default.
public string? TlsMode { get; set; }
/// Gets or sets the sender address placed in the From header.
public string FromAddress { get; set; }
/// Gets or sets the connection timeout in seconds.
public int ConnectionTimeoutSeconds { get; set; }
/// Gets or sets the maximum number of concurrent SMTP connections.
public int MaxConcurrentConnections { get; set; }
/// Gets or sets the maximum number of delivery retries before parking.
public int MaxRetries { get; set; }
/// Gets or sets the delay between retry attempts.
public TimeSpan RetryDelay { get; set; }
///
/// Initializes a new with required fields.
///
/// SMTP server hostname or IP address.
/// Authentication type string (e.g. Basic, OAuth2ClientCredentials).
/// Sender address for the From header.
public SmtpConfiguration(string host, string authType, string fromAddress)
{
Host = host ?? throw new ArgumentNullException(nameof(host));
AuthType = authType ?? throw new ArgumentNullException(nameof(authType));
FromAddress = fromAddress ?? throw new ArgumentNullException(nameof(fromAddress));
}
}