From a86b71899ec52c44ddc6c3018e8cc5e9d7ff4d62 Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Thu, 27 Dec 2018 18:27:57 -0500 Subject: Add GPL modules --- .../Notifications/INotificationManager.cs | 41 ++++++++++++++++++++++ .../Notifications/INotificationService.cs | 30 ++++++++++++++++ .../Notifications/INotificationTypeFactory.cs | 14 ++++++++ .../Notifications/UserNotification.cs | 21 +++++++++++ 4 files changed, 106 insertions(+) create mode 100644 MediaBrowser.Controller/Notifications/INotificationManager.cs create mode 100644 MediaBrowser.Controller/Notifications/INotificationService.cs create mode 100644 MediaBrowser.Controller/Notifications/INotificationTypeFactory.cs create mode 100644 MediaBrowser.Controller/Notifications/UserNotification.cs (limited to 'MediaBrowser.Controller/Notifications') diff --git a/MediaBrowser.Controller/Notifications/INotificationManager.cs b/MediaBrowser.Controller/Notifications/INotificationManager.cs new file mode 100644 index 0000000000..161f0ffba2 --- /dev/null +++ b/MediaBrowser.Controller/Notifications/INotificationManager.cs @@ -0,0 +1,41 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.Dto; +using MediaBrowser.Model.Notifications; +using System.Collections.Generic; +using System.Threading.Tasks; +using System.Threading; + +namespace MediaBrowser.Controller.Notifications +{ + public interface INotificationManager + { + /// + /// Sends the notification. + /// + /// The request. + /// The cancellation token. + /// Task. + Task SendNotification(NotificationRequest request, CancellationToken cancellationToken); + + Task SendNotification(NotificationRequest request, BaseItem relatedItem, CancellationToken cancellationToken); + + /// + /// Adds the parts. + /// + /// The services. + /// The notification type factories. + void AddParts(IEnumerable services, IEnumerable notificationTypeFactories); + + /// + /// Gets the notification types. + /// + /// IEnumerable{NotificationTypeInfo}. + List GetNotificationTypes(); + + /// + /// Gets the notification services. + /// + /// IEnumerable{NotificationServiceInfo}. + IEnumerable GetNotificationServices(); + } +} diff --git a/MediaBrowser.Controller/Notifications/INotificationService.cs b/MediaBrowser.Controller/Notifications/INotificationService.cs new file mode 100644 index 0000000000..b1e313b873 --- /dev/null +++ b/MediaBrowser.Controller/Notifications/INotificationService.cs @@ -0,0 +1,30 @@ +using MediaBrowser.Controller.Entities; +using System.Threading; +using System.Threading.Tasks; + +namespace MediaBrowser.Controller.Notifications +{ + public interface INotificationService + { + /// + /// Gets the name. + /// + /// The name. + string Name { get; } + + /// + /// Sends the notification. + /// + /// The request. + /// The cancellation token. + /// Task. + Task SendNotification(UserNotification request, CancellationToken cancellationToken); + + /// + /// Determines whether [is enabled for user] [the specified user identifier]. + /// + /// The user. + /// true if [is enabled for user] [the specified user identifier]; otherwise, false. + bool IsEnabledForUser(User user); + } +} diff --git a/MediaBrowser.Controller/Notifications/INotificationTypeFactory.cs b/MediaBrowser.Controller/Notifications/INotificationTypeFactory.cs new file mode 100644 index 0000000000..bf92aae2da --- /dev/null +++ b/MediaBrowser.Controller/Notifications/INotificationTypeFactory.cs @@ -0,0 +1,14 @@ +using MediaBrowser.Model.Notifications; +using System.Collections.Generic; + +namespace MediaBrowser.Controller.Notifications +{ + public interface INotificationTypeFactory + { + /// + /// Gets the notification types. + /// + /// IEnumerable{NotificationTypeInfo}. + IEnumerable GetNotificationTypes(); + } +} diff --git a/MediaBrowser.Controller/Notifications/UserNotification.cs b/MediaBrowser.Controller/Notifications/UserNotification.cs new file mode 100644 index 0000000000..d035a3995c --- /dev/null +++ b/MediaBrowser.Controller/Notifications/UserNotification.cs @@ -0,0 +1,21 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.Notifications; +using System; + +namespace MediaBrowser.Controller.Notifications +{ + public class UserNotification + { + public string Name { get; set; } + + public string Description { get; set; } + + public string Url { get; set; } + + public NotificationLevel Level { get; set; } + + public DateTime Date { get; set; } + + public User User { get; set; } + } +} -- cgit v1.2.3