View Source
Class WebhookEventBase<TNotification>
Assembly: Umbraco.Core.dll
Syntax
public abstract class WebhookEventBase<TNotification> : IWebhookEvent, INotificationAsyncHandler<TNotification>, INotificationHandler where TNotification : INotification
Type Parameters
| Name |
Description |
| TNotification |
|
Constructors
View Source
WebhookEventBase(IWebhookFiringService, IWebhookService, IOptionsMonitor<WebhookSettings>, IServerRoleAccessor)
Declaration
protected WebhookEventBase(IWebhookFiringService webhookFiringService, IWebhookService webhookService, IOptionsMonitor<WebhookSettings> webhookSettings, IServerRoleAccessor serverRoleAccessor)
Parameters
Properties
View Source
Alias
Declaration
public abstract string Alias { get; }
Property Value
View Source
EventName
Declaration
public string EventName { get; set; }
Property Value
View Source
EventType
Declaration
public string EventType { get; }
Property Value
View Source
WebhookFiringService
Declaration
protected IWebhookFiringService WebhookFiringService { get; }
Property Value
View Source
WebhookService
Declaration
protected IWebhookService WebhookService { get; }
Property Value
View Source
WebhookSettings
Declaration
protected WebhookSettings WebhookSettings { get; }
Property Value
Methods
View Source
ConvertNotificationToRequestPayload(TNotification)
Use this method if you wish to change the shape of the object to be serialised
for the JSON webhook payload.
For example excluding sensitive data
Declaration
public virtual object? ConvertNotificationToRequestPayload(TNotification notification)
Parameters
| Type |
Name |
Description |
| TNotification |
notification |
|
Returns
View Source
HandleAsync(TNotification, CancellationToken)
Declaration
public Task HandleAsync(TNotification notification, CancellationToken cancellationToken)
Parameters
| Type |
Name |
Description |
| TNotification |
notification |
The notification.
|
| CancellationToken |
cancellationToken |
The cancellation token.
|
Returns
| Type |
Description |
| Task |
A System.Threading.Tasks.Task representing the asynchronous operation.
|
View Source
ProcessWebhooks(TNotification, IEnumerable<IWebhook>, CancellationToken)
Process the webhooks for the given notification.
Declaration
public virtual Task ProcessWebhooks(TNotification notification, IEnumerable<IWebhook> webhooks, CancellationToken cancellationToken)
Parameters
| Type |
Name |
Description |
| TNotification |
notification |
|
| IEnumerable<IWebhook> |
webhooks |
|
| CancellationToken |
cancellationToken |
|
Returns
View Source
ShouldFireWebhookForNotification(TNotification)
should webhooks fire for this notification.
Declaration
public virtual bool ShouldFireWebhookForNotification(TNotification notificationObject)
Parameters
| Type |
Name |
Description |
| TNotification |
notificationObject |
|
Returns
| Type |
Description |
| bool |
true if webhooks should be fired.
|