Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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.redshift.model;
 
 
Container for the parameters to the ModifyEventSubscription operation.

Modifies an existing Amazon Redshift event notification subscription.

 
 public class ModifyEventSubscriptionRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The name of the modified Amazon Redshift event notification subscription.
 
     private String subscriptionName;

    
The Amazon Resource Name (ARN) of the SNS topic to be used by the event notification subscription.
 
     private String snsTopicArn;

    
The type of source that will be generating the events. For example, if you want to be notified of events generated by a cluster, you would set this parameter to cluster. If this value is not specified, events are returned for all Amazon Redshift objects in your AWS account. You must specify a source type in order to specify source IDs.

Valid values: cluster, cluster-parameter-group, cluster-security-group, and cluster-snapshot.

 
     private String sourceType;

    
A list of one or more identifiers of Amazon Redshift source objects. All of the objects must be of the same type as was specified in the source type parameter. The event subscription will return only events generated by the specified objects. If not specified, then events are returned for all objects within the source type specified.

Example: my-cluster-1, my-cluster-2

Example: my-snapshot-20131010

 
Specifies the Amazon Redshift event categories to be published by the event notification subscription.

Values: Configuration, Management, Monitoring, Security

 
Specifies the Amazon Redshift event severity to be published by the event notification subscription.

Values: ERROR, INFO

 
     private String severity;

    
A Boolean value indicating if the subscription is enabled. true indicates the subscription is enabled
 
     private Boolean enabled;

    
The name of the modified Amazon Redshift event notification subscription.

Returns:
The name of the modified Amazon Redshift event notification subscription.
 
     public String getSubscriptionName() {
         return ;
     }
    
    
The name of the modified Amazon Redshift event notification subscription.

Parameters:
subscriptionName The name of the modified Amazon Redshift event notification subscription.
    public void setSubscriptionName(String subscriptionName) {
        this. = subscriptionName;
    }
    
    
The name of the modified Amazon Redshift event notification subscription.

Returns a reference to this object so that method calls can be chained together.

Parameters:
subscriptionName The name of the modified Amazon Redshift event notification subscription.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ModifyEventSubscriptionRequest withSubscriptionName(String subscriptionName) {
        this. = subscriptionName;
        return this;
    }

    
The Amazon Resource Name (ARN) of the SNS topic to be used by the event notification subscription.

Returns:
The Amazon Resource Name (ARN) of the SNS topic to be used by the event notification subscription.
    public String getSnsTopicArn() {
        return ;
    }
    
    
The Amazon Resource Name (ARN) of the SNS topic to be used by the event notification subscription.

Parameters:
snsTopicArn The Amazon Resource Name (ARN) of the SNS topic to be used by the event notification subscription.
    public void setSnsTopicArn(String snsTopicArn) {
        this. = snsTopicArn;
    }
    
    
The Amazon Resource Name (ARN) of the SNS topic to be used by the event notification subscription.

Returns a reference to this object so that method calls can be chained together.

Parameters:
snsTopicArn The Amazon Resource Name (ARN) of the SNS topic to be used by the event notification subscription.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ModifyEventSubscriptionRequest withSnsTopicArn(String snsTopicArn) {
        this. = snsTopicArn;
        return this;
    }

    
The type of source that will be generating the events. For example, if you want to be notified of events generated by a cluster, you would set this parameter to cluster. If this value is not specified, events are returned for all Amazon Redshift objects in your AWS account. You must specify a source type in order to specify source IDs.

Valid values: cluster, cluster-parameter-group, cluster-security-group, and cluster-snapshot.

Returns:
The type of source that will be generating the events. For example, if you want to be notified of events generated by a cluster, you would set this parameter to cluster. If this value is not specified, events are returned for all Amazon Redshift objects in your AWS account. You must specify a source type in order to specify source IDs.

Valid values: cluster, cluster-parameter-group, cluster-security-group, and cluster-snapshot.

    public String getSourceType() {
        return ;
    }
    
    
