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

Contains information about a rule in Amazon EventBridge.

See * Also:

AWS API * Reference

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

The name of the rule.

*/ inline const Aws::String& GetName() const{ return m_name; } /** *

The name of the rule.

*/ inline bool NameHasBeenSet() const { return m_nameHasBeenSet; } /** *

The name of the rule.

*/ inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; } /** *

The name of the rule.

*/ inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); } /** *

The name of the rule.

*/ inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); } /** *

The name of the rule.

*/ inline Rule& WithName(const Aws::String& value) { SetName(value); return *this;} /** *

The name of the rule.

*/ inline Rule& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;} /** *

The name of the rule.

*/ inline Rule& WithName(const char* value) { SetName(value); return *this;} /** *

The Amazon Resource Name (ARN) of the rule.

*/ inline const Aws::String& GetArn() const{ return m_arn; } /** *

The Amazon Resource Name (ARN) of the rule.

*/ inline bool ArnHasBeenSet() const { return m_arnHasBeenSet; } /** *

The Amazon Resource Name (ARN) of the rule.

*/ inline void SetArn(const Aws::String& value) { m_arnHasBeenSet = true; m_arn = value; } /** *

The Amazon Resource Name (ARN) of the rule.

*/ inline void SetArn(Aws::String&& value) { m_arnHasBeenSet = true; m_arn = std::move(value); } /** *

The Amazon Resource Name (ARN) of the rule.

*/ inline void SetArn(const char* value) { m_arnHasBeenSet = true; m_arn.assign(value); } /** *

The Amazon Resource Name (ARN) of the rule.

*/ inline Rule& WithArn(const Aws::String& value) { SetArn(value); return *this;} /** *

The Amazon Resource Name (ARN) of the rule.

*/ inline Rule& WithArn(Aws::String&& value) { SetArn(std::move(value)); return *this;} /** *

The Amazon Resource Name (ARN) of the rule.

*/ inline Rule& WithArn(const char* value) { SetArn(value); return *this;} /** *

The event pattern of the rule. For more information, see Events * and Event Patterns in the Amazon EventBridge User Guide.

*/ inline const Aws::String& GetEventPattern() const{ return m_eventPattern; } /** *

The event pattern of the rule. For more information, see Events * and Event Patterns in the Amazon EventBridge User Guide.

*/ inline bool EventPatternHasBeenSet() const { return m_eventPatternHasBeenSet; } /** *

The event pattern of the rule. For more information, see Events * and Event Patterns in the Amazon EventBridge User Guide.

*/ inline void SetEventPattern(const Aws::String& value) { m_eventPatternHasBeenSet = true; m_eventPattern = value; } /** *

The event pattern of the rule. For more information, see Events * and Event Patterns in the Amazon EventBridge User Guide.

*/ inline void SetEventPattern(Aws::String&& value) { m_eventPatternHasBeenSet = true; m_eventPattern = std::move(value); } /** *

The event pattern of the rule. For more information, see Events * and Event Patterns in the Amazon EventBridge User Guide.

*/ inline void SetEventPattern(const char* value) { m_eventPatternHasBeenSet = true; m_eventPattern.assign(value); } /** *

The event pattern of the rule. For more information, see Events * and Event Patterns in the Amazon EventBridge User Guide.

*/ inline Rule& WithEventPattern(const Aws::String& value) { SetEventPattern(value); return *this;} /** *

The event pattern of the rule. For more information, see Events * and Event Patterns in the Amazon EventBridge User Guide.

*/ inline Rule& WithEventPattern(Aws::String&& value) { SetEventPattern(std::move(value)); return *this;} /** *

The event pattern of the rule. For more information, see Events * and Event Patterns in the Amazon EventBridge User Guide.

*/ inline Rule& WithEventPattern(const char* value) { SetEventPattern(value); return *this;} /** *

The state of the rule.

*/ inline const RuleState& GetState() const{ return m_state; } /** *

The state of the rule.

*/ inline bool StateHasBeenSet() const { return m_stateHasBeenSet; } /** *

The state of the rule.

*/ inline void SetState(const RuleState& value) { m_stateHasBeenSet = true; m_state = value; } /** *

The state of the rule.

*/ inline void SetState(RuleState&& value) { m_stateHasBeenSet = true; m_state = std::move(value); } /** *

The state of the rule.

*/ inline Rule& WithState(const RuleState& value) { SetState(value); return *this;} /** *

The state of the rule.

*/ inline Rule& WithState(RuleState&& value) { SetState(std::move(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 Rule& WithDescription(const Aws::String& value) { SetDescription(value); return *this;} /** *

The description of the rule.

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

The description of the rule.

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

The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 * minutes)". For more information, see Creating * an Amazon EventBridge rule that runs on a schedule.

*/ inline const Aws::String& GetScheduleExpression() const{ return m_scheduleExpression; } /** *

The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 * minutes)". For more information, see Creating * an Amazon EventBridge rule that runs on a schedule.

*/ inline bool ScheduleExpressionHasBeenSet() const { return m_scheduleExpressionHasBeenSet; } /** *

The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 * minutes)". For more information, see Creating * an Amazon EventBridge rule that runs on a schedule.

*/ inline void SetScheduleExpression(const Aws::String& value) { m_scheduleExpressionHasBeenSet = true; m_scheduleExpression = value; } /** *

The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 * minutes)". For more information, see Creating * an Amazon EventBridge rule that runs on a schedule.

*/ inline void SetScheduleExpression(Aws::String&& value) { m_scheduleExpressionHasBeenSet = true; m_scheduleExpression = std::move(value); } /** *

The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 * minutes)". For more information, see Creating * an Amazon EventBridge rule that runs on a schedule.

*/ inline void SetScheduleExpression(const char* value) { m_scheduleExpressionHasBeenSet = true; m_scheduleExpression.assign(value); } /** *

The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 * minutes)". For more information, see Creating * an Amazon EventBridge rule that runs on a schedule.

*/ inline Rule& WithScheduleExpression(const Aws::String& value) { SetScheduleExpression(value); return *this;} /** *

The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 * minutes)". For more information, see Creating * an Amazon EventBridge rule that runs on a schedule.

*/ inline Rule& WithScheduleExpression(Aws::String&& value) { SetScheduleExpression(std::move(value)); return *this;} /** *

The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 * minutes)". For more information, see Creating * an Amazon EventBridge rule that runs on a schedule.

*/ inline Rule& WithScheduleExpression(const char* value) { SetScheduleExpression(value); return *this;} /** *

The Amazon Resource Name (ARN) of the role that is used for target * invocation.

If you're setting an event bus in another account as the * target and that account granted permission to your account through an * organization instead of directly by the account ID, you must specify a * RoleArn with proper permissions in the Target * structure, instead of here in this parameter.

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

The Amazon Resource Name (ARN) of the role that is used for target * invocation.

If you're setting an event bus in another account as the * target and that account granted permission to your account through an * organization instead of directly by the account ID, you must specify a * RoleArn with proper permissions in the Target * structure, instead of here in this parameter.

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

The Amazon Resource Name (ARN) of the role that is used for target * invocation.

If you're setting an event bus in another account as the * target and that account granted permission to your account through an * organization instead of directly by the account ID, you must specify a * RoleArn with proper permissions in the Target * structure, instead of here in this parameter.

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

The Amazon Resource Name (ARN) of the role that is used for target * invocation.

If you're setting an event bus in another account as the * target and that account granted permission to your account through an * organization instead of directly by the account ID, you must specify a * RoleArn with proper permissions in the Target * structure, instead of here in this parameter.

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

The Amazon Resource Name (ARN) of the role that is used for target * invocation.

If you're setting an event bus in another account as the * target and that account granted permission to your account through an * organization instead of directly by the account ID, you must specify a * RoleArn with proper permissions in the Target * structure, instead of here in this parameter.

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

The Amazon Resource Name (ARN) of the role that is used for target * invocation.

If you're setting an event bus in another account as the * target and that account granted permission to your account through an * organization instead of directly by the account ID, you must specify a * RoleArn with proper permissions in the Target * structure, instead of here in this parameter.

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

The Amazon Resource Name (ARN) of the role that is used for target * invocation.

If you're setting an event bus in another account as the * target and that account granted permission to your account through an * organization instead of directly by the account ID, you must specify a * RoleArn with proper permissions in the Target * structure, instead of here in this parameter.

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

The Amazon Resource Name (ARN) of the role that is used for target * invocation.

If you're setting an event bus in another account as the * target and that account granted permission to your account through an * organization instead of directly by the account ID, you must specify a * RoleArn with proper permissions in the Target * structure, instead of here in this parameter.

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

If the rule was created on behalf of your account by an Amazon Web Services * service, this field displays the principal name of the service that created the * rule.

*/ inline const Aws::String& GetManagedBy() const{ return m_managedBy; } /** *

If the rule was created on behalf of your account by an Amazon Web Services * service, this field displays the principal name of the service that created the * rule.

*/ inline bool ManagedByHasBeenSet() const { return m_managedByHasBeenSet; } /** *

If the rule was created on behalf of your account by an Amazon Web Services * service, this field displays the principal name of the service that created the * rule.

*/ inline void SetManagedBy(const Aws::String& value) { m_managedByHasBeenSet = true; m_managedBy = value; } /** *

If the rule was created on behalf of your account by an Amazon Web Services * service, this field displays the principal name of the service that created the * rule.

*/ inline void SetManagedBy(Aws::String&& value) { m_managedByHasBeenSet = true; m_managedBy = std::move(value); } /** *

If the rule was created on behalf of your account by an Amazon Web Services * service, this field displays the principal name of the service that created the * rule.

*/ inline void SetManagedBy(const char* value) { m_managedByHasBeenSet = true; m_managedBy.assign(value); } /** *

If the rule was created on behalf of your account by an Amazon Web Services * service, this field displays the principal name of the service that created the * rule.

*/ inline Rule& WithManagedBy(const Aws::String& value) { SetManagedBy(value); return *this;} /** *

If the rule was created on behalf of your account by an Amazon Web Services * service, this field displays the principal name of the service that created the * rule.

*/ inline Rule& WithManagedBy(Aws::String&& value) { SetManagedBy(std::move(value)); return *this;} /** *

If the rule was created on behalf of your account by an Amazon Web Services * service, this field displays the principal name of the service that created the * rule.

*/ inline Rule& WithManagedBy(const char* value) { SetManagedBy(value); return *this;} /** *

The name or ARN of the event bus associated with the rule. If you omit this, * the default event bus is used.

*/ inline const Aws::String& GetEventBusName() const{ return m_eventBusName; } /** *

The name or ARN of the event bus associated with the rule. If you omit this, * the default event bus is used.

*/ inline bool EventBusNameHasBeenSet() const { return m_eventBusNameHasBeenSet; } /** *

The name or ARN of the event bus associated with the rule. If you omit this, * the default event bus is used.

*/ inline void SetEventBusName(const Aws::String& value) { m_eventBusNameHasBeenSet = true; m_eventBusName = value; } /** *

The name or ARN of the event bus associated with the rule. If you omit this, * the default event bus is used.

*/ inline void SetEventBusName(Aws::String&& value) { m_eventBusNameHasBeenSet = true; m_eventBusName = std::move(value); } /** *

The name or ARN of the event bus associated with the rule. If you omit this, * the default event bus is used.

*/ inline void SetEventBusName(const char* value) { m_eventBusNameHasBeenSet = true; m_eventBusName.assign(value); } /** *

The name or ARN of the event bus associated with the rule. If you omit this, * the default event bus is used.

*/ inline Rule& WithEventBusName(const Aws::String& value) { SetEventBusName(value); return *this;} /** *

The name or ARN of the event bus associated with the rule. If you omit this, * the default event bus is used.

*/ inline Rule& WithEventBusName(Aws::String&& value) { SetEventBusName(std::move(value)); return *this;} /** *

The name or ARN of the event bus associated with the rule. If you omit this, * the default event bus is used.

*/ inline Rule& WithEventBusName(const char* value) { SetEventBusName(value); return *this;} private: Aws::String m_name; bool m_nameHasBeenSet = false; Aws::String m_arn; bool m_arnHasBeenSet = false; Aws::String m_eventPattern; bool m_eventPatternHasBeenSet = false; RuleState m_state; bool m_stateHasBeenSet = false; Aws::String m_description; bool m_descriptionHasBeenSet = false; Aws::String m_scheduleExpression; bool m_scheduleExpressionHasBeenSet = false; Aws::String m_roleArn; bool m_roleArnHasBeenSet = false; Aws::String m_managedBy; bool m_managedByHasBeenSet = false; Aws::String m_eventBusName; bool m_eventBusNameHasBeenSet = false; }; } // namespace Model } // namespace CloudWatchEvents } // namespace Aws