mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-18 21:35:51 -04:00
31 lines
1.1 KiB
C#
31 lines
1.1 KiB
C#
using FluentValidation;
|
|
using NzbDrone.Core.Annotations;
|
|
using NzbDrone.Core.ThingiProvider;
|
|
using NzbDrone.Core.Validation;
|
|
|
|
namespace NzbDrone.Core.Notifications.Notifiarr
|
|
{
|
|
public class NotifiarrSettingsValidator : AbstractValidator<NotifiarrSettings>
|
|
{
|
|
public NotifiarrSettingsValidator()
|
|
{
|
|
RuleFor(c => c.APIKey).NotEmpty();
|
|
}
|
|
}
|
|
|
|
public class NotifiarrSettings : IProviderConfig
|
|
{
|
|
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; }
|
|
[FieldDefinition(1, Label = "Instance Name", Advanced = true, HelpText = "Unique name for this instance", HelpLink = "https://notifiarr.com")]
|
|
public string InstanceName { get; set; }
|
|
|
|
public NzbDroneValidationResult Validate()
|
|
{
|
|
return new NzbDroneValidationResult(Validator.Validate(this));
|
|
}
|
|
}
|
|
}
|