The type of source that will be generating the events. For example, if you want to be notified of events generated by a cluster, you would set this parameter to cluster. If this value is not specified, events are returned for all Amazon Redshift objects in your AWS account. You must specify a source type in order to specify source IDs.

Valid values: cluster, cluster-parameter-group, cluster-security-group, and cluster-snapshot.

Parameters:
sourceType The type of source that will be generating the events. For example, if you want to be notified of events generated by a cluster, you would set this parameter to cluster. If this value is not specified, events are returned for all Amazon Redshift objects in your AWS account. You must specify a source type in order to specify source IDs.

Valid values: cluster, cluster-parameter-group, cluster-security-group, and cluster-snapshot.

    public void setSourceType(String sourceType) {
        this. = sourceType;
    }
    
    
The type of source that will be generating the events. For example, if you want to be notified of events generated by a cluster, you would set this parameter to cluster. If this value is not specified, events are returned for all Amazon Redshift objects in your AWS account. You must specify a source type in order to specify source IDs.

Valid values: cluster, cluster-parameter-group, cluster-security-group, and cluster-snapshot.

Returns a reference to this object so that method calls can be chained together.

Parameters:
sourceType The type of source that will be generating the events. For example, if you want to be notified of events generated by a cluster, you would set this parameter to cluster. If this value is not specified, events are returned for all Amazon Redshift objects in your AWS account. You must specify a source type in order to specify source IDs.

Valid values: cluster, cluster-parameter-group, cluster-security-group, and cluster-snapshot.

Returns:
A reference to this updated object so that method calls can be chained together.
        this. = sourceType;
        return this;
    }

    
A list of one or more identifiers of Amazon Redshift source objects. All of the objects must be of the same type as was specified in the source type parameter. The event subscription will return only events generated by the specified objects. If not specified, then events are returned for all objects within the source type specified.

Example: my-cluster-1, my-cluster-2

Example: my-snapshot-20131010

Returns:
A list of one or more identifiers of Amazon Redshift source objects. All of the objects must be of the same type as was specified in the source type parameter. The event subscription will return only events generated by the specified objects. If not specified, then events are returned for all objects within the source type specified.

Example: my-cluster-1, my-cluster-2

Example: my-snapshot-20131010

    public java.util.List<StringgetSourceIds() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of one or more identifiers of Amazon Redshift source objects. All of the objects must be of the same type as was specified in the source type parameter. The event subscription will return only events generated by the specified objects. If not specified, then events are returned for all objects within the source type specified.

Example: my-cluster-1, my-cluster-2

Example: my-snapshot-20131010

Parameters:
sourceIds A list of one or more identifiers of Amazon Redshift source objects. All of the objects must be of the same type as was specified in the source type parameter. The event subscription will return only events generated by the specified objects. If not specified, then events are returned for all objects within the source type specified.

Example: my-cluster-1, my-cluster-2

Example: my-snapshot-20131010

    public void setSourceIds(java.util.Collection<StringsourceIds) {
        if (sourceIds == null) {
            this. = null;
            return;
        }
        sourceIdsCopy.addAll(sourceIds);
        this. = sourceIdsCopy;
    }
    
    
A list of one or more identifiers of Amazon Redshift source objects. All of the objects must be of the same type as was specified in the source type parameter. The event subscription will return only events generated by the specified objects. If not specified, then events are returned for all objects within the source type specified.

Example: my-cluster-1, my-cluster-2

Example: my-snapshot-20131010

