# CustomActionAttachmentProperty

> AWS Chatbot is now Amazon Q Developer . [Learn more](https://docs.aws.amazon.com//chatbot/latest/adminguide/service-rename.html) >  > `Type` attribute values remain unchanged.

Defines when a custom action button should be attached to a notification.

- Source: Generated at build time
- Type last changed: v2.172.0 · 7 Dec 2024

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_chatbot as chatbot } from 'aws-cdk-lib';
const customActionAttachmentProperty: chatbot.CfnCustomAction.CustomActionAttachmentProperty = {
  buttonText: 'buttonText',
  criteria: [{
    operator: 'operator',
    variableName: 'variableName',

    // the properties below are optional
    value: 'value',
  }],
  notificationType: 'notificationType',
  variables: {
    variablesKey: 'variables',
  },
};
```

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_chatbot as chatbot

custom_action_attachment_property = chatbot.CfnCustomAction.CustomActionAttachmentProperty(
    button_text="buttonText",
    criteria=[chatbot.CfnCustomAction.CustomActionAttachmentCriteriaProperty(
        operator="operator",
        variable_name="variableName",

        # the properties below are optional
        value="value"
    )],
    notification_type="notificationType",
    variables={
        "variables_key": "variables"
    }
)
```

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.chatbot.*;

CustomActionAttachmentProperty customActionAttachmentProperty = CustomActionAttachmentProperty.builder()
        .buttonText("buttonText")
        .criteria(List.of(CustomActionAttachmentCriteriaProperty.builder()
                .operator("operator")
                .variableName("variableName")

                // the properties below are optional
                .value("value")
                .build()))
        .notificationType("notificationType")
        .variables(Map.of(
                "variablesKey", "variables"))
        .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.Chatbot;

var customActionAttachmentProperty = new CustomActionAttachmentProperty {
    ButtonText = "buttonText",
    Criteria = new [] { new CustomActionAttachmentCriteriaProperty {
        Operator = "operator",
        VariableName = "variableName",

        // the properties below are optional
        Value = "value"
    } },
    NotificationType = "notificationType",
    Variables = new Dictionary<string, string> {
        { "variablesKey", "variables" }
    }
};
```

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"

customActionAttachmentProperty := &CustomActionAttachmentProperty{
	ButtonText: jsii.String("buttonText"),
	Criteria: []interface{}{
		&CustomActionAttachmentCriteriaProperty{
			Operator: jsii.String("operator"),
			VariableName: jsii.String("variableName"),

			// the properties below are optional
			Value: jsii.String("value"),
		},
	},
	NotificationType: jsii.String("notificationType"),
	Variables: map[string]*string{
		"variablesKey": jsii.String("variables"),
	},
}
```

## Properties

- `buttonText`: string — The text of the button that appears on the notification.

- `criteria`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnCustomAction.CustomActionAttachmentCriteriaProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_chatbot.CfnCustomAction.CustomActionAttachmentCriteriaProperty.html)[] — The criteria for when a button should be shown based on values in the notification.

- `notificationType`: string — The type of notification that the custom action should be attached to.

- `variables`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | { [key: string]: string } — The variables to extract from the notification.
