/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include #include #include #include namespace Aws { namespace DynamoDB { namespace Model { /** *

Represents the input of a BatchWriteItem * operation.

See Also:

AWS * API Reference

*/ class BatchWriteItemRequest : public DynamoDBRequest { public: AWS_DYNAMODB_API BatchWriteItemRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "BatchWriteItem"; } AWS_DYNAMODB_API Aws::String SerializePayload() const override; AWS_DYNAMODB_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** *

A map of one or more table names and, for each table, a list of operations to * be performed (DeleteRequest or PutRequest). Each * element in the map consists of the following:

  • * DeleteRequest - Perform a DeleteItem operation on the * specified item. The item to be deleted is identified by a Key * subelement:

    • Key - A map of primary key attribute * values that uniquely identify the item. Each entry in this map consists of an * attribute name and an attribute value. For each primary key, you must provide * all of the key attributes. For example, with a simple primary key, you * only need to provide a value for the partition key. For a composite primary key, * you must provide values for both the partition key and the sort key.

      *
  • PutRequest - Perform a * PutItem operation on the specified item. The item to be put is * identified by an Item subelement:

    • * Item - A map of attributes and their values. Each entry in this map * consists of an attribute name and an attribute value. Attribute values must not * be null; string and binary type attributes must have lengths greater than zero; * and set type attributes must not be empty. Requests that contain empty values * are rejected with a ValidationException exception.

      If you * specify any attributes that are part of an index key, then the data types for * those attributes must match those of the schema in the table's attribute * definition.

