AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Represents the output of a BatchGetItem operation.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceResponse
    Amazon.DynamoDBv2.Model.BatchGetItemResponse

Namespace: Amazon.DynamoDBv2.Model
Assembly: AWSSDK.DynamoDBv2.dll
Version: 3.x.y.z

Syntax

C#
public class BatchGetItemResponse : AmazonWebServiceResponse

The BatchGetItemResponse type exposes the following members

Constructors

NameDescription
Public Method BatchGetItemResponse()

Properties

NameTypeDescription
Public Property ConsumedCapacity System.Collections.Generic.List<Amazon.DynamoDBv2.Model.ConsumedCapacity>

Gets and sets the property ConsumedCapacity.

The read capacity units consumed by the entire BatchGetItem operation.

Each element consists of:

  • TableName - The table that consumed the provisioned throughput.

  • CapacityUnits - The total number of capacity units consumed.

Public Property ContentLength System.Int64 Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property HttpStatusCode System.Net.HttpStatusCode Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property ResponseMetadata Amazon.Runtime.ResponseMetadata Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property Responses System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.List<System.Collections.Generic.Dictionary<System.String, Amazon.DynamoDBv2.Model.AttributeValue>>>

Gets and sets the property Responses.

A map of table name or table ARN to a list of items. Each object in Responses consists of a table name or ARN, along with a map of attribute data consisting of the data type and attribute value.

Public Property UnprocessedKeys System.Collections.Generic.Dictionary<System.String, Amazon.DynamoDBv2.Model.KeysAndAttributes>

Gets and sets the property UnprocessedKeys.

A map of tables and their respective keys that were not processed with the current response. The UnprocessedKeys value is in the same form as RequestItems, so the value can be provided directly to a subsequent BatchGetItem operation. For more information, see RequestItems in the Request Parameters section.

Each element consists of:

  • Keys - An array of primary key attribute values that define specific items in the table.

  • ProjectionExpression - One or more attributes to be retrieved from the table or index. By default, all attributes are returned. If a requested attribute is not found, it does not appear in the result.

  • ConsistentRead - The consistency of a read operation. If set to true, then a strongly consistent read is used; otherwise, an eventually consistent read is used.

If there are no unprocessed keys remaining, the response contains an empty UnprocessedKeys map.

Examples

batch-get-item


var client = new AmazonDynamoDBClient();
var response = client.BatchGetItem(new BatchGetItemRequest 
{
    RequestItems = new Dictionary<string, KeysAndAttributes> {
        { "tablename1", new KeysAndAttributes {
            Keys = new List<Dictionary<string, AttributeValue>> {
                new Dictionary<string, AttributeValue> {
                    { "key1", new AttributeValue { N = "NumberAttributeValue" } }
                }
            },
            AttributesToGet = new List<string> {
                "attr1",
                "attr2"
            },
            ConsistentRead = true,
            ProjectionExpression = "str1",
            ExpressionAttributeNames = new Dictionary<string, string> {
                { "name1", "attr3" },
                { "name2", "attr4" }
            }
        } },
        { "tablename2", new KeysAndAttributes {
            Keys = new List<Dictionary<string, AttributeValue>> {
                new Dictionary<string, AttributeValue> {
                    { "key2", new AttributeValue { BOOL = true } }
                }
            },
            AttributesToGet = new List<string> {
                "attr1",
                "attr2"
            },
            ConsistentRead = false,
            ProjectionExpression = "str2",
            ExpressionAttributeNames = new Dictionary<string, string> {
                { "name1", "attr3" },
                { "name2", "attr4" }
            }
        } }
    },
    ReturnConsumedCapacity = "NONE"
});

Dictionary<string, List<Dictionary<string, AttributeValue>>> responses = response.Responses;
List<ConsumedCapacity> consumedCapacity = response.ConsumedCapacity;

            

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5, 4.0, 3.5