/* * 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.databasemigrationservice.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 ModifyEventSubscriptionRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** ** The name of the DMS event notification subscription to be modified. *
*/ private String subscriptionName; /** ** 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. *
*/ private String snsTopicArn; /** ** The type of DMS resource that generates the events you want to subscribe to. *
** Valid values: replication-instance | replication-task *
*/ private String sourceType; /** *
* A list of event categories for a source type that you want to subscribe to. Use the
* DescribeEventCategories
action to see a list of event categories.
*
* A Boolean value; set to true to activate the subscription. *
*/ private Boolean enabled; /** ** The name of the DMS event notification subscription to be modified. *
* * @param subscriptionName * The name of the DMS event notification subscription to be modified. */ public void setSubscriptionName(String subscriptionName) { this.subscriptionName = subscriptionName; } /** ** The name of the DMS event notification subscription to be modified. *
* * @return The name of the DMS event notification subscription to be modified. */ public String getSubscriptionName() { return this.subscriptionName; } /** ** The name of the DMS event notification subscription to be modified. *
* * @param subscriptionName * The name of the DMS event notification subscription to be modified. * @return Returns a reference to this object so that method calls can be chained together. */ public ModifyEventSubscriptionRequest withSubscriptionName(String subscriptionName) { setSubscriptionName(subscriptionName); return this; } /** ** 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. *
* * @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 void setSnsTopicArn(String snsTopicArn) { this.snsTopicArn = 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. *
* * @return 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 String getSnsTopicArn() { return this.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. *
* * @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. * @return Returns a reference to this object so that method calls can be chained together. */ public ModifyEventSubscriptionRequest withSnsTopicArn(String snsTopicArn) { setSnsTopicArn(snsTopicArn); return this; } /** ** The type of DMS resource that generates the events you want to subscribe to. *
** Valid values: replication-instance | replication-task *
* * @param sourceType * The type of DMS resource that generates the events you want to subscribe to. ** Valid values: replication-instance | replication-task */ public void setSourceType(String sourceType) { this.sourceType = sourceType; } /** *
* The type of DMS resource that generates the events you want to subscribe to. *
** Valid values: replication-instance | replication-task *
* * @return The type of DMS resource that generates the events you want to subscribe to. ** Valid values: replication-instance | replication-task */ public String getSourceType() { return this.sourceType; } /** *
* The type of DMS resource that generates the events you want to subscribe to. *
** Valid values: replication-instance | replication-task *
* * @param sourceType * The type of DMS resource that generates the events you want to subscribe to. ** Valid values: replication-instance | replication-task * @return Returns a reference to this object so that method calls can be chained together. */ public ModifyEventSubscriptionRequest withSourceType(String sourceType) { setSourceType(sourceType); return this; } /** *
* A list of event categories for a source type that you want to subscribe to. Use the
* DescribeEventCategories
action to see a list of event categories.
*
DescribeEventCategories
action to see a list of event categories.
*/
public java.util.List
* A list of event categories for a source type that you want to subscribe to. Use the
* DescribeEventCategories
action to see a list of event categories.
*
DescribeEventCategories
action to see a list of event categories.
*/
public void setEventCategories(java.util.Collection
* A list of event categories for a source type that you want to subscribe to. Use the
* DescribeEventCategories
action to see a list of event categories.
*
* 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 source type that you want to subscribe to. Use the *DescribeEventCategories
action to see a list of event categories.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ModifyEventSubscriptionRequest withEventCategories(String... eventCategories) {
if (this.eventCategories == null) {
setEventCategories(new java.util.ArrayList
* A list of event categories for a source type that you want to subscribe to. Use the
* DescribeEventCategories
action to see a list of event categories.
*
DescribeEventCategories
action to see a list of event categories.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ModifyEventSubscriptionRequest withEventCategories(java.util.Collection* A Boolean value; set to true to activate the subscription. *
* * @param enabled * A Boolean value; set to true to activate the subscription. */ public void setEnabled(Boolean enabled) { this.enabled = enabled; } /** ** A Boolean value; set to true to activate the subscription. *
* * @return A Boolean value; set to true to activate the subscription. */ public Boolean getEnabled() { return this.enabled; } /** ** A Boolean value; set to true to activate the subscription. *
* * @param enabled * A Boolean value; set to true to activate the subscription. * @return Returns a reference to this object so that method calls can be chained together. */ public ModifyEventSubscriptionRequest withEnabled(Boolean enabled) { setEnabled(enabled); return this; } /** ** A Boolean value; set to true to activate the subscription. *
* * @return A Boolean value; set to true to activate the subscription. */ public Boolean isEnabled() { return this.enabled; } /** * 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 (getEnabled() != null) sb.append("Enabled: ").append(getEnabled()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ModifyEventSubscriptionRequest == false) return false; ModifyEventSubscriptionRequest other = (ModifyEventSubscriptionRequest) 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.getEnabled() == null ^ this.getEnabled() == null) return false; if (other.getEnabled() != null && other.getEnabled().equals(this.getEnabled()) == 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 + ((getEnabled() == null) ? 0 : getEnabled().hashCode()); return hashCode; } @Override public ModifyEventSubscriptionRequest clone() { return (ModifyEventSubscriptionRequest) super.clone(); } }