/** * 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 check that an item exists or to check the * condition of specific attributes of the item.

See Also:

AWS * API Reference

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

The primary key of the item to be checked. Each element consists of an * attribute name and a value for that attribute.

*/ inline const Aws::Map& GetKey() const{ return m_key; } /** *

The primary key of the item to be checked. Each element consists of an * attribute name and a value for that attribute.

*/ inline bool KeyHasBeenSet() const { return m_keyHasBeenSet; } /** *

The primary key of the item to be checked. Each element consists of an * attribute name and a value for that attribute.

*/ inline void SetKey(const Aws::Map& value) { m_keyHasBeenSet = true; m_key = value; } /** *

The primary key of the item to be checked. Each element consists of an * attribute name and a value for that attribute.

*/ inline void SetKey(Aws::Map&& value) { m_keyHasBeenSet = true; m_key = std::move(value); } /** *

The primary key of the item to be checked. Each element consists of an * attribute name and a value for that attribute.

*/ inline ConditionCheck& WithKey(const Aws::Map& value) { SetKey(value); return *this;} /** *

The primary key of the item to be checked. Each element consists of an * attribute name and a value for that attribute.

*/ inline ConditionCheck& WithKey(Aws::Map&& value) { SetKey(std::move(value)); return *this;} /** *

The primary key of the item to be checked. Each element consists of an * attribute name and a value for that attribute.

*/ inline ConditionCheck& AddKey(const Aws::String& key, const AttributeValue& value) { m_keyHasBeenSet = true; m_key.emplace(key, value); return *this; } /** *

The primary key of the item to be checked. Each element consists of an * attribute name and a value for that attribute.

*/ inline ConditionCheck& AddKey(Aws::String&& key, const AttributeValue& value) { m_keyHasBeenSet = true; m_key.emplace(std::move(key), value); return *this; } /** *

The primary key of the item to be checked. Each element consists of an * attribute name and a value for that attribute.

*/ inline ConditionCheck& AddKey(const Aws::String& key, AttributeValue&& value) { m_keyHasBeenSet = true; m_key.emplace(key, std::move(value)); return *this; } /** *

The primary key of the item to be checked. Each element consists of an * attribute name and a value for that attribute.

*/ inline ConditionCheck& AddKey(Aws::String&& key, AttributeValue&& value) { m_keyHasBeenSet = true; m_key.emplace(std::move(key), std::move(value)); return *this; } /** *

The primary key of the item to be checked. Each element consists of an * attribute name and a value for that attribute.

*/ inline ConditionCheck& AddKey(const char* key, AttributeValue&& value) { m_keyHasBeenSet = true; m_key.emplace(key, std::move(value)); return *this; } /** *

The primary key of the item to be checked. Each element consists of an * attribute name and a value for that attribute.

*/ inline ConditionCheck& AddKey(const char* key, const AttributeValue& value) { m_keyHasBeenSet = true; m_key.emplace(key, value); return *this; } /** *

Name of the table for the check item request.

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

Name of the table for the check item request.

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

Name of the table for the check item request.

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

Name of the table for the check item request.

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

Name of the table for the check item request.

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

Name of the table for the check item request.

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

Name of the table for the check item request.

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

Name of the table for the check item request.

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

A condition that must be satisfied in order for a conditional update to * succeed. For more information, see Condition * expressions in the Amazon DynamoDB Developer Guide.

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

A condition that must be satisfied in order for a conditional update to * succeed. For more information, see Condition * expressions in the Amazon DynamoDB Developer Guide.

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

A condition that must be satisfied in order for a conditional update to * succeed. For more information, see Condition * expressions in the Amazon DynamoDB Developer Guide.

*/ 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. For more information, see Condition * expressions in the Amazon DynamoDB Developer Guide.

*/ 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. For more information, see Condition * expressions in the Amazon DynamoDB Developer Guide.

*/ 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. For more information, see Condition * expressions in the Amazon DynamoDB Developer Guide.

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