NOTE: This method appends the values to the existing list (if any). Use setSourceIds(java.util.Collection) or withSourceIds(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
sourceIds A list of one or more identifiers of Amazon Redshift source objects. All of the objects must be of the same type as was specified in the source type parameter. The event subscription will return only events generated by the specified objects. If not specified, then events are returned for all objects within the source type specified.

Example: my-cluster-1, my-cluster-2

Example: my-snapshot-20131010

Returns:
A reference to this updated object so that method calls can be chained together.
    public ModifyEventSubscriptionRequest withSourceIds(String... sourceIds) {
        if (getSourceIds() == nullsetSourceIds(new java.util.ArrayList<String>(sourceIds.length));
        for (String value : sourceIds) {
            getSourceIds().add(value);
        }
        return this;
    }
    
    
A list of one or more identifiers of Amazon Redshift source objects. All of the objects must be of the same type as was specified in the source type parameter. The event subscription will return only events generated by the specified objects. If not specified, then events are returned for all objects within the source type specified.

Example: my-cluster-1, my-cluster-2

Example: my-snapshot-20131010

Returns a reference to this object so that method calls can be chained together.

Parameters:
sourceIds A list of one or more identifiers of Amazon Redshift source objects. All of the objects must be of the same type as was specified in the source type parameter. The event subscription will return only events generated by the specified objects. If not specified, then events are returned for all objects within the source type specified.

Example: my-cluster-1, my-cluster-2

Example: my-snapshot-20131010

Returns:
A reference to this updated object so that method calls can be chained together.
        if (sourceIds == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringsourceIdsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(sourceIds.size());
            sourceIdsCopy.addAll(sourceIds);
            this. = sourceIdsCopy;
        }
        return this;
    }

    
Specifies the Amazon Redshift event categories to be published by the event notification subscription.

Values: Configuration, Management, Monitoring, Security

Returns:
Specifies the Amazon Redshift event categories to be published by the event notification subscription.

Values: Configuration, Management, Monitoring, Security

    public java.util.List<StringgetEventCategories() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Specifies the Amazon Redshift event categories to be published by the event notification subscription.

Values: Configuration, Management, Monitoring, Security

Parameters:
eventCategories Specifies the Amazon Redshift event categories to be published by the event notification subscription.

Values: Configuration, Management, Monitoring, Security

    public void setEventCategories(java.util.Collection<StringeventCategories) {
        if (eventCategories == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringeventCategoriesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(eventCategories.size());
        eventCategoriesCopy.addAll(eventCategories);
        this. = eventCategoriesCopy;
    }
    
    
Specifies the Amazon Redshift event categories to be published by the event notification subscription.

Values: Configuration, Management, Monitoring, Security

NOTE: This method appends the values to the existing list (if any). Use setEventCategories(java.util.Collection) or withEventCategories(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
eventCategories Specifies the Amazon Redshift event categories to be published by the event notification subscription.

Values: Configuration, Management, Monitoring, Security

Returns:
A reference to this updated object so that method calls can be chained together.
    public ModifyEventSubscriptionRequest withEventCategories(String... eventCategories) {
        if (getEventCategories() == nullsetEventCategories(new java.util.ArrayList<String>(eventCategories.length));
        for (String value : eventCategories) {
            getEventCategories().add(value);
        }
        return this;
    }
    
    
Specifies the Amazon Redshift event categories to be published by the event notification subscription.

Values: Configuration, Management, Monitoring, Security

Returns a reference to this object so that method calls can be chained together.

Parameters:
eventCategories Specifies the Amazon Redshift event categories to be published by the event notification subscription.

Values: Configuration, Management, Monitoring, Security

Returns:
A reference to this updated object so that method calls can be chained together.
        if (eventCategories == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringeventCategoriesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(eventCategories.size());
            eventCategoriesCopy.addAll(eventCategories);
            this. = eventCategoriesCopy;
        }
        return this;
    }

    
Specifies the Amazon Redshift event severity to be published by the event notification subscription.

Values: ERROR, INFO

Returns:
Specifies the Amazon Redshift event severity to be published by the event notification subscription.

Values: ERROR, INFO

    public String getSeverity() {
        return ;
    }
    
    
Specifies the Amazon Redshift event severity to be published by the event notification subscription.

Values: ERROR, INFO

Parameters:
severity Specifies the Amazon Redshift event severity to be published by the event notification subscription.

Values: ERROR, INFO

    public void setSeverity(String severity) {
        this. = severity;
    }
    
    
Specifies the Amazon Redshift event severity to be published by the event notification subscription.

Values: ERROR, INFO

Returns a reference to this object so that method calls can be chained together.

Parameters:
severity Specifies the Amazon Redshift event severity to be published by the event notification subscription.

Values: ERROR, INFO

Returns:
A reference to this updated object so that method calls can be chained together.
        this. = severity;
        return this;
    }

    
A Boolean value indicating if the subscription is enabled. true indicates the subscription is enabled

Returns:
A Boolean value indicating if the subscription is enabled. true indicates the subscription is enabled
    public Boolean isEnabled() {
        return ;
    }
    
    
A Boolean value indicating if the subscription is enabled. true indicates the subscription is enabled

Parameters:
enabled A Boolean value indicating if the subscription is enabled. true indicates the subscription is enabled
    public void setEnabled(Boolean enabled) {
        this. = enabled;
    }
    
    
A Boolean value indicating if the subscription is enabled. true indicates the subscription is enabled

Returns a reference to this object so that method calls can be chained together.

Parameters:
enabled A Boolean value indicating if the subscription is enabled. true indicates the subscription is enabled
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = enabled;
        return this;
    }

    
A Boolean value indicating if the subscription is enabled. true indicates the subscription is enabled

Returns:
A Boolean value indicating if the subscription is enabled. true indicates the subscription is enabled
    public Boolean getEnabled() {
        return ;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getSubscriptionName() != nullsb.append("SubscriptionName: " + getSubscriptionName() + ",");
        if (getSnsTopicArn() != nullsb.append("SnsTopicArn: " + getSnsTopicArn() + ",");
        if (getSourceType() != nullsb.append("SourceType: " + getSourceType() + ",");
        if (getSourceIds() != nullsb.append("SourceIds: " + getSourceIds() + ",");
        if (getEventCategories() != nullsb.append("EventCategories: " + getEventCategories() + ",");
        if (getSeverity() != nullsb.append("Severity: " + getSeverity() + ",");
        if (isEnabled() != nullsb.append("Enabled: " + isEnabled() );
        sb.append("}");
        return sb.toString();
    }
    
    @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 + ((getSourceIds() == null) ? 0 : getSourceIds().hashCode()); 
        hashCode = prime * hashCode + ((getEventCategories() == null) ? 0 : getEventCategories().hashCode()); 
        hashCode = prime * hashCode + ((getSeverity() == null) ? 0 : getSeverity().hashCode()); 
        hashCode = prime * hashCode + ((isEnabled() == null) ? 0 : isEnabled().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof ModifyEventSubscriptionRequest == falsereturn false;
        
        if (other.getSubscriptionName() == null ^ this.getSubscriptionName() == nullreturn false;
        if (other.getSubscriptionName() != null && other.getSubscriptionName().equals(this.getSubscriptionName()) == falsereturn false
        if (other.getSnsTopicArn() == null ^ this.getSnsTopicArn() == nullreturn false;
        if (other.getSnsTopicArn() != null && other.getSnsTopicArn().equals(this.getSnsTopicArn()) == falsereturn false
        if (other.getSourceType() == null ^ this.getSourceType() == nullreturn false;
        if (other.getSourceType() != null && other.getSourceType().equals(this.getSourceType()) == falsereturn false
        if (other.getSourceIds() == null ^ this.getSourceIds() == nullreturn false;
        if (other.getSourceIds() != null && other.getSourceIds().equals(this.getSourceIds()) == falsereturn false
        if (other.getEventCategories() == null ^ this.getEventCategories() == nullreturn false;
        if (other.getEventCategories() != null && other.getEventCategories().equals(this.getEventCategories()) == falsereturn false
        if (other.getSeverity() == null ^ this.getSeverity() == nullreturn false;
        if (other.getSeverity() != null && other.getSeverity().equals(this.getSeverity()) == falsereturn false
        if (other.isEnabled() == null ^ this.isEnabled() == nullreturn false;
        if (other.isEnabled() != null && other.isEnabled().equals(this.isEnabled()) == falsereturn false
        return true;
    }
    
    @Override
        
            return (ModifyEventSubscriptionRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X