using System.Collections.Generic;
using Jellyfin.Api.Constants;
using MediaBrowser.Controller.Notifications;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Notifications;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace Jellyfin.Api.Controllers
{
///
/// The notification controller.
///
[Authorize(Policy = Policies.DefaultAuthorization)]
public class NotificationsController : BaseJellyfinApiController
{
private readonly INotificationManager _notificationManager;
///
/// Initializes a new instance of the class.
///
/// The notification manager.
public NotificationsController(INotificationManager notificationManager)
{
_notificationManager = notificationManager;
}
///
/// Gets notification types.
///
/// All notification types returned.
/// An containing a list of all notification types.
[HttpGet("Types")]
[ProducesResponseType(StatusCodes.Status200OK)]
public IEnumerable GetNotificationTypes()
{
return _notificationManager.GetNotificationTypes();
}
///
/// Gets notification services.
///
/// All notification services returned.
/// An containing a list of all notification services.
[HttpGet("Services")]
[ProducesResponseType(StatusCodes.Status200OK)]
public IEnumerable GetNotificationServices()
{
return _notificationManager.GetNotificationServices();
}
}
}