com.amazonaws.services.docdb.model.CreateEventSubscriptionRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-docdb Show documentation
/*
* Copyright 2019-2024 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.docdb.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* Represents the input to CreateEventSubscription.
*
*
* @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 fewer than 255 characters.
*
*/
private String subscriptionName;
/**
*
* The Amazon Resource Name (ARN) of the SNS topic created for event notification. Amazon SNS creates the ARN 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
* an instance, you would set this parameter to db-instance
. If this value is not specified, all events
* are returned.
*
*
* Valid values: db-instance
, db-cluster
, db-parameter-group
,
* db-security-group
, db-cluster-snapshot
*
*/
private String sourceType;
/**
*
* A list of event categories for a SourceType
that you want to subscribe to.
*
*/
private java.util.List eventCategories;
/**
*
* 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 provided, SourceType
must also be provided.
*
*
* -
*
* If the source type is an instance, a DBInstanceIdentifier
must be provided.
*
*
* -
*
* If the source type is a security group, a DBSecurityGroupName
must be provided.
*
*
* -
*
* If the source type is a parameter group, a DBParameterGroupName
must be provided.
*
*
* -
*
* If the source type is a snapshot, a DBSnapshotIdentifier
must be provided.
*
*
*
*/
private java.util.List sourceIds;
/**
*
* A Boolean value; set to true
to activate the subscription, set to false
to create the
* subscription but not active it.
*
*/
private Boolean enabled;
/**
*
* The tags to be assigned to the event subscription.
*
*/
private java.util.List tags;
/**
*
* The name of the subscription.
*
*
* Constraints: The name must be fewer than 255 characters.
*
*
* @param subscriptionName
* The name of the subscription.
*
* Constraints: The name must be fewer than 255 characters.
*/
public void setSubscriptionName(String subscriptionName) {
this.subscriptionName = subscriptionName;
}
/**
*
* The name of the subscription.
*
*
* Constraints: The name must be fewer than 255 characters.
*
*
* @return The name of the subscription.
*
* Constraints: The name must be fewer than 255 characters.
*/
public String getSubscriptionName() {
return this.subscriptionName;
}
/**
*
* The name of the subscription.
*
*
* Constraints: The name must be fewer than 255 characters.
*
*
* @param subscriptionName
* The name of the subscription.
*
* Constraints: The name must be fewer 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. Amazon SNS creates the ARN when
* you create a topic and subscribe to it.
*
*
* @param snsTopicArn
* The Amazon Resource Name (ARN) of the SNS topic created for event notification. Amazon SNS creates the ARN
* 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. Amazon SNS creates the ARN when
* you create a topic and subscribe to it.
*
*
* @return The Amazon Resource Name (ARN) of the SNS topic created for event notification. Amazon SNS creates the
* ARN 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. Amazon SNS creates the ARN when
* you create a topic and subscribe to it.
*
*
* @param snsTopicArn
* The Amazon Resource Name (ARN) of the SNS topic created for event notification. Amazon SNS creates the ARN
* 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
* an instance, you would set this parameter to db-instance
. If this value is not specified, all events
* are returned.
*
*
* Valid values: db-instance
, db-cluster
, db-parameter-group
,
* db-security-group
, db-cluster-snapshot
*
*
* @param sourceType
* The type of source that is generating the events. For example, if you want to be notified of events
* generated by an instance, you would set this parameter to db-instance
. If this value is not
* specified, all events are returned.
*
* Valid values: db-instance
, db-cluster
, db-parameter-group
,
* db-security-group
, db-cluster-snapshot
*/
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
* an instance, you would set this parameter to db-instance
. If this value is not specified, all events
* are returned.
*
*
* Valid values: db-instance
, db-cluster
, db-parameter-group
,
* db-security-group
, db-cluster-snapshot
*
*
* @return The type of source that is generating the events. For example, if you want to be notified of events
* generated by an instance, you would set this parameter to db-instance
. If this value is not
* specified, all events are returned.
*
* Valid values: db-instance
, db-cluster
, db-parameter-group
,
* db-security-group
, db-cluster-snapshot
*/
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
* an instance, you would set this parameter to db-instance
. If this value is not specified, all events
* are returned.
*
*
* Valid values: db-instance
, db-cluster
, db-parameter-group
,
* db-security-group
, db-cluster-snapshot
*
*
* @param sourceType
* The type of source that is generating the events. For example, if you want to be notified of events
* generated by an instance, you would set this parameter to db-instance
. If this value is not
* specified, all events are returned.
*
* Valid values: db-instance
, db-cluster
, db-parameter-group
,
* db-security-group
, db-cluster-snapshot
* @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 SourceType
that you want to subscribe to.
*
*
* @return A list of event categories for a SourceType
that you want to subscribe to.
*/
public java.util.List getEventCategories() {
return eventCategories;
}
/**
*
* A list of event categories for a SourceType
that you want to subscribe to.
*
*
* @param eventCategories
* A list of event categories for a SourceType
that you want to subscribe to.
*/
public void setEventCategories(java.util.Collection eventCategories) {
if (eventCategories == null) {
this.eventCategories = null;
return;
}
this.eventCategories = new java.util.ArrayList(eventCategories);
}
/**
*
* A list of event categories for a SourceType
that you want to subscribe to.
*
*
* 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 SourceType
that you want to subscribe to.
* @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 java.util.ArrayList(eventCategories.length));
}
for (String ele : eventCategories) {
this.eventCategories.add(ele);
}
return this;
}
/**
*
* A list of event categories for a SourceType
that you want to subscribe to.
*
*
* @param eventCategories
* A list of event categories for a SourceType
that you want to subscribe to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateEventSubscriptionRequest withEventCategories(java.util.Collection eventCategories) {
setEventCategories(eventCategories);
return this;
}
/**
*
* 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 provided, SourceType
must also be provided.
*
*
* -
*
* If the source type is an instance, a DBInstanceIdentifier
must be provided.
*
*
* -
*
* If the source type is a security group, a DBSecurityGroupName
must be provided.
*
*
* -
*
* If the source type is a parameter group, a DBParameterGroupName
must be provided.
*
*
* -
*
* If the source type is a snapshot, a DBSnapshotIdentifier
must be provided.
*
*
*
*
* @return 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 provided, SourceType
must also be provided.
*
*
* -
*
* If the source type is an instance, a DBInstanceIdentifier
must be provided.
*
*
* -
*
* If the source type is a security group, a DBSecurityGroupName
must be provided.
*
*
* -
*
* If the source type is a parameter group, a DBParameterGroupName
must be provided.
*
*
* -
*
* If the source type is a snapshot, a DBSnapshotIdentifier
must be provided.
*
*
*/
public java.util.List getSourceIds() {
return 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 provided, SourceType
must also be provided.
*
*
* -
*
* If the source type is an instance, a DBInstanceIdentifier
must be provided.
*
*
* -
*
* If the source type is a security group, a DBSecurityGroupName
must be provided.
*
*
* -
*
* If the source type is a parameter group, a DBParameterGroupName
must be provided.
*
*
* -
*
* If the source type is a snapshot, a DBSnapshotIdentifier
must be provided.
*
*
*
*
* @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 provided, SourceType
must also be provided.
*
*
* -
*
* If the source type is an instance, a DBInstanceIdentifier
must be provided.
*
*
* -
*
* If the source type is a security group, a DBSecurityGroupName
must be provided.
*
*
* -
*
* If the source type is a parameter group, a DBParameterGroupName
must be provided.
*
*
* -
*
* If the source type is a snapshot, a DBSnapshotIdentifier
must be provided.
*
*
*/
public void setSourceIds(java.util.Collection sourceIds) {
if (sourceIds == null) {
this.sourceIds = null;
return;
}
this.sourceIds = new java.util.ArrayList(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 provided, SourceType
must also be provided.
*
*
* -
*
* If the source type is an instance, a DBInstanceIdentifier
must be provided.
*
*
* -
*
* If the source type is a security group, a DBSecurityGroupName
must be provided.
*
*
* -
*
* If the source type is a parameter group, a DBParameterGroupName
must be provided.
*
*
* -
*
* If the source type is a snapshot, a DBSnapshotIdentifier
must be provided.
*
*
*
*
* 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 provided, SourceType
must also be provided.
*
*
* -
*
* If the source type is an instance, a DBInstanceIdentifier
must be provided.
*
*
* -
*
* If the source type is a security group, a DBSecurityGroupName
must be provided.
*
*
* -
*
* If the source type is a parameter group, a DBParameterGroupName
must be provided.
*
*
* -
*
* If the source type is a snapshot, a DBSnapshotIdentifier
must be provided.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateEventSubscriptionRequest withSourceIds(String... sourceIds) {
if (this.sourceIds == null) {
setSourceIds(new java.util.ArrayList(sourceIds.length));
}
for (String ele : sourceIds) {
this.sourceIds.add(ele);
}
return this;
}
/**
*
* 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 provided, SourceType
must also be provided.
*
*
* -
*
* If the source type is an instance, a DBInstanceIdentifier
must be provided.
*
*
* -
*
* If the source type is a security group, a DBSecurityGroupName
must be provided.
*
*
* -
*
* If the source type is a parameter group, a DBParameterGroupName
must be provided.
*
*
* -
*
* If the source type is a snapshot, a DBSnapshotIdentifier
must be provided.
*
*
*
*
* @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 provided, SourceType
must also be provided.
*
*
* -
*
* If the source type is an instance, a DBInstanceIdentifier
must be provided.
*
*
* -
*
* If the source type is a security group, a DBSecurityGroupName
must be provided.
*
*
* -
*
* If the source type is a parameter group, a DBParameterGroupName
must be provided.
*
*
* -
*
* If the source type is a snapshot, a DBSnapshotIdentifier
must be provided.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateEventSubscriptionRequest withSourceIds(java.util.Collection sourceIds) {
setSourceIds(sourceIds);
return this;
}
/**
*
* A Boolean value; set to true
to activate the subscription, set to false
to create the
* subscription but not active it.
*
*
* @param enabled
* A Boolean value; set to true
to activate the subscription, set to false
to
* create the subscription but not active it.
*/
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
/**
*
* A Boolean value; set to true
to activate the subscription, set to false
to create the
* subscription but not active it.
*
*
* @return A Boolean value; set to true
to activate the subscription, set to false
to
* create the subscription but not active it.
*/
public Boolean getEnabled() {
return this.enabled;
}
/**
*
* A Boolean value; set to true
to activate the subscription, set to false
to create the
* subscription but not active it.
*
*
* @param enabled
* A Boolean value; set to true
to activate the subscription, set to false
to
* create the subscription but not active it.
* @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 Boolean value; set to true
to activate the subscription, set to false
to create the
* subscription but not active it.
*
*
* @return A Boolean value; set to true
to activate the subscription, set to false
to
* create the subscription but not active it.
*/
public Boolean isEnabled() {
return this.enabled;
}
/**
*
* The tags to be assigned to the event subscription.
*
*
* @return The tags to be assigned to the event subscription.
*/
public java.util.List getTags() {
return tags;
}
/**
*
* The tags to be assigned to the event subscription.
*
*
* @param tags
* The tags to be assigned to the event subscription.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new java.util.ArrayList(tags);
}
/**
*
* The tags to be assigned to the event subscription.
*
*
* 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
* The tags to be assigned to the event subscription.
* @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 java.util.ArrayList(tags.length));
}
for (Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
*
* The tags to be assigned to the event subscription.
*
*
* @param tags
* The tags to be assigned to the event subscription.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateEventSubscriptionRequest withTags(java.util.Collection tags) {
setTags(tags);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getSubscriptionName() != null)
sb.append("SubscriptionName: ").append(getSubscriptionName()).append(",");
if (getSnsTopicArn() != null)
sb.append("SnsTopicArn: ").append(getSnsTopicArn()).append(",");
if (getSourceType() != null)
sb.append("SourceType: ").append(getSourceType()).append(",");
if (getEventCategories() != null)
sb.append("EventCategories: ").append(getEventCategories()).append(",");
if (getSourceIds() != null)
sb.append("SourceIds: ").append(getSourceIds()).append(",");
if (getEnabled() != null)
sb.append("Enabled: ").append(getEnabled()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateEventSubscriptionRequest == false)
return false;
CreateEventSubscriptionRequest other = (CreateEventSubscriptionRequest) obj;
if (other.getSubscriptionName() == null ^ this.getSubscriptionName() == null)
return false;
if (other.getSubscriptionName() != null && other.getSubscriptionName().equals(this.getSubscriptionName()) == false)
return false;
if (other.getSnsTopicArn() == null ^ this.getSnsTopicArn() == null)
return false;
if (other.getSnsTopicArn() != null && other.getSnsTopicArn().equals(this.getSnsTopicArn()) == false)
return false;
if (other.getSourceType() == null ^ this.getSourceType() == null)
return false;
if (other.getSourceType() != null && other.getSourceType().equals(this.getSourceType()) == false)
return false;
if (other.getEventCategories() == null ^ this.getEventCategories() == null)
return false;
if (other.getEventCategories() != null && other.getEventCategories().equals(this.getEventCategories()) == false)
return false;
if (other.getSourceIds() == null ^ this.getSourceIds() == null)
return false;
if (other.getSourceIds() != null && other.getSourceIds().equals(this.getSourceIds()) == false)
return false;
if (other.getEnabled() == null ^ this.getEnabled() == null)
return false;
if (other.getEnabled() != null && other.getEnabled().equals(this.getEnabled()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getSubscriptionName() == null) ? 0 : getSubscriptionName().hashCode());
hashCode = prime * hashCode + ((getSnsTopicArn() == null) ? 0 : getSnsTopicArn().hashCode());
hashCode = prime * hashCode + ((getSourceType() == null) ? 0 : getSourceType().hashCode());
hashCode = prime * hashCode + ((getEventCategories() == null) ? 0 : getEventCategories().hashCode());
hashCode = prime * hashCode + ((getSourceIds() == null) ? 0 : getSourceIds().hashCode());
hashCode = prime * hashCode + ((getEnabled() == null) ? 0 : getEnabled().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public CreateEventSubscriptionRequest clone() {
return (CreateEventSubscriptionRequest) super.clone();
}
}