/* * 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.simpleemail.model; import java.io.Serializable; import javax.annotation.Generated; /** *
* 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. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class EventDestination implements Serializable, Cloneable { /** ** 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 com.amazonaws.internal.SdkInternalList* 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. *
** 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. *
** 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. *
** 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
.
*
true
to enable publishing to this destination; set to
* false
to prevent publishing to this destination. The default value is false
.
*/
public void setEnabled(Boolean enabled) {
this.enabled = 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
.
*
true
to enable publishing to this destination; set to
* false
to prevent publishing to this destination. The default value is false
.
*/
public Boolean getEnabled() {
return this.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
.
*
true
to enable publishing to this destination; set to
* false
to prevent publishing to this destination. The default value is false
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EventDestination withEnabled(Boolean enabled) {
setEnabled(enabled);
return this;
}
/**
*
* 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
.
*
true
to enable publishing to this destination; set to
* false
to prevent publishing to this destination. The default value is false
.
*/
public Boolean isEnabled() {
return this.enabled;
}
/**
* * 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. * @see EventType */ 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. * @see EventType */ public void setMatchingEventTypes(java.util.Collection* The type of email sending events to publish to the event destination. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setMatchingEventTypes(java.util.Collection)} or {@link #withMatchingEventTypes(java.util.Collection)} if * you want to override the existing values. *
* * @param matchingEventTypes * The type of email sending events to publish to the event destination. * @return Returns a reference to this object so that method calls can be chained together. * @see EventType */ public EventDestination withMatchingEventTypes(String... matchingEventTypes) { if (this.matchingEventTypes == null) { setMatchingEventTypes(new com.amazonaws.internal.SdkInternalList* 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. * @return Returns a reference to this object so that method calls can be chained together. * @see EventType */ public EventDestination withMatchingEventTypes(java.util.Collection* 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. * @return Returns a reference to this object so that method calls can be chained together. * @see EventType */ public EventDestination withMatchingEventTypes(EventType... matchingEventTypes) { com.amazonaws.internal.SdkInternalList* 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. *
* * @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 this.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. * @return Returns a reference to this object so that method calls can be chained together. */ public EventDestination withKinesisFirehoseDestination(KinesisFirehoseDestination kinesisFirehoseDestination) { setKinesisFirehoseDestination(kinesisFirehoseDestination); return this; } /** ** 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. *
* * @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 this.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. * @return Returns a reference to this object so that method calls can be chained together. */ public EventDestination withCloudWatchDestination(CloudWatchDestination cloudWatchDestination) { setCloudWatchDestination(cloudWatchDestination); return this; } /** ** 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. *
* * @return An object that contains the topic ARN associated with an Amazon Simple Notification Service (Amazon SNS) * event destination. */ public SNSDestination getSNSDestination() { return this.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. * @return Returns a reference to this object so that method calls can be chained together. */ public EventDestination withSNSDestination(SNSDestination sNSDestination) { setSNSDestination(sNSDestination); 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 (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getEnabled() != null) sb.append("Enabled: ").append(getEnabled()).append(","); if (getMatchingEventTypes() != null) sb.append("MatchingEventTypes: ").append(getMatchingEventTypes()).append(","); if (getKinesisFirehoseDestination() != null) sb.append("KinesisFirehoseDestination: ").append(getKinesisFirehoseDestination()).append(","); if (getCloudWatchDestination() != null) sb.append("CloudWatchDestination: ").append(getCloudWatchDestination()).append(","); if (getSNSDestination() != null) sb.append("SNSDestination: ").append(getSNSDestination()); sb.append("}"); return sb.toString(); } @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; } @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 EventDestination clone() { try { return (EventDestination) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }