/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.rds.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CreateEventSubscriptionRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** ** The name of the subscription. *
** Constraints: The name must be less than 255 characters. *
*/ private String subscriptionName; /** ** The Amazon Resource Name (ARN) of the SNS topic created for event notification. The ARN is created by Amazon SNS * when you create a topic and subscribe to it. *
*/ private String snsTopicArn; /** *
* The type of source that is generating the events. For example, if you want to be notified of events generated by
* a DB instance, you set this parameter to db-instance
. For RDS Proxy events, specify
* db-proxy
. If this value isn't specified, all events are returned.
*
* Valid values: db-instance
| db-cluster
| db-parameter-group
|
* db-security-group
| db-snapshot
| db-cluster-snapshot
|
* db-proxy
*
* A list of event categories for a particular source type (SourceType
) that you want to subscribe to.
* You can see a list of the categories for a given source type in the
* "Amazon RDS event categories and event messages" section of the Amazon RDS User
* Guide or the Amazon Aurora
* User Guide . You can also see this list by using the DescribeEventCategories
operation.
*
* The list of identifiers of the event sources for which events are returned. If not specified, then all sources * are included in the response. An identifier must begin with a letter and must contain only ASCII letters, digits, * and hyphens. It can't end with a hyphen or contain two consecutive hyphens. *
** Constraints: *
*
* If SourceIds
are supplied, SourceType
must also be provided.
*
* If the source type is a DB instance, a DBInstanceIdentifier
value must be supplied.
*
* If the source type is a DB cluster, a DBClusterIdentifier
value must be supplied.
*
* If the source type is a DB parameter group, a DBParameterGroupName
value must be supplied.
*
* If the source type is a DB security group, a DBSecurityGroupName
value must be supplied.
*
* If the source type is a DB snapshot, a DBSnapshotIdentifier
value must be supplied.
*
* If the source type is a DB cluster snapshot, a DBClusterSnapshotIdentifier
value must be supplied.
*
* If the source type is an RDS Proxy, a DBProxyName
value must be supplied.
*
* A value that indicates whether to activate the subscription. If the event notification subscription isn't * activated, the subscription is created but not active. *
*/ private Boolean enabled; private com.amazonaws.internal.SdkInternalList* The name of the subscription. *
** Constraints: The name must be less than 255 characters. *
* * @param subscriptionName * The name of the subscription. ** Constraints: The name must be less than 255 characters. */ public void setSubscriptionName(String subscriptionName) { this.subscriptionName = subscriptionName; } /** *
* The name of the subscription. *
** Constraints: The name must be less than 255 characters. *
* * @return The name of the subscription. ** Constraints: The name must be less than 255 characters. */ public String getSubscriptionName() { return this.subscriptionName; } /** *
* The name of the subscription. *
** Constraints: The name must be less than 255 characters. *
* * @param subscriptionName * The name of the subscription. ** Constraints: The name must be less than 255 characters. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateEventSubscriptionRequest withSubscriptionName(String subscriptionName) { setSubscriptionName(subscriptionName); return this; } /** *
* The Amazon Resource Name (ARN) of the SNS topic created for event notification. The ARN is created by Amazon SNS * when you create a topic and subscribe to it. *
* * @param snsTopicArn * The Amazon Resource Name (ARN) of the SNS topic created for event notification. The ARN is created by * Amazon SNS when you create a topic and subscribe to it. */ public void setSnsTopicArn(String snsTopicArn) { this.snsTopicArn = snsTopicArn; } /** ** The Amazon Resource Name (ARN) of the SNS topic created for event notification. The ARN is created by Amazon SNS * when you create a topic and subscribe to it. *
* * @return The Amazon Resource Name (ARN) of the SNS topic created for event notification. The ARN is created by * Amazon SNS when you create a topic and subscribe to it. */ public String getSnsTopicArn() { return this.snsTopicArn; } /** ** The Amazon Resource Name (ARN) of the SNS topic created for event notification. The ARN is created by Amazon SNS * when you create a topic and subscribe to it. *
* * @param snsTopicArn * The Amazon Resource Name (ARN) of the SNS topic created for event notification. The ARN is created by * Amazon SNS when you create a topic and subscribe to it. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateEventSubscriptionRequest withSnsTopicArn(String snsTopicArn) { setSnsTopicArn(snsTopicArn); return this; } /** *
* The type of source that is generating the events. For example, if you want to be notified of events generated by
* a DB instance, you set this parameter to db-instance
. For RDS Proxy events, specify
* db-proxy
. If this value isn't specified, all events are returned.
*
* Valid values: db-instance
| db-cluster
| db-parameter-group
|
* db-security-group
| db-snapshot
| db-cluster-snapshot
|
* db-proxy
*
db-instance
. For RDS Proxy events,
* specify db-proxy
. If this value isn't specified, all events are returned.
*
* Valid values: db-instance
| db-cluster
| db-parameter-group
|
* db-security-group
| db-snapshot
| db-cluster-snapshot
|
* db-proxy
*/
public void setSourceType(String sourceType) {
this.sourceType = sourceType;
}
/**
*
* The type of source that is generating the events. For example, if you want to be notified of events generated by
* a DB instance, you set this parameter to db-instance
. For RDS Proxy events, specify
* db-proxy
. If this value isn't specified, all events are returned.
*
* Valid values: db-instance
| db-cluster
| db-parameter-group
|
* db-security-group
| db-snapshot
| db-cluster-snapshot
|
* db-proxy
*
db-instance
. For RDS Proxy events,
* specify db-proxy
. If this value isn't specified, all events are returned.
*
* Valid values: db-instance
| db-cluster
| db-parameter-group
|
* db-security-group
| db-snapshot
| db-cluster-snapshot
|
* db-proxy
*/
public String getSourceType() {
return this.sourceType;
}
/**
*
* The type of source that is generating the events. For example, if you want to be notified of events generated by
* a DB instance, you set this parameter to db-instance
. For RDS Proxy events, specify
* db-proxy
. If this value isn't specified, all events are returned.
*
* Valid values: db-instance
| db-cluster
| db-parameter-group
|
* db-security-group
| db-snapshot
| db-cluster-snapshot
|
* db-proxy
*
db-instance
. For RDS Proxy events,
* specify db-proxy
. If this value isn't specified, all events are returned.
*
* Valid values: db-instance
| db-cluster
| db-parameter-group
|
* db-security-group
| db-snapshot
| db-cluster-snapshot
|
* db-proxy
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateEventSubscriptionRequest withSourceType(String sourceType) {
setSourceType(sourceType);
return this;
}
/**
*
* A list of event categories for a particular source type (SourceType
) that you want to subscribe to.
* You can see a list of the categories for a given source type in the
* "Amazon RDS event categories and event messages" section of the Amazon RDS User
* Guide or the Amazon Aurora
* User Guide . You can also see this list by using the DescribeEventCategories
operation.
*
SourceType
) that you want to
* subscribe to. You can see a list of the categories for a given source type in the
* "Amazon RDS event categories and event messages" section of the Amazon RDS
* User Guide or the Amazon
* Aurora User Guide . You can also see this list by using the DescribeEventCategories
* operation.
*/
public java.util.List
* A list of event categories for a particular source type (SourceType
) that you want to subscribe to.
* You can see a list of the categories for a given source type in the
* "Amazon RDS event categories and event messages" section of the Amazon RDS User
* Guide or the Amazon Aurora
* User Guide . You can also see this list by using the DescribeEventCategories
operation.
*
SourceType
) that you want to
* subscribe to. You can see a list of the categories for a given source type in the
* "Amazon RDS event categories and event messages" section of the Amazon RDS
* User Guide or the Amazon
* Aurora User Guide . You can also see this list by using the DescribeEventCategories
* operation.
*/
public void setEventCategories(java.util.Collection
* A list of event categories for a particular source type (SourceType
) that you want to subscribe to.
* You can see a list of the categories for a given source type in the
* "Amazon RDS event categories and event messages" section of the Amazon RDS User
* Guide or the Amazon Aurora
* User Guide . You can also see this list by using the DescribeEventCategories
operation.
*
* NOTE: This method appends the values to the existing list (if any). Use * {@link #setEventCategories(java.util.Collection)} or {@link #withEventCategories(java.util.Collection)} if you * want to override the existing values. *
* * @param eventCategories * A list of event categories for a particular source type (SourceType
) that you want to
* subscribe to. You can see a list of the categories for a given source type in the
* "Amazon RDS event categories and event messages" section of the Amazon RDS
* User Guide or the Amazon
* Aurora User Guide . You can also see this list by using the DescribeEventCategories
* operation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateEventSubscriptionRequest withEventCategories(String... eventCategories) {
if (this.eventCategories == null) {
setEventCategories(new com.amazonaws.internal.SdkInternalList
* A list of event categories for a particular source type (SourceType
) that you want to subscribe to.
* You can see a list of the categories for a given source type in the
* "Amazon RDS event categories and event messages" section of the Amazon RDS User
* Guide or the Amazon Aurora
* User Guide . You can also see this list by using the DescribeEventCategories
operation.
*
SourceType
) that you want to
* subscribe to. You can see a list of the categories for a given source type in the
* "Amazon RDS event categories and event messages" section of the Amazon RDS
* User Guide or the Amazon
* Aurora User Guide . You can also see this list by using the DescribeEventCategories
* operation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateEventSubscriptionRequest withEventCategories(java.util.Collection* The list of identifiers of the event sources for which events are returned. If not specified, then all sources * are included in the response. An identifier must begin with a letter and must contain only ASCII letters, digits, * and hyphens. It can't end with a hyphen or contain two consecutive hyphens. *
** Constraints: *
*
* If SourceIds
are supplied, SourceType
must also be provided.
*
* If the source type is a DB instance, a DBInstanceIdentifier
value must be supplied.
*
* If the source type is a DB cluster, a DBClusterIdentifier
value must be supplied.
*
* If the source type is a DB parameter group, a DBParameterGroupName
value must be supplied.
*
* If the source type is a DB security group, a DBSecurityGroupName
value must be supplied.
*
* If the source type is a DB snapshot, a DBSnapshotIdentifier
value must be supplied.
*
* If the source type is a DB cluster snapshot, a DBClusterSnapshotIdentifier
value must be supplied.
*
* If the source type is an RDS Proxy, a DBProxyName
value must be supplied.
*
* Constraints: *
*
* If SourceIds
are supplied, SourceType
must also be provided.
*
* If the source type is a DB instance, a DBInstanceIdentifier
value must be supplied.
*
* If the source type is a DB cluster, a DBClusterIdentifier
value must be supplied.
*
* If the source type is a DB parameter group, a DBParameterGroupName
value must be supplied.
*
* If the source type is a DB security group, a DBSecurityGroupName
value must be supplied.
*
* If the source type is a DB snapshot, a DBSnapshotIdentifier
value must be supplied.
*
* If the source type is a DB cluster snapshot, a DBClusterSnapshotIdentifier
value must be
* supplied.
*
* If the source type is an RDS Proxy, a DBProxyName
value must be supplied.
*
* The list of identifiers of the event sources for which events are returned. If not specified, then all sources * are included in the response. An identifier must begin with a letter and must contain only ASCII letters, digits, * and hyphens. It can't end with a hyphen or contain two consecutive hyphens. *
** Constraints: *
*
* If SourceIds
are supplied, SourceType
must also be provided.
*
* If the source type is a DB instance, a DBInstanceIdentifier
value must be supplied.
*
* If the source type is a DB cluster, a DBClusterIdentifier
value must be supplied.
*
* If the source type is a DB parameter group, a DBParameterGroupName
value must be supplied.
*
* If the source type is a DB security group, a DBSecurityGroupName
value must be supplied.
*
* If the source type is a DB snapshot, a DBSnapshotIdentifier
value must be supplied.
*
* If the source type is a DB cluster snapshot, a DBClusterSnapshotIdentifier
value must be supplied.
*
* If the source type is an RDS Proxy, a DBProxyName
value must be supplied.
*
* Constraints: *
*
* If SourceIds
are supplied, SourceType
must also be provided.
*
* If the source type is a DB instance, a DBInstanceIdentifier
value must be supplied.
*
* If the source type is a DB cluster, a DBClusterIdentifier
value must be supplied.
*
* If the source type is a DB parameter group, a DBParameterGroupName
value must be supplied.
*
* If the source type is a DB security group, a DBSecurityGroupName
value must be supplied.
*
* If the source type is a DB snapshot, a DBSnapshotIdentifier
value must be supplied.
*
* If the source type is a DB cluster snapshot, a DBClusterSnapshotIdentifier
value must be
* supplied.
*
* If the source type is an RDS Proxy, a DBProxyName
value must be supplied.
*
* The list of identifiers of the event sources for which events are returned. If not specified, then all sources * are included in the response. An identifier must begin with a letter and must contain only ASCII letters, digits, * and hyphens. It can't end with a hyphen or contain two consecutive hyphens. *
** Constraints: *
*
* If SourceIds
are supplied, SourceType
must also be provided.
*
* If the source type is a DB instance, a DBInstanceIdentifier
value must be supplied.
*
* If the source type is a DB cluster, a DBClusterIdentifier
value must be supplied.
*
* If the source type is a DB parameter group, a DBParameterGroupName
value must be supplied.
*
* If the source type is a DB security group, a DBSecurityGroupName
value must be supplied.
*
* If the source type is a DB snapshot, a DBSnapshotIdentifier
value must be supplied.
*
* If the source type is a DB cluster snapshot, a DBClusterSnapshotIdentifier
value must be supplied.
*
* If the source type is an RDS Proxy, a DBProxyName
value must be supplied.
*
* NOTE: This method appends the values to the existing list (if any). Use * {@link #setSourceIds(java.util.Collection)} or {@link #withSourceIds(java.util.Collection)} if you want to * override the existing values. *
* * @param sourceIds * The list of identifiers of the event sources for which events are returned. If not specified, then all * sources are included in the response. An identifier must begin with a letter and must contain only ASCII * letters, digits, and hyphens. It can't end with a hyphen or contain two consecutive hyphens. ** Constraints: *
*
* If SourceIds
are supplied, SourceType
must also be provided.
*
* If the source type is a DB instance, a DBInstanceIdentifier
value must be supplied.
*
* If the source type is a DB cluster, a DBClusterIdentifier
value must be supplied.
*
* If the source type is a DB parameter group, a DBParameterGroupName
value must be supplied.
*
* If the source type is a DB security group, a DBSecurityGroupName
value must be supplied.
*
* If the source type is a DB snapshot, a DBSnapshotIdentifier
value must be supplied.
*
* If the source type is a DB cluster snapshot, a DBClusterSnapshotIdentifier
value must be
* supplied.
*
* If the source type is an RDS Proxy, a DBProxyName
value must be supplied.
*
* The list of identifiers of the event sources for which events are returned. If not specified, then all sources * are included in the response. An identifier must begin with a letter and must contain only ASCII letters, digits, * and hyphens. It can't end with a hyphen or contain two consecutive hyphens. *
** Constraints: *
*
* If SourceIds
are supplied, SourceType
must also be provided.
*
* If the source type is a DB instance, a DBInstanceIdentifier
value must be supplied.
*
* If the source type is a DB cluster, a DBClusterIdentifier
value must be supplied.
*
* If the source type is a DB parameter group, a DBParameterGroupName
value must be supplied.
*
* If the source type is a DB security group, a DBSecurityGroupName
value must be supplied.
*
* If the source type is a DB snapshot, a DBSnapshotIdentifier
value must be supplied.
*
* If the source type is a DB cluster snapshot, a DBClusterSnapshotIdentifier
value must be supplied.
*
* If the source type is an RDS Proxy, a DBProxyName
value must be supplied.
*
* Constraints: *
*
* If SourceIds
are supplied, SourceType
must also be provided.
*
* If the source type is a DB instance, a DBInstanceIdentifier
value must be supplied.
*
* If the source type is a DB cluster, a DBClusterIdentifier
value must be supplied.
*
* If the source type is a DB parameter group, a DBParameterGroupName
value must be supplied.
*
* If the source type is a DB security group, a DBSecurityGroupName
value must be supplied.
*
* If the source type is a DB snapshot, a DBSnapshotIdentifier
value must be supplied.
*
* If the source type is a DB cluster snapshot, a DBClusterSnapshotIdentifier
value must be
* supplied.
*
* If the source type is an RDS Proxy, a DBProxyName
value must be supplied.
*
* A value that indicates whether to activate the subscription. If the event notification subscription isn't * activated, the subscription is created but not active. *
* * @param enabled * A value that indicates whether to activate the subscription. If the event notification subscription isn't * activated, the subscription is created but not active. */ public void setEnabled(Boolean enabled) { this.enabled = enabled; } /** ** A value that indicates whether to activate the subscription. If the event notification subscription isn't * activated, the subscription is created but not active. *
* * @return A value that indicates whether to activate the subscription. If the event notification subscription isn't * activated, the subscription is created but not active. */ public Boolean getEnabled() { return this.enabled; } /** ** A value that indicates whether to activate the subscription. If the event notification subscription isn't * activated, the subscription is created but not active. *
* * @param enabled * A value that indicates whether to activate the subscription. If the event notification subscription isn't * activated, the subscription is created but not active. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateEventSubscriptionRequest withEnabled(Boolean enabled) { setEnabled(enabled); return this; } /** ** A value that indicates whether to activate the subscription. If the event notification subscription isn't * activated, the subscription is created but not active. *
* * @return A value that indicates whether to activate the subscription. If the event notification subscription isn't * activated, the subscription is created but not active. */ public Boolean isEnabled() { return this.enabled; } /** * @return */ public java.util.List* NOTE: This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. *
* * @param tags * @return Returns a reference to this object so that method calls can be chained together. */ public CreateEventSubscriptionRequest withTags(Tag... tags) { if (this.tags == null) { setTags(new com.amazonaws.internal.SdkInternalList