Files
Umbraco-CMS/src/Umbraco.Core/Services/IWebhookService.cs
Bjarne Fyrstenborg f47830b165 V14: Webhook Management API (#15147)
* Add webhook to management api

* Update webhook controllers

* Add ByKey webhook controller

* Fix typo

* Fix typo

* Update multiple webhooks

* Update using

* Remove duplicate constant after merge

* Fix typo in file name

* Update casing of IWebhookService

* Fix typo

* Use Webhook entity type

* Fix ambiguous reference

* Update webhook mapping

* Update after change of CreatedAtAction

* Use CreatedAtId instead

* Update src/Umbraco.Cms.Api.Management/Controllers/Webhook/ByKeyWebhookController.cs

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>

* Update src/Umbraco.Cms.Api.Management/Controllers/Webhook/ByKeyWebhookController.cs

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>

* Update src/Umbraco.Cms.Api.Management/ViewModels/Webhook/CreateWebhookRequestModel.cs

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>

* Update src/Umbraco.Cms.Api.Management/Controllers/Webhook/DeleteWebhookController.cs

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>

* Update src/Umbraco.Cms.Api.Management/Controllers/Webhook/CreateWebhookController.cs

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>

* Add Guid to WebhookResponseModel

* Cleanup

* Add Auth

* Move webhook logic from backoffice to management api

* Add mapping

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2024-02-26 14:35:35 +01:00

49 lines
1.5 KiB
C#

using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services.OperationStatus;
namespace Umbraco.Cms.Core.Services;
public interface IWebhookService
{
/// <summary>
/// Creates a webhook.
/// </summary>
/// <param name="webhook"><see cref="IWebhook" /> to create.</param>
Task<Attempt<IWebhook, WebhookOperationStatus>> CreateAsync(IWebhook webhook);
/// <summary>
/// Updates a webhook.
/// </summary>
/// <param name="webhook"><see cref="IWebhook" /> to update.</param>
Task<Attempt<IWebhook, WebhookOperationStatus>> UpdateAsync(IWebhook webhook);
/// <summary>
/// Deletes a webhook.
/// </summary>
/// <param name="key">The unique key of the webhook.</param>
Task<Attempt<IWebhook?, WebhookOperationStatus>> DeleteAsync(Guid key);
/// <summary>
/// Gets a webhook by its key.
/// </summary>
/// <param name="key">The unique key of the webhook.</param>
Task<IWebhook?> GetAsync(Guid key);
/// <summary>
/// Gets all webhooks with the given keys.
/// </summary>
/// <returns>An enumerable list of <see cref="IWebhook" /> objects.</returns>
Task<IEnumerable<IWebhook?>> GetMultipleAsync(IEnumerable<Guid> keys)
=> throw new NotImplementedException();
/// <summary>
/// Gets all webhooks.
/// </summary>
Task<PagedModel<IWebhook>> GetAllAsync(int skip, int take);
/// <summary>
/// Gets webhooks by event name.
/// </summary>
Task<IEnumerable<IWebhook>> GetByAliasAsync(string alias);
}