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

Describes an action to write to a DynamoDB table.

The * tableName, hashKeyField, and * rangeKeyField values must match the values used when you created * the table.

The hashKeyValue and rangeKeyvalue * fields use a substitution template syntax. These templates provide data at * runtime. The syntax is as follows: ${sql-expression}.

You can * specify any valid expression in a WHERE or SELECT clause, including JSON * properties, comparisons, calculations, and functions. For example, the following * field uses the third level of the topic:

"hashKeyValue": * "${topic(3)}"

The following field uses the timestamp:

* "rangeKeyValue": "${timestamp()}"

See Also:

AWS * API Reference

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

The name of the DynamoDB table.

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

The name of the DynamoDB table.

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

The name of the DynamoDB table.

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

The name of the DynamoDB table.

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

The name of the DynamoDB table.

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

The name of the DynamoDB table.

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

The name of the DynamoDB table.

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

The name of the DynamoDB table.

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

The ARN of the IAM role that grants access to the DynamoDB table.

*/ inline const Aws::String& GetRoleArn() const{ return m_roleArn; } /** *

The ARN of the IAM role that grants access to the DynamoDB table.

*/ inline bool RoleArnHasBeenSet() const { return m_roleArnHasBeenSet; } /** *

The ARN of the IAM role that grants access to the DynamoDB table.

*/ inline void SetRoleArn(const Aws::String& value) { m_roleArnHasBeenSet = true; m_roleArn = value; } /** *

The ARN of the IAM role that grants access to the DynamoDB table.

*/ inline void SetRoleArn(Aws::String&& value) { m_roleArnHasBeenSet = true; m_roleArn = std::move(value); } /** *

The ARN of the IAM role that grants access to the DynamoDB table.

*/ inline void SetRoleArn(const char* value) { m_roleArnHasBeenSet = true; m_roleArn.assign(value); } /** *

The ARN of the IAM role that grants access to the DynamoDB table.

*/ inline DynamoDBAction& WithRoleArn(const Aws::String& value) { SetRoleArn(value); return *this;} /** *

The ARN of the IAM role that grants access to the DynamoDB table.

*/ inline DynamoDBAction& WithRoleArn(Aws::String&& value) { SetRoleArn(std::move(value)); return *this;} /** *

The ARN of the IAM role that grants access to the DynamoDB table.

*/ inline DynamoDBAction& WithRoleArn(const char* value) { SetRoleArn(value); return *this;} /** *

The type of operation to be performed. This follows the substitution * template, so it can be ${operation}, but the substitution must * result in one of the following: INSERT, UPDATE, or * DELETE.

*/ inline const Aws::String& GetOperation() const{ return m_operation; } /** *

The type of operation to be performed. This follows the substitution * template, so it can be ${operation}, but the substitution must * result in one of the following: INSERT, UPDATE, or * DELETE.

*/ inline bool OperationHasBeenSet() const { return m_operationHasBeenSet; } /** *

The type of operation to be performed. This follows the substitution * template, so it can be ${operation}, but the substitution must * result in one of the following: INSERT, UPDATE, or * DELETE.

*/ inline void SetOperation(const Aws::String& value) { m_operationHasBeenSet = true; m_operation = value; } /** *

The type of operation to be performed. This follows the substitution * template, so it can be ${operation}, but the substitution must * result in one of the following: INSERT, UPDATE, or * DELETE.

*/ inline void SetOperation(Aws::String&& value) { m_operationHasBeenSet = true; m_operation = std::move(value); } /** *

The type of operation to be performed. This follows the substitution * template, so it can be ${operation}, but the substitution must * result in one of the following: INSERT, UPDATE, or * DELETE.

*/ inline void SetOperation(const char* value) { m_operationHasBeenSet = true; m_operation.assign(value); } /** *

The type of operation to be performed. This follows the substitution * template, so it can be ${operation}, but the substitution must * result in one of the following: INSERT, UPDATE, or * DELETE.

*/ inline DynamoDBAction& WithOperation(const Aws::String& value) { SetOperation(value); return *this;} /** *

The type of operation to be performed. This follows the substitution * template, so it can be ${operation}, but the substitution must * result in one of the following: INSERT, UPDATE, or * DELETE.

*/ inline DynamoDBAction& WithOperation(Aws::String&& value) { SetOperation(std::move(value)); return *this;} /** *

The type of operation to be performed. This follows the substitution * template, so it can be ${operation}, but the substitution must * result in one of the following: INSERT, UPDATE, or * DELETE.

*/ inline DynamoDBAction& WithOperation(const char* value) { SetOperation(value); return *this;} /** *

The hash key name.

*/ inline const Aws::String& GetHashKeyField() const{ return m_hashKeyField; } /** *

The hash key name.

*/ inline bool HashKeyFieldHasBeenSet() const { return m_hashKeyFieldHasBeenSet; } /** *

The hash key name.

*/ inline void SetHashKeyField(const Aws::String& value) { m_hashKeyFieldHasBeenSet = true; m_hashKeyField = value; } /** *

The hash key name.

*/ inline void SetHashKeyField(Aws::String&& value) { m_hashKeyFieldHasBeenSet = true; m_hashKeyField = std::move(value); } /** *

The hash key name.

*/ inline void SetHashKeyField(const char* value) { m_hashKeyFieldHasBeenSet = true; m_hashKeyField.assign(value); } /** *

The hash key name.

*/ inline DynamoDBAction& WithHashKeyField(const Aws::String& value) { SetHashKeyField(value); return *this;} /** *

The hash key name.

*/ inline DynamoDBAction& WithHashKeyField(Aws::String&& value) { SetHashKeyField(std::move(value)); return *this;} /** *

The hash key name.

*/ inline DynamoDBAction& WithHashKeyField(const char* value) { SetHashKeyField(value); return *this;} /** *

The hash key value.

*/ inline const Aws::String& GetHashKeyValue() const{ return m_hashKeyValue; } /** *

The hash key value.

*/ inline bool HashKeyValueHasBeenSet() const { return m_hashKeyValueHasBeenSet; } /** *

The hash key value.

*/ inline void SetHashKeyValue(const Aws::String& value) { m_hashKeyValueHasBeenSet = true; m_hashKeyValue = value; } /** *

The hash key value.

*/ inline void SetHashKeyValue(Aws::String&& value) { m_hashKeyValueHasBeenSet = true; m_hashKeyValue = std::move(value); } /** *

The hash key value.

*/ inline void SetHashKeyValue(const char* value) { m_hashKeyValueHasBeenSet = true; m_hashKeyValue.assign(value); } /** *

The hash key value.

*/ inline DynamoDBAction& WithHashKeyValue(const Aws::String& value) { SetHashKeyValue(value); return *this;} /** *

The hash key value.

*/ inline DynamoDBAction& WithHashKeyValue(Aws::String&& value) { SetHashKeyValue(std::move(value)); return *this;} /** *

The hash key value.

*/ inline DynamoDBAction& WithHashKeyValue(const char* value) { SetHashKeyValue(value); return *this;} /** *

The hash key type. Valid values are "STRING" or "NUMBER"

*/ inline const DynamoKeyType& GetHashKeyType() const{ return m_hashKeyType; } /** *

The hash key type. Valid values are "STRING" or "NUMBER"

*/ inline bool HashKeyTypeHasBeenSet() const { return m_hashKeyTypeHasBeenSet; } /** *

The hash key type. Valid values are "STRING" or "NUMBER"

*/ inline void SetHashKeyType(const DynamoKeyType& value) { m_hashKeyTypeHasBeenSet = true; m_hashKeyType = value; } /** *

The hash key type. Valid values are "STRING" or "NUMBER"

*/ inline void SetHashKeyType(DynamoKeyType&& value) { m_hashKeyTypeHasBeenSet = true; m_hashKeyType = std::move(value); } /** *

The hash key type. Valid values are "STRING" or "NUMBER"

*/ inline DynamoDBAction& WithHashKeyType(const DynamoKeyType& value) { SetHashKeyType(value); return *this;} /** *

The hash key type. Valid values are "STRING" or "NUMBER"

*/ inline DynamoDBAction& WithHashKeyType(DynamoKeyType&& value) { SetHashKeyType(std::move(value)); return *this;} /** *

The range key name.

*/ inline const Aws::String& GetRangeKeyField() const{ return m_rangeKeyField; } /** *

The range key name.

*/ inline bool RangeKeyFieldHasBeenSet() const { return m_rangeKeyFieldHasBeenSet; } /** *

The range key name.

*/ inline void SetRangeKeyField(const Aws::String& value) { m_rangeKeyFieldHasBeenSet = true; m_rangeKeyField = value; } /** *

The range key name.

*/ inline void SetRangeKeyField(Aws::String&& value) { m_rangeKeyFieldHasBeenSet = true; m_rangeKeyField = std::move(value); } /** *

The range key name.

*/ inline void SetRangeKeyField(const char* value) { m_rangeKeyFieldHasBeenSet = true; m_rangeKeyField.assign(value); } /** *

The range key name.

*/ inline DynamoDBAction& WithRangeKeyField(const Aws::String& value) { SetRangeKeyField(value); return *this;} /** *

The range key name.

*/ inline DynamoDBAction& WithRangeKeyField(Aws::String&& value) { SetRangeKeyField(std::move(value)); return *this;} /** *

The range key name.

*/ inline DynamoDBAction& WithRangeKeyField(const char* value) { SetRangeKeyField(value); return *this;} /** *

The range key value.

*/ inline const Aws::String& GetRangeKeyValue() const{ return m_rangeKeyValue; } /** *

The range key value.

*/ inline bool RangeKeyValueHasBeenSet() const { return m_rangeKeyValueHasBeenSet; } /** *

The range key value.

*/ inline void SetRangeKeyValue(const Aws::String& value) { m_rangeKeyValueHasBeenSet = true; m_rangeKeyValue = value; } /** *

The range key value.

*/ inline void SetRangeKeyValue(Aws::String&& value) { m_rangeKeyValueHasBeenSet = true; m_rangeKeyValue = std::move(value); } /** *

The range key value.

*/ inline void SetRangeKeyValue(const char* value) { m_rangeKeyValueHasBeenSet = true; m_rangeKeyValue.assign(value); } /** *

The range key value.

*/ inline DynamoDBAction& WithRangeKeyValue(const Aws::String& value) { SetRangeKeyValue(value); return *this;} /** *

The range key value.

*/ inline DynamoDBAction& WithRangeKeyValue(Aws::String&& value) { SetRangeKeyValue(std::move(value)); return *this;} /** *

The range key value.

*/ inline DynamoDBAction& WithRangeKeyValue(const char* value) { SetRangeKeyValue(value); return *this;} /** *

The range key type. Valid values are "STRING" or "NUMBER"

*/ inline const DynamoKeyType& GetRangeKeyType() const{ return m_rangeKeyType; } /** *

The range key type. Valid values are "STRING" or "NUMBER"

*/ inline bool RangeKeyTypeHasBeenSet() const { return m_rangeKeyTypeHasBeenSet; } /** *

The range key type. Valid values are "STRING" or "NUMBER"

*/ inline void SetRangeKeyType(const DynamoKeyType& value) { m_rangeKeyTypeHasBeenSet = true; m_rangeKeyType = value; } /** *

The range key type. Valid values are "STRING" or "NUMBER"

*/ inline void SetRangeKeyType(DynamoKeyType&& value) { m_rangeKeyTypeHasBeenSet = true; m_rangeKeyType = std::move(value); } /** *

The range key type. Valid values are "STRING" or "NUMBER"

*/ inline DynamoDBAction& WithRangeKeyType(const DynamoKeyType& value) { SetRangeKeyType(value); return *this;} /** *

The range key type. Valid values are "STRING" or "NUMBER"

*/ inline DynamoDBAction& WithRangeKeyType(DynamoKeyType&& value) { SetRangeKeyType(std::move(value)); return *this;} /** *

The action payload. This name can be customized.

*/ inline const Aws::String& GetPayloadField() const{ return m_payloadField; } /** *

The action payload. This name can be customized.

*/ inline bool PayloadFieldHasBeenSet() const { return m_payloadFieldHasBeenSet; } /** *

The action payload. This name can be customized.

*/ inline void SetPayloadField(const Aws::String& value) { m_payloadFieldHasBeenSet = true; m_payloadField = value; } /** *

The action payload. This name can be customized.

*/ inline void SetPayloadField(Aws::String&& value) { m_payloadFieldHasBeenSet = true; m_payloadField = std::move(value); } /** *

The action payload. This name can be customized.

*/ inline void SetPayloadField(const char* value) { m_payloadFieldHasBeenSet = true; m_payloadField.assign(value); } /** *

The action payload. This name can be customized.

*/ inline DynamoDBAction& WithPayloadField(const Aws::String& value) { SetPayloadField(value); return *this;} /** *

The action payload. This name can be customized.

*/ inline DynamoDBAction& WithPayloadField(Aws::String&& value) { SetPayloadField(std::move(value)); return *this;} /** *

The action payload. This name can be customized.

*/ inline DynamoDBAction& WithPayloadField(const char* value) { SetPayloadField(value); return *this;} private: Aws::String m_tableName; bool m_tableNameHasBeenSet = false; Aws::String m_roleArn; bool m_roleArnHasBeenSet = false; Aws::String m_operation; bool m_operationHasBeenSet = false; Aws::String m_hashKeyField; bool m_hashKeyFieldHasBeenSet = false; Aws::String m_hashKeyValue; bool m_hashKeyValueHasBeenSet = false; DynamoKeyType m_hashKeyType; bool m_hashKeyTypeHasBeenSet = false; Aws::String m_rangeKeyField; bool m_rangeKeyFieldHasBeenSet = false; Aws::String m_rangeKeyValue; bool m_rangeKeyValueHasBeenSet = false; DynamoKeyType m_rangeKeyType; bool m_rangeKeyTypeHasBeenSet = false; Aws::String m_payloadField; bool m_payloadFieldHasBeenSet = false; }; } // namespace Model } // namespace IoT } // namespace Aws