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.
Lidarr/src/NzbDrone.Core/Notifications/PushBullet/PushBulletSettings.cs

36 lines
1.3 KiB

using System;
using FluentValidation;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Notifications.PushBullet
{
public class PushBulletSettingsValidator : AbstractValidator<PushBulletSettings>
{
public PushBulletSettingsValidator()
{
RuleFor(c => c.ApiKey).NotEmpty();
}
}
public class PushBulletSettings : IProviderConfig
{
private static readonly PushBulletSettingsValidator Validator = new PushBulletSettingsValidator();
[FieldDefinition(0, Label = "API Key", HelpLink = "https://www.pushbullet.com/")]
public String ApiKey { get; set; }
[FieldDefinition(1, Label = "Device IDs", HelpText = "List of device IDs, use device_iden in the device's URL on pushbullet.com (leave blank to send to all devices)", Type = FieldType.Tag)]
public String DeviceIds { get; set; }
[FieldDefinition(2, Label = "Channel Tags", HelpText = "List of Channel Tags to send notifications to", Type = FieldType.Tag)]
public String ChannelTags { get; set; }
public NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));
}
}
}