|
| 1 | +package events |
| 2 | + |
| 3 | +// Window is the object that captures the time window for the records in the event when using the tumbling windows feature |
| 4 | +// Kinesis: https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-windows |
| 5 | +// DDB: https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-windows |
| 6 | +type Window struct { |
| 7 | + Start string `json:"start"` |
| 8 | + End string `json:"end"` |
| 9 | +} |
| 10 | + |
| 11 | +// TimeWindowProperties is the object that captures properties that relate to the tumbling windows feature |
| 12 | +// Kinesis: https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-windows |
| 13 | +// DDB: https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-windows |
| 14 | +type TimeWindowProperties struct { |
| 15 | + // Time window for the records in the event. |
| 16 | + Window Window `json:"window"` |
| 17 | + |
| 18 | + // State being built up to this invoke in the time window. |
| 19 | + State map[string]string `json:"state"` |
| 20 | + |
| 21 | + // Shard id of the records |
| 22 | + ShardID string `json:"shardId"` |
| 23 | + |
| 24 | + // Dynamodb stream arn. |
| 25 | + EventSourceArn string `json:"eventSourceARN"` |
| 26 | + |
| 27 | + // Set to true for the last invoke of the time window. |
| 28 | + // Subsequent invoke will start a new time window along with a fresh state. |
| 29 | + IsFinalInvokeForWindow bool `json:"isFinalInvokeForWindow"` |
| 30 | + |
| 31 | + // Set to true if window is terminated prematurely. |
| 32 | + // Subsequent invoke will continue the same window with a fresh state. |
| 33 | + IsWindowTerminatedEarly bool `json:"isWindowTerminatedEarly"` |
| 34 | +} |
| 35 | + |
| 36 | +// TimeWindowEventResponseProperties is the object that captures response properties that relate to the tumbling windows feature |
| 37 | +// Kinesis: https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-windows |
| 38 | +// DDB: https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-windows |
| 39 | +type TimeWindowEventResponseProperties struct { |
| 40 | + // State being built up to this invoke in the time window. |
| 41 | + State map[string]string `json:"state"` |
| 42 | +} |
| 43 | + |
| 44 | +// KinesisTimeWindowEventResponse is the outer structure to report batch item failures for KinesisTimeWindowEvent. |
| 45 | +type KinesisTimeWindowEventResponse struct { |
| 46 | + TimeWindowEventResponseProperties |
| 47 | + BatchItemFailures []KinesisBatchItemFailure `json:"batchItemFailures"` |
| 48 | +} |
| 49 | + |
| 50 | +// DynamoDBTimeWindowEventResponse is the outer structure to report batch item failures for DynamoDBTimeWindowEvent. |
| 51 | +type DynamoDBTimeWindowEventResponse struct { |
| 52 | + TimeWindowEventResponseProperties |
| 53 | + BatchItemFailures []DynamoDBBatchItemFailure `json:"batchItemFailures"` |
| 54 | +} |
0 commit comments