-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFunction.cs
32 lines (28 loc) · 1004 Bytes
/
Function.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System.Threading.Tasks;
using Amazon.Lambda.APIGatewayEvents;
using Amazon.Lambda.Core;
using GitHubHook.S3Dump.Handlers;
// Assembly attribute to enable the Lambda function's JSON input to be converted into a .NET class.
[assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]
namespace GitHubHook.S3Dump
{
public class Function
{
private readonly LambdaHandler lambdaHandler;
public async Task<APIGatewayProxyResponse> FunctionHandler(
APIGatewayProxyRequest input,
ILambdaContext context)
{
return await lambdaHandler.Handle(input, context);
}
public Function()
{
var eventHandlers = new EventHandlersRegistry();
eventHandlers.RegisterEventHandler<AnyToS3Handler>();
lambdaHandler = new LambdaHandler(
new Authentication(),
eventHandlers,
new EventPayloadFactory());
}
}
}