com.amazonaws.services.simpleemailv2.model.BulkEmailEntry Maven / Gradle / Ivy
/*
* Copyright 2017-2022 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.simpleemailv2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class BulkEmailEntry implements Serializable, Cloneable, StructuredPojo {
/**
*
* Represents the destination of the message, consisting of To:, CC:, and BCC: fields.
*
*
*
* Amazon SES does not support the SMTPUTF8 extension, as described in RFC6531. For this reason, the local part of a destination email
* address (the part of the email address that precedes the @ sign) may only contain 7-bit ASCII characters. If the domain part of
* an address (the part after the @ sign) contains non-ASCII characters, they must be encoded using Punycode, as
* described in RFC3492.
*
*
*/
private Destination destination;
/**
*
* A list of tags, in the form of name/value pairs, to apply to an email that you send using the
* SendBulkTemplatedEmail
operation. Tags correspond to characteristics of the email that you define,
* so that you can publish email sending events.
*
*/
private java.util.List replacementTags;
/**
*
* The ReplacementEmailContent
associated with a BulkEmailEntry
.
*
*/
private ReplacementEmailContent replacementEmailContent;
/**
*
* Represents the destination of the message, consisting of To:, CC:, and BCC: fields.
*
*
*
* Amazon SES does not support the SMTPUTF8 extension, as described in RFC6531. For this reason, the local part of a destination email
* address (the part of the email address that precedes the @ sign) may only contain 7-bit ASCII characters. If the domain part of
* an address (the part after the @ sign) contains non-ASCII characters, they must be encoded using Punycode, as
* described in RFC3492.
*
*
*
* @param destination
* Represents the destination of the message, consisting of To:, CC:, and BCC: fields.
*
* Amazon SES does not support the SMTPUTF8 extension, as described in RFC6531. For this reason, the local part of a destination
* email address (the part of the email address that precedes the @ sign) may only contain 7-bit ASCII characters. If the domain
* part of an address (the part after the @ sign) contains non-ASCII characters, they must be encoded using
* Punycode, as described in RFC3492.
*
*/
public void setDestination(Destination destination) {
this.destination = destination;
}
/**
*
* Represents the destination of the message, consisting of To:, CC:, and BCC: fields.
*
*
*
* Amazon SES does not support the SMTPUTF8 extension, as described in RFC6531. For this reason, the local part of a destination email
* address (the part of the email address that precedes the @ sign) may only contain 7-bit ASCII characters. If the domain part of
* an address (the part after the @ sign) contains non-ASCII characters, they must be encoded using Punycode, as
* described in RFC3492.
*
*
*
* @return Represents the destination of the message, consisting of To:, CC:, and BCC: fields.
*
* Amazon SES does not support the SMTPUTF8 extension, as described in RFC6531. For this reason, the local part of a destination
* email address (the part of the email address that precedes the @ sign) may only contain 7-bit ASCII characters. If the domain
* part of an address (the part after the @ sign) contains non-ASCII characters, they must be encoded using
* Punycode, as described in RFC3492.
*
*/
public Destination getDestination() {
return this.destination;
}
/**
*
* Represents the destination of the message, consisting of To:, CC:, and BCC: fields.
*
*
*
* Amazon SES does not support the SMTPUTF8 extension, as described in RFC6531. For this reason, the local part of a destination email
* address (the part of the email address that precedes the @ sign) may only contain 7-bit ASCII characters. If the domain part of
* an address (the part after the @ sign) contains non-ASCII characters, they must be encoded using Punycode, as
* described in RFC3492.
*
*
*
* @param destination
* Represents the destination of the message, consisting of To:, CC:, and BCC: fields.
*
* Amazon SES does not support the SMTPUTF8 extension, as described in RFC6531. For this reason, the local part of a destination
* email address (the part of the email address that precedes the @ sign) may only contain 7-bit ASCII characters. If the domain
* part of an address (the part after the @ sign) contains non-ASCII characters, they must be encoded using
* Punycode, as described in RFC3492.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BulkEmailEntry withDestination(Destination destination) {
setDestination(destination);
return this;
}
/**
*
* A list of tags, in the form of name/value pairs, to apply to an email that you send using the
* SendBulkTemplatedEmail
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
* SendBulkTemplatedEmail
operation. Tags correspond to characteristics of the email that you
* define, so that you can publish email sending events.
*/
public java.util.List getReplacementTags() {
return replacementTags;
}
/**
*
* A list of tags, in the form of name/value pairs, to apply to an email that you send using the
* SendBulkTemplatedEmail
operation. Tags correspond to characteristics of the email that you define,
* so that you can publish email sending events.
*
*
* @param replacementTags
* A list of tags, in the form of name/value pairs, to apply to an email that you send using the
* SendBulkTemplatedEmail
operation. Tags correspond to characteristics of the email that you
* define, so that you can publish email sending events.
*/
public void setReplacementTags(java.util.Collection replacementTags) {
if (replacementTags == null) {
this.replacementTags = null;
return;
}
this.replacementTags = new java.util.ArrayList(replacementTags);
}
/**
*
* A list of tags, in the form of name/value pairs, to apply to an email that you send using the
* SendBulkTemplatedEmail
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 #setReplacementTags(java.util.Collection)} or {@link #withReplacementTags(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param replacementTags
* A list of tags, in the form of name/value pairs, to apply to an email that you send using the
* SendBulkTemplatedEmail
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 BulkEmailEntry withReplacementTags(MessageTag... replacementTags) {
if (this.replacementTags == null) {
setReplacementTags(new java.util.ArrayList(replacementTags.length));
}
for (MessageTag ele : replacementTags) {
this.replacementTags.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
* SendBulkTemplatedEmail
operation. Tags correspond to characteristics of the email that you define,
* so that you can publish email sending events.
*
*
* @param replacementTags
* A list of tags, in the form of name/value pairs, to apply to an email that you send using the
* SendBulkTemplatedEmail
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 BulkEmailEntry withReplacementTags(java.util.Collection replacementTags) {
setReplacementTags(replacementTags);
return this;
}
/**
*
* The ReplacementEmailContent
associated with a BulkEmailEntry
.
*
*
* @param replacementEmailContent
* The ReplacementEmailContent
associated with a BulkEmailEntry
.
*/
public void setReplacementEmailContent(ReplacementEmailContent replacementEmailContent) {
this.replacementEmailContent = replacementEmailContent;
}
/**
*
* The ReplacementEmailContent
associated with a BulkEmailEntry
.
*
*
* @return The ReplacementEmailContent
associated with a BulkEmailEntry
.
*/
public ReplacementEmailContent getReplacementEmailContent() {
return this.replacementEmailContent;
}
/**
*
* The ReplacementEmailContent
associated with a BulkEmailEntry
.
*
*
* @param replacementEmailContent
* The ReplacementEmailContent
associated with a BulkEmailEntry
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BulkEmailEntry withReplacementEmailContent(ReplacementEmailContent replacementEmailContent) {
setReplacementEmailContent(replacementEmailContent);
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 (getDestination() != null)
sb.append("Destination: ").append(getDestination()).append(",");
if (getReplacementTags() != null)
sb.append("ReplacementTags: ").append(getReplacementTags()).append(",");
if (getReplacementEmailContent() != null)
sb.append("ReplacementEmailContent: ").append(getReplacementEmailContent());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof BulkEmailEntry == false)
return false;
BulkEmailEntry other = (BulkEmailEntry) obj;
if (other.getDestination() == null ^ this.getDestination() == null)
return false;
if (other.getDestination() != null && other.getDestination().equals(this.getDestination()) == false)
return false;
if (other.getReplacementTags() == null ^ this.getReplacementTags() == null)
return false;
if (other.getReplacementTags() != null && other.getReplacementTags().equals(this.getReplacementTags()) == false)
return false;
if (other.getReplacementEmailContent() == null ^ this.getReplacementEmailContent() == null)
return false;
if (other.getReplacementEmailContent() != null && other.getReplacementEmailContent().equals(this.getReplacementEmailContent()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDestination() == null) ? 0 : getDestination().hashCode());
hashCode = prime * hashCode + ((getReplacementTags() == null) ? 0 : getReplacementTags().hashCode());
hashCode = prime * hashCode + ((getReplacementEmailContent() == null) ? 0 : getReplacementEmailContent().hashCode());
return hashCode;
}
@Override
public BulkEmailEntry clone() {
try {
return (BulkEmailEntry) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.simpleemailv2.model.transform.BulkEmailEntryMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}