mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-18 04:34:21 +01:00
Greenfield: Manage notifications (#6058)
Prerequisite for btcpayserver/app#12.
This commit is contained in:
@@ -33,6 +33,16 @@ public partial class BTCPayServerClient
|
||||
return await SendHttpRequest<NotificationData>($"api/v1/users/me/notifications/{notificationId}", new UpdateNotification { Seen = seen }, HttpMethod.Put, token);
|
||||
}
|
||||
|
||||
public virtual async Task<NotificationSettingsData> GetNotificationSettings(CancellationToken token = default)
|
||||
{
|
||||
return await SendHttpRequest<NotificationSettingsData>("api/v1/users/me/notification-settings", null, HttpMethod.Get, token);
|
||||
}
|
||||
|
||||
public virtual async Task<NotificationSettingsData> UpdateNotificationSettings(UpdateNotificationSettingsRequest request, CancellationToken token = default)
|
||||
{
|
||||
return await SendHttpRequest<NotificationSettingsData>("api/v1/users/me/notification-settings", request, HttpMethod.Put, token);
|
||||
}
|
||||
|
||||
public virtual async Task RemoveNotification(string notificationId, CancellationToken token = default)
|
||||
{
|
||||
await SendHttpRequest($"api/v1/users/me/notifications/{notificationId}", null, HttpMethod.Delete, token);
|
||||
|
||||
15
BTCPayServer.Client/Models/NotificationSettingsData.cs
Normal file
15
BTCPayServer.Client/Models/NotificationSettingsData.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BTCPayServer.Client.Models;
|
||||
|
||||
public class NotificationSettingsData
|
||||
{
|
||||
public List<NotificationSettingsItemData> Notifications { get; set; }
|
||||
}
|
||||
|
||||
public class NotificationSettingsItemData
|
||||
{
|
||||
public string Identifier { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BTCPayServer.Client.Models;
|
||||
|
||||
public class UpdateNotificationSettingsRequest
|
||||
{
|
||||
public List<string> Disabled { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user