/* * Copyright 2010-2020 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.simpleemail.model; import java.io.Serializable; /** *
* Contains information about the event destination that the specified email * sending events will be published to. *
** When you create or update an event destination, you must provide one, and * only one, destination. The destination can be Amazon CloudWatch, Amazon * Kinesis Firehose or Amazon Simple Notification Service (Amazon SNS). *
** Event destinations are associated with configuration sets, which enable you * to publish email sending events to Amazon CloudWatch, Amazon Kinesis * Firehose, or Amazon Simple Notification Service (Amazon SNS). For information * about using configuration sets, see the Amazon SES Developer Guide. *
*/ public class EventDestination implements Serializable { /** ** The name of the event destination. The name must: *
** This value can only contain ASCII letters (a-z, A-Z), numbers (0-9), * underscores (_), or dashes (-). *
** Contain less than 64 characters. *
*
* Sets whether Amazon SES publishes events to this destination when you
* send an email with the associated configuration set. Set to
* true
to enable publishing to this destination; set to
* false
to prevent publishing to this destination. The default
* value is false
.
*
* The type of email sending events to publish to the event destination. *
*/ private java.util.List* An object that contains the delivery stream ARN and the IAM role ARN * associated with an Amazon Kinesis Firehose event destination. *
*/ private KinesisFirehoseDestination kinesisFirehoseDestination; /** ** An object that contains the names, default values, and sources of the * dimensions associated with an Amazon CloudWatch event destination. *
*/ private CloudWatchDestination cloudWatchDestination; /** ** An object that contains the topic ARN associated with an Amazon Simple * Notification Service (Amazon SNS) event destination. *
*/ private SNSDestination sNSDestination; /** ** The name of the event destination. The name must: *
** This value can only contain ASCII letters (a-z, A-Z), numbers (0-9), * underscores (_), or dashes (-). *
** Contain less than 64 characters. *
** The name of the event destination. The name must: *
** This value can only contain ASCII letters (a-z, A-Z), numbers * (0-9), underscores (_), or dashes (-). *
** Contain less than 64 characters. *
** The name of the event destination. The name must: *
** This value can only contain ASCII letters (a-z, A-Z), numbers (0-9), * underscores (_), or dashes (-). *
** Contain less than 64 characters. *
** The name of the event destination. The name must: *
** This value can only contain ASCII letters (a-z, A-Z), numbers * (0-9), underscores (_), or dashes (-). *
** Contain less than 64 characters. *
** The name of the event destination. The name must: *
** This value can only contain ASCII letters (a-z, A-Z), numbers (0-9), * underscores (_), or dashes (-). *
** Contain less than 64 characters. *
** Returns a reference to this object so that method calls can be chained * together. * * @param name
* The name of the event destination. The name must: *
** This value can only contain ASCII letters (a-z, A-Z), numbers * (0-9), underscores (_), or dashes (-). *
** Contain less than 64 characters. *
*
* Sets whether Amazon SES publishes events to this destination when you
* send an email with the associated configuration set. Set to
* true
to enable publishing to this destination; set to
* false
to prevent publishing to this destination. The default
* value is false
.
*
* Sets whether Amazon SES publishes events to this destination when
* you send an email with the associated configuration set. Set to
* true
to enable publishing to this destination; set
* to false
to prevent publishing to this destination.
* The default value is false
.
*
* Sets whether Amazon SES publishes events to this destination when you
* send an email with the associated configuration set. Set to
* true
to enable publishing to this destination; set to
* false
to prevent publishing to this destination. The default
* value is false
.
*
* Sets whether Amazon SES publishes events to this destination when
* you send an email with the associated configuration set. Set to
* true
to enable publishing to this destination; set
* to false
to prevent publishing to this destination.
* The default value is false
.
*
* Sets whether Amazon SES publishes events to this destination when you
* send an email with the associated configuration set. Set to
* true
to enable publishing to this destination; set to
* false
to prevent publishing to this destination. The default
* value is false
.
*
* Sets whether Amazon SES publishes events to this destination
* when you send an email with the associated configuration set.
* Set to true
to enable publishing to this
* destination; set to false
to prevent publishing
* to this destination. The default value is false
.
*
* Sets whether Amazon SES publishes events to this destination when you
* send an email with the associated configuration set. Set to
* true
to enable publishing to this destination; set to
* false
to prevent publishing to this destination. The default
* value is false
.
*
* Returns a reference to this object so that method calls can be chained * together. * * @param enabled
* Sets whether Amazon SES publishes events to this destination
* when you send an email with the associated configuration set.
* Set to true
to enable publishing to this
* destination; set to false
to prevent publishing
* to this destination. The default value is false
.
*
* The type of email sending events to publish to the event destination. *
* * @return* The type of email sending events to publish to the event * destination. *
*/ public java.util.List* The type of email sending events to publish to the event destination. *
* * @param matchingEventTypes* The type of email sending events to publish to the event * destination. *
*/ public void setMatchingEventTypes(java.util.Collection* The type of email sending events to publish to the event destination. *
** Returns a reference to this object so that method calls can be chained * together. * * @param matchingEventTypes
* The type of email sending events to publish to the event * destination. *
* @return A reference to this updated object so that method calls can be * chained together. */ public EventDestination withMatchingEventTypes(String... matchingEventTypes) { if (getMatchingEventTypes() == null) { this.matchingEventTypes = new java.util.ArrayList* The type of email sending events to publish to the event destination. *
** Returns a reference to this object so that method calls can be chained * together. * * @param matchingEventTypes
* The type of email sending events to publish to the event * destination. *
* @return A reference to this updated object so that method calls can be * chained together. */ public EventDestination withMatchingEventTypes(java.util.Collection* An object that contains the delivery stream ARN and the IAM role ARN * associated with an Amazon Kinesis Firehose event destination. *
* * @return* An object that contains the delivery stream ARN and the IAM role * ARN associated with an Amazon Kinesis Firehose event destination. *
*/ public KinesisFirehoseDestination getKinesisFirehoseDestination() { return kinesisFirehoseDestination; } /** ** An object that contains the delivery stream ARN and the IAM role ARN * associated with an Amazon Kinesis Firehose event destination. *
* * @param kinesisFirehoseDestination* An object that contains the delivery stream ARN and the IAM * role ARN associated with an Amazon Kinesis Firehose event * destination. *
*/ public void setKinesisFirehoseDestination(KinesisFirehoseDestination kinesisFirehoseDestination) { this.kinesisFirehoseDestination = kinesisFirehoseDestination; } /** ** An object that contains the delivery stream ARN and the IAM role ARN * associated with an Amazon Kinesis Firehose event destination. *
** Returns a reference to this object so that method calls can be chained * together. * * @param kinesisFirehoseDestination
* An object that contains the delivery stream ARN and the IAM * role ARN associated with an Amazon Kinesis Firehose event * destination. *
* @return A reference to this updated object so that method calls can be * chained together. */ public EventDestination withKinesisFirehoseDestination( KinesisFirehoseDestination kinesisFirehoseDestination) { this.kinesisFirehoseDestination = kinesisFirehoseDestination; return this; } /** ** An object that contains the names, default values, and sources of the * dimensions associated with an Amazon CloudWatch event destination. *
* * @return* An object that contains the names, default values, and sources of * the dimensions associated with an Amazon CloudWatch event * destination. *
*/ public CloudWatchDestination getCloudWatchDestination() { return cloudWatchDestination; } /** ** An object that contains the names, default values, and sources of the * dimensions associated with an Amazon CloudWatch event destination. *
* * @param cloudWatchDestination* An object that contains the names, default values, and sources * of the dimensions associated with an Amazon CloudWatch event * destination. *
*/ public void setCloudWatchDestination(CloudWatchDestination cloudWatchDestination) { this.cloudWatchDestination = cloudWatchDestination; } /** ** An object that contains the names, default values, and sources of the * dimensions associated with an Amazon CloudWatch event destination. *
** Returns a reference to this object so that method calls can be chained * together. * * @param cloudWatchDestination
* An object that contains the names, default values, and sources * of the dimensions associated with an Amazon CloudWatch event * destination. *
* @return A reference to this updated object so that method calls can be * chained together. */ public EventDestination withCloudWatchDestination(CloudWatchDestination cloudWatchDestination) { this.cloudWatchDestination = cloudWatchDestination; return this; } /** ** An object that contains the topic ARN associated with an Amazon Simple * Notification Service (Amazon SNS) event destination. *
* * @return* An object that contains the topic ARN associated with an Amazon * Simple Notification Service (Amazon SNS) event destination. *
*/ public SNSDestination getSNSDestination() { return sNSDestination; } /** ** An object that contains the topic ARN associated with an Amazon Simple * Notification Service (Amazon SNS) event destination. *
* * @param sNSDestination* An object that contains the topic ARN associated with an * Amazon Simple Notification Service (Amazon SNS) event * destination. *
*/ public void setSNSDestination(SNSDestination sNSDestination) { this.sNSDestination = sNSDestination; } /** ** An object that contains the topic ARN associated with an Amazon Simple * Notification Service (Amazon SNS) event destination. *
** Returns a reference to this object so that method calls can be chained * together. * * @param sNSDestination
* An object that contains the topic ARN associated with an * Amazon Simple Notification Service (Amazon SNS) event * destination. *
* @return A reference to this updated object so that method calls can be * chained together. */ public EventDestination withSNSDestination(SNSDestination sNSDestination) { this.sNSDestination = sNSDestination; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getName() != null) sb.append("Name: " + getName() + ","); if (getEnabled() != null) sb.append("Enabled: " + getEnabled() + ","); if (getMatchingEventTypes() != null) sb.append("MatchingEventTypes: " + getMatchingEventTypes() + ","); if (getKinesisFirehoseDestination() != null) sb.append("KinesisFirehoseDestination: " + getKinesisFirehoseDestination() + ","); if (getCloudWatchDestination() != null) sb.append("CloudWatchDestination: " + getCloudWatchDestination() + ","); if (getSNSDestination() != null) sb.append("SNSDestination: " + getSNSDestination()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getEnabled() == null) ? 0 : getEnabled().hashCode()); hashCode = prime * hashCode + ((getMatchingEventTypes() == null) ? 0 : getMatchingEventTypes().hashCode()); hashCode = prime * hashCode + ((getKinesisFirehoseDestination() == null) ? 0 : getKinesisFirehoseDestination() .hashCode()); hashCode = prime * hashCode + ((getCloudWatchDestination() == null) ? 0 : getCloudWatchDestination().hashCode()); hashCode = prime * hashCode + ((getSNSDestination() == null) ? 0 : getSNSDestination().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof EventDestination == false) return false; EventDestination other = (EventDestination) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == 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.getMatchingEventTypes() == null ^ this.getMatchingEventTypes() == null) return false; if (other.getMatchingEventTypes() != null && other.getMatchingEventTypes().equals(this.getMatchingEventTypes()) == false) return false; if (other.getKinesisFirehoseDestination() == null ^ this.getKinesisFirehoseDestination() == null) return false; if (other.getKinesisFirehoseDestination() != null && other.getKinesisFirehoseDestination().equals( this.getKinesisFirehoseDestination()) == false) return false; if (other.getCloudWatchDestination() == null ^ this.getCloudWatchDestination() == null) return false; if (other.getCloudWatchDestination() != null && other.getCloudWatchDestination().equals(this.getCloudWatchDestination()) == false) return false; if (other.getSNSDestination() == null ^ this.getSNSDestination() == null) return false; if (other.getSNSDestination() != null && other.getSNSDestination().equals(this.getSNSDestination()) == false) return false; return true; } }