Radarr/src/NzbDrone.Api/Health/HealthResource.cs

41 lines
998 B
C#
Raw Normal View History

2016-12-23 21:45:24 +00:00
using System.Collections.Generic;
using System.Linq;
2016-02-29 23:33:28 +00:00
using NzbDrone.Common.Http;
2014-02-26 05:40:47 +00:00
using NzbDrone.Core.HealthCheck;
2019-12-22 22:08:53 +00:00
using Radarr.Http.REST;
2014-02-26 05:40:47 +00:00
namespace NzbDrone.Api.Health
{
public class HealthResource : RestResource
{
public HealthCheckResult Type { get; set; }
public string Message { get; set; }
2016-02-29 23:33:28 +00:00
public HttpUri WikiUrl { get; set; }
2014-02-26 05:40:47 +00:00
}
public static class HealthResourceMapper
{
public static HealthResource ToResource(this HealthCheck model)
{
2019-12-22 22:08:53 +00:00
if (model == null)
{
return null;
}
return new HealthResource
{
Id = model.Id,
Type = model.Type,
Message = model.Message,
WikiUrl = model.WikiUrl
};
}
public static List<HealthResource> ToResource(this IEnumerable<HealthCheck> models)
{
return models.Select(ToResource).ToList();
}
}
2014-02-26 05:40:47 +00:00
}