using System.ComponentModel; namespace Umbraco.Cms.Core.Configuration.Models; [UmbracoOptions(Constants.Configuration.ConfigWebhook)] public class WebhookSettings { private const bool StaticEnabled = true; private const int StaticMaximumRetries = 5; internal const string StaticPeriod = "00:00:10"; private const bool StaticEnableLoggingCleanup = true; private const int StaticKeepLogsForDays = 30; /// /// Gets or sets a value indicating whether webhooks are enabled. /// /// /// /// By default, webhooks are enabled. /// If this option is set to false webhooks will no longer send web-requests. /// /// [DefaultValue(StaticEnabled)] public bool Enabled { get; set; } = StaticEnabled; /// /// Gets or sets a value indicating the maximum number of retries for all webhooks. /// /// /// /// By default, maximum number of retries is 5. /// If this option is set to 0 webhooks will no longer retry. /// /// [DefaultValue(StaticMaximumRetries)] public int MaximumRetries { get; set; } = StaticMaximumRetries; /// /// Gets or sets a value for the period of the webhook firing. /// [DefaultValue(StaticPeriod)] public TimeSpan Period { get; set; } = TimeSpan.Parse(StaticPeriod); /// /// Gets or sets a value indicating whether cleanup of webhook logs are enabled. /// /// /// /// By default, cleanup is enabled. /// /// [DefaultValue(StaticEnableLoggingCleanup)] public bool EnableLoggingCleanup { get; set; } = StaticEnableLoggingCleanup; /// /// Gets or sets a value indicating number of days to keep logs for. /// /// /// /// By default, logs are kept for 30 days. /// /// [DefaultValue(StaticKeepLogsForDays)] public int KeepLogsForDays { get; set; } = StaticKeepLogsForDays; }