mirror of
https://github.com/bitwarden/server.git
synced 2025-06-17 09:33:51 -05:00

* [PM-17562] Add support for retires on event integrations * Add additional test coverage * Fixed missing await call * Remove debug organization id * Respond to PR feedback * Change NotBeforeUtc to DelayUntilDate. Adjust comments. * Respond to PR feedback
25 lines
698 B
C#
25 lines
698 B
C#
using Bit.Core.AdminConsole.Models.Data.Integrations;
|
|
|
|
namespace Bit.Core.Services;
|
|
|
|
public interface IIntegrationHandler
|
|
{
|
|
Task<IntegrationHandlerResult> HandleAsync(string json);
|
|
}
|
|
|
|
public interface IIntegrationHandler<T> : IIntegrationHandler
|
|
{
|
|
Task<IntegrationHandlerResult> HandleAsync(IntegrationMessage<T> message);
|
|
}
|
|
|
|
public abstract class IntegrationHandlerBase<T> : IIntegrationHandler<T>
|
|
{
|
|
public async Task<IntegrationHandlerResult> HandleAsync(string json)
|
|
{
|
|
var message = IntegrationMessage<T>.FromJson(json);
|
|
return await HandleAsync(message);
|
|
}
|
|
|
|
public abstract Task<IntegrationHandlerResult> HandleAsync(IntegrationMessage<T> message);
|
|
}
|