2
0

INotificationManager.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using MediaBrowser.Controller.Entities;
  2. using MediaBrowser.Model.Notifications;
  3. using System.Collections.Generic;
  4. using System.Threading;
  5. using System.Threading.Tasks;
  6. namespace MediaBrowser.Controller.Notifications
  7. {
  8. public interface INotificationManager
  9. {
  10. /// <summary>
  11. /// Sends the notification.
  12. /// </summary>
  13. /// <param name="request">The request.</param>
  14. /// <param name="cancellationToken">The cancellation token.</param>
  15. /// <returns>Task.</returns>
  16. Task SendNotification(NotificationRequest request, CancellationToken cancellationToken);
  17. /// <summary>
  18. /// Adds the parts.
  19. /// </summary>
  20. /// <param name="services">The services.</param>
  21. void AddParts(IEnumerable<INotificationService> services);
  22. }
  23. public interface INotificationService
  24. {
  25. /// <summary>
  26. /// Gets the name.
  27. /// </summary>
  28. /// <value>The name.</value>
  29. string Name { get; }
  30. /// <summary>
  31. /// Sends the notification.
  32. /// </summary>
  33. /// <param name="request">The request.</param>
  34. /// <param name="cancellationToken">The cancellation token.</param>
  35. /// <returns>Task.</returns>
  36. Task SendNotification(UserNotification request, CancellationToken cancellationToken);
  37. /// <summary>
  38. /// Determines whether [is enabled for user] [the specified user identifier].
  39. /// </summary>
  40. /// <param name="user">The user.</param>
  41. /// <returns><c>true</c> if [is enabled for user] [the specified user identifier]; otherwise, <c>false</c>.</returns>
  42. bool IsEnabledForUser(User user);
  43. }
  44. }