/* * 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; /** *
* The configuration for the message content. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class InAppMessageContent implements Serializable, Cloneable, StructuredPojo { /** ** The background color for the message. *
*/ private String backgroundColor; /** ** The configuration for the message body. *
*/ private InAppMessageBodyConfig bodyConfig; /** ** The configuration for the message header. *
*/ private InAppMessageHeaderConfig headerConfig; /** ** The image url for the background of message. *
*/ private String imageUrl; /** ** The first button inside the message. *
*/ private InAppMessageButton primaryBtn; /** ** The second button inside message. *
*/ private InAppMessageButton secondaryBtn; /** ** The background color for the message. *
* * @param backgroundColor * The background color for the message. */ public void setBackgroundColor(String backgroundColor) { this.backgroundColor = backgroundColor; } /** ** The background color for the message. *
* * @return The background color for the message. */ public String getBackgroundColor() { return this.backgroundColor; } /** ** The background color for the message. *
* * @param backgroundColor * The background color for the message. * @return Returns a reference to this object so that method calls can be chained together. */ public InAppMessageContent withBackgroundColor(String backgroundColor) { setBackgroundColor(backgroundColor); return this; } /** ** The configuration for the message body. *
* * @param bodyConfig * The configuration for the message body. */ public void setBodyConfig(InAppMessageBodyConfig bodyConfig) { this.bodyConfig = bodyConfig; } /** ** The configuration for the message body. *
* * @return The configuration for the message body. */ public InAppMessageBodyConfig getBodyConfig() { return this.bodyConfig; } /** ** The configuration for the message body. *
* * @param bodyConfig * The configuration for the message body. * @return Returns a reference to this object so that method calls can be chained together. */ public InAppMessageContent withBodyConfig(InAppMessageBodyConfig bodyConfig) { setBodyConfig(bodyConfig); return this; } /** ** The configuration for the message header. *
* * @param headerConfig * The configuration for the message header. */ public void setHeaderConfig(InAppMessageHeaderConfig headerConfig) { this.headerConfig = headerConfig; } /** ** The configuration for the message header. *
* * @return The configuration for the message header. */ public InAppMessageHeaderConfig getHeaderConfig() { return this.headerConfig; } /** ** The configuration for the message header. *
* * @param headerConfig * The configuration for the message header. * @return Returns a reference to this object so that method calls can be chained together. */ public InAppMessageContent withHeaderConfig(InAppMessageHeaderConfig headerConfig) { setHeaderConfig(headerConfig); return this; } /** ** The image url for the background of message. *
* * @param imageUrl * The image url for the background of message. */ public void setImageUrl(String imageUrl) { this.imageUrl = imageUrl; } /** ** The image url for the background of message. *
* * @return The image url for the background of message. */ public String getImageUrl() { return this.imageUrl; } /** ** The image url for the background of message. *
* * @param imageUrl * The image url for the background of message. * @return Returns a reference to this object so that method calls can be chained together. */ public InAppMessageContent withImageUrl(String imageUrl) { setImageUrl(imageUrl); return this; } /** ** The first button inside the message. *
* * @param primaryBtn * The first button inside the message. */ public void setPrimaryBtn(InAppMessageButton primaryBtn) { this.primaryBtn = primaryBtn; } /** ** The first button inside the message. *
* * @return The first button inside the message. */ public InAppMessageButton getPrimaryBtn() { return this.primaryBtn; } /** ** The first button inside the message. *
* * @param primaryBtn * The first button inside the message. * @return Returns a reference to this object so that method calls can be chained together. */ public InAppMessageContent withPrimaryBtn(InAppMessageButton primaryBtn) { setPrimaryBtn(primaryBtn); return this; } /** ** The second button inside message. *
* * @param secondaryBtn * The second button inside message. */ public void setSecondaryBtn(InAppMessageButton secondaryBtn) { this.secondaryBtn = secondaryBtn; } /** ** The second button inside message. *
* * @return The second button inside message. */ public InAppMessageButton getSecondaryBtn() { return this.secondaryBtn; } /** ** The second button inside message. *
* * @param secondaryBtn * The second button inside message. * @return Returns a reference to this object so that method calls can be chained together. */ public InAppMessageContent withSecondaryBtn(InAppMessageButton secondaryBtn) { setSecondaryBtn(secondaryBtn); 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 (getBackgroundColor() != null) sb.append("BackgroundColor: ").append(getBackgroundColor()).append(","); if (getBodyConfig() != null) sb.append("BodyConfig: ").append(getBodyConfig()).append(","); if (getHeaderConfig() != null) sb.append("HeaderConfig: ").append(getHeaderConfig()).append(","); if (getImageUrl() != null) sb.append("ImageUrl: ").append(getImageUrl()).append(","); if (getPrimaryBtn() != null) sb.append("PrimaryBtn: ").append(getPrimaryBtn()).append(","); if (getSecondaryBtn() != null) sb.append("SecondaryBtn: ").append(getSecondaryBtn()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof InAppMessageContent == false) return false; InAppMessageContent other = (InAppMessageContent) obj; if (other.getBackgroundColor() == null ^ this.getBackgroundColor() == null) return false; if (other.getBackgroundColor() != null && other.getBackgroundColor().equals(this.getBackgroundColor()) == false) return false; if (other.getBodyConfig() == null ^ this.getBodyConfig() == null) return false; if (other.getBodyConfig() != null && other.getBodyConfig().equals(this.getBodyConfig()) == false) return false; if (other.getHeaderConfig() == null ^ this.getHeaderConfig() == null) return false; if (other.getHeaderConfig() != null && other.getHeaderConfig().equals(this.getHeaderConfig()) == false) return false; if (other.getImageUrl() == null ^ this.getImageUrl() == null) return false; if (other.getImageUrl() != null && other.getImageUrl().equals(this.getImageUrl()) == false) return false; if (other.getPrimaryBtn() == null ^ this.getPrimaryBtn() == null) return false; if (other.getPrimaryBtn() != null && other.getPrimaryBtn().equals(this.getPrimaryBtn()) == false) return false; if (other.getSecondaryBtn() == null ^ this.getSecondaryBtn() == null) return false; if (other.getSecondaryBtn() != null && other.getSecondaryBtn().equals(this.getSecondaryBtn()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getBackgroundColor() == null) ? 0 : getBackgroundColor().hashCode()); hashCode = prime * hashCode + ((getBodyConfig() == null) ? 0 : getBodyConfig().hashCode()); hashCode = prime * hashCode + ((getHeaderConfig() == null) ? 0 : getHeaderConfig().hashCode()); hashCode = prime * hashCode + ((getImageUrl() == null) ? 0 : getImageUrl().hashCode()); hashCode = prime * hashCode + ((getPrimaryBtn() == null) ? 0 : getPrimaryBtn().hashCode()); hashCode = prime * hashCode + ((getSecondaryBtn() == null) ? 0 : getSecondaryBtn().hashCode()); return hashCode; } @Override public InAppMessageContent clone() { try { return (InAppMessageContent) 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.InAppMessageContentMarshaller.getInstance().marshall(this, protocolMarshaller); } }