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

Describes a rule.

See Also:

AWS API * Reference

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

The name of the rule.

*/ inline const Aws::String& GetRuleName() const{ return m_ruleName; } /** *

The name of the rule.

*/ inline bool RuleNameHasBeenSet() const { return m_ruleNameHasBeenSet; } /** *

The name of the rule.

*/ inline void SetRuleName(const Aws::String& value) { m_ruleNameHasBeenSet = true; m_ruleName = value; } /** *

The name of the rule.

*/ inline void SetRuleName(Aws::String&& value) { m_ruleNameHasBeenSet = true; m_ruleName = std::move(value); } /** *

The name of the rule.

*/ inline void SetRuleName(const char* value) { m_ruleNameHasBeenSet = true; m_ruleName.assign(value); } /** *

The name of the rule.

*/ inline TopicRule& WithRuleName(const Aws::String& value) { SetRuleName(value); return *this;} /** *

The name of the rule.

*/ inline TopicRule& WithRuleName(Aws::String&& value) { SetRuleName(std::move(value)); return *this;} /** *

The name of the rule.

*/ inline TopicRule& WithRuleName(const char* value) { SetRuleName(value); return *this;} /** *

The SQL statement used to query the topic. When using a SQL query with * multiple lines, be sure to escape the newline characters.

*/ inline const Aws::String& GetSql() const{ return m_sql; } /** *

The SQL statement used to query the topic. When using a SQL query with * multiple lines, be sure to escape the newline characters.

*/ inline bool SqlHasBeenSet() const { return m_sqlHasBeenSet; } /** *

The SQL statement used to query the topic. When using a SQL query with * multiple lines, be sure to escape the newline characters.

*/ inline void SetSql(const Aws::String& value) { m_sqlHasBeenSet = true; m_sql = value; } /** *

The SQL statement used to query the topic. When using a SQL query with * multiple lines, be sure to escape the newline characters.

*/ inline void SetSql(Aws::String&& value) { m_sqlHasBeenSet = true; m_sql = std::move(value); } /** *

The SQL statement used to query the topic. When using a SQL query with * multiple lines, be sure to escape the newline characters.

*/ inline void SetSql(const char* value) { m_sqlHasBeenSet = true; m_sql.assign(value); } /** *

The SQL statement used to query the topic. When using a SQL query with * multiple lines, be sure to escape the newline characters.

*/ inline TopicRule& WithSql(const Aws::String& value) { SetSql(value); return *this;} /** *

The SQL statement used to query the topic. When using a SQL query with * multiple lines, be sure to escape the newline characters.

*/ inline TopicRule& WithSql(Aws::String&& value) { SetSql(std::move(value)); return *this;} /** *

The SQL statement used to query the topic. When using a SQL query with * multiple lines, be sure to escape the newline characters.

*/ inline TopicRule& WithSql(const char* value) { SetSql(value); return *this;} /** *

The description of the rule.

*/ inline const Aws::String& GetDescription() const{ return m_description; } /** *

The description of the rule.

*/ inline bool DescriptionHasBeenSet() const { return m_descriptionHasBeenSet; } /** *

The description of the rule.

*/ inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; } /** *

The description of the rule.

*/ inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = std::move(value); } /** *

The description of the rule.

*/ inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); } /** *

The description of the rule.

*/ inline TopicRule& WithDescription(const Aws::String& value) { SetDescription(value); return *this;} /** *

The description of the rule.

*/ inline TopicRule& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;} /** *

The description of the rule.

*/ inline TopicRule& WithDescription(const char* value) { SetDescription(value); return *this;} /** *

The date and time the rule was created.

*/ inline const Aws::Utils::DateTime& GetCreatedAt() const{ return m_createdAt; } /** *

The date and time the rule was created.

*/ inline bool CreatedAtHasBeenSet() const { return m_createdAtHasBeenSet; } /** *

The date and time the rule was created.

*/ inline void SetCreatedAt(const Aws::Utils::DateTime& value) { m_createdAtHasBeenSet = true; m_createdAt = value; } /** *

The date and time the rule was created.

*/ inline void SetCreatedAt(Aws::Utils::DateTime&& value) { m_createdAtHasBeenSet = true; m_createdAt = std::move(value); } /** *

The date and time the rule was created.

*/ inline TopicRule& WithCreatedAt(const Aws::Utils::DateTime& value) { SetCreatedAt(value); return *this;} /** *

The date and time the rule was created.

*/ inline TopicRule& WithCreatedAt(Aws::Utils::DateTime&& value) { SetCreatedAt(std::move(value)); return *this;} /** *

The actions associated with the rule.

*/ inline const Aws::Vector& GetActions() const{ return m_actions; } /** *

The actions associated with the rule.

*/ inline bool ActionsHasBeenSet() const { return m_actionsHasBeenSet; } /** *

The actions associated with the rule.

*/ inline void SetActions(const Aws::Vector& value) { m_actionsHasBeenSet = true; m_actions = value; } /** *

The actions associated with the rule.

*/ inline void SetActions(Aws::Vector&& value) { m_actionsHasBeenSet = true; m_actions = std::move(value); } /** *

The actions associated with the rule.

*/ inline TopicRule& WithActions(const Aws::Vector& value) { SetActions(value); return *this;} /** *

The actions associated with the rule.

*/ inline TopicRule& WithActions(Aws::Vector&& value) { SetActions(std::move(value)); return *this;} /** *

The actions associated with the rule.

*/ inline TopicRule& AddActions(const Action& value) { m_actionsHasBeenSet = true; m_actions.push_back(value); return *this; } /** *

The actions associated with the rule.

*/ inline TopicRule& AddActions(Action&& value) { m_actionsHasBeenSet = true; m_actions.push_back(std::move(value)); return *this; } /** *

Specifies whether the rule is disabled.

*/ inline bool GetRuleDisabled() const{ return m_ruleDisabled; } /** *

Specifies whether the rule is disabled.

*/ inline bool RuleDisabledHasBeenSet() const { return m_ruleDisabledHasBeenSet; } /** *

Specifies whether the rule is disabled.

*/ inline void SetRuleDisabled(bool value) { m_ruleDisabledHasBeenSet = true; m_ruleDisabled = value; } /** *

Specifies whether the rule is disabled.

*/ inline TopicRule& WithRuleDisabled(bool value) { SetRuleDisabled(value); return *this;} /** *

The version of the SQL rules engine to use when evaluating the rule.

*/ inline const Aws::String& GetAwsIotSqlVersion() const{ return m_awsIotSqlVersion; } /** *

The version of the SQL rules engine to use when evaluating the rule.

*/ inline bool AwsIotSqlVersionHasBeenSet() const { return m_awsIotSqlVersionHasBeenSet; } /** *

The version of the SQL rules engine to use when evaluating the rule.

*/ inline void SetAwsIotSqlVersion(const Aws::String& value) { m_awsIotSqlVersionHasBeenSet = true; m_awsIotSqlVersion = value; } /** *

The version of the SQL rules engine to use when evaluating the rule.

*/ inline void SetAwsIotSqlVersion(Aws::String&& value) { m_awsIotSqlVersionHasBeenSet = true; m_awsIotSqlVersion = std::move(value); } /** *

The version of the SQL rules engine to use when evaluating the rule.

*/ inline void SetAwsIotSqlVersion(const char* value) { m_awsIotSqlVersionHasBeenSet = true; m_awsIotSqlVersion.assign(value); } /** *

The version of the SQL rules engine to use when evaluating the rule.

*/ inline TopicRule& WithAwsIotSqlVersion(const Aws::String& value) { SetAwsIotSqlVersion(value); return *this;} /** *

The version of the SQL rules engine to use when evaluating the rule.

*/ inline TopicRule& WithAwsIotSqlVersion(Aws::String&& value) { SetAwsIotSqlVersion(std::move(value)); return *this;} /** *

The version of the SQL rules engine to use when evaluating the rule.

*/ inline TopicRule& WithAwsIotSqlVersion(const char* value) { SetAwsIotSqlVersion(value); return *this;} /** *

The action to perform when an error occurs.

*/ inline const Action& GetErrorAction() const{ return m_errorAction; } /** *

The action to perform when an error occurs.

*/ inline bool ErrorActionHasBeenSet() const { return m_errorActionHasBeenSet; } /** *

The action to perform when an error occurs.

*/ inline void SetErrorAction(const Action& value) { m_errorActionHasBeenSet = true; m_errorAction = value; } /** *

The action to perform when an error occurs.

*/ inline void SetErrorAction(Action&& value) { m_errorActionHasBeenSet = true; m_errorAction = std::move(value); } /** *

The action to perform when an error occurs.

*/ inline TopicRule& WithErrorAction(const Action& value) { SetErrorAction(value); return *this;} /** *

The action to perform when an error occurs.

*/ inline TopicRule& WithErrorAction(Action&& value) { SetErrorAction(std::move(value)); return *this;} private: Aws::String m_ruleName; bool m_ruleNameHasBeenSet = false; Aws::String m_sql; bool m_sqlHasBeenSet = false; Aws::String m_description; bool m_descriptionHasBeenSet = false; Aws::Utils::DateTime m_createdAt; bool m_createdAtHasBeenSet = false; Aws::Vector m_actions; bool m_actionsHasBeenSet = false; bool m_ruleDisabled; bool m_ruleDisabledHasBeenSet = false; Aws::String m_awsIotSqlVersion; bool m_awsIotSqlVersionHasBeenSet = false; Action m_errorAction; bool m_errorActionHasBeenSet = false; }; } // namespace Model } // namespace IoT } // namespace Aws