AWS SDK Version 4 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Creates a notification rule for a resource. The rule specifies the events you want notifications about and the targets (such as Amazon Q Developer in chat applications topics or Amazon Q Developer in chat applications clients configured for Slack) where you want to receive them.

Note:

This is an asynchronous operation using the standard naming convention for .NET 4.7.2 or higher.

Namespace: Amazon.CodeStarNotifications
Assembly: AWSSDK.CodeStarNotifications.dll
Version: 3.x.y.z

Syntax

C#
public abstract Task<CreateNotificationRuleResponse> CreateNotificationRuleAsync(
         CreateNotificationRuleRequest request,
         CancellationToken cancellationToken
)

Parameters

request
Type: Amazon.CodeStarNotifications.Model.CreateNotificationRuleRequest

Container for the necessary parameters to execute the CreateNotificationRule service method.

cancellationToken
Type: System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Return Value


The response from the CreateNotificationRule service method, as returned by CodeStarNotifications.

Exceptions

ExceptionCondition
AccessDeniedException CodeStar Notifications can't create the notification rule because you do not have sufficient permissions.
ConcurrentModificationException CodeStar Notifications can't complete the request because the resource is being modified by another process. Wait a few minutes and try again.
ConfigurationException Some or all of the configuration is incomplete, missing, or not valid.
LimitExceededException One of the CodeStar Notifications limits has been exceeded. Limits apply to accounts, notification rules, notifications, resources, and targets. For more information, see Limits.
ResourceAlreadyExistsException A resource with the same name or ID already exists. Notification rule names must be unique in your Amazon Web Services account.
ValidationException One or more parameter values are not valid.

Version Information

.NET:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.7.2 and newer

See Also