aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/ApiClient/IApiClient.cs9
-rw-r--r--MediaBrowser.Model/Notifications/Notification.cs31
2 files changed, 25 insertions, 15 deletions
diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs
index 323373106..bbd07817c 100644
--- a/MediaBrowser.Model/ApiClient/IApiClient.cs
+++ b/MediaBrowser.Model/ApiClient/IApiClient.cs
@@ -141,18 +141,11 @@ namespace MediaBrowser.Model.ApiClient
Task MarkNotificationsRead(string userId, IEnumerable<Guid> notificationIdList, bool isRead);
/// <summary>
- /// Updates the notification.
- /// </summary>
- /// <param name="notification">The notification.</param>
- /// <returns>Task.</returns>
- Task UpdateNotification(Notification notification);
-
- /// <summary>
/// Adds the notification.
/// </summary>
/// <param name="notification">The notification.</param>
/// <returns>Task{Notification}.</returns>
- Task<Notification> AddNotification(Notification notification);
+ Task SendNotification(NotificationRequest notification);
/// <summary>
/// Gets the notifications summary.
diff --git a/MediaBrowser.Model/Notifications/Notification.cs b/MediaBrowser.Model/Notifications/Notification.cs
index 14f55b6e1..511227cbf 100644
--- a/MediaBrowser.Model/Notifications/Notification.cs
+++ b/MediaBrowser.Model/Notifications/Notification.cs
@@ -1,12 +1,13 @@
using System;
+using System.Collections.Generic;
namespace MediaBrowser.Model.Notifications
{
public class Notification
{
- public Guid Id { get; set; }
+ public string Id { get; set; }
- public Guid UserId { get; set; }
+ public string UserId { get; set; }
public DateTime Date { get; set; }
@@ -17,16 +18,32 @@ namespace MediaBrowser.Model.Notifications
public string Description { get; set; }
public string Url { get; set; }
-
- public string Category { get; set; }
-
- public string RelatedId { get; set; }
public NotificationLevel Level { get; set; }
public Notification()
{
- Id = Guid.NewGuid();
+ Date = DateTime.UtcNow;
+ }
+ }
+
+ public class NotificationRequest
+ {
+ public string Name { get; set; }
+
+ public string Description { get; set; }
+
+ public string Url { get; set; }
+
+ public NotificationLevel Level { get; set; }
+
+ public List<string> UserIds { get; set; }
+
+ public DateTime Date { get; set; }
+
+ public NotificationRequest()
+ {
+ UserIds = new List<string>();
Date = DateTime.UtcNow;
}
}