Radarr/NzbDrone.Core/Indexers/Omgwtfnzbs/OmgwtfnzbsSettings.cs

29 lines
696 B
C#
Raw Normal View History

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