blob: 87b89e79c80b98bdf89aaad13cd57953220a80a6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
using MediaBrowser.Model.Notifications;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Notifications
{
/// <summary>
/// Interface INotificationsRepository
/// </summary>
public interface INotificationsRepository
{
/// <summary>
/// Occurs when [notification added].
/// </summary>
event EventHandler<NotificationUpdateEventArgs> NotificationAdded;
/// <summary>
/// Occurs when [notification updated].
/// </summary>
event EventHandler<NotificationUpdateEventArgs> NotificationUpdated;
/// <summary>
/// Occurs when [notifications marked read].
/// </summary>
event EventHandler<NotificationReadEventArgs> NotificationsMarkedRead;
/// <summary>
/// Opens the connection to the repository
/// </summary>
/// <returns>Task.</returns>
Task Initialize();
/// <summary>
/// Gets the notifications.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>NotificationResult.</returns>
NotificationResult GetNotifications(NotificationQuery query);
/// <summary>
/// Gets the notification.
/// </summary>
/// <param name="id">The id.</param>
/// <param name="userId">The user id.</param>
/// <returns>Notification.</returns>
Notification GetNotification(string id, string userId);
/// <summary>
/// Adds the notification.
/// </summary>
/// <param name="notification">The notification.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task AddNotification(Notification notification, CancellationToken cancellationToken);
/// <summary>
/// Marks the read.
/// </summary>
/// <param name="notificationIdList">The notification id list.</param>
/// <param name="userId">The user id.</param>
/// <param name="isRead">if set to <c>true</c> [is read].</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task MarkRead(IEnumerable<string> notificationIdList, string userId, bool isRead, CancellationToken cancellationToken);
/// <summary>
/// Gets the notifications summary.
/// </summary>
/// <param name="userId">The user id.</param>
/// <returns>NotificationsSummary.</returns>
NotificationsSummary GetNotificationsSummary(string userId);
}
}
|