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
{
///
/// Creates a new instance of
///
public SQSBatchResponse()
: this(new List())
{
}
///
/// Creates a new instance of
///
/// A list of batch item failures
public SQSBatchResponse(List batchItemFailures)
{
BatchItemFailures = batchItemFailures;
}
///
/// Gets or sets the message failures within the batch failures
///
[DataMember(Name = "batchItemFailures")]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("batchItemFailures")]
#endif
public List BatchItemFailures { get; set; }
///
/// Class representing a SQS message item failure
///
[DataContract]
public class BatchItemFailure
{
///
/// MessageId that failed processing
///
[DataMember(Name = "itemIdentifier")]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("itemIdentifier")]
#endif
public string ItemIdentifier { get; set; }
}
}
}