-
Notifications
You must be signed in to change notification settings - Fork 478
/
KinesisTimeWindowEvent.cs
66 lines (57 loc) · 2.04 KB
/
KinesisTimeWindowEvent.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
namespace Amazon.Lambda.KinesisEvents
{
using System;
using System.Collections.Generic;
#if NETCOREAPP3_1_OR_GREATER
using Amazon.Lambda.KinesisEvents.Converters;
using System.Text.Json.Serialization;
#endif
/// <summary>
/// Represents an Amazon Kinesis event when using time windows.
/// https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-windows
/// </summary>
public class KinesisTimeWindowEvent : KinesisEvent
{
/// <summary>
/// Time window for the records in the event.
/// </summary>
public TimeWindow Window { get; set; }
/// <summary>
/// State being built up to this invoke in the time window.
/// </summary>
#if NETCOREAPP3_1_OR_GREATER
[JsonConverter(typeof(DictionaryLongToStringJsonConverter))]
#endif
public Dictionary<string, string> State { get; set; }
/// <summary>
/// Shard Id of the records.
/// </summary>
public string ShardId { get; set; }
/// <summary>
/// Kinesis stream or consumer ARN.
/// </summary>
public string EventSourceARN { get; set; }
/// <summary>
/// Set to true for the last invoke of the time window. Subsequent invoke will start a new time window along with a fresh state.
/// </summary>
public bool? IsFinalInvokeForWindow { get; set; }
/// <summary>
/// Set to true if window is terminated prematurely. Subsequent invoke will continue the same window with a fresh state.
/// </summary>
public bool? IsWindowTerminatedEarly { get; set; }
/// <summary>
/// Time window for the records in the event.
/// </summary>
public class TimeWindow
{
/// <summary>
/// Window start instant.
/// </summary>
public DateTime Start { get; set; }
/// <summary>
/// Window end instant.
/// </summary>
public DateTime End { get; set; }
}
}
}