You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Prowlarr/src/NzbDrone.Core/Notifications/Notifiarr/NotifiarrSettings.cs

28 lines
888 B

using FluentValidation;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Notifications.Notifiarr
{
public class NotifiarrSettingsValidator : AbstractValidator<NotifiarrSettings>
{
public NotifiarrSettingsValidator()
{
RuleFor(c => c.APIKey).NotEmpty();
}
}
public class NotifiarrSettings : NotificationBaseSettings
{
private static readonly NotifiarrSettingsValidator Validator = new NotifiarrSettingsValidator();
[FieldDefinition(0, Label = "API Key", Privacy = PrivacyLevel.ApiKey, HelpText = "Your API key from your profile", HelpLink = "https://notifiarr.com")]
public string APIKey { get; set; }
public override NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));
}
}
}