/* * 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.pinpoint.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Provides information about the content and settings for a message template that can be used in messages that are sent * through the email channel. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class EmailTemplateResponse implements Serializable, Cloneable, StructuredPojo { /** ** The Amazon Resource Name (ARN) of the message template. *
*/ private String arn; /** ** The date, in ISO 8601 format, when the message template was created. *
*/ private String creationDate; /** ** The JSON object that specifies the default values that are used for message variables in the message template. * This object is a set of key-value pairs. Each key defines a message variable in the template. The corresponding * value defines the default value for that variable. *
*/ private String defaultSubstitutions; /** ** The message body, in HTML format, that's used in email messages that are based on the message template. *
*/ private String htmlPart; /** ** The date, in ISO 8601 format, when the message template was last modified. *
*/ private String lastModifiedDate; /** ** The unique identifier for the recommender model that's used by the message template. *
*/ private String recommenderId; /** ** The subject line, or title, that's used in email messages that are based on the message template. *
*/ private String subject; /** ** A string-to-string map of key-value pairs that identifies the tags that are associated with the message template. * Each tag consists of a required tag key and an associated tag value. *
*/ private java.util.Map* The custom description of the message template. *
*/ private String templateDescription; /** ** The name of the message template. *
*/ private String templateName; /** ** The type of channel that the message template is designed for. For an email template, this value is EMAIL. *
*/ private String templateType; /** ** The message body, in plain text format, that's used in email messages that are based on the message template. *
*/ private String textPart; /** ** The unique identifier, as an integer, for the active version of the message template, or the version of the * template that you specified by using the version parameter in your request. *
*/ private String version; /** ** The Amazon Resource Name (ARN) of the message template. *
* * @param arn * The Amazon Resource Name (ARN) of the message template. */ public void setArn(String arn) { this.arn = arn; } /** ** The Amazon Resource Name (ARN) of the message template. *
* * @return The Amazon Resource Name (ARN) of the message template. */ public String getArn() { return this.arn; } /** ** The Amazon Resource Name (ARN) of the message template. *
* * @param arn * The Amazon Resource Name (ARN) of the message template. * @return Returns a reference to this object so that method calls can be chained together. */ public EmailTemplateResponse withArn(String arn) { setArn(arn); return this; } /** ** The date, in ISO 8601 format, when the message template was created. *
* * @param creationDate * The date, in ISO 8601 format, when the message template was created. */ public void setCreationDate(String creationDate) { this.creationDate = creationDate; } /** ** The date, in ISO 8601 format, when the message template was created. *
* * @return The date, in ISO 8601 format, when the message template was created. */ public String getCreationDate() { return this.creationDate; } /** ** The date, in ISO 8601 format, when the message template was created. *
* * @param creationDate * The date, in ISO 8601 format, when the message template was created. * @return Returns a reference to this object so that method calls can be chained together. */ public EmailTemplateResponse withCreationDate(String creationDate) { setCreationDate(creationDate); return this; } /** ** The JSON object that specifies the default values that are used for message variables in the message template. * This object is a set of key-value pairs. Each key defines a message variable in the template. The corresponding * value defines the default value for that variable. *
* * @param defaultSubstitutions * The JSON object that specifies the default values that are used for message variables in the message * template. This object is a set of key-value pairs. Each key defines a message variable in the template. * The corresponding value defines the default value for that variable. */ public void setDefaultSubstitutions(String defaultSubstitutions) { this.defaultSubstitutions = defaultSubstitutions; } /** ** The JSON object that specifies the default values that are used for message variables in the message template. * This object is a set of key-value pairs. Each key defines a message variable in the template. The corresponding * value defines the default value for that variable. *
* * @return The JSON object that specifies the default values that are used for message variables in the message * template. This object is a set of key-value pairs. Each key defines a message variable in the template. * The corresponding value defines the default value for that variable. */ public String getDefaultSubstitutions() { return this.defaultSubstitutions; } /** ** The JSON object that specifies the default values that are used for message variables in the message template. * This object is a set of key-value pairs. Each key defines a message variable in the template. The corresponding * value defines the default value for that variable. *
* * @param defaultSubstitutions * The JSON object that specifies the default values that are used for message variables in the message * template. This object is a set of key-value pairs. Each key defines a message variable in the template. * The corresponding value defines the default value for that variable. * @return Returns a reference to this object so that method calls can be chained together. */ public EmailTemplateResponse withDefaultSubstitutions(String defaultSubstitutions) { setDefaultSubstitutions(defaultSubstitutions); return this; } /** ** The message body, in HTML format, that's used in email messages that are based on the message template. *
* * @param htmlPart * The message body, in HTML format, that's used in email messages that are based on the message template. */ public void setHtmlPart(String htmlPart) { this.htmlPart = htmlPart; } /** ** The message body, in HTML format, that's used in email messages that are based on the message template. *
* * @return The message body, in HTML format, that's used in email messages that are based on the message template. */ public String getHtmlPart() { return this.htmlPart; } /** ** The message body, in HTML format, that's used in email messages that are based on the message template. *
* * @param htmlPart * The message body, in HTML format, that's used in email messages that are based on the message template. * @return Returns a reference to this object so that method calls can be chained together. */ public EmailTemplateResponse withHtmlPart(String htmlPart) { setHtmlPart(htmlPart); return this; } /** ** The date, in ISO 8601 format, when the message template was last modified. *
* * @param lastModifiedDate * The date, in ISO 8601 format, when the message template was last modified. */ public void setLastModifiedDate(String lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; } /** ** The date, in ISO 8601 format, when the message template was last modified. *
* * @return The date, in ISO 8601 format, when the message template was last modified. */ public String getLastModifiedDate() { return this.lastModifiedDate; } /** ** The date, in ISO 8601 format, when the message template was last modified. *
* * @param lastModifiedDate * The date, in ISO 8601 format, when the message template was last modified. * @return Returns a reference to this object so that method calls can be chained together. */ public EmailTemplateResponse withLastModifiedDate(String lastModifiedDate) { setLastModifiedDate(lastModifiedDate); return this; } /** ** The unique identifier for the recommender model that's used by the message template. *
* * @param recommenderId * The unique identifier for the recommender model that's used by the message template. */ public void setRecommenderId(String recommenderId) { this.recommenderId = recommenderId; } /** ** The unique identifier for the recommender model that's used by the message template. *
* * @return The unique identifier for the recommender model that's used by the message template. */ public String getRecommenderId() { return this.recommenderId; } /** ** The unique identifier for the recommender model that's used by the message template. *
* * @param recommenderId * The unique identifier for the recommender model that's used by the message template. * @return Returns a reference to this object so that method calls can be chained together. */ public EmailTemplateResponse withRecommenderId(String recommenderId) { setRecommenderId(recommenderId); return this; } /** ** The subject line, or title, that's used in email messages that are based on the message template. *
* * @param subject * The subject line, or title, that's used in email messages that are based on the message template. */ public void setSubject(String subject) { this.subject = subject; } /** ** The subject line, or title, that's used in email messages that are based on the message template. *
* * @return The subject line, or title, that's used in email messages that are based on the message template. */ public String getSubject() { return this.subject; } /** ** The subject line, or title, that's used in email messages that are based on the message template. *
* * @param subject * The subject line, or title, that's used in email messages that are based on the message template. * @return Returns a reference to this object so that method calls can be chained together. */ public EmailTemplateResponse withSubject(String subject) { setSubject(subject); return this; } /** ** A string-to-string map of key-value pairs that identifies the tags that are associated with the message template. * Each tag consists of a required tag key and an associated tag value. *
* * @return A string-to-string map of key-value pairs that identifies the tags that are associated with the message * template. Each tag consists of a required tag key and an associated tag value. */ public java.util.Map* A string-to-string map of key-value pairs that identifies the tags that are associated with the message template. * Each tag consists of a required tag key and an associated tag value. *
* * @param tags * A string-to-string map of key-value pairs that identifies the tags that are associated with the message * template. Each tag consists of a required tag key and an associated tag value. */ public void setTags(java.util.Map* A string-to-string map of key-value pairs that identifies the tags that are associated with the message template. * Each tag consists of a required tag key and an associated tag value. *
* * @param tags * A string-to-string map of key-value pairs that identifies the tags that are associated with the message * template. Each tag consists of a required tag key and an associated tag value. * @return Returns a reference to this object so that method calls can be chained together. */ public EmailTemplateResponse withTags(java.util.Map* The custom description of the message template. *
* * @param templateDescription * The custom description of the message template. */ public void setTemplateDescription(String templateDescription) { this.templateDescription = templateDescription; } /** ** The custom description of the message template. *
* * @return The custom description of the message template. */ public String getTemplateDescription() { return this.templateDescription; } /** ** The custom description of the message template. *
* * @param templateDescription * The custom description of the message template. * @return Returns a reference to this object so that method calls can be chained together. */ public EmailTemplateResponse withTemplateDescription(String templateDescription) { setTemplateDescription(templateDescription); return this; } /** ** The name of the message template. *
* * @param templateName * The name of the message template. */ public void setTemplateName(String templateName) { this.templateName = templateName; } /** ** The name of the message template. *
* * @return The name of the message template. */ public String getTemplateName() { return this.templateName; } /** ** The name of the message template. *
* * @param templateName * The name of the message template. * @return Returns a reference to this object so that method calls can be chained together. */ public EmailTemplateResponse withTemplateName(String templateName) { setTemplateName(templateName); return this; } /** ** The type of channel that the message template is designed for. For an email template, this value is EMAIL. *
* * @param templateType * The type of channel that the message template is designed for. For an email template, this value is EMAIL. * @see TemplateType */ public void setTemplateType(String templateType) { this.templateType = templateType; } /** ** The type of channel that the message template is designed for. For an email template, this value is EMAIL. *
* * @return The type of channel that the message template is designed for. For an email template, this value is * EMAIL. * @see TemplateType */ public String getTemplateType() { return this.templateType; } /** ** The type of channel that the message template is designed for. For an email template, this value is EMAIL. *
* * @param templateType * The type of channel that the message template is designed for. For an email template, this value is EMAIL. * @return Returns a reference to this object so that method calls can be chained together. * @see TemplateType */ public EmailTemplateResponse withTemplateType(String templateType) { setTemplateType(templateType); return this; } /** ** The type of channel that the message template is designed for. For an email template, this value is EMAIL. *
* * @param templateType * The type of channel that the message template is designed for. For an email template, this value is EMAIL. * @return Returns a reference to this object so that method calls can be chained together. * @see TemplateType */ public EmailTemplateResponse withTemplateType(TemplateType templateType) { this.templateType = templateType.toString(); return this; } /** ** The message body, in plain text format, that's used in email messages that are based on the message template. *
* * @param textPart * The message body, in plain text format, that's used in email messages that are based on the message * template. */ public void setTextPart(String textPart) { this.textPart = textPart; } /** ** The message body, in plain text format, that's used in email messages that are based on the message template. *
* * @return The message body, in plain text format, that's used in email messages that are based on the message * template. */ public String getTextPart() { return this.textPart; } /** ** The message body, in plain text format, that's used in email messages that are based on the message template. *
* * @param textPart * The message body, in plain text format, that's used in email messages that are based on the message * template. * @return Returns a reference to this object so that method calls can be chained together. */ public EmailTemplateResponse withTextPart(String textPart) { setTextPart(textPart); return this; } /** ** The unique identifier, as an integer, for the active version of the message template, or the version of the * template that you specified by using the version parameter in your request. *
* * @param version * The unique identifier, as an integer, for the active version of the message template, or the version of * the template that you specified by using the version parameter in your request. */ public void setVersion(String version) { this.version = version; } /** ** The unique identifier, as an integer, for the active version of the message template, or the version of the * template that you specified by using the version parameter in your request. *
* * @return The unique identifier, as an integer, for the active version of the message template, or the version of * the template that you specified by using the version parameter in your request. */ public String getVersion() { return this.version; } /** ** The unique identifier, as an integer, for the active version of the message template, or the version of the * template that you specified by using the version parameter in your request. *
* * @param version * The unique identifier, as an integer, for the active version of the message template, or the version of * the template that you specified by using the version parameter in your request. * @return Returns a reference to this object so that method calls can be chained together. */ public EmailTemplateResponse withVersion(String version) { setVersion(version); 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 (getArn() != null) sb.append("Arn: ").append(getArn()).append(","); if (getCreationDate() != null) sb.append("CreationDate: ").append(getCreationDate()).append(","); if (getDefaultSubstitutions() != null) sb.append("DefaultSubstitutions: ").append(getDefaultSubstitutions()).append(","); if (getHtmlPart() != null) sb.append("HtmlPart: ").append(getHtmlPart()).append(","); if (getLastModifiedDate() != null) sb.append("LastModifiedDate: ").append(getLastModifiedDate()).append(","); if (getRecommenderId() != null) sb.append("RecommenderId: ").append(getRecommenderId()).append(","); if (getSubject() != null) sb.append("Subject: ").append(getSubject()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()).append(","); if (getTemplateDescription() != null) sb.append("TemplateDescription: ").append(getTemplateDescription()).append(","); if (getTemplateName() != null) sb.append("TemplateName: ").append(getTemplateName()).append(","); if (getTemplateType() != null) sb.append("TemplateType: ").append(getTemplateType()).append(","); if (getTextPart() != null) sb.append("TextPart: ").append(getTextPart()).append(","); if (getVersion() != null) sb.append("Version: ").append(getVersion()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof EmailTemplateResponse == false) return false; EmailTemplateResponse other = (EmailTemplateResponse) obj; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getCreationDate() == null ^ this.getCreationDate() == null) return false; if (other.getCreationDate() != null && other.getCreationDate().equals(this.getCreationDate()) == false) return false; if (other.getDefaultSubstitutions() == null ^ this.getDefaultSubstitutions() == null) return false; if (other.getDefaultSubstitutions() != null && other.getDefaultSubstitutions().equals(this.getDefaultSubstitutions()) == false) return false; if (other.getHtmlPart() == null ^ this.getHtmlPart() == null) return false; if (other.getHtmlPart() != null && other.getHtmlPart().equals(this.getHtmlPart()) == false) return false; if (other.getLastModifiedDate() == null ^ this.getLastModifiedDate() == null) return false; if (other.getLastModifiedDate() != null && other.getLastModifiedDate().equals(this.getLastModifiedDate()) == false) return false; if (other.getRecommenderId() == null ^ this.getRecommenderId() == null) return false; if (other.getRecommenderId() != null && other.getRecommenderId().equals(this.getRecommenderId()) == false) return false; if (other.getSubject() == null ^ this.getSubject() == null) return false; if (other.getSubject() != null && other.getSubject().equals(this.getSubject()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getTemplateDescription() == null ^ this.getTemplateDescription() == null) return false; if (other.getTemplateDescription() != null && other.getTemplateDescription().equals(this.getTemplateDescription()) == false) return false; if (other.getTemplateName() == null ^ this.getTemplateName() == null) return false; if (other.getTemplateName() != null && other.getTemplateName().equals(this.getTemplateName()) == false) return false; if (other.getTemplateType() == null ^ this.getTemplateType() == null) return false; if (other.getTemplateType() != null && other.getTemplateType().equals(this.getTemplateType()) == false) return false; if (other.getTextPart() == null ^ this.getTextPart() == null) return false; if (other.getTextPart() != null && other.getTextPart().equals(this.getTextPart()) == false) return false; if (other.getVersion() == null ^ this.getVersion() == null) return false; if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getCreationDate() == null) ? 0 : getCreationDate().hashCode()); hashCode = prime * hashCode + ((getDefaultSubstitutions() == null) ? 0 : getDefaultSubstitutions().hashCode()); hashCode = prime * hashCode + ((getHtmlPart() == null) ? 0 : getHtmlPart().hashCode()); hashCode = prime * hashCode + ((getLastModifiedDate() == null) ? 0 : getLastModifiedDate().hashCode()); hashCode = prime * hashCode + ((getRecommenderId() == null) ? 0 : getRecommenderId().hashCode()); hashCode = prime * hashCode + ((getSubject() == null) ? 0 : getSubject().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getTemplateDescription() == null) ? 0 : getTemplateDescription().hashCode()); hashCode = prime * hashCode + ((getTemplateName() == null) ? 0 : getTemplateName().hashCode()); hashCode = prime * hashCode + ((getTemplateType() == null) ? 0 : getTemplateType().hashCode()); hashCode = prime * hashCode + ((getTextPart() == null) ? 0 : getTextPart().hashCode()); hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode()); return hashCode; } @Override public EmailTemplateResponse clone() { try { return (EmailTemplateResponse) 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.pinpoint.model.transform.EmailTemplateResponseMarshaller.getInstance().marshall(this, protocolMarshaller); } }