forked from aws/aws-lambda-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSQSBatchResponse.cs
54 lines (50 loc) · 1.81 KB
/
SQSBatchResponse.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
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace Amazon.Lambda.SQSEvents
{
/// This class can be used as the return type for Lambda functions that have partially
/// succeeded by supplying a list of message IDs that have failed to process.
/// https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-batchfailurereporting
[DataContract]
public class SQSBatchResponse
{
/// <summary>
/// Creates a new instance of <see cref="SQSBatchResponse"/>
/// </summary>
public SQSBatchResponse()
: this(new List<BatchItemFailure>())
{
}
/// <summary>
/// Creates a new instance of <see cref="SQSBatchResponse"/>
/// </summary>
/// <param name="batchItemFailures">A list of batch item failures</param>
public SQSBatchResponse(List<BatchItemFailure> batchItemFailures)
{
BatchItemFailures = batchItemFailures;
}
/// <summary>
/// Gets or sets the message failures within the batch failures
/// </summary>
[DataMember(Name = "batchItemFailures")]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("batchItemFailures")]
#endif
public List<BatchItemFailure> BatchItemFailures { get; set; }
/// <summary>
/// Class representing a SQS message item failure
/// </summary>
[DataContract]
public class BatchItemFailure
{
/// <summary>
/// MessageId that failed processing
/// </summary>
[DataMember(Name = "itemIdentifier")]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("itemIdentifier")]
#endif
public string ItemIdentifier { get; set; }
}
}
}