# RepositoryTriggerProperty

Information about a trigger for a repository.

> If you want to receive notifications about repository events, consider using notifications instead of triggers. For more information, see [Configuring notifications for repository events](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-repository-email.html) .

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_codecommit as codecommit } from 'aws-cdk-lib';
const repositoryTriggerProperty: codecommit.CfnRepository.RepositoryTriggerProperty = {
  destinationArn: 'destinationArn',
  events: ['events'],
  name: 'name',

  // the properties below are optional
  branches: ['branches'],
  customData: 'customData',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_codecommit as codecommit

repository_trigger_property = codecommit.CfnRepository.RepositoryTriggerProperty(
    destination_arn="destinationArn",
    events=["events"],
    name="name",

    # the properties below are optional
    branches=["branches"],
    custom_data="customData"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.codecommit.*;

RepositoryTriggerProperty repositoryTriggerProperty = RepositoryTriggerProperty.builder()
        .destinationArn("destinationArn")
        .events(List.of("events"))
        .name("name")

        // the properties below are optional
        .branches(List.of("branches"))
        .customData("customData")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CodeCommit;

var repositoryTriggerProperty = new RepositoryTriggerProperty {
    DestinationArn = "destinationArn",
    Events = new [] { "events" },
    Name = "name",

    // the properties below are optional
    Branches = new [] { "branches" },
    CustomData = "customData"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

repositoryTriggerProperty := &RepositoryTriggerProperty{
	DestinationArn: jsii.String("destinationArn"),
	Events: []*string{
		jsii.String("events"),
	},
	Name: jsii.String("name"),

	// the properties below are optional
	Branches: []*string{
		jsii.String("branches"),
	},
	CustomData: jsii.String("customData"),
}
```

## Properties

- `branches`: string[] — The branches to be included in the trigger configuration.

  If you specify an empty array, the trigger applies to all branches.

  > Although no content is required in the array, you must include the array itself.

- `customData`: string — Any custom data associated with the trigger to be included in the information sent to the target of the trigger.

- `destinationArn`: string (required) — The ARN of the resource that is the target for a trigger (for example, the ARN of a topic in Amazon SNS).

- `events`: string[] (required) — The repository events that cause the trigger to run actions in another service, such as sending a notification through Amazon SNS.

  > The valid value "all" cannot be used with any other values.

- `name`: string (required) — The name of the trigger.
