io.cloudshiftdev.awscdk.services.dms.CfnEventSubscriptionProps.kt Maven / Gradle / Ivy
The newest version!
@file:Suppress("RedundantVisibilityModifier","RedundantUnitReturnType","RemoveRedundantQualifierName","unused","UnusedImport","ClassName","REDUNDANT_PROJECTION","DEPRECATION")
package io.cloudshiftdev.awscdk.services.dms
import io.cloudshiftdev.awscdk.CfnTag
import io.cloudshiftdev.awscdk.IResolvable
import io.cloudshiftdev.awscdk.common.CdkDslMarker
import io.cloudshiftdev.awscdk.common.CdkObject
import io.cloudshiftdev.awscdk.common.CdkObjectWrappers
import kotlin.Any
import kotlin.Boolean
import kotlin.String
import kotlin.Unit
import kotlin.collections.List
/**
* Properties for defining a `CfnEventSubscription`.
*
* Example:
*
* ```
* // The code below shows an example of how to instantiate this type.
* // The values are placeholders you should change.
* import io.cloudshiftdev.awscdk.services.dms.*;
* CfnEventSubscriptionProps cfnEventSubscriptionProps = CfnEventSubscriptionProps.builder()
* .snsTopicArn("snsTopicArn")
* // the properties below are optional
* .enabled(false)
* .eventCategories(List.of("eventCategories"))
* .sourceIds(List.of("sourceIds"))
* .sourceType("sourceType")
* .subscriptionName("subscriptionName")
* .tags(List.of(CfnTag.builder()
* .key("key")
* .value("value")
* .build()))
* .build();
* ```
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-eventsubscription.html)
*/
public interface CfnEventSubscriptionProps {
/**
* Indicates whether to activate the subscription.
*
* If you don't specify this property, AWS CloudFormation activates the subscription.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-eventsubscription.html#cfn-dms-eventsubscription-enabled)
*/
public fun enabled(): Any? = unwrap(this).getEnabled()
/**
* A list of event categories for a source type that you want to subscribe to.
*
* If you don't specify this property, you are notified about all event categories. For more
* information, see [Working with Events and
* Notifications](https://docs.aws.amazon.com//dms/latest/userguide/CHAP_Events.html) in the *AWS DMS
* User Guide* .
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-eventsubscription.html#cfn-dms-eventsubscription-eventcategories)
*/
public fun eventCategories(): List = unwrap(this).getEventCategories() ?: emptyList()
/**
* The Amazon Resource Name (ARN) of the Amazon SNS topic created for event notification.
*
* The ARN is created by Amazon SNS when you create a topic and subscribe to it.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-eventsubscription.html#cfn-dms-eventsubscription-snstopicarn)
*/
public fun snsTopicArn(): String
/**
* A list of identifiers for which AWS DMS provides notification events.
*
* If you don't specify a value, notifications are provided for all sources.
*
* If you specify multiple values, they must be of the same type. For example, if you specify a
* database instance ID, then all of the other values must be database instance IDs.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-eventsubscription.html#cfn-dms-eventsubscription-sourceids)
*/
public fun sourceIds(): List = unwrap(this).getSourceIds() ?: emptyList()
/**
* The type of AWS DMS resource that generates the events.
*
* For example, if you want to be notified of events generated by a replication instance, you set
* this parameter to `replication-instance` . If this value isn't specified, all events are returned.
*
* *Valid values* : `replication-instance` | `replication-task`
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-eventsubscription.html#cfn-dms-eventsubscription-sourcetype)
*/
public fun sourceType(): String? = unwrap(this).getSourceType()
/**
* The name of the AWS DMS event notification subscription.
*
* This name must be less than 255 characters.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-eventsubscription.html#cfn-dms-eventsubscription-subscriptionname)
*/
public fun subscriptionName(): String? = unwrap(this).getSubscriptionName()
/**
* One or more tags to be assigned to the event subscription.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-eventsubscription.html#cfn-dms-eventsubscription-tags)
*/
public fun tags(): List = unwrap(this).getTags()?.map(CfnTag::wrap) ?: emptyList()
/**
* A builder for [CfnEventSubscriptionProps]
*/
@CdkDslMarker
public interface Builder {
/**
* @param enabled Indicates whether to activate the subscription.
* If you don't specify this property, AWS CloudFormation activates the subscription.
*/
public fun enabled(enabled: Boolean)
/**
* @param enabled Indicates whether to activate the subscription.
* If you don't specify this property, AWS CloudFormation activates the subscription.
*/
public fun enabled(enabled: IResolvable)
/**
* @param eventCategories A list of event categories for a source type that you want to
* subscribe to.
* If you don't specify this property, you are notified about all event categories. For more
* information, see [Working with Events and
* Notifications](https://docs.aws.amazon.com//dms/latest/userguide/CHAP_Events.html) in the *AWS
* DMS User Guide* .
*/
public fun eventCategories(eventCategories: List)
/**
* @param eventCategories A list of event categories for a source type that you want to
* subscribe to.
* If you don't specify this property, you are notified about all event categories. For more
* information, see [Working with Events and
* Notifications](https://docs.aws.amazon.com//dms/latest/userguide/CHAP_Events.html) in the *AWS
* DMS User Guide* .
*/
public fun eventCategories(vararg eventCategories: String)
/**
* @param snsTopicArn The Amazon Resource Name (ARN) of the Amazon SNS topic created for event
* notification.
* The ARN is created by Amazon SNS when you create a topic and subscribe to it.
*/
public fun snsTopicArn(snsTopicArn: String)
/**
* @param sourceIds A list of identifiers for which AWS DMS provides notification events.
* If you don't specify a value, notifications are provided for all sources.
*
* If you specify multiple values, they must be of the same type. For example, if you specify a
* database instance ID, then all of the other values must be database instance IDs.
*/
public fun sourceIds(sourceIds: List)
/**
* @param sourceIds A list of identifiers for which AWS DMS provides notification events.
* If you don't specify a value, notifications are provided for all sources.
*
* If you specify multiple values, they must be of the same type. For example, if you specify a
* database instance ID, then all of the other values must be database instance IDs.
*/
public fun sourceIds(vararg sourceIds: String)
/**
* @param sourceType The type of AWS DMS resource that generates the events.
* For example, if you want to be notified of events generated by a replication instance, you
* set this parameter to `replication-instance` . If this value isn't specified, all events are
* returned.
*
* *Valid values* : `replication-instance` | `replication-task`
*/
public fun sourceType(sourceType: String)
/**
* @param subscriptionName The name of the AWS DMS event notification subscription.
* This name must be less than 255 characters.
*/
public fun subscriptionName(subscriptionName: String)
/**
* @param tags One or more tags to be assigned to the event subscription.
*/
public fun tags(tags: List)
/**
* @param tags One or more tags to be assigned to the event subscription.
*/
public fun tags(vararg tags: CfnTag)
}
private class BuilderImpl : Builder {
private val cdkBuilder: software.amazon.awscdk.services.dms.CfnEventSubscriptionProps.Builder =
software.amazon.awscdk.services.dms.CfnEventSubscriptionProps.builder()
/**
* @param enabled Indicates whether to activate the subscription.
* If you don't specify this property, AWS CloudFormation activates the subscription.
*/
override fun enabled(enabled: Boolean) {
cdkBuilder.enabled(enabled)
}
/**
* @param enabled Indicates whether to activate the subscription.
* If you don't specify this property, AWS CloudFormation activates the subscription.
*/
override fun enabled(enabled: IResolvable) {
cdkBuilder.enabled(enabled.let(IResolvable.Companion::unwrap))
}
/**
* @param eventCategories A list of event categories for a source type that you want to
* subscribe to.
* If you don't specify this property, you are notified about all event categories. For more
* information, see [Working with Events and
* Notifications](https://docs.aws.amazon.com//dms/latest/userguide/CHAP_Events.html) in the *AWS
* DMS User Guide* .
*/
override fun eventCategories(eventCategories: List) {
cdkBuilder.eventCategories(eventCategories)
}
/**
* @param eventCategories A list of event categories for a source type that you want to
* subscribe to.
* If you don't specify this property, you are notified about all event categories. For more
* information, see [Working with Events and
* Notifications](https://docs.aws.amazon.com//dms/latest/userguide/CHAP_Events.html) in the *AWS
* DMS User Guide* .
*/
override fun eventCategories(vararg eventCategories: String): Unit =
eventCategories(eventCategories.toList())
/**
* @param snsTopicArn The Amazon Resource Name (ARN) of the Amazon SNS topic created for event
* notification.
* The ARN is created by Amazon SNS when you create a topic and subscribe to it.
*/
override fun snsTopicArn(snsTopicArn: String) {
cdkBuilder.snsTopicArn(snsTopicArn)
}
/**
* @param sourceIds A list of identifiers for which AWS DMS provides notification events.
* If you don't specify a value, notifications are provided for all sources.
*
* If you specify multiple values, they must be of the same type. For example, if you specify a
* database instance ID, then all of the other values must be database instance IDs.
*/
override fun sourceIds(sourceIds: List) {
cdkBuilder.sourceIds(sourceIds)
}
/**
* @param sourceIds A list of identifiers for which AWS DMS provides notification events.
* If you don't specify a value, notifications are provided for all sources.
*
* If you specify multiple values, they must be of the same type. For example, if you specify a
* database instance ID, then all of the other values must be database instance IDs.
*/
override fun sourceIds(vararg sourceIds: String): Unit = sourceIds(sourceIds.toList())
/**
* @param sourceType The type of AWS DMS resource that generates the events.
* For example, if you want to be notified of events generated by a replication instance, you
* set this parameter to `replication-instance` . If this value isn't specified, all events are
* returned.
*
* *Valid values* : `replication-instance` | `replication-task`
*/
override fun sourceType(sourceType: String) {
cdkBuilder.sourceType(sourceType)
}
/**
* @param subscriptionName The name of the AWS DMS event notification subscription.
* This name must be less than 255 characters.
*/
override fun subscriptionName(subscriptionName: String) {
cdkBuilder.subscriptionName(subscriptionName)
}
/**
* @param tags One or more tags to be assigned to the event subscription.
*/
override fun tags(tags: List) {
cdkBuilder.tags(tags.map(CfnTag.Companion::unwrap))
}
/**
* @param tags One or more tags to be assigned to the event subscription.
*/
override fun tags(vararg tags: CfnTag): Unit = tags(tags.toList())
public fun build(): software.amazon.awscdk.services.dms.CfnEventSubscriptionProps =
cdkBuilder.build()
}
private class Wrapper(
cdkObject: software.amazon.awscdk.services.dms.CfnEventSubscriptionProps,
) : CdkObject(cdkObject),
CfnEventSubscriptionProps {
/**
* Indicates whether to activate the subscription.
*
* If you don't specify this property, AWS CloudFormation activates the subscription.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-eventsubscription.html#cfn-dms-eventsubscription-enabled)
*/
override fun enabled(): Any? = unwrap(this).getEnabled()
/**
* A list of event categories for a source type that you want to subscribe to.
*
* If you don't specify this property, you are notified about all event categories. For more
* information, see [Working with Events and
* Notifications](https://docs.aws.amazon.com//dms/latest/userguide/CHAP_Events.html) in the *AWS
* DMS User Guide* .
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-eventsubscription.html#cfn-dms-eventsubscription-eventcategories)
*/
override fun eventCategories(): List = unwrap(this).getEventCategories() ?: emptyList()
/**
* The Amazon Resource Name (ARN) of the Amazon SNS topic created for event notification.
*
* The ARN is created by Amazon SNS when you create a topic and subscribe to it.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-eventsubscription.html#cfn-dms-eventsubscription-snstopicarn)
*/
override fun snsTopicArn(): String = unwrap(this).getSnsTopicArn()
/**
* A list of identifiers for which AWS DMS provides notification events.
*
* If you don't specify a value, notifications are provided for all sources.
*
* If you specify multiple values, they must be of the same type. For example, if you specify a
* database instance ID, then all of the other values must be database instance IDs.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-eventsubscription.html#cfn-dms-eventsubscription-sourceids)
*/
override fun sourceIds(): List = unwrap(this).getSourceIds() ?: emptyList()
/**
* The type of AWS DMS resource that generates the events.
*
* For example, if you want to be notified of events generated by a replication instance, you
* set this parameter to `replication-instance` . If this value isn't specified, all events are
* returned.
*
* *Valid values* : `replication-instance` | `replication-task`
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-eventsubscription.html#cfn-dms-eventsubscription-sourcetype)
*/
override fun sourceType(): String? = unwrap(this).getSourceType()
/**
* The name of the AWS DMS event notification subscription.
*
* This name must be less than 255 characters.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-eventsubscription.html#cfn-dms-eventsubscription-subscriptionname)
*/
override fun subscriptionName(): String? = unwrap(this).getSubscriptionName()
/**
* One or more tags to be assigned to the event subscription.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-eventsubscription.html#cfn-dms-eventsubscription-tags)
*/
override fun tags(): List = unwrap(this).getTags()?.map(CfnTag::wrap) ?: emptyList()
}
public companion object {
public operator fun invoke(block: Builder.() -> Unit = {}): CfnEventSubscriptionProps {
val builderImpl = BuilderImpl()
return Wrapper(builderImpl.apply(block).build())
}
internal fun wrap(cdkObject: software.amazon.awscdk.services.dms.CfnEventSubscriptionProps):
CfnEventSubscriptionProps = CdkObjectWrappers.wrap(cdkObject) as? CfnEventSubscriptionProps
?: Wrapper(cdkObject)
internal fun unwrap(wrapped: CfnEventSubscriptionProps):
software.amazon.awscdk.services.dms.CfnEventSubscriptionProps = (wrapped as
CdkObject).cdkObject as software.amazon.awscdk.services.dms.CfnEventSubscriptionProps
}
}