View Source
Class WebhookEventBase<TNotification>
Inheritance
System.Object
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
Type |
Description |
System.String |
|
View Source
EventName
Declaration
public string EventName { get; set; }
Property Value
Type |
Description |
System.String |
|
View Source
EventType
Declaration
public string EventType { get; }
Property Value
Type |
Description |
System.String |
|
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
Type |
Description |
System.Object |
|
View Source
HandleAsync(TNotification, CancellationToken)
Declaration
public async Task HandleAsync(TNotification notification, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
TNotification |
notification |
|
CancellationToken |
cancellationToken |
|
Returns
View Source
ProcessWebhooks(TNotification, IEnumerable<IWebhook>, CancellationToken)
Process the webhooks for the given notification.
Declaration
public virtual async 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 |
System.Boolean |
true if webhooks should be fired.
|