Class EventPattern.Builder
java.lang.Object
software.amazon.awscdk.services.events.EventPattern.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<EventPattern>
- Enclosing interface:
EventPattern
@Stability(Stable)
public static final class EventPattern.Builder
extends Object
implements software.amazon.jsii.Builder<EventPattern>
A builder for
EventPattern
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets the value ofEventPattern.getAccount()
build()
Builds the configured instance.Sets the value ofEventPattern.getDetail()
detailType
(List<String> detailType) Sets the value ofEventPattern.getDetailType()
Sets the value ofEventPattern.getId()
Sets the value ofEventPattern.getRegion()
Sets the value ofEventPattern.getResources()
Sets the value ofEventPattern.getSource()
Sets the value ofEventPattern.getTime()
Sets the value ofEventPattern.getVersion()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
account
Sets the value ofEventPattern.getAccount()
- Parameters:
account
- The 12-digit number identifying an AWS account.- Returns:
this
-
detail
Sets the value ofEventPattern.getDetail()
- Parameters:
detail
- A JSON object, whose content is at the discretion of the service originating the event.- Returns:
this
-
detailType
Sets the value ofEventPattern.getDetailType()
- Parameters:
detailType
- Identifies, in combination with the source field, the fields and values that appear in the detail field. Represents the "detail-type" event field.- Returns:
this
-
id
Sets the value ofEventPattern.getId()
- Parameters:
id
- A unique value is generated for every event. This can be helpful in tracing events as they move through rules to targets, and are processed.- Returns:
this
-
region
Sets the value ofEventPattern.getRegion()
- Parameters:
region
- Identifies the AWS region where the event originated.- Returns:
this
-
resources
Sets the value ofEventPattern.getResources()
- Parameters:
resources
- This JSON array contains ARNs that identify resources that are involved in the event. Inclusion of these ARNs is at the discretion of the service.For example, Amazon EC2 instance state-changes include Amazon EC2 instance ARNs, Auto Scaling events include ARNs for both instances and Auto Scaling groups, but API calls with AWS CloudTrail do not include resource ARNs.
- Returns:
this
-
source
Sets the value ofEventPattern.getSource()
- Parameters:
source
- Identifies the service that sourced the event. All events sourced from within AWS begin with "aws." Customer-generated events can have any value here, as long as it doesn't begin with "aws." We recommend the use of Java package-name style reverse domain-name strings.To find the correct value for source for an AWS service, see the table in AWS Service Namespaces. For example, the source value for Amazon CloudFront is aws.cloudfront.
- Returns:
this
-
time
Sets the value ofEventPattern.getTime()
- Parameters:
time
- The event timestamp, which can be specified by the service originating the event. If the event spans a time interval, the service might choose to report the start time, so this value can be noticeably before the time the event is actually received.- Returns:
this
-
version
Sets the value ofEventPattern.getVersion()
- Parameters:
version
- By default, this is set to 0 (zero) in all events.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<EventPattern>
- Returns:
- a new instance of
EventPattern
- Throws:
NullPointerException
- if any required attribute was not provided
-