/* * 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; /** *
* In-App Template Response. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class InAppTemplateResponse implements Serializable, Cloneable, StructuredPojo { /** ** The resource arn of the template. *
*/ private String arn; /** ** The content of the message, can include up to 5 modals. Each modal must contain a message, a header, and * background color. ImageUrl and buttons are optional. *
*/ private java.util.List* The creation date of the template. *
*/ private String creationDate; /** ** Custom config to be sent to client. *
*/ private java.util.Map* The last modified date of the template. *
*/ private String lastModifiedDate; /** ** The layout of the message. *
*/ private String layout; /** ** A string-to-string map of key-value pairs that defines the tags to associate with the message template. Each tag * consists of a required tag key and an associated tag value. *
*/ private java.util.Map* The description of the template. *
*/ private String templateDescription; /** ** The name of the template. *
*/ private String templateName; /** ** The type of the template. *
*/ private String templateType; /** ** The version id of the template. *
*/ private String version; /** ** The resource arn of the template. *
* * @param arn * The resource arn of the template. */ public void setArn(String arn) { this.arn = arn; } /** ** The resource arn of the template. *
* * @return The resource arn of the template. */ public String getArn() { return this.arn; } /** ** The resource arn of the template. *
* * @param arn * The resource arn of the template. * @return Returns a reference to this object so that method calls can be chained together. */ public InAppTemplateResponse withArn(String arn) { setArn(arn); return this; } /** ** The content of the message, can include up to 5 modals. Each modal must contain a message, a header, and * background color. ImageUrl and buttons are optional. *
* * @return The content of the message, can include up to 5 modals. Each modal must contain a message, a header, and * background color. ImageUrl and buttons are optional. */ public java.util.List* The content of the message, can include up to 5 modals. Each modal must contain a message, a header, and * background color. ImageUrl and buttons are optional. *
* * @param content * The content of the message, can include up to 5 modals. Each modal must contain a message, a header, and * background color. ImageUrl and buttons are optional. */ public void setContent(java.util.Collection* The content of the message, can include up to 5 modals. Each modal must contain a message, a header, and * background color. ImageUrl and buttons are optional. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setContent(java.util.Collection)} or {@link #withContent(java.util.Collection)} if you want to override * the existing values. *
* * @param content * The content of the message, can include up to 5 modals. Each modal must contain a message, a header, and * background color. ImageUrl and buttons are optional. * @return Returns a reference to this object so that method calls can be chained together. */ public InAppTemplateResponse withContent(InAppMessageContent... content) { if (this.content == null) { setContent(new java.util.ArrayList* The content of the message, can include up to 5 modals. Each modal must contain a message, a header, and * background color. ImageUrl and buttons are optional. *
* * @param content * The content of the message, can include up to 5 modals. Each modal must contain a message, a header, and * background color. ImageUrl and buttons are optional. * @return Returns a reference to this object so that method calls can be chained together. */ public InAppTemplateResponse withContent(java.util.Collection* The creation date of the template. *
* * @param creationDate * The creation date of the template. */ public void setCreationDate(String creationDate) { this.creationDate = creationDate; } /** ** The creation date of the template. *
* * @return The creation date of the template. */ public String getCreationDate() { return this.creationDate; } /** ** The creation date of the template. *
* * @param creationDate * The creation date of the template. * @return Returns a reference to this object so that method calls can be chained together. */ public InAppTemplateResponse withCreationDate(String creationDate) { setCreationDate(creationDate); return this; } /** ** Custom config to be sent to client. *
* * @return Custom config to be sent to client. */ public java.util.Map* Custom config to be sent to client. *
* * @param customConfig * Custom config to be sent to client. */ public void setCustomConfig(java.util.Map* Custom config to be sent to client. *
* * @param customConfig * Custom config to be sent to client. * @return Returns a reference to this object so that method calls can be chained together. */ public InAppTemplateResponse withCustomConfig(java.util.Map* The last modified date of the template. *
* * @param lastModifiedDate * The last modified date of the template. */ public void setLastModifiedDate(String lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; } /** ** The last modified date of the template. *
* * @return The last modified date of the template. */ public String getLastModifiedDate() { return this.lastModifiedDate; } /** ** The last modified date of the template. *
* * @param lastModifiedDate * The last modified date of the template. * @return Returns a reference to this object so that method calls can be chained together. */ public InAppTemplateResponse withLastModifiedDate(String lastModifiedDate) { setLastModifiedDate(lastModifiedDate); return this; } /** ** The layout of the message. *
* * @param layout * The layout of the message. * @see Layout */ public void setLayout(String layout) { this.layout = layout; } /** ** The layout of the message. *
* * @return The layout of the message. * @see Layout */ public String getLayout() { return this.layout; } /** ** The layout of the message. *
* * @param layout * The layout of the message. * @return Returns a reference to this object so that method calls can be chained together. * @see Layout */ public InAppTemplateResponse withLayout(String layout) { setLayout(layout); return this; } /** ** The layout of the message. *
* * @param layout * The layout of the message. * @return Returns a reference to this object so that method calls can be chained together. * @see Layout */ public InAppTemplateResponse withLayout(Layout layout) { this.layout = layout.toString(); return this; } /** ** A string-to-string map of key-value pairs that defines the tags to associate 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 defines the tags to associate 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 defines the tags to associate 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 defines the tags to associate 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 defines the tags to associate 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 defines the tags to associate 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 InAppTemplateResponse withTags(java.util.Map* The description of the template. *
* * @param templateDescription * The description of the template. */ public void setTemplateDescription(String templateDescription) { this.templateDescription = templateDescription; } /** ** The description of the template. *
* * @return The description of the template. */ public String getTemplateDescription() { return this.templateDescription; } /** ** The description of the template. *
* * @param templateDescription * The description of the template. * @return Returns a reference to this object so that method calls can be chained together. */ public InAppTemplateResponse withTemplateDescription(String templateDescription) { setTemplateDescription(templateDescription); return this; } /** ** The name of the template. *
* * @param templateName * The name of the template. */ public void setTemplateName(String templateName) { this.templateName = templateName; } /** ** The name of the template. *
* * @return The name of the template. */ public String getTemplateName() { return this.templateName; } /** ** The name of the template. *
* * @param templateName * The name of the template. * @return Returns a reference to this object so that method calls can be chained together. */ public InAppTemplateResponse withTemplateName(String templateName) { setTemplateName(templateName); return this; } /** ** The type of the template. *
* * @param templateType * The type of the template. * @see TemplateType */ public void setTemplateType(String templateType) { this.templateType = templateType; } /** ** The type of the template. *
* * @return The type of the template. * @see TemplateType */ public String getTemplateType() { return this.templateType; } /** ** The type of the template. *
* * @param templateType * The type of the template. * @return Returns a reference to this object so that method calls can be chained together. * @see TemplateType */ public InAppTemplateResponse withTemplateType(String templateType) { setTemplateType(templateType); return this; } /** ** The type of the template. *
* * @param templateType * The type of the template. * @return Returns a reference to this object so that method calls can be chained together. * @see TemplateType */ public InAppTemplateResponse withTemplateType(TemplateType templateType) { this.templateType = templateType.toString(); return this; } /** ** The version id of the template. *
* * @param version * The version id of the template. */ public void setVersion(String version) { this.version = version; } /** ** The version id of the template. *
* * @return The version id of the template. */ public String getVersion() { return this.version; } /** ** The version id of the template. *
* * @param version * The version id of the template. * @return Returns a reference to this object so that method calls can be chained together. */ public InAppTemplateResponse 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 (getContent() != null) sb.append("Content: ").append(getContent()).append(","); if (getCreationDate() != null) sb.append("CreationDate: ").append(getCreationDate()).append(","); if (getCustomConfig() != null) sb.append("CustomConfig: ").append(getCustomConfig()).append(","); if (getLastModifiedDate() != null) sb.append("LastModifiedDate: ").append(getLastModifiedDate()).append(","); if (getLayout() != null) sb.append("Layout: ").append(getLayout()).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 (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 InAppTemplateResponse == false) return false; InAppTemplateResponse other = (InAppTemplateResponse) obj; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == 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.getCreationDate() == null ^ this.getCreationDate() == null) return false; if (other.getCreationDate() != null && other.getCreationDate().equals(this.getCreationDate()) == false) return false; if (other.getCustomConfig() == null ^ this.getCustomConfig() == null) return false; if (other.getCustomConfig() != null && other.getCustomConfig().equals(this.getCustomConfig()) == 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.getLayout() == null ^ this.getLayout() == null) return false; if (other.getLayout() != null && other.getLayout().equals(this.getLayout()) == 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.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 + ((getContent() == null) ? 0 : getContent().hashCode()); hashCode = prime * hashCode + ((getCreationDate() == null) ? 0 : getCreationDate().hashCode()); hashCode = prime * hashCode + ((getCustomConfig() == null) ? 0 : getCustomConfig().hashCode()); hashCode = prime * hashCode + ((getLastModifiedDate() == null) ? 0 : getLastModifiedDate().hashCode()); hashCode = prime * hashCode + ((getLayout() == null) ? 0 : getLayout().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 + ((getVersion() == null) ? 0 : getVersion().hashCode()); return hashCode; } @Override public InAppTemplateResponse clone() { try { return (InAppTemplateResponse) 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.InAppTemplateResponseMarshaller.getInstance().marshall(this, protocolMarshaller); } }