Class: AWSCDK::CodeStarNotifications::NotificationRuleProps

Inherits:
NotificationRuleOptions
  • Object
show all
Defined in:
code_star_notifications/notification_rule_props.rb

Overview

Properties for a new notification rule.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(created_by: nil, detail_type: nil, enabled: nil, notification_rule_name: nil, events:, source:, targets: nil) ⇒ NotificationRuleProps

Returns a new instance of NotificationRuleProps.

Parameters:

  • created_by (String, nil) (defaults to: nil)

    The name or email alias of the person who created the notification rule.

  • detail_type (AWSCDK::CodeStarNotifications::DetailType, nil) (defaults to: nil)

    The level of detail to include in the notifications for this resource.

  • enabled (Boolean, nil) (defaults to: nil)

    The status of the notification rule.

  • notification_rule_name (String, nil) (defaults to: nil)

    The name for the notification rule.

  • events (Array<String>)

    A list of event types associated with this notification rule.

  • source (AWSCDK::CodeStarNotifications::INotificationRuleSource)

    The Amazon Resource Name (ARN) of the resource to associate with the notification rule.

  • targets (Array<AWSCDK::CodeStarNotifications::INotificationRuleTarget>, nil) (defaults to: nil)

    The targets to register for the notification destination.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'code_star_notifications/notification_rule_props.rb', line 14

def initialize(created_by: nil, detail_type: nil, enabled: nil, notification_rule_name: nil, events:, source:, targets: nil)
  @created_by = created_by
  Jsii::Type.check_type(@created_by, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "createdBy") unless @created_by.nil?
  @detail_type = detail_type
  Jsii::Type.check_type(@detail_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLkRldGFpbFR5cGUifQ==")), "detailType") unless @detail_type.nil?
  @enabled = enabled
  Jsii::Type.check_type(@enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enabled") unless @enabled.nil?
  @notification_rule_name = notification_rule_name
  Jsii::Type.check_type(@notification_rule_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "notificationRuleName") unless @notification_rule_name.nil?
  @events = events
  Jsii::Type.check_type(@events, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "events")
  @source = source
  Jsii::Type.check_type(@source, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLklOb3RpZmljYXRpb25SdWxlU291cmNlIn0=")), "source")
  @targets = targets
  Jsii::Type.check_type(@targets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2Rlc3Rhcm5vdGlmaWNhdGlvbnMuSU5vdGlmaWNhdGlvblJ1bGVUYXJnZXQifSwia2luZCI6ImFycmF5In19")), "targets") unless @targets.nil?
end

Instance Attribute Details

#created_byString? (readonly)

Note:

Default: - No alias provided

The name or email alias of the person who created the notification rule.

If not specified, it means that the creator's alias is not provided.

Returns:

  • (String, nil)


37
38
39
# File 'code_star_notifications/notification_rule_props.rb', line 37

def created_by
  @created_by
end

#detail_typeAWSCDK::CodeStarNotifications::DetailType? (readonly)

Note:

Default: DetailType.FULL

The level of detail to include in the notifications for this resource.

BASIC will include only the contents of the event as it would appear in AWS CloudWatch. FULL will include any supplemental information provided by AWS CodeStar Notifications and/or the service for the resource for which the notification is created.



45
46
47
# File 'code_star_notifications/notification_rule_props.rb', line 45

def detail_type
  @detail_type
end

#enabledBoolean? (readonly)

Note:

Default: true

The status of the notification rule.

If the enabled is set to DISABLED, notifications aren't sent for the notification rule.

Returns:

  • (Boolean, nil)


52
53
54
# File 'code_star_notifications/notification_rule_props.rb', line 52

def enabled
  @enabled
end

#eventsArray<String> (readonly)

A list of event types associated with this notification rule.

For a complete list of event types and IDs, see Notification concepts in the Developer Tools Console User Guide.



66
67
68
# File 'code_star_notifications/notification_rule_props.rb', line 66

def events
  @events
end

#notification_rule_nameString? (readonly)

Note:

Default: - generated from the id

The name for the notification rule.

Notification rule names must be unique in your AWS account.

Returns:

  • (String, nil)


59
60
61
# File 'code_star_notifications/notification_rule_props.rb', line 59

def notification_rule_name
  @notification_rule_name
end

#sourceAWSCDK::CodeStarNotifications::INotificationRuleSource (readonly)

The Amazon Resource Name (ARN) of the resource to associate with the notification rule.

Currently, Supported sources include pipelines in AWS CodePipeline, build projects in AWS CodeBuild, and repositories in AWS CodeCommit in this L2 constructor.



73
74
75
# File 'code_star_notifications/notification_rule_props.rb', line 73

def source
  @source
end

#targetsArray<AWSCDK::CodeStarNotifications::INotificationRuleTarget>? (readonly)

Note:

Default: - No targets are added to the rule. Use addTarget() to add a target.

The targets to register for the notification destination.



78
79
80
# File 'code_star_notifications/notification_rule_props.rb', line 78

def targets
  @targets
end

Class Method Details

.jsii_propertiesObject



80
81
82
83
84
85
86
87
88
89
90
# File 'code_star_notifications/notification_rule_props.rb', line 80

def self.jsii_properties
  {
    :created_by => "createdBy",
    :detail_type => "detailType",
    :enabled => "enabled",
    :notification_rule_name => "notificationRuleName",
    :events => "events",
    :source => "source",
    :targets => "targets",
  }
end

Instance Method Details

#to_jsiiObject



92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'code_star_notifications/notification_rule_props.rb', line 92

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "createdBy" => @created_by,
    "detailType" => @detail_type,
    "enabled" => @enabled,
    "notificationRuleName" => @notification_rule_name,
    "events" => @events,
    "source" => @source,
    "targets" => @targets,
  })
  result.compact
end