Class WebhookService
Implements IWebhookService to manage webhooks.
Inheritance
object
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public class WebhookService : IWebhookService
Constructors
View SourceWebhookService(ICoreScopeProvider, IWebhookRepository, IEventMessagesFactory)
Initializes a new instance of the WebhookService class.
Declaration
public WebhookService(ICoreScopeProvider provider, IWebhookRepository webhookRepository, IEventMessagesFactory eventMessagesFactory)
Parameters
| Type | Name | Description |
|---|---|---|
| ICoreScopeProvider | provider | The core scope provider. |
| IWebhookRepository | webhookRepository | The webhook repository. |
| IEventMessagesFactory | eventMessagesFactory | The event messages factory. |
Methods
View SourceCreateAsync(IWebhook)
Creates a webhook.
Declaration
public Task<Attempt<IWebhook, WebhookOperationStatus>> CreateAsync(IWebhook webhook)
Parameters
| Type | Name | Description |
|---|---|---|
| IWebhook | webhook | IWebhook to create. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<IWebhook, WebhookOperationStatus>> |
DeleteAsync(Guid)
Deletes a webhook.
Declaration
public Task<Attempt<IWebhook?, WebhookOperationStatus>> DeleteAsync(Guid key)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | key | The unique key of the webhook. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<IWebhook, WebhookOperationStatus>> |
GetAllAsync(int, int)
Gets all webhooks.
Declaration
public Task<PagedModel<IWebhook>> GetAllAsync(int skip, int take)
Parameters
| Type | Name | Description |
|---|---|---|
| int | skip | |
| int | take |
Returns
| Type | Description |
|---|---|
| Task<PagedModel<IWebhook>> |
GetAsync(Guid)
Gets a webhook by its key.
Declaration
public Task<IWebhook?> GetAsync(Guid key)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | key | The unique key of the webhook. |
Returns
| Type | Description |
|---|---|
| Task<IWebhook> |
GetByAliasAsync(string)
Gets webhooks by event name.
Declaration
public Task<IEnumerable<IWebhook>> GetByAliasAsync(string alias)
Parameters
| Type | Name | Description |
|---|---|---|
| string | alias |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<IWebhook>> |
GetMultipleAsync(IEnumerable<Guid>)
Gets all webhooks with the given keys.
Declaration
public Task<IEnumerable<IWebhook?>> GetMultipleAsync(IEnumerable<Guid> keys)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<Guid> | keys |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<IWebhook>> | An enumerable list of IWebhook objects. |
UpdateAsync(IWebhook)
Updates a webhook.
Declaration
public Task<Attempt<IWebhook, WebhookOperationStatus>> UpdateAsync(IWebhook webhook)
Parameters
| Type | Name | Description |
|---|---|---|
| IWebhook | webhook | IWebhook to update. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<IWebhook, WebhookOperationStatus>> |