1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-03-11 14:59:46 +02:00
Sonarr/NzbDrone.Core/Indexers/Omgwtfnzbs/OmgwtfnzbsSettings.cs

33 lines
883 B
C#
Raw Normal View History

2013-04-07 00:30:37 -07:00
using System;
2013-08-22 01:08:43 -07:00
using FluentValidation;
using FluentValidation.Results;
2013-05-02 22:24:52 -07:00
using NzbDrone.Core.Annotations;
2013-04-07 00:30:37 -07:00
namespace NzbDrone.Core.Indexers.Omgwtfnzbs
{
2013-08-25 21:01:03 -07:00
public class OmgwtfnzbsSettingsValidator : AbstractValidator<OmgwtfnzbsSettings>
{
public OmgwtfnzbsSettingsValidator()
{
RuleFor(c => c.Username).NotEmpty();
RuleFor(c => c.ApiKey).NotEmpty();
}
}
public class OmgwtfnzbsSettings : IIndexerSetting
2013-04-07 00:30:37 -07:00
{
2013-08-25 21:01:03 -07:00
private static readonly OmgwtfnzbsSettingsValidator Validator = new OmgwtfnzbsSettingsValidator();
2013-08-22 01:08:43 -07:00
2013-05-29 00:06:25 -07:00
[FieldDefinition(0, Label = "Username")]
2013-04-07 00:30:37 -07:00
public String Username { get; set; }
2013-05-02 22:24:52 -07:00
2013-05-29 00:06:25 -07:00
[FieldDefinition(1, Label = "API Key")]
2013-04-07 00:30:37 -07:00
public String ApiKey { get; set; }
2013-08-22 01:08:43 -07:00
public ValidationResult Validate()
2013-04-07 00:30:37 -07:00
{
2013-08-25 21:01:03 -07:00
return Validator.Validate(this);
2013-04-07 00:30:37 -07:00
}
}
}