*/ inline const Aws::Map>& GetRequestItems() const{ return m_requestItems; } /** *

A map of one or more table names and, for each table, a list of operations to * be performed (DeleteRequest or PutRequest). Each * element in the map consists of the following:

  • * DeleteRequest - Perform a DeleteItem operation on the * specified item. The item to be deleted is identified by a Key * subelement:

    • Key - A map of primary key attribute * values that uniquely identify the item. Each entry in this map consists of an * attribute name and an attribute value. For each primary key, you must provide * all of the key attributes. For example, with a simple primary key, you * only need to provide a value for the partition key. For a composite primary key, * you must provide values for both the partition key and the sort key.

      *
  • PutRequest - Perform a * PutItem operation on the specified item. The item to be put is * identified by an Item subelement:

    • * Item - A map of attributes and their values. Each entry in this map * consists of an attribute name and an attribute value. Attribute values must not * be null; string and binary type attributes must have lengths greater than zero; * and set type attributes must not be empty. Requests that contain empty values * are rejected with a ValidationException exception.

      If you * specify any attributes that are part of an index key, then the data types for * those attributes must match those of the schema in the table's attribute * definition.

*/ inline bool RequestItemsHasBeenSet() const { return m_requestItemsHasBeenSet; } /** *

A map of one or more table names and, for each table, a list of operations to * be performed (DeleteRequest or PutRequest). Each * element in the map consists of the following:

  • * DeleteRequest - Perform a DeleteItem operation on the * specified item. The item to be deleted is identified by a Key * subelement:

    • Key - A map of primary key attribute * values that uniquely identify the item. Each entry in this map consists of an * attribute name and an attribute value. For each primary key, you must provide * all of the key attributes. For example, with a simple primary key, you * only need to provide a value for the partition key. For a composite primary key, * you must provide values for both the partition key and the sort key.

      *
  • PutRequest - Perform a * PutItem operation on the specified item. The item to be put is * identified by an Item subelement:

    • * Item - A map of attributes and their values. Each entry in this map * consists of an attribute name and an attribute value. Attribute values must not * be null; string and binary type attributes must have lengths greater than zero; * and set type attributes must not be empty. Requests that contain empty values * are rejected with a ValidationException exception.

      If you * specify any attributes that are part of an index key, then the data types for * those attributes must match those of the schema in the table's attribute * definition.

*/ inline void SetRequestItems(const Aws::Map>& value) { m_requestItemsHasBeenSet = true; m_requestItems = value; } /** *

A map of one or more table names and, for each table, a list of operations to * be performed (DeleteRequest or PutRequest). Each * element in the map consists of the following:

  • * DeleteRequest - Perform a DeleteItem operation on the * specified item. The item to be deleted is identified by a Key * subelement:

    • Key - A map of primary key attribute * values that uniquely identify the item. Each entry in this map consists of an * attribute name and an attribute value. For each primary key, you must provide * all of the key attributes. For example, with a simple primary key, you * only need to provide a value for the partition key. For a composite primary key, * you must provide values for both the partition key and the sort key.

      *
  • PutRequest - Perform a * PutItem operation on the specified item. The item to be put is * identified by an Item subelement:

    • * Item - A map of attributes and their values. Each entry in this map * consists of an attribute name and an attribute value. Attribute values must not * be null; string and binary type attributes must have lengths greater than zero; * and set type attributes must not be empty. Requests that contain empty values * are rejected with a ValidationException exception.

      If you * specify any attributes that are part of an index key, then the data types for * those attributes must match those of the schema in the table's attribute * definition.

*/ inline void SetRequestItems(Aws::Map>&& value) { m_requestItemsHasBeenSet = true; m_requestItems = std::move(value); } /** *

A map of one or more table names and, for each table, a list of operations to * be performed (DeleteRequest or PutRequest). Each * element in the map consists of the following:

  • * DeleteRequest - Perform a DeleteItem operation on the * specified item. The item to be deleted is identified by a Key * subelement:

    • Key - A map of primary key attribute * values that uniquely identify the item. Each entry in this map consists of an * attribute name and an attribute value. For each primary key, you must provide * all of the key attributes. For example, with a simple primary key, you * only need to provide a value for the partition key. For a composite primary key, * you must provide values for both the partition key and the sort key.

      *
  • PutRequest - Perform a * PutItem operation on the specified item. The item to be put is * identified by an Item subelement:

    • * Item - A map of attributes and their values. Each entry in this map * consists of an attribute name and an attribute value. Attribute values must not * be null; string and binary type attributes must have lengths greater than zero; * and set type attributes must not be empty. Requests that contain empty values * are rejected with a ValidationException exception.

      If you * specify any attributes that are part of an index key, then the data types for * those attributes must match those of the schema in the table's attribute * definition.

*/ inline BatchWriteItemRequest& WithRequestItems(const Aws::Map>& value) { SetRequestItems(value); return *this;} /** *

A map of one or more table names and, for each table, a list of operations to * be performed (DeleteRequest or PutRequest). Each * element in the map consists of the following:

  • * DeleteRequest - Perform a DeleteItem operation on the * specified item. The item to be deleted is identified by a Key * subelement:

    • Key - A map of primary key attribute * values that uniquely identify the item. Each entry in this map consists of an * attribute name and an attribute value. For each primary key, you must provide * all of the key attributes. For example, with a simple primary key, you * only need to provide a value for the partition key. For a composite primary key, * you must provide values for both the partition key and the sort key.

      *
  • PutRequest - Perform a * PutItem operation on the specified item. The item to be put is * identified by an Item subelement:

    • * Item - A map of attributes and their values. Each entry in this map * consists of an attribute name and an attribute value. Attribute values must not * be null; string and binary type attributes must have lengths greater than zero; * and set type attributes must not be empty. Requests that contain empty values * are rejected with a ValidationException exception.

      If you * specify any attributes that are part of an index key, then the data types for * those attributes must match those of the schema in the table's attribute * definition.

*/ inline BatchWriteItemRequest& WithRequestItems(Aws::Map>&& value) { SetRequestItems(std::move(value)); return *this;} /** *

A map of one or more table names and, for each table, a list of operations to * be performed (DeleteRequest or PutRequest). Each * element in the map consists of the following:

  • * DeleteRequest - Perform a DeleteItem operation on the * specified item. The item to be deleted is identified by a Key * subelement:

    • Key - A map of primary key attribute * values that uniquely identify the item. Each entry in this map consists of an * attribute name and an attribute value. For each primary key, you must provide * all of the key attributes. For example, with a simple primary key, you * only need to provide a value for the partition key. For a composite primary key, * you must provide values for both the partition key and the sort key.

      *
  • PutRequest - Perform a * PutItem operation on the specified item. The item to be put is * identified by an Item subelement:

    • * Item - A map of attributes and their values. Each entry in this map * consists of an attribute name and an attribute value. Attribute values must not * be null; string and binary type attributes must have lengths greater than zero; * and set type attributes must not be empty. Requests that contain empty values * are rejected with a ValidationException exception.

      If you * specify any attributes that are part of an index key, then the data types for * those attributes must match those of the schema in the table's attribute * definition.

*/ inline BatchWriteItemRequest& AddRequestItems(const Aws::String& key, const Aws::Vector& value) { m_requestItemsHasBeenSet = true; m_requestItems.emplace(key, value); return *this; } /** *

A map of one or more table names and, for each table, a list of operations to * be performed (DeleteRequest or PutRequest). Each * element in the map consists of the following:

  • * DeleteRequest - Perform a DeleteItem operation on the * specified item. The item to be deleted is identified by a Key * subelement:

    • Key - A map of primary key attribute * values that uniquely identify the item. Each entry in this map consists of an * attribute name and an attribute value. For each primary key, you must provide * all of the key attributes. For example, with a simple primary key, you * only need to provide a value for the partition key. For a composite primary key, * you must provide values for both the partition key and the sort key.

      *
  • PutRequest - Perform a * PutItem operation on the specified item. The item to be put is * identified by an Item subelement:

    • * Item - A map of attributes and their values. Each entry in this map * consists of an attribute name and an attribute value. Attribute values must not * be null; string and binary type attributes must have lengths greater than zero; * and set type attributes must not be empty. Requests that contain empty values * are rejected with a ValidationException exception.

      If you * specify any attributes that are part of an index key, then the data types for * those attributes must match those of the schema in the table's attribute * definition.

*/ inline BatchWriteItemRequest& AddRequestItems(Aws::String&& key, const Aws::Vector& value) { m_requestItemsHasBeenSet = true; m_requestItems.emplace(std::move(key), value); return *this; } /** *

A map of one or more table names and, for each table, a list of operations to * be performed (DeleteRequest or PutRequest). Each * element in the map consists of the following:

  • * DeleteRequest - Perform a DeleteItem operation on the * specified item. The item to be deleted is identified by a Key * subelement:

    • Key - A map of primary key attribute * values that uniquely identify the item. Each entry in this map consists of an * attribute name and an attribute value. For each primary key, you must provide * all of the key attributes. For example, with a simple primary key, you * only need to provide a value for the partition key. For a composite primary key, * you must provide values for both the partition key and the sort key.

      *
  • PutRequest - Perform a * PutItem operation on the specified item. The item to be put is * identified by an Item subelement:

    • * Item - A map of attributes and their values. Each entry in this map * consists of an attribute name and an attribute value. Attribute values must not * be null; string and binary type attributes must have lengths greater than zero; * and set type attributes must not be empty. Requests that contain empty values * are rejected with a ValidationException exception.

      If you * specify any attributes that are part of an index key, then the data types for * those attributes must match those of the schema in the table's attribute * definition.

*/ inline BatchWriteItemRequest& AddRequestItems(const Aws::String& key, Aws::Vector&& value) { m_requestItemsHasBeenSet = true; m_requestItems.emplace(key, std::move(value)); return *this; } /** *

A map of one or more table names and, for each table, a list of operations to * be performed (DeleteRequest or PutRequest). Each * element in the map consists of the following:

  • * DeleteRequest - Perform a DeleteItem operation on the * specified item. The item to be deleted is identified by a Key * subelement:

    • Key - A map of primary key attribute * values that uniquely identify the item. Each entry in this map consists of an * attribute name and an attribute value. For each primary key, you must provide * all of the key attributes. For example, with a simple primary key, you * only need to provide a value for the partition key. For a composite primary key, * you must provide values for both the partition key and the sort key.

      *
  • PutRequest - Perform a * PutItem operation on the specified item. The item to be put is * identified by an Item subelement:

    • * Item - A map of attributes and their values. Each entry in this map * consists of an attribute name and an attribute value. Attribute values must not * be null; string and binary type attributes must have lengths greater than zero; * and set type attributes must not be empty. Requests that contain empty values * are rejected with a ValidationException exception.

      If you * specify any attributes that are part of an index key, then the data types for * those attributes must match those of the schema in the table's attribute * definition.

*/ inline BatchWriteItemRequest& AddRequestItems(Aws::String&& key, Aws::Vector&& value) { m_requestItemsHasBeenSet = true; m_requestItems.emplace(std::move(key), std::move(value)); return *this; } /** *

A map of one or more table names and, for each table, a list of operations to * be performed (DeleteRequest or PutRequest). Each * element in the map consists of the following:

  • * DeleteRequest - Perform a DeleteItem operation on the * specified item. The item to be deleted is identified by a Key * subelement:

    • Key - A map of primary key attribute * values that uniquely identify the item. Each entry in this map consists of an * attribute name and an attribute value. For each primary key, you must provide * all of the key attributes. For example, with a simple primary key, you * only need to provide a value for the partition key. For a composite primary key, * you must provide values for both the partition key and the sort key.

      *
  • PutRequest - Perform a * PutItem operation on the specified item. The item to be put is * identified by an Item subelement:

    • * Item - A map of attributes and their values. Each entry in this map * consists of an attribute name and an attribute value. Attribute values must not * be null; string and binary type attributes must have lengths greater than zero; * and set type attributes must not be empty. Requests that contain empty values * are rejected with a ValidationException exception.

      If you * specify any attributes that are part of an index key, then the data types for * those attributes must match those of the schema in the table's attribute * definition.

*/ inline BatchWriteItemRequest& AddRequestItems(const char* key, Aws::Vector&& value) { m_requestItemsHasBeenSet = true; m_requestItems.emplace(key, std::move(value)); return *this; } /** *

A map of one or more table names and, for each table, a list of operations to * be performed (DeleteRequest or PutRequest). Each * element in the map consists of the following:

  • * DeleteRequest - Perform a DeleteItem operation on the * specified item. The item to be deleted is identified by a Key * subelement:

    • Key - A map of primary key attribute * values that uniquely identify the item. Each entry in this map consists of an * attribute name and an attribute value. For each primary key, you must provide * all of the key attributes. For example, with a simple primary key, you * only need to provide a value for the partition key. For a composite primary key, * you must provide values for both the partition key and the sort key.

      *
  • PutRequest - Perform a * PutItem operation on the specified item. The item to be put is * identified by an Item subelement:

    • * Item - A map of attributes and their values. Each entry in this map * consists of an attribute name and an attribute value. Attribute values must not * be null; string and binary type attributes must have lengths greater than zero; * and set type attributes must not be empty. Requests that contain empty values * are rejected with a ValidationException exception.

      If you * specify any attributes that are part of an index key, then the data types for * those attributes must match those of the schema in the table's attribute * definition.

*/ inline BatchWriteItemRequest& AddRequestItems(const char* key, const Aws::Vector& value) { m_requestItemsHasBeenSet = true; m_requestItems.emplace(key, value); return *this; } inline const ReturnConsumedCapacity& GetReturnConsumedCapacity() const{ return m_returnConsumedCapacity; } inline bool ReturnConsumedCapacityHasBeenSet() const { return m_returnConsumedCapacityHasBeenSet; } inline void SetReturnConsumedCapacity(const ReturnConsumedCapacity& value) { m_returnConsumedCapacityHasBeenSet = true; m_returnConsumedCapacity = value; } inline void SetReturnConsumedCapacity(ReturnConsumedCapacity&& value) { m_returnConsumedCapacityHasBeenSet = true; m_returnConsumedCapacity = std::move(value); } inline BatchWriteItemRequest& WithReturnConsumedCapacity(const ReturnConsumedCapacity& value) { SetReturnConsumedCapacity(value); return *this;} inline BatchWriteItemRequest& WithReturnConsumedCapacity(ReturnConsumedCapacity&& value) { SetReturnConsumedCapacity(std::move(value)); return *this;} /** *

Determines whether item collection metrics are returned. If set to * SIZE, the response includes statistics about item collections, if * any, that were modified during the operation are returned in the response. If * set to NONE (the default), no statistics are returned.

*/ inline const ReturnItemCollectionMetrics& GetReturnItemCollectionMetrics() const{ return m_returnItemCollectionMetrics; } /** *

Determines whether item collection metrics are returned. If set to * SIZE, the response includes statistics about item collections, if * any, that were modified during the operation are returned in the response. If * set to NONE (the default), no statistics are returned.

*/ inline bool ReturnItemCollectionMetricsHasBeenSet() const { return m_returnItemCollectionMetricsHasBeenSet; } /** *

Determines whether item collection metrics are returned. If set to * SIZE, the response includes statistics about item collections, if * any, that were modified during the operation are returned in the response. If * set to NONE (the default), no statistics are returned.

*/ inline void SetReturnItemCollectionMetrics(const ReturnItemCollectionMetrics& value) { m_returnItemCollectionMetricsHasBeenSet = true; m_returnItemCollectionMetrics = value; } /** *

Determines whether item collection metrics are returned. If set to * SIZE, the response includes statistics about item collections, if * any, that were modified during the operation are returned in the response. If * set to NONE (the default), no statistics are returned.

*/ inline void SetReturnItemCollectionMetrics(ReturnItemCollectionMetrics&& value) { m_returnItemCollectionMetricsHasBeenSet = true; m_returnItemCollectionMetrics = std::move(value); } /** *

Determines whether item collection metrics are returned. If set to * SIZE, the response includes statistics about item collections, if * any, that were modified during the operation are returned in the response. If * set to NONE (the default), no statistics are returned.

*/ inline BatchWriteItemRequest& WithReturnItemCollectionMetrics(const ReturnItemCollectionMetrics& value) { SetReturnItemCollectionMetrics(value); return *this;} /** *

Determines whether item collection metrics are returned. If set to * SIZE, the response includes statistics about item collections, if * any, that were modified during the operation are returned in the response. If * set to NONE (the default), no statistics are returned.

*/ inline BatchWriteItemRequest& WithReturnItemCollectionMetrics(ReturnItemCollectionMetrics&& value) { SetReturnItemCollectionMetrics(std::move(value)); return *this;} private: Aws::Map> m_requestItems; bool m_requestItemsHasBeenSet = false; ReturnConsumedCapacity m_returnConsumedCapacity; bool m_returnConsumedCapacityHasBeenSet = false; ReturnItemCollectionMetrics m_returnItemCollectionMetrics; bool m_returnItemCollectionMetricsHasBeenSet = false; }; } // namespace Model } // namespace DynamoDB } // namespace Aws