/* * Copyright 2010-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.chimesdkmessaging.model; import java.io.Serializable; /** *
* The channel membership preferences for push notification. *
*/ public class PushNotificationPreferences implements Serializable { /** *
* Enum value that indicates which push notifications to send to the
* requested member of a channel. ALL
sends all push
* notifications, NONE
sends no push notifications,
* FILTERED
sends only filtered push notifications.
*
* Constraints:
* Allowed Values: ALL, NONE, FILTERED
*/
private String allowNotifications;
/**
*
* The simple JSON object used to send a subset of a push notification to * the requested member. *
*
* Constraints:
* Length: 1 -
* Pattern: [\s\S]*
*/
private String filterRule;
/**
*
* Enum value that indicates which push notifications to send to the
* requested member of a channel. ALL
sends all push
* notifications, NONE
sends no push notifications,
* FILTERED
sends only filtered push notifications.
*
* Constraints:
* Allowed Values: ALL, NONE, FILTERED
*
* @return
* Enum value that indicates which push notifications to send to the
* requested member of a channel. ALL
sends all push
* notifications, NONE
sends no push notifications,
* FILTERED
sends only filtered push notifications.
*
* Enum value that indicates which push notifications to send to the
* requested member of a channel. ALL
sends all push
* notifications, NONE
sends no push notifications,
* FILTERED
sends only filtered push notifications.
*
* Constraints:
* Allowed Values: ALL, NONE, FILTERED
*
* @param allowNotifications
* Enum value that indicates which push notifications to send to
* the requested member of a channel. ALL
sends all
* push notifications, NONE
sends no push
* notifications, FILTERED
sends only filtered push
* notifications.
*
* Enum value that indicates which push notifications to send to the
* requested member of a channel. ALL
sends all push
* notifications, NONE
sends no push notifications,
* FILTERED
sends only filtered push notifications.
*
* Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: ALL, NONE, FILTERED
*
* @param allowNotifications
* Enum value that indicates which push notifications to send to
* the requested member of a channel. ALL
sends all
* push notifications, NONE
sends no push
* notifications, FILTERED
sends only filtered push
* notifications.
*
* Enum value that indicates which push notifications to send to the
* requested member of a channel. ALL
sends all push
* notifications, NONE
sends no push notifications,
* FILTERED
sends only filtered push notifications.
*
* Constraints:
* Allowed Values: ALL, NONE, FILTERED
*
* @param allowNotifications
* Enum value that indicates which push notifications to send to
* the requested member of a channel. ALL
sends all
* push notifications, NONE
sends no push
* notifications, FILTERED
sends only filtered push
* notifications.
*
* Enum value that indicates which push notifications to send to the
* requested member of a channel. ALL
sends all push
* notifications, NONE
sends no push notifications,
* FILTERED
sends only filtered push notifications.
*
* Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: ALL, NONE, FILTERED
*
* @param allowNotifications
* Enum value that indicates which push notifications to send to
* the requested member of a channel. ALL
sends all
* push notifications, NONE
sends no push
* notifications, FILTERED
sends only filtered push
* notifications.
*
* The simple JSON object used to send a subset of a push notification to * the requested member. *
*
* Constraints:
* Length: 1 -
* Pattern: [\s\S]*
*
* @return
* The simple JSON object used to send a subset of a push * notification to the requested member. *
*/ public String getFilterRule() { return filterRule; } /** ** The simple JSON object used to send a subset of a push notification to * the requested member. *
*
* Constraints:
* Length: 1 -
* Pattern: [\s\S]*
*
* @param filterRule
* The simple JSON object used to send a subset of a push * notification to the requested member. *
*/ public void setFilterRule(String filterRule) { this.filterRule = filterRule; } /** ** The simple JSON object used to send a subset of a push notification to * the requested member. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 -
* Pattern: [\s\S]*
*
* @param filterRule
* The simple JSON object used to send a subset of a push * notification to the requested member. *
* @return A reference to this updated object so that method calls can be * chained together. */ public PushNotificationPreferences withFilterRule(String filterRule) { this.filterRule = filterRule; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAllowNotifications() != null) sb.append("AllowNotifications: " + getAllowNotifications() + ","); if (getFilterRule() != null) sb.append("FilterRule: " + getFilterRule()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAllowNotifications() == null) ? 0 : getAllowNotifications().hashCode()); hashCode = prime * hashCode + ((getFilterRule() == null) ? 0 : getFilterRule().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof PushNotificationPreferences == false) return false; PushNotificationPreferences other = (PushNotificationPreferences) obj; if (other.getAllowNotifications() == null ^ this.getAllowNotifications() == null) return false; if (other.getAllowNotifications() != null && other.getAllowNotifications().equals(this.getAllowNotifications()) == false) return false; if (other.getFilterRule() == null ^ this.getFilterRule() == null) return false; if (other.getFilterRule() != null && other.getFilterRule().equals(this.getFilterRule()) == false) return false; return true; } }