/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the events-2015-10-07.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.CloudWatchEvents.Model
{
///
/// Container for the parameters to the PutRule operation.
/// Creates or updates the specified rule. Rules are enabled by default, or based on value
/// of the state. You can disable a rule using DisableRule.
///
///
///
/// A single rule watches for events from a single event bus. Events generated by Amazon
/// Web Services services go to your account's default event bus. Events generated by
/// SaaS partner services or applications go to the matching partner event bus. If you
/// have custom applications or services, you can specify whether their events go to your
/// default event bus or a custom event bus that you have created. For more information,
/// see CreateEventBus.
///
///
///
/// If you are updating an existing rule, the rule is replaced with what you specify in
/// this PutRule
command. If you omit arguments in PutRule
,
/// the old values for those arguments are not kept. Instead, they are replaced with null
/// values.
///
///
///
/// When you create or update a rule, incoming events might not immediately start matching
/// to new or updated rules. Allow a short period of time for changes to take effect.
///
///
///
/// A rule must contain at least an EventPattern or ScheduleExpression. Rules with EventPatterns
/// are triggered when a matching event is observed. Rules with ScheduleExpressions self-trigger
/// based on the given schedule. A rule can have both an EventPattern and a ScheduleExpression,
/// in which case the rule triggers on matching events as well as on a schedule.
///
///
///
/// When you initially create a rule, you can optionally assign one or more tags to the
/// rule. Tags can help you organize and categorize your resources. You can also use them
/// to scope user permissions, by granting a user permission to access or change only
/// rules with certain tag values. To use the PutRule
operation and assign
/// tags, you must have both the events:PutRule
and events:TagResource
/// permissions.
///
///
///
/// If you are updating an existing rule, any tags you specify in the PutRule
/// operation are ignored. To update the tags of an existing rule, use TagResource
/// and UntagResource.
///
///
///
/// Most services in Amazon Web Services treat : or / as the same character in Amazon
/// Resource Names (ARNs). However, EventBridge uses an exact match in event patterns
/// and rules. Be sure to use the correct ARN characters when creating event patterns
/// so that they match the ARN syntax in the event you want to match.
///
///
///
/// In EventBridge, it is possible to create rules that lead to infinite loops, where
/// a rule is fired repeatedly. For example, a rule might detect that ACLs have changed
/// on an S3 bucket, and trigger software to change them to the desired state. If the
/// rule is not written carefully, the subsequent change to the ACLs fires the rule again,
/// creating an infinite loop.
///
///
///
/// To prevent this, write the rules so that the triggered actions do not re-fire the
/// same rule. For example, your rule could fire only if ACLs are found to be in a bad
/// state, instead of after any change.
///
///
///
/// An infinite loop can quickly cause higher than expected charges. We recommend that
/// you use budgeting, which alerts you when charges exceed your specified limit. For
/// more information, see Managing
/// Your Costs with Budgets.
///
///
public partial class PutRuleRequest : AmazonCloudWatchEventsRequest
{
private string _description;
private string _eventBusName;
private string _eventPattern;
private string _name;
private string _roleArn;
private string _scheduleExpression;
private RuleState _state;
private List _tags = new List();
///
/// Gets and sets the property Description.
///
/// A description of the rule.
///
///
[AWSProperty(Max=512)]
public string Description
{
get { return this._description; }
set { this._description = value; }
}
// Check to see if Description property is set
internal bool IsSetDescription()
{
return this._description != null;
}
///
/// Gets and sets the property EventBusName.
///
/// The name or ARN of the event bus to associate with this rule. If you omit this, the
/// default event bus is used.
///
///
[AWSProperty(Min=1, Max=1600)]
public string EventBusName
{
get { return this._eventBusName; }
set { this._eventBusName = value; }
}
// Check to see if EventBusName property is set
internal bool IsSetEventBusName()
{
return this._eventBusName != null;
}
///
/// Gets and sets the property EventPattern.
///
/// The event pattern. For more information, see Events
/// and Event Patterns in the Amazon EventBridge User Guide.
///
///
public string EventPattern
{
get { return this._eventPattern; }
set { this._eventPattern = value; }
}
// Check to see if EventPattern property is set
internal bool IsSetEventPattern()
{
return this._eventPattern != null;
}
///
/// Gets and sets the property Name.
///
/// The name of the rule that you are creating or updating.
///
///
[AWSProperty(Required=true, Min=1, Max=64)]
public string Name
{
get { return this._name; }
set { this._name = value; }
}
// Check to see if Name property is set
internal bool IsSetName()
{
return this._name != null;
}
///
/// Gets and sets the property RoleArn.
///
/// The Amazon Resource Name (ARN) of the IAM role associated with the rule.
///
///
///
/// 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.
///
///
[AWSProperty(Min=1, Max=1600)]
public string RoleArn
{
get { return this._roleArn; }
set { this._roleArn = value; }
}
// Check to see if RoleArn property is set
internal bool IsSetRoleArn()
{
return this._roleArn != null;
}
///
/// Gets and sets the property ScheduleExpression.
///
/// The scheduling expression. For example, "cron(0 20 * * ? *)" or "rate(5 minutes)".
///
///
[AWSProperty(Max=256)]
public string ScheduleExpression
{
get { return this._scheduleExpression; }
set { this._scheduleExpression = value; }
}
// Check to see if ScheduleExpression property is set
internal bool IsSetScheduleExpression()
{
return this._scheduleExpression != null;
}
///
/// Gets and sets the property State.
///
/// Indicates whether the rule is enabled or disabled.
///
///
public RuleState State
{
get { return this._state; }
set { this._state = value; }
}
// Check to see if State property is set
internal bool IsSetState()
{
return this._state != null;
}
///
/// Gets and sets the property Tags.
///
/// The list of key-value pairs to associate with the rule.
///
///
public List Tags
{
get { return this._tags; }
set { this._tags = value; }
}
// Check to see if Tags property is set
internal bool IsSetTags()
{
return this._tags != null && this._tags.Count > 0;
}
}
}