/** * 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 IoTEvents { namespace Model { /** *

Defines an action to write to the Amazon DynamoDB table that you created. The * default action payload contains all the information about the detector model * instance and the event that triggered the action. You can customize the payload. * A separate column of the DynamoDB table receives one attribute-value pair in the * payload that you specify.

You must use expressions for all parameters in * DynamoDBv2Action. The expressions accept literals, operators, * functions, references, and substitution templates.

* Examples

  • For literal values, the expressions must * contain single quotes. For example, the value for the tableName * parameter can be 'GreenhouseTemperatureTable'.

  • *

    For references, you must specify either variables or input values. For * example, the value for the tableName parameter can be * $variable.ddbtableName.

  • For a substitution * template, you must use ${}, and the template must be in single * quotes. A substitution template can also contain a combination of literals, * operators, functions, references, and substitution templates.

    In the * following example, the value for the contentExpression parameter in * Payload uses a substitution template.

    * '{\"sensorID\": \"${$input.GreenhouseInput.sensor_id}\", \"temperature\": * \"${$input.GreenhouseInput.temperature * 9 / 5 + 32}\"}'

  • *

    For a string concatenation, you must use +. A string * concatenation can also contain a combination of literals, operators, functions, * references, and substitution templates.

    In the following example, the * value for the tableName parameter uses a string concatenation.

    *

    'GreenhouseTemperatureTable ' + $input.GreenhouseInput.date *

For more information, see Expressions * in the AWS IoT Events Developer Guide.

The value for the * type parameter in Payload must be * JSON.

See Also:

AWS * API Reference

*/ class DynamoDBv2Action { public: AWS_IOTEVENTS_API DynamoDBv2Action(); AWS_IOTEVENTS_API DynamoDBv2Action(Aws::Utils::Json::JsonView jsonValue); AWS_IOTEVENTS_API DynamoDBv2Action& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_IOTEVENTS_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 DynamoDBv2Action& WithTableName(const Aws::String& value) { SetTableName(value); return *this;} /** *

The name of the DynamoDB table.

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

The name of the DynamoDB table.

*/ inline DynamoDBv2Action& WithTableName(const char* value) { SetTableName(value); return *this;} inline const Payload& GetPayload() const{ return m_payload; } inline bool PayloadHasBeenSet() const { return m_payloadHasBeenSet; } inline void SetPayload(const Payload& value) { m_payloadHasBeenSet = true; m_payload = value; } inline void SetPayload(Payload&& value) { m_payloadHasBeenSet = true; m_payload = std::move(value); } inline DynamoDBv2Action& WithPayload(const Payload& value) { SetPayload(value); return *this;} inline DynamoDBv2Action& WithPayload(Payload&& value) { SetPayload(std::move(value)); return *this;} private: Aws::String m_tableName; bool m_tableNameHasBeenSet = false; Payload m_payload; bool m_payloadHasBeenSet = false; }; } // namespace Model } // namespace IoTEvents } // namespace Aws