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

* Specifies the message template to use for the message, for each type of channel. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class TemplateConfiguration implements Serializable, Cloneable, StructuredPojo { /** *

* The email template to use for the message. *

*/ private Template emailTemplate; /** *

* The push notification template to use for the message. *

*/ private Template pushTemplate; /** *

* The SMS template to use for the message. *

*/ private Template sMSTemplate; /** *

* The voice template to use for the message. This object isn't supported for campaigns. *

*/ private Template voiceTemplate; /** *

* The InApp template to use for the message. The InApp template object is not supported for SendMessages. *

*/ private Template inAppTemplate; /** *

* The email template to use for the message. *

* * @param emailTemplate * The email template to use for the message. */ public void setEmailTemplate(Template emailTemplate) { this.emailTemplate = emailTemplate; } /** *

* The email template to use for the message. *

* * @return The email template to use for the message. */ public Template getEmailTemplate() { return this.emailTemplate; } /** *

* The email template to use for the message. *

* * @param emailTemplate * The email template to use for the message. * @return Returns a reference to this object so that method calls can be chained together. */ public TemplateConfiguration withEmailTemplate(Template emailTemplate) { setEmailTemplate(emailTemplate); return this; } /** *

* The push notification template to use for the message. *

* * @param pushTemplate * The push notification template to use for the message. */ public void setPushTemplate(Template pushTemplate) { this.pushTemplate = pushTemplate; } /** *

* The push notification template to use for the message. *

* * @return The push notification template to use for the message. */ public Template getPushTemplate() { return this.pushTemplate; } /** *

* The push notification template to use for the message. *

* * @param pushTemplate * The push notification template to use for the message. * @return Returns a reference to this object so that method calls can be chained together. */ public TemplateConfiguration withPushTemplate(Template pushTemplate) { setPushTemplate(pushTemplate); return this; } /** *

* The SMS template to use for the message. *

* * @param sMSTemplate * The SMS template to use for the message. */ public void setSMSTemplate(Template sMSTemplate) { this.sMSTemplate = sMSTemplate; } /** *

* The SMS template to use for the message. *

* * @return The SMS template to use for the message. */ public Template getSMSTemplate() { return this.sMSTemplate; } /** *

* The SMS template to use for the message. *

* * @param sMSTemplate * The SMS template to use for the message. * @return Returns a reference to this object so that method calls can be chained together. */ public TemplateConfiguration withSMSTemplate(Template sMSTemplate) { setSMSTemplate(sMSTemplate); return this; } /** *

* The voice template to use for the message. This object isn't supported for campaigns. *

* * @param voiceTemplate * The voice template to use for the message. This object isn't supported for campaigns. */ public void setVoiceTemplate(Template voiceTemplate) { this.voiceTemplate = voiceTemplate; } /** *

* The voice template to use for the message. This object isn't supported for campaigns. *

* * @return The voice template to use for the message. This object isn't supported for campaigns. */ public Template getVoiceTemplate() { return this.voiceTemplate; } /** *

* The voice template to use for the message. This object isn't supported for campaigns. *

* * @param voiceTemplate * The voice template to use for the message. This object isn't supported for campaigns. * @return Returns a reference to this object so that method calls can be chained together. */ public TemplateConfiguration withVoiceTemplate(Template voiceTemplate) { setVoiceTemplate(voiceTemplate); return this; } /** *

* The InApp template to use for the message. The InApp template object is not supported for SendMessages. *

* * @param inAppTemplate * The InApp template to use for the message. The InApp template object is not supported for SendMessages. */ public void setInAppTemplate(Template inAppTemplate) { this.inAppTemplate = inAppTemplate; } /** *

* The InApp template to use for the message. The InApp template object is not supported for SendMessages. *

* * @return The InApp template to use for the message. The InApp template object is not supported for SendMessages. */ public Template getInAppTemplate() { return this.inAppTemplate; } /** *

* The InApp template to use for the message. The InApp template object is not supported for SendMessages. *

* * @param inAppTemplate * The InApp template to use for the message. The InApp template object is not supported for SendMessages. * @return Returns a reference to this object so that method calls can be chained together. */ public TemplateConfiguration withInAppTemplate(Template inAppTemplate) { setInAppTemplate(inAppTemplate); 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 (getEmailTemplate() != null) sb.append("EmailTemplate: ").append(getEmailTemplate()).append(","); if (getPushTemplate() != null) sb.append("PushTemplate: ").append(getPushTemplate()).append(","); if (getSMSTemplate() != null) sb.append("SMSTemplate: ").append(getSMSTemplate()).append(","); if (getVoiceTemplate() != null) sb.append("VoiceTemplate: ").append(getVoiceTemplate()).append(","); if (getInAppTemplate() != null) sb.append("InAppTemplate: ").append(getInAppTemplate()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof TemplateConfiguration == false) return false; TemplateConfiguration other = (TemplateConfiguration) obj; if (other.getEmailTemplate() == null ^ this.getEmailTemplate() == null) return false; if (other.getEmailTemplate() != null && other.getEmailTemplate().equals(this.getEmailTemplate()) == false) return false; if (other.getPushTemplate() == null ^ this.getPushTemplate() == null) return false; if (other.getPushTemplate() != null && other.getPushTemplate().equals(this.getPushTemplate()) == false) return false; if (other.getSMSTemplate() == null ^ this.getSMSTemplate() == null) return false; if (other.getSMSTemplate() != null && other.getSMSTemplate().equals(this.getSMSTemplate()) == false) return false; if (other.getVoiceTemplate() == null ^ this.getVoiceTemplate() == null) return false; if (other.getVoiceTemplate() != null && other.getVoiceTemplate().equals(this.getVoiceTemplate()) == false) return false; if (other.getInAppTemplate() == null ^ this.getInAppTemplate() == null) return false; if (other.getInAppTemplate() != null && other.getInAppTemplate().equals(this.getInAppTemplate()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getEmailTemplate() == null) ? 0 : getEmailTemplate().hashCode()); hashCode = prime * hashCode + ((getPushTemplate() == null) ? 0 : getPushTemplate().hashCode()); hashCode = prime * hashCode + ((getSMSTemplate() == null) ? 0 : getSMSTemplate().hashCode()); hashCode = prime * hashCode + ((getVoiceTemplate() == null) ? 0 : getVoiceTemplate().hashCode()); hashCode = prime * hashCode + ((getInAppTemplate() == null) ? 0 : getInAppTemplate().hashCode()); return hashCode; } @Override public TemplateConfiguration clone() { try { return (TemplateConfiguration) 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.TemplateConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller); } }