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

Represents a request to perform a PutItem * operation.

See Also:

AWS API * Reference

*/ class Put { public: AWS_DYNAMODB_API Put(); AWS_DYNAMODB_API Put(Aws::Utils::Json::JsonView jsonValue); AWS_DYNAMODB_API Put& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_DYNAMODB_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

A map of attribute name to attribute values, representing the primary key of * the item to be written by PutItem. All of the table's primary key * attributes must be specified, and their data types must match those of the * table's key schema. If any attributes are present in the item that are part of * an index key schema for the table, their types must match the index key schema. *

*/ inline const Aws::Map& GetItem() const{ return m_item; } /** *

A map of attribute name to attribute values, representing the primary key of * the item to be written by PutItem. All of the table's primary key * attributes must be specified, and their data types must match those of the * table's key schema. If any attributes are present in the item that are part of * an index key schema for the table, their types must match the index key schema. *

*/ inline bool ItemHasBeenSet() const { return m_itemHasBeenSet; } /** *

A map of attribute name to attribute values, representing the primary key of * the item to be written by PutItem. All of the table's primary key * attributes must be specified, and their data types must match those of the * table's key schema. If any attributes are present in the item that are part of * an index key schema for the table, their types must match the index key schema. *

*/ inline void SetItem(const Aws::Map& value) { m_itemHasBeenSet = true; m_item = value; } /** *

A map of attribute name to attribute values, representing the primary key of * the item to be written by PutItem. All of the table's primary key * attributes must be specified, and their data types must match those of the * table's key schema. If any attributes are present in the item that are part of * an index key schema for the table, their types must match the index key schema. *

*/ inline void SetItem(Aws::Map&& value) { m_itemHasBeenSet = true; m_item = std::move(value); } /** *

A map of attribute name to attribute values, representing the primary key of * the item to be written by PutItem. All of the table's primary key * attributes must be specified, and their data types must match those of the * table's key schema. If any attributes are present in the item that are part of * an index key schema for the table, their types must match the index key schema. *

*/ inline Put& WithItem(const Aws::Map& value) { SetItem(value); return *this;} /** *

A map of attribute name to attribute values, representing the primary key of * the item to be written by PutItem. All of the table's primary key * attributes must be specified, and their data types must match those of the * table's key schema. If any attributes are present in the item that are part of * an index key schema for the table, their types must match the index key schema. *

*/ inline Put& WithItem(Aws::Map&& value) { SetItem(std::move(value)); return *this;} /** *

A map of attribute name to attribute values, representing the primary key of * the item to be written by PutItem. All of the table's primary key * attributes must be specified, and their data types must match those of the * table's key schema. If any attributes are present in the item that are part of * an index key schema for the table, their types must match the index key schema. *

*/ inline Put& AddItem(const Aws::String& key, const AttributeValue& value) { m_itemHasBeenSet = true; m_item.emplace(key, value); return *this; } /** *

A map of attribute name to attribute values, representing the primary key of * the item to be written by PutItem. All of the table's primary key * attributes must be specified, and their data types must match those of the * table's key schema. If any attributes are present in the item that are part of * an index key schema for the table, their types must match the index key schema. *

*/ inline Put& AddItem(Aws::String&& key, const AttributeValue& value) { m_itemHasBeenSet = true; m_item.emplace(std::move(key), value); return *this; } /** *

A map of attribute name to attribute values, representing the primary key of * the item to be written by PutItem. All of the table's primary key * attributes must be specified, and their data types must match those of the * table's key schema. If any attributes are present in the item that are part of * an index key schema for the table, their types must match the index key schema. *

*/ inline Put& AddItem(const Aws::String& key, AttributeValue&& value) { m_itemHasBeenSet = true; m_item.emplace(key, std::move(value)); return *this; } /** *

A map of attribute name to attribute values, representing the primary key of * the item to be written by PutItem. All of the table's primary key * attributes must be specified, and their data types must match those of the * table's key schema. If any attributes are present in the item that are part of * an index key schema for the table, their types must match the index key schema. *

*/ inline Put& AddItem(Aws::String&& key, AttributeValue&& value) { m_itemHasBeenSet = true; m_item.emplace(std::move(key), std::move(value)); return *this; } /** *

A map of attribute name to attribute values, representing the primary key of * the item to be written by PutItem. All of the table's primary key * attributes must be specified, and their data types must match those of the * table's key schema. If any attributes are present in the item that are part of * an index key schema for the table, their types must match the index key schema. *

*/ inline Put& AddItem(const char* key, AttributeValue&& value) { m_itemHasBeenSet = true; m_item.emplace(key, std::move(value)); return *this; } /** *

A map of attribute name to attribute values, representing the primary key of * the item to be written by PutItem. All of the table's primary key * attributes must be specified, and their data types must match those of the * table's key schema. If any attributes are present in the item that are part of * an index key schema for the table, their types must match the index key schema. *

*/ inline Put& AddItem(const char* key, const AttributeValue& value) { m_itemHasBeenSet = true; m_item.emplace(key, value); return *this; } /** *

Name of the table in which to write the item.

*/ inline const Aws::String& GetTableName() const{ return m_tableName; } /** *

Name of the table in which to write the item.

*/ inline bool TableNameHasBeenSet() const { return m_tableNameHasBeenSet; } /** *

Name of the table in which to write the item.

*/ inline void SetTableName(const Aws::String& value) { m_tableNameHasBeenSet = true; m_tableName = value; } /** *

Name of the table in which to write the item.

*/ inline void SetTableName(Aws::String&& value) { m_tableNameHasBeenSet = true; m_tableName = std::move(value); } /** *

Name of the table in which to write the item.

*/ inline void SetTableName(const char* value) { m_tableNameHasBeenSet = true; m_tableName.assign(value); } /** *

Name of the table in which to write the item.

*/ inline Put& WithTableName(const Aws::String& value) { SetTableName(value); return *this;} /** *

Name of the table in which to write the item.

*/ inline Put& WithTableName(Aws::String&& value) { SetTableName(std::move(value)); return *this;} /** *

Name of the table in which to write the item.

*/ inline Put& WithTableName(const char* value) { SetTableName(value); return *this;} /** *

A condition that must be satisfied in order for a conditional update to * succeed.

*/ inline const Aws::String& GetConditionExpression() const{ return m_conditionExpression; } /** *

A condition that must be satisfied in order for a conditional update to * succeed.

*/ inline bool ConditionExpressionHasBeenSet() const { return m_conditionExpressionHasBeenSet; } /** *

A condition that must be satisfied in order for a conditional update to * succeed.

*/ inline void SetConditionExpression(const Aws::String& value) { m_conditionExpressionHasBeenSet = true; m_conditionExpression = value; } /** *

A condition that must be satisfied in order for a conditional update to * succeed.

*/ inline void SetConditionExpression(Aws::String&& value) { m_conditionExpressionHasBeenSet = true; m_conditionExpression = std::move(value); } /** *

A condition that must be satisfied in order for a conditional update to * succeed.

*/ inline void SetConditionExpression(const char* value) { m_conditionExpressionHasBeenSet = true; m_conditionExpression.assign(value); } /** *

A condition that must be satisfied in order for a conditional update to * succeed.

*/ inline Put& WithConditionExpression(const Aws::String& value) { SetConditionExpression(value); return *this;} /** *

A condition that must be satisfied in order for a conditional update to * succeed.

*/ inline Put& WithConditionExpression(Aws::String&& value) { SetConditionExpression(std::move(value)); return *this;} /** *

A condition that must be satisfied in order for a conditional update to * succeed.

*/ inline Put& WithConditionExpression(const char* value) { SetConditionExpression(value); return *this;} /** *

One or more substitution tokens for attribute names in an expression.

*/ inline const Aws::Map& GetExpressionAttributeNames() const{ return m_expressionAttributeNames; } /** *

One or more substitution tokens for attribute names in an expression.

*/ inline bool ExpressionAttributeNamesHasBeenSet() const { return m_expressionAttributeNamesHasBeenSet; } /** *

One or more substitution tokens for attribute names in an expression.

*/ inline void SetExpressionAttributeNames(const Aws::Map& value) { m_expressionAttributeNamesHasBeenSet = true; m_expressionAttributeNames = value; } /** *

One or more substitution tokens for attribute names in an expression.

*/ inline void SetExpressionAttributeNames(Aws::Map&& value) { m_expressionAttributeNamesHasBeenSet = true; m_expressionAttributeNames = std::move(value); } /** *

One or more substitution tokens for attribute names in an expression.

*/ inline Put& WithExpressionAttributeNames(const Aws::Map& value) { SetExpressionAttributeNames(value); return *this;} /** *

One or more substitution tokens for attribute names in an expression.

*/ inline Put& WithExpressionAttributeNames(Aws::Map&& value) { SetExpressionAttributeNames(std::move(value)); return *this;} /** *

One or more substitution tokens for attribute names in an expression.

*/ inline Put& AddExpressionAttributeNames(const Aws::String& key, const Aws::String& value) { m_expressionAttributeNamesHasBeenSet = true; m_expressionAttributeNames.emplace(key, value); return *this; } /** *

One or more substitution tokens for attribute names in an expression.

*/ inline Put& AddExpressionAttributeNames(Aws::String&& key, const Aws::String& value) { m_expressionAttributeNamesHasBeenSet = true; m_expressionAttributeNames.emplace(std::move(key), value); return *this; } /** *

One or more substitution tokens for attribute names in an expression.

*/ inline Put& AddExpressionAttributeNames(const Aws::String& key, Aws::String&& value) { m_expressionAttributeNamesHasBeenSet = true; m_expressionAttributeNames.emplace(key, std::move(value)); return *this; } /** *

One or more substitution tokens for attribute names in an expression.

*/ inline Put& AddExpressionAttributeNames(Aws::String&& key, Aws::String&& value) { m_expressionAttributeNamesHasBeenSet = true; m_expressionAttributeNames.emplace(std::move(key), std::move(value)); return *this; } /** *

One or more substitution tokens for attribute names in an expression.

*/ inline Put& AddExpressionAttributeNames(const char* key, Aws::String&& value) { m_expressionAttributeNamesHasBeenSet = true; m_expressionAttributeNames.emplace(key, std::move(value)); return *this; } /** *

One or more substitution tokens for attribute names in an expression.

*/ inline Put& AddExpressionAttributeNames(Aws::String&& key, const char* value) { m_expressionAttributeNamesHasBeenSet = true; m_expressionAttributeNames.emplace(std::move(key), value); return *this; } /** *

One or more substitution tokens for attribute names in an expression.

*/ inline Put& AddExpressionAttributeNames(const char* key, const char* value) { m_expressionAttributeNamesHasBeenSet = true; m_expressionAttributeNames.emplace(key, value); return *this; } /** *

One or more values that can be substituted in an expression.

*/ inline const Aws::Map& GetExpressionAttributeValues() const{ return m_expressionAttributeValues; } /** *

One or more values that can be substituted in an expression.

*/ inline bool ExpressionAttributeValuesHasBeenSet() const { return m_expressionAttributeValuesHasBeenSet; } /** *

One or more values that can be substituted in an expression.

*/ inline void SetExpressionAttributeValues(const Aws::Map& value) { m_expressionAttributeValuesHasBeenSet = true; m_expressionAttributeValues = value; } /** *

One or more values that can be substituted in an expression.

*/ inline void SetExpressionAttributeValues(Aws::Map&& value) { m_expressionAttributeValuesHasBeenSet = true; m_expressionAttributeValues = std::move(value); } /** *

One or more values that can be substituted in an expression.

*/ inline Put& WithExpressionAttributeValues(const Aws::Map& value) { SetExpressionAttributeValues(value); return *this;} /** *

One or more values that can be substituted in an expression.

*/ inline Put& WithExpressionAttributeValues(Aws::Map&& value) { SetExpressionAttributeValues(std::move(value)); return *this;} /** *

One or more values that can be substituted in an expression.

*/ inline Put& AddExpressionAttributeValues(const Aws::String& key, const AttributeValue& value) { m_expressionAttributeValuesHasBeenSet = true; m_expressionAttributeValues.emplace(key, value); return *this; } /** *

One or more values that can be substituted in an expression.

*/ inline Put& AddExpressionAttributeValues(Aws::String&& key, const AttributeValue& value) { m_expressionAttributeValuesHasBeenSet = true; m_expressionAttributeValues.emplace(std::move(key), value); return *this; } /** *

One or more values that can be substituted in an expression.

*/ inline Put& AddExpressionAttributeValues(const Aws::String& key, AttributeValue&& value) { m_expressionAttributeValuesHasBeenSet = true; m_expressionAttributeValues.emplace(key, std::move(value)); return *this; } /** *

One or more values that can be substituted in an expression.

*/ inline Put& AddExpressionAttributeValues(Aws::String&& key, AttributeValue&& value) { m_expressionAttributeValuesHasBeenSet = true; m_expressionAttributeValues.emplace(std::move(key), std::move(value)); return *this; } /** *

One or more values that can be substituted in an expression.

*/ inline Put& AddExpressionAttributeValues(const char* key, AttributeValue&& value) { m_expressionAttributeValuesHasBeenSet = true; m_expressionAttributeValues.emplace(key, std::move(value)); return *this; } /** *

One or more values that can be substituted in an expression.

*/ inline Put& AddExpressionAttributeValues(const char* key, const AttributeValue& value) { m_expressionAttributeValuesHasBeenSet = true; m_expressionAttributeValues.emplace(key, value); return *this; } /** *

Use ReturnValuesOnConditionCheckFailure to get the item * attributes if the Put condition fails. For * ReturnValuesOnConditionCheckFailure, the valid values are: NONE and * ALL_OLD.

*/ inline const ReturnValuesOnConditionCheckFailure& GetReturnValuesOnConditionCheckFailure() const{ return m_returnValuesOnConditionCheckFailure; } /** *

Use ReturnValuesOnConditionCheckFailure to get the item * attributes if the Put condition fails. For * ReturnValuesOnConditionCheckFailure, the valid values are: NONE and * ALL_OLD.

*/ inline bool ReturnValuesOnConditionCheckFailureHasBeenSet() const { return m_returnValuesOnConditionCheckFailureHasBeenSet; } /** *

Use ReturnValuesOnConditionCheckFailure to get the item * attributes if the Put condition fails. For * ReturnValuesOnConditionCheckFailure, the valid values are: NONE and * ALL_OLD.

*/ inline void SetReturnValuesOnConditionCheckFailure(const ReturnValuesOnConditionCheckFailure& value) { m_returnValuesOnConditionCheckFailureHasBeenSet = true; m_returnValuesOnConditionCheckFailure = value; } /** *

Use ReturnValuesOnConditionCheckFailure to get the item * attributes if the Put condition fails. For * ReturnValuesOnConditionCheckFailure, the valid values are: NONE and * ALL_OLD.

*/ inline void SetReturnValuesOnConditionCheckFailure(ReturnValuesOnConditionCheckFailure&& value) { m_returnValuesOnConditionCheckFailureHasBeenSet = true; m_returnValuesOnConditionCheckFailure = std::move(value); } /** *

Use ReturnValuesOnConditionCheckFailure to get the item * attributes if the Put condition fails. For * ReturnValuesOnConditionCheckFailure, the valid values are: NONE and * ALL_OLD.

*/ inline Put& WithReturnValuesOnConditionCheckFailure(const ReturnValuesOnConditionCheckFailure& value) { SetReturnValuesOnConditionCheckFailure(value); return *this;} /** *

Use ReturnValuesOnConditionCheckFailure to get the item * attributes if the Put condition fails. For * ReturnValuesOnConditionCheckFailure, the valid values are: NONE and * ALL_OLD.

*/ inline Put& WithReturnValuesOnConditionCheckFailure(ReturnValuesOnConditionCheckFailure&& value) { SetReturnValuesOnConditionCheckFailure(std::move(value)); return *this;} private: Aws::Map m_item; bool m_itemHasBeenSet = false; Aws::String m_tableName; bool m_tableNameHasBeenSet = false; Aws::String m_conditionExpression; bool m_conditionExpressionHasBeenSet = false; Aws::Map m_expressionAttributeNames; bool m_expressionAttributeNamesHasBeenSet = false; Aws::Map m_expressionAttributeValues; bool m_expressionAttributeValuesHasBeenSet = false; ReturnValuesOnConditionCheckFailure m_returnValuesOnConditionCheckFailure; bool m_returnValuesOnConditionCheckFailureHasBeenSet = false; }; } // namespace Model } // namespace DynamoDB } // namespace Aws