A condition that must be satisfied in order for a conditional update to * succeed. For more information, see Condition * expressions in the Amazon DynamoDB Developer Guide.

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

A condition that must be satisfied in order for a conditional update to * succeed. For more information, see Condition * expressions in the Amazon DynamoDB Developer Guide.

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

One or more substitution tokens for attribute names in an expression. For * more information, see Expression * attribute names in the Amazon DynamoDB Developer Guide.

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

One or more substitution tokens for attribute names in an expression. For * more information, see Expression * attribute names in the Amazon DynamoDB Developer Guide.

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

One or more substitution tokens for attribute names in an expression. For * more information, see Expression * attribute names in the Amazon DynamoDB Developer Guide.

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

One or more substitution tokens for attribute names in an expression. For * more information, see Expression * attribute names in the Amazon DynamoDB Developer Guide.

*/ 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. For * more information, see Expression * attribute names in the Amazon DynamoDB Developer Guide.

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

One or more substitution tokens for attribute names in an expression. For * more information, see Expression * attribute names in the Amazon DynamoDB Developer Guide.

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

One or more substitution tokens for attribute names in an expression. For * more information, see Expression * attribute names in the Amazon DynamoDB Developer Guide.

*/ inline ConditionCheck& 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. For * more information, see Expression * attribute names in the Amazon DynamoDB Developer Guide.

*/ inline ConditionCheck& 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. For * more information, see Expression * attribute names in the Amazon DynamoDB Developer Guide.

*/ inline ConditionCheck& 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. For * more information, see Expression * attribute names in the Amazon DynamoDB Developer Guide.

*/ inline ConditionCheck& 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. For * more information, see Expression * attribute names in the Amazon DynamoDB Developer Guide.

*/ inline ConditionCheck& 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. For * more information, see Expression * attribute names in the Amazon DynamoDB Developer Guide.

*/ inline ConditionCheck& 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. For * more information, see Expression * attribute names in the Amazon DynamoDB Developer Guide.

*/ inline ConditionCheck& 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. For more * information, see Condition * expressions in the Amazon DynamoDB Developer Guide.

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

One or more values that can be substituted in an expression. For more * information, see Condition * expressions in the Amazon DynamoDB Developer Guide.

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

One or more values that can be substituted in an expression. For more * information, see Condition * expressions in the Amazon DynamoDB Developer Guide.

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

One or more values that can be substituted in an expression. For more * information, see Condition * expressions in the Amazon DynamoDB Developer Guide.

*/ 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. For more * information, see Condition * expressions in the Amazon DynamoDB Developer Guide.

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

One or more values that can be substituted in an expression. For more * information, see Condition * expressions in the Amazon DynamoDB Developer Guide.

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

One or more values that can be substituted in an expression. For more * information, see Condition * expressions in the Amazon DynamoDB Developer Guide.

*/ inline ConditionCheck& 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. For more * information, see Condition * expressions in the Amazon DynamoDB Developer Guide.

*/ inline ConditionCheck& 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. For more * information, see Condition * expressions in the Amazon DynamoDB Developer Guide.

*/ inline ConditionCheck& 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. For more * information, see Condition * expressions in the Amazon DynamoDB Developer Guide.

*/ inline ConditionCheck& 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. For more * information, see Condition * expressions in the Amazon DynamoDB Developer Guide.

*/ inline ConditionCheck& 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. For more * information, see Condition * expressions in the Amazon DynamoDB Developer Guide.

*/ inline ConditionCheck& 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 ConditionCheck 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 ConditionCheck 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 ConditionCheck 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 ConditionCheck 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 ConditionCheck condition fails. For * ReturnValuesOnConditionCheckFailure, the valid values are: NONE and * ALL_OLD.

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

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

*/ inline ConditionCheck& WithReturnValuesOnConditionCheckFailure(ReturnValuesOnConditionCheckFailure&& value) { SetReturnValuesOnConditionCheckFailure(std::move(value)); return *this;} private: Aws::Map m_key; bool m_keyHasBeenSet = 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