Class ALambdaEventFunction<TMessage>
The ALambdaEventFunction<TMessage> is the abstract base class for handling Amazon CloudWatch Events events.
Implements
Inherited Members
Namespace: LambdaSharp.EventBridge
Assembly: LambdaSharp.EventBridge.dll
Syntax
public abstract class ALambdaEventFunction<TMessage> : ALambdaFunction, ILambdaSharpLogger
Type Parameters
Name | Description |
---|---|
TMessage | The CloudWatch event message type. |
Constructors
ALambdaEventFunction(ILambdaJsonSerializer)
Initializes a new ALambdaEventFunction<TMessage> instance using the default
implementation of ILambda
Declaration
protected ALambdaEventFunction(ILambdaJsonSerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
ILambda |
serializer | Custom implementation of ILambda |
ALambdaEventFunction(ILambdaJsonSerializer, ILambdaFunctionDependencyProvider)
Initializes a new ALambdaEventFunction<TMessage> instance using a
custom implementation of ILambda
Declaration
protected ALambdaEventFunction(ILambdaJsonSerializer serializer, ILambdaFunctionDependencyProvider provider)
Parameters
Type | Name | Description |
---|---|---|
ILambda |
serializer | Custom implementation of ILambda |
ILambda |
provider | Custom implementation of ILambda |
Properties
CurrentEvent
The Current
Declaration
protected CloudWatchEvent<TMessage> CurrentEvent { get; }
Property Value
Type | Description |
---|---|
Amazon. |
The Amazon.Lambda.CloudWatchEvents.CloudWatchEvent<T> instance. |
Remarks
This property is only set during the invocation of Processnull
.
LambdaSerializer
An instance of ILambda
Declaration
protected ILambdaJsonSerializer LambdaSerializer { get; }
Property Value
Type | Description |
---|---|
ILambda |
The ILambda |
Methods
Deserialize(String, String)
The Deserialize(String, String) method converts the CloudWatch event detail from string to a typed instance.
Declaration
public virtual TMessage Deserialize(string detailType, string detail)
Parameters
Type | Name | Description |
---|---|---|
System. |
detailType | The CloudWatch event detail type |
System. |
detail | The CloudWatch event detail. |
Returns
Type | Description |
---|---|
TMessage | The deserialized The CloudWatch event message. |
Remarks
This method invokes Amazon.
ProcessEventAsync(TMessage)
The Process
Declaration
public abstract Task ProcessEventAsync(TMessage message)
Parameters
Type | Name | Description |
---|---|---|
TMessage | message | The deserialized CloudWatch event message. |
Returns
Type | Description |
---|---|
System. |
The task object representing the asynchronous operation. |
ProcessMessageStreamAsync(Stream)
The Process
Declaration
public sealed override async Task<Stream> ProcessMessageStreamAsync(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System. |
stream | The stream with the request payload. |
Returns
Type | Description |
---|---|
System. |
The task object representing the asynchronous operation. |
Overrides
Remarks
This method cannot be overridden.