/* * 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; /** *

* An array that contains one or more Destinations, as well as the tags and * replacement data associated with each of those Destinations. *

*/ public class BulkEmailDestination implements Serializable { /** *

* 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 SendBulkTemplatedEmail. Tags correspond * to characteristics of the email that you define, so that you can publish * email sending events. *

*/ private java.util.List replacementTags = new java.util.ArrayList(); /** *

* A list of replacement values to apply to the template. This parameter is * a JSON object, typically consisting of key-value pairs in which the keys * correspond to replacement tags in the email template. *

*

* Constraints:
* Length: - 262144
*/ private String replacementTemplateData; /** *

* 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 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. *

*
*/ 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. *

*
*

* Returns a reference to this object so that method calls can be chained * together. * * @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 A reference to this updated object so that method calls can be * chained together. */ public BulkEmailDestination withDestination(Destination destination) { this.destination = destination; return this; } /** *

* A list of tags, in the form of name/value pairs, to apply to an email * that you send using SendBulkTemplatedEmail. 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 SendBulkTemplatedEmail. * 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 SendBulkTemplatedEmail. 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 * SendBulkTemplatedEmail. 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 SendBulkTemplatedEmail. Tags correspond * to characteristics of the email that you define, so that you can publish * email sending events. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param replacementTags

* A list of tags, in the form of name/value pairs, to apply to * an email that you send using * SendBulkTemplatedEmail. Tags correspond to * characteristics of the email that you define, so that you can * publish email sending events. *

* @return A reference to this updated object so that method calls can be * chained together. */ public BulkEmailDestination withReplacementTags(MessageTag... replacementTags) { if (getReplacementTags() == null) { this.replacementTags = new java.util.ArrayList(replacementTags.length); } for (MessageTag value : replacementTags) { this.replacementTags.add(value); } return this; } /** *

* A list of tags, in the form of name/value pairs, to apply to an email * that you send using SendBulkTemplatedEmail. Tags correspond * to characteristics of the email that you define, so that you can publish * email sending events. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param replacementTags

* A list of tags, in the form of name/value pairs, to apply to * an email that you send using * SendBulkTemplatedEmail. Tags correspond to * characteristics of the email that you define, so that you can * publish email sending events. *

* @return A reference to this updated object so that method calls can be * chained together. */ public BulkEmailDestination withReplacementTags(java.util.Collection replacementTags) { setReplacementTags(replacementTags); return this; } /** *

* A list of replacement values to apply to the template. This parameter is * a JSON object, typically consisting of key-value pairs in which the keys * correspond to replacement tags in the email template. *

*

* Constraints:
* Length: - 262144
* * @return

* A list of replacement values to apply to the template. This * parameter is a JSON object, typically consisting of key-value * pairs in which the keys correspond to replacement tags in the * email template. *

*/ public String getReplacementTemplateData() { return replacementTemplateData; } /** *

* A list of replacement values to apply to the template. This parameter is * a JSON object, typically consisting of key-value pairs in which the keys * correspond to replacement tags in the email template. *

*

* Constraints:
* Length: - 262144
* * @param replacementTemplateData

* A list of replacement values to apply to the template. This * parameter is a JSON object, typically consisting of key-value * pairs in which the keys correspond to replacement tags in the * email template. *

*/ public void setReplacementTemplateData(String replacementTemplateData) { this.replacementTemplateData = replacementTemplateData; } /** *

* A list of replacement values to apply to the template. This parameter is * a JSON object, typically consisting of key-value pairs in which the keys * correspond to replacement tags in the email template. *

*

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

* Constraints:
* Length: - 262144
* * @param replacementTemplateData

* A list of replacement values to apply to the template. This * parameter is a JSON object, typically consisting of key-value * pairs in which the keys correspond to replacement tags in the * email template. *

* @return A reference to this updated object so that method calls can be * chained together. */ public BulkEmailDestination withReplacementTemplateData(String replacementTemplateData) { this.replacementTemplateData = replacementTemplateData; 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 (getDestination() != null) sb.append("Destination: " + getDestination() + ","); if (getReplacementTags() != null) sb.append("ReplacementTags: " + getReplacementTags() + ","); if (getReplacementTemplateData() != null) sb.append("ReplacementTemplateData: " + getReplacementTemplateData()); sb.append("}"); return sb.toString(); } @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 + ((getReplacementTemplateData() == null) ? 0 : getReplacementTemplateData() .hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof BulkEmailDestination == false) return false; BulkEmailDestination other = (BulkEmailDestination) 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.getReplacementTemplateData() == null ^ this.getReplacementTemplateData() == null) return false; if (other.getReplacementTemplateData() != null && other.getReplacementTemplateData().equals(this.getReplacementTemplateData()) == false) return false; return true; } }