/* * 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 content and settings for a message template that can be used in messages that are sent through a push * notification channel. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class PushNotificationTemplateRequest implements Serializable, Cloneable, StructuredPojo { /** ** The message template to use for the ADM (Amazon Device Messaging) channel. This message template overrides the * default template for push notification channels (DefaultPushNotificationTemplate). *
*/ private AndroidPushNotificationTemplate aDM; /** ** The message template to use for the APNs (Apple Push Notification service) channel. This message template * overrides the default template for push notification channels (DefaultPushNotificationTemplate). *
*/ private APNSPushNotificationTemplate aPNS; /** ** The message template to use for the Baidu (Baidu Cloud Push) channel. This message template overrides the default * template for push notification channels (DefaultPushNotificationTemplate). *
*/ private AndroidPushNotificationTemplate baidu; /** ** The default message template to use for push notification channels. *
*/ private DefaultPushNotificationTemplate defaultValue; /** ** A JSON object that specifies the default values to use 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. When you create a message that's based on the template, you can override * these defaults with message-specific and address-specific variables and values. *
*/ private String defaultSubstitutions; /** ** The message template to use for the GCM channel, which is used to send notifications through the Firebase Cloud * Messaging (FCM), formerly Google Cloud Messaging (GCM), service. This message template overrides the default * template for push notification channels (DefaultPushNotificationTemplate). *
*/ private AndroidPushNotificationTemplate gCM; /** ** The unique identifier for the recommender model to use for the message template. Amazon Pinpoint uses this value * to determine how to retrieve and process data from a recommender model when it sends messages that use the * template, if the template contains message variables for recommendation data. *
*/ private String recommenderId; /** ** As of 22-05-2023 tags has been deprecated for update operations. After this date any value in tags is not * processed and an error code is not returned. To manage tags we recommend using either Tags in the API * Reference for Amazon Pinpoint, resourcegroupstaggingapi commands in the AWS Command Line Interface Documentation or resourcegroupstaggingapi in the AWS SDK. *
** (Deprecated) 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* A custom description of the message template. *
*/ private String templateDescription; /** ** The message template to use for the ADM (Amazon Device Messaging) channel. This message template overrides the * default template for push notification channels (DefaultPushNotificationTemplate). *
* * @param aDM * The message template to use for the ADM (Amazon Device Messaging) channel. This message template overrides * the default template for push notification channels (DefaultPushNotificationTemplate). */ public void setADM(AndroidPushNotificationTemplate aDM) { this.aDM = aDM; } /** ** The message template to use for the ADM (Amazon Device Messaging) channel. This message template overrides the * default template for push notification channels (DefaultPushNotificationTemplate). *
* * @return The message template to use for the ADM (Amazon Device Messaging) channel. This message template * overrides the default template for push notification channels (DefaultPushNotificationTemplate). */ public AndroidPushNotificationTemplate getADM() { return this.aDM; } /** ** The message template to use for the ADM (Amazon Device Messaging) channel. This message template overrides the * default template for push notification channels (DefaultPushNotificationTemplate). *
* * @param aDM * The message template to use for the ADM (Amazon Device Messaging) channel. This message template overrides * the default template for push notification channels (DefaultPushNotificationTemplate). * @return Returns a reference to this object so that method calls can be chained together. */ public PushNotificationTemplateRequest withADM(AndroidPushNotificationTemplate aDM) { setADM(aDM); return this; } /** ** The message template to use for the APNs (Apple Push Notification service) channel. This message template * overrides the default template for push notification channels (DefaultPushNotificationTemplate). *
* * @param aPNS * The message template to use for the APNs (Apple Push Notification service) channel. This message template * overrides the default template for push notification channels (DefaultPushNotificationTemplate). */ public void setAPNS(APNSPushNotificationTemplate aPNS) { this.aPNS = aPNS; } /** ** The message template to use for the APNs (Apple Push Notification service) channel. This message template * overrides the default template for push notification channels (DefaultPushNotificationTemplate). *
* * @return The message template to use for the APNs (Apple Push Notification service) channel. This message template * overrides the default template for push notification channels (DefaultPushNotificationTemplate). */ public APNSPushNotificationTemplate getAPNS() { return this.aPNS; } /** ** The message template to use for the APNs (Apple Push Notification service) channel. This message template * overrides the default template for push notification channels (DefaultPushNotificationTemplate). *
* * @param aPNS * The message template to use for the APNs (Apple Push Notification service) channel. This message template * overrides the default template for push notification channels (DefaultPushNotificationTemplate). * @return Returns a reference to this object so that method calls can be chained together. */ public PushNotificationTemplateRequest withAPNS(APNSPushNotificationTemplate aPNS) { setAPNS(aPNS); return this; } /** ** The message template to use for the Baidu (Baidu Cloud Push) channel. This message template overrides the default * template for push notification channels (DefaultPushNotificationTemplate). *
* * @param baidu * The message template to use for the Baidu (Baidu Cloud Push) channel. This message template overrides the * default template for push notification channels (DefaultPushNotificationTemplate). */ public void setBaidu(AndroidPushNotificationTemplate baidu) { this.baidu = baidu; } /** ** The message template to use for the Baidu (Baidu Cloud Push) channel. This message template overrides the default * template for push notification channels (DefaultPushNotificationTemplate). *
* * @return The message template to use for the Baidu (Baidu Cloud Push) channel. This message template overrides the * default template for push notification channels (DefaultPushNotificationTemplate). */ public AndroidPushNotificationTemplate getBaidu() { return this.baidu; } /** ** The message template to use for the Baidu (Baidu Cloud Push) channel. This message template overrides the default * template for push notification channels (DefaultPushNotificationTemplate). *
* * @param baidu * The message template to use for the Baidu (Baidu Cloud Push) channel. This message template overrides the * default template for push notification channels (DefaultPushNotificationTemplate). * @return Returns a reference to this object so that method calls can be chained together. */ public PushNotificationTemplateRequest withBaidu(AndroidPushNotificationTemplate baidu) { setBaidu(baidu); return this; } /** ** The default message template to use for push notification channels. *
* * @param defaultValue * The default message template to use for push notification channels. */ public void setDefault(DefaultPushNotificationTemplate defaultValue) { this.defaultValue = defaultValue; } /** ** The default message template to use for push notification channels. *
* * @return The default message template to use for push notification channels. */ public DefaultPushNotificationTemplate getDefault() { return this.defaultValue; } /** ** The default message template to use for push notification channels. *
* * @param defaultValue * The default message template to use for push notification channels. * @return Returns a reference to this object so that method calls can be chained together. */ public PushNotificationTemplateRequest withDefault(DefaultPushNotificationTemplate defaultValue) { setDefault(defaultValue); return this; } /** ** A JSON object that specifies the default values to use 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. When you create a message that's based on the template, you can override * these defaults with message-specific and address-specific variables and values. *
* * @param defaultSubstitutions * A JSON object that specifies the default values to use 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. When you create a message that's based on the template, * you can override these defaults with message-specific and address-specific variables and values. */ public void setDefaultSubstitutions(String defaultSubstitutions) { this.defaultSubstitutions = defaultSubstitutions; } /** ** A JSON object that specifies the default values to use 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. When you create a message that's based on the template, you can override * these defaults with message-specific and address-specific variables and values. *
* * @return A JSON object that specifies the default values to use 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. When you create a message that's based * on the template, you can override these defaults with message-specific and address-specific variables and * values. */ public String getDefaultSubstitutions() { return this.defaultSubstitutions; } /** ** A JSON object that specifies the default values to use 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. When you create a message that's based on the template, you can override * these defaults with message-specific and address-specific variables and values. *
* * @param defaultSubstitutions * A JSON object that specifies the default values to use 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. When you create a message that's based on the template, * you can override these defaults with message-specific and address-specific variables and values. * @return Returns a reference to this object so that method calls can be chained together. */ public PushNotificationTemplateRequest withDefaultSubstitutions(String defaultSubstitutions) { setDefaultSubstitutions(defaultSubstitutions); return this; } /** ** The message template to use for the GCM channel, which is used to send notifications through the Firebase Cloud * Messaging (FCM), formerly Google Cloud Messaging (GCM), service. This message template overrides the default * template for push notification channels (DefaultPushNotificationTemplate). *
* * @param gCM * The message template to use for the GCM channel, which is used to send notifications through the Firebase * Cloud Messaging (FCM), formerly Google Cloud Messaging (GCM), service. This message template overrides the * default template for push notification channels (DefaultPushNotificationTemplate). */ public void setGCM(AndroidPushNotificationTemplate gCM) { this.gCM = gCM; } /** ** The message template to use for the GCM channel, which is used to send notifications through the Firebase Cloud * Messaging (FCM), formerly Google Cloud Messaging (GCM), service. This message template overrides the default * template for push notification channels (DefaultPushNotificationTemplate). *
* * @return The message template to use for the GCM channel, which is used to send notifications through the Firebase * Cloud Messaging (FCM), formerly Google Cloud Messaging (GCM), service. This message template overrides * the default template for push notification channels (DefaultPushNotificationTemplate). */ public AndroidPushNotificationTemplate getGCM() { return this.gCM; } /** ** The message template to use for the GCM channel, which is used to send notifications through the Firebase Cloud * Messaging (FCM), formerly Google Cloud Messaging (GCM), service. This message template overrides the default * template for push notification channels (DefaultPushNotificationTemplate). *
* * @param gCM * The message template to use for the GCM channel, which is used to send notifications through the Firebase * Cloud Messaging (FCM), formerly Google Cloud Messaging (GCM), service. This message template overrides the * default template for push notification channels (DefaultPushNotificationTemplate). * @return Returns a reference to this object so that method calls can be chained together. */ public PushNotificationTemplateRequest withGCM(AndroidPushNotificationTemplate gCM) { setGCM(gCM); return this; } /** ** The unique identifier for the recommender model to use for the message template. Amazon Pinpoint uses this value * to determine how to retrieve and process data from a recommender model when it sends messages that use the * template, if the template contains message variables for recommendation data. *
* * @param recommenderId * The unique identifier for the recommender model to use for the message template. Amazon Pinpoint uses this * value to determine how to retrieve and process data from a recommender model when it sends messages that * use the template, if the template contains message variables for recommendation data. */ public void setRecommenderId(String recommenderId) { this.recommenderId = recommenderId; } /** ** The unique identifier for the recommender model to use for the message template. Amazon Pinpoint uses this value * to determine how to retrieve and process data from a recommender model when it sends messages that use the * template, if the template contains message variables for recommendation data. *
* * @return The unique identifier for the recommender model to use for the message template. Amazon Pinpoint uses * this value to determine how to retrieve and process data from a recommender model when it sends messages * that use the template, if the template contains message variables for recommendation data. */ public String getRecommenderId() { return this.recommenderId; } /** ** The unique identifier for the recommender model to use for the message template. Amazon Pinpoint uses this value * to determine how to retrieve and process data from a recommender model when it sends messages that use the * template, if the template contains message variables for recommendation data. *
* * @param recommenderId * The unique identifier for the recommender model to use for the message template. Amazon Pinpoint uses this * value to determine how to retrieve and process data from a recommender model when it sends messages that * use the template, if the template contains message variables for recommendation data. * @return Returns a reference to this object so that method calls can be chained together. */ public PushNotificationTemplateRequest withRecommenderId(String recommenderId) { setRecommenderId(recommenderId); return this; } /** ** As of 22-05-2023 tags has been deprecated for update operations. After this date any value in tags is not * processed and an error code is not returned. To manage tags we recommend using either Tags in the API * Reference for Amazon Pinpoint, resourcegroupstaggingapi commands in the AWS Command Line Interface Documentation or resourcegroupstaggingapi in the AWS SDK. *
** (Deprecated) 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 As of 22-05-2023 tags has been deprecated for update operations. After this date any value in tags * is not processed and an error code is not returned. To manage tags we recommend using either Tags in the * API Reference for Amazon Pinpoint, resourcegroupstaggingapi commands in the AWS Command Line Interface Documentation or resourcegroupstaggingapi in the AWS SDK. */ public java.util.Map* As of 22-05-2023 tags has been deprecated for update operations. After this date any value in tags is not * processed and an error code is not returned. To manage tags we recommend using either Tags in the API * Reference for Amazon Pinpoint, resourcegroupstaggingapi commands in the AWS Command Line Interface Documentation or resourcegroupstaggingapi in the AWS SDK. *
** (Deprecated) 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 * As of 22-05-2023 tags has been deprecated for update operations. After this date any value in tags * is not processed and an error code is not returned. To manage tags we recommend using either Tags in the * API Reference for Amazon Pinpoint, resourcegroupstaggingapi commands in the AWS Command Line Interface Documentation or resourcegroupstaggingapi in the AWS SDK. */ public void setTags(java.util.Map* As of 22-05-2023 tags has been deprecated for update operations. After this date any value in tags is not * processed and an error code is not returned. To manage tags we recommend using either Tags in the API * Reference for Amazon Pinpoint, resourcegroupstaggingapi commands in the AWS Command Line Interface Documentation or resourcegroupstaggingapi in the AWS SDK. *
** (Deprecated) 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 * As of 22-05-2023 tags has been deprecated for update operations. After this date any value in tags * is not processed and an error code is not returned. To manage tags we recommend using either Tags in the * API Reference for Amazon Pinpoint, resourcegroupstaggingapi commands in the AWS Command Line Interface Documentation or resourcegroupstaggingapi in the AWS SDK. * @return Returns a reference to this object so that method calls can be chained together. */ public PushNotificationTemplateRequest withTags(java.util.Map* A custom description of the message template. *
* * @param templateDescription * A custom description of the message template. */ public void setTemplateDescription(String templateDescription) { this.templateDescription = templateDescription; } /** ** A custom description of the message template. *
* * @return A custom description of the message template. */ public String getTemplateDescription() { return this.templateDescription; } /** ** A custom description of the message template. *
* * @param templateDescription * A custom description of the message template. * @return Returns a reference to this object so that method calls can be chained together. */ public PushNotificationTemplateRequest withTemplateDescription(String templateDescription) { setTemplateDescription(templateDescription); 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 (getADM() != null) sb.append("ADM: ").append(getADM()).append(","); if (getAPNS() != null) sb.append("APNS: ").append(getAPNS()).append(","); if (getBaidu() != null) sb.append("Baidu: ").append(getBaidu()).append(","); if (getDefault() != null) sb.append("Default: ").append(getDefault()).append(","); if (getDefaultSubstitutions() != null) sb.append("DefaultSubstitutions: ").append(getDefaultSubstitutions()).append(","); if (getGCM() != null) sb.append("GCM: ").append(getGCM()).append(","); if (getRecommenderId() != null) sb.append("RecommenderId: ").append(getRecommenderId()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()).append(","); if (getTemplateDescription() != null) sb.append("TemplateDescription: ").append(getTemplateDescription()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof PushNotificationTemplateRequest == false) return false; PushNotificationTemplateRequest other = (PushNotificationTemplateRequest) obj; if (other.getADM() == null ^ this.getADM() == null) return false; if (other.getADM() != null && other.getADM().equals(this.getADM()) == false) return false; if (other.getAPNS() == null ^ this.getAPNS() == null) return false; if (other.getAPNS() != null && other.getAPNS().equals(this.getAPNS()) == false) return false; if (other.getBaidu() == null ^ this.getBaidu() == null) return false; if (other.getBaidu() != null && other.getBaidu().equals(this.getBaidu()) == false) return false; if (other.getDefault() == null ^ this.getDefault() == null) return false; if (other.getDefault() != null && other.getDefault().equals(this.getDefault()) == 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.getGCM() == null ^ this.getGCM() == null) return false; if (other.getGCM() != null && other.getGCM().equals(this.getGCM()) == 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.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; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getADM() == null) ? 0 : getADM().hashCode()); hashCode = prime * hashCode + ((getAPNS() == null) ? 0 : getAPNS().hashCode()); hashCode = prime * hashCode + ((getBaidu() == null) ? 0 : getBaidu().hashCode()); hashCode = prime * hashCode + ((getDefault() == null) ? 0 : getDefault().hashCode()); hashCode = prime * hashCode + ((getDefaultSubstitutions() == null) ? 0 : getDefaultSubstitutions().hashCode()); hashCode = prime * hashCode + ((getGCM() == null) ? 0 : getGCM().hashCode()); hashCode = prime * hashCode + ((getRecommenderId() == null) ? 0 : getRecommenderId().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getTemplateDescription() == null) ? 0 : getTemplateDescription().hashCode()); return hashCode; } @Override public PushNotificationTemplateRequest clone() { try { return (PushNotificationTemplateRequest) 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.PushNotificationTemplateRequestMarshaller.getInstance().marshall(this, protocolMarshaller); } }