com.amazonaws.services.pinpointemail.model.SendEmailRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-pinpointemail Show documentation
/*
* Copyright 2015-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.pinpointemail.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* A request to send an email message.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class SendEmailRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The email address that you want to use as the "From" address for the email. The address that you specify has to
* be verified.
*
*/
private String fromEmailAddress;
/**
*
* An object that contains the recipients of the email message.
*
*/
private Destination destination;
/**
*
* The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to address
* receives the reply.
*
*/
private java.util.List replyToAddresses;
/**
*
* The address that Amazon Pinpoint should send bounce and complaint notifications to.
*
*/
private String feedbackForwardingEmailAddress;
/**
*
* An object that contains the body of the message. You can send either a Simple message or a Raw message.
*
*/
private EmailContent content;
/**
*
* A list of tags, in the form of name/value pairs, to apply to an email that you send using the
* SendEmail
operation. Tags correspond to characteristics of the email that you define, so that you
* can publish email sending events.
*
*/
private java.util.List emailTags;
/**
*
* The name of the configuration set that you want to use when sending the email.
*
*/
private String configurationSetName;
/**
*
* The email address that you want to use as the "From" address for the email. The address that you specify has to
* be verified.
*
*
* @param fromEmailAddress
* The email address that you want to use as the "From" address for the email. The address that you specify
* has to be verified.
*/
public void setFromEmailAddress(String fromEmailAddress) {
this.fromEmailAddress = fromEmailAddress;
}
/**
*
* The email address that you want to use as the "From" address for the email. The address that you specify has to
* be verified.
*
*
* @return The email address that you want to use as the "From" address for the email. The address that you specify
* has to be verified.
*/
public String getFromEmailAddress() {
return this.fromEmailAddress;
}
/**
*
* The email address that you want to use as the "From" address for the email. The address that you specify has to
* be verified.
*
*
* @param fromEmailAddress
* The email address that you want to use as the "From" address for the email. The address that you specify
* has to be verified.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SendEmailRequest withFromEmailAddress(String fromEmailAddress) {
setFromEmailAddress(fromEmailAddress);
return this;
}
/**
*
* An object that contains the recipients of the email message.
*
*
* @param destination
* An object that contains the recipients of the email message.
*/
public void setDestination(Destination destination) {
this.destination = destination;
}
/**
*
* An object that contains the recipients of the email message.
*
*
* @return An object that contains the recipients of the email message.
*/
public Destination getDestination() {
return this.destination;
}
/**
*
* An object that contains the recipients of the email message.
*
*
* @param destination
* An object that contains the recipients of the email message.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SendEmailRequest withDestination(Destination destination) {
setDestination(destination);
return this;
}
/**
*
* The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to address
* receives the reply.
*
*
* @return The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to
* address receives the reply.
*/
public java.util.List getReplyToAddresses() {
return replyToAddresses;
}
/**
*
* The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to address
* receives the reply.
*
*
* @param replyToAddresses
* The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to
* address receives the reply.
*/
public void setReplyToAddresses(java.util.Collection replyToAddresses) {
if (replyToAddresses == null) {
this.replyToAddresses = null;
return;
}
this.replyToAddresses = new java.util.ArrayList(replyToAddresses);
}
/**
*
* The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to address
* receives the reply.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setReplyToAddresses(java.util.Collection)} or {@link #withReplyToAddresses(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param replyToAddresses
* The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to
* address receives the reply.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SendEmailRequest withReplyToAddresses(String... replyToAddresses) {
if (this.replyToAddresses == null) {
setReplyToAddresses(new java.util.ArrayList(replyToAddresses.length));
}
for (String ele : replyToAddresses) {
this.replyToAddresses.add(ele);
}
return this;
}
/**
*
* The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to address
* receives the reply.
*
*
* @param replyToAddresses
* The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to
* address receives the reply.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SendEmailRequest withReplyToAddresses(java.util.Collection replyToAddresses) {
setReplyToAddresses(replyToAddresses);
return this;
}
/**
*
* The address that Amazon Pinpoint should send bounce and complaint notifications to.
*
*
* @param feedbackForwardingEmailAddress
* The address that Amazon Pinpoint should send bounce and complaint notifications to.
*/
public void setFeedbackForwardingEmailAddress(String feedbackForwardingEmailAddress) {
this.feedbackForwardingEmailAddress = feedbackForwardingEmailAddress;
}
/**
*
* The address that Amazon Pinpoint should send bounce and complaint notifications to.
*
*
* @return The address that Amazon Pinpoint should send bounce and complaint notifications to.
*/
public String getFeedbackForwardingEmailAddress() {
return this.feedbackForwardingEmailAddress;
}
/**
*
* The address that Amazon Pinpoint should send bounce and complaint notifications to.
*
*
* @param feedbackForwardingEmailAddress
* The address that Amazon Pinpoint should send bounce and complaint notifications to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SendEmailRequest withFeedbackForwardingEmailAddress(String feedbackForwardingEmailAddress) {
setFeedbackForwardingEmailAddress(feedbackForwardingEmailAddress);
return this;
}
/**
*
* An object that contains the body of the message. You can send either a Simple message or a Raw message.
*
*
* @param content
* An object that contains the body of the message. You can send either a Simple message or a Raw message.
*/
public void setContent(EmailContent content) {
this.content = content;
}
/**
*
* An object that contains the body of the message. You can send either a Simple message or a Raw message.
*
*
* @return An object that contains the body of the message. You can send either a Simple message or a Raw message.
*/
public EmailContent getContent() {
return this.content;
}
/**
*
* An object that contains the body of the message. You can send either a Simple message or a Raw message.
*
*
* @param content
* An object that contains the body of the message. You can send either a Simple message or a Raw message.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SendEmailRequest withContent(EmailContent content) {
setContent(content);
return this;
}
/**
*
* A list of tags, in the form of name/value pairs, to apply to an email that you send using the
* SendEmail
operation. Tags correspond to characteristics of the email that you define, so that you
* can publish email sending events.
*
*
* @return A list of tags, in the form of name/value pairs, to apply to an email that you send using the
* SendEmail
operation. Tags correspond to characteristics of the email that you define, so
* that you can publish email sending events.
*/
public java.util.List getEmailTags() {
return emailTags;
}
/**
*
* A list of tags, in the form of name/value pairs, to apply to an email that you send using the
* SendEmail
operation. Tags correspond to characteristics of the email that you define, so that you
* can publish email sending events.
*
*
* @param emailTags
* A list of tags, in the form of name/value pairs, to apply to an email that you send using the
* SendEmail
operation. Tags correspond to characteristics of the email that you define, so that
* you can publish email sending events.
*/
public void setEmailTags(java.util.Collection emailTags) {
if (emailTags == null) {
this.emailTags = null;
return;
}
this.emailTags = new java.util.ArrayList(emailTags);
}
/**
*
* A list of tags, in the form of name/value pairs, to apply to an email that you send using the
* SendEmail
operation. Tags correspond to characteristics of the email that you define, so that you
* can publish email sending events.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setEmailTags(java.util.Collection)} or {@link #withEmailTags(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param emailTags
* A list of tags, in the form of name/value pairs, to apply to an email that you send using the
* SendEmail
operation. Tags correspond to characteristics of the email that you define, so that
* you can publish email sending events.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SendEmailRequest withEmailTags(MessageTag... emailTags) {
if (this.emailTags == null) {
setEmailTags(new java.util.ArrayList(emailTags.length));
}
for (MessageTag ele : emailTags) {
this.emailTags.add(ele);
}
return this;
}
/**
*
* A list of tags, in the form of name/value pairs, to apply to an email that you send using the
* SendEmail
operation. Tags correspond to characteristics of the email that you define, so that you
* can publish email sending events.
*
*
* @param emailTags
* A list of tags, in the form of name/value pairs, to apply to an email that you send using the
* SendEmail
operation. Tags correspond to characteristics of the email that you define, so that
* you can publish email sending events.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SendEmailRequest withEmailTags(java.util.Collection emailTags) {
setEmailTags(emailTags);
return this;
}
/**
*
* The name of the configuration set that you want to use when sending the email.
*
*
* @param configurationSetName
* The name of the configuration set that you want to use when sending the email.
*/
public void setConfigurationSetName(String configurationSetName) {
this.configurationSetName = configurationSetName;
}
/**
*
* The name of the configuration set that you want to use when sending the email.
*
*
* @return The name of the configuration set that you want to use when sending the email.
*/
public String getConfigurationSetName() {
return this.configurationSetName;
}
/**
*
* The name of the configuration set that you want to use when sending the email.
*
*
* @param configurationSetName
* The name of the configuration set that you want to use when sending the email.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SendEmailRequest withConfigurationSetName(String configurationSetName) {
setConfigurationSetName(configurationSetName);
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 (getFromEmailAddress() != null)
sb.append("FromEmailAddress: ").append(getFromEmailAddress()).append(",");
if (getDestination() != null)
sb.append("Destination: ").append(getDestination()).append(",");
if (getReplyToAddresses() != null)
sb.append("ReplyToAddresses: ").append(getReplyToAddresses()).append(",");
if (getFeedbackForwardingEmailAddress() != null)
sb.append("FeedbackForwardingEmailAddress: ").append(getFeedbackForwardingEmailAddress()).append(",");
if (getContent() != null)
sb.append("Content: ").append(getContent()).append(",");
if (getEmailTags() != null)
sb.append("EmailTags: ").append(getEmailTags()).append(",");
if (getConfigurationSetName() != null)
sb.append("ConfigurationSetName: ").append(getConfigurationSetName());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof SendEmailRequest == false)
return false;
SendEmailRequest other = (SendEmailRequest) obj;
if (other.getFromEmailAddress() == null ^ this.getFromEmailAddress() == null)
return false;
if (other.getFromEmailAddress() != null && other.getFromEmailAddress().equals(this.getFromEmailAddress()) == false)
return false;
if (other.getDestination() == null ^ this.getDestination() == null)
return false;
if (other.getDestination() != null && other.getDestination().equals(this.getDestination()) == false)
return false;
if (other.getReplyToAddresses() == null ^ this.getReplyToAddresses() == null)
return false;
if (other.getReplyToAddresses() != null && other.getReplyToAddresses().equals(this.getReplyToAddresses()) == false)
return false;
if (other.getFeedbackForwardingEmailAddress() == null ^ this.getFeedbackForwardingEmailAddress() == null)
return false;
if (other.getFeedbackForwardingEmailAddress() != null
&& other.getFeedbackForwardingEmailAddress().equals(this.getFeedbackForwardingEmailAddress()) == false)
return false;
if (other.getContent() == null ^ this.getContent() == null)
return false;
if (other.getContent() != null && other.getContent().equals(this.getContent()) == false)
return false;
if (other.getEmailTags() == null ^ this.getEmailTags() == null)
return false;
if (other.getEmailTags() != null && other.getEmailTags().equals(this.getEmailTags()) == false)
return false;
if (other.getConfigurationSetName() == null ^ this.getConfigurationSetName() == null)
return false;
if (other.getConfigurationSetName() != null && other.getConfigurationSetName().equals(this.getConfigurationSetName()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getFromEmailAddress() == null) ? 0 : getFromEmailAddress().hashCode());
hashCode = prime * hashCode + ((getDestination() == null) ? 0 : getDestination().hashCode());
hashCode = prime * hashCode + ((getReplyToAddresses() == null) ? 0 : getReplyToAddresses().hashCode());
hashCode = prime * hashCode + ((getFeedbackForwardingEmailAddress() == null) ? 0 : getFeedbackForwardingEmailAddress().hashCode());
hashCode = prime * hashCode + ((getContent() == null) ? 0 : getContent().hashCode());
hashCode = prime * hashCode + ((getEmailTags() == null) ? 0 : getEmailTags().hashCode());
hashCode = prime * hashCode + ((getConfigurationSetName() == null) ? 0 : getConfigurationSetName().hashCode());
return hashCode;
}
@Override
public SendEmailRequest clone() {
return (SendEmailRequest) super.clone();
}
}