mirror of
https://github.com/C9Glax/tranga.git
synced 2025-06-20 10:07:54 +02:00
Arbitrary Webhook for NotificationConnectors
Backend only deals in REST Webhooks The API has custom Endpoints for Ntfy, Gotify, Lunasea that create pre-formatted Webhooks #297 #259
This commit is contained in:
17
API/APIEndpointRecords/NtfyRecord.cs
Normal file
17
API/APIEndpointRecords/NtfyRecord.cs
Normal file
@ -0,0 +1,17 @@
|
||||
namespace API.APIEndpointRecords;
|
||||
|
||||
public record NtfyRecord(string endpoint, string username, string password, string topic, int priority)
|
||||
{
|
||||
public bool Validate()
|
||||
{
|
||||
if (endpoint == string.Empty)
|
||||
return false;
|
||||
if (username == string.Empty)
|
||||
return false;
|
||||
if (password == string.Empty)
|
||||
return false;
|
||||
if (priority < 1 || priority > 5)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user