/* * 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.chimesdkmessaging.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Stores information about a callback. *

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

* The message ID. *

*/ private String messageId; /** *

* The message content. For Amazon Lex V2 bot responses, this field holds a list of messages originating from the * bot. For more information, refer to Processing * responses from an AppInstanceBot in the Amazon Chime SDK Messaging Developer Guide. *

*/ private String content; /** *

* The message metadata. *

*/ private String metadata; /** *

* The push notification configuration of the message. *

*/ private PushNotificationConfiguration pushNotification; /** *

* The attributes for the channel message. For Amazon Lex V2 bot responses, the attributes are mapped to specific * fields from the bot. For more information, refer to Processing * responses from an AppInstanceBot in the Amazon Chime SDK Messaging Developer Guide. *

*/ private java.util.Map messageAttributes; /** *

* The ID of the SubChannel. *

*/ private String subChannelId; /** *

* The content type of the call-back message. For Amazon Lex V2 bot responses, the content type is * application/amz-chime-lex-msgs for success responses and * application/amz-chime-lex-error for failure responses. For more information, refer to Processing * responses from an AppInstanceBot in the Amazon Chime SDK Messaging Developer Guide. *

*/ private String contentType; /** *

* The message ID. *

* * @param messageId * The message ID. */ public void setMessageId(String messageId) { this.messageId = messageId; } /** *

* The message ID. *

* * @return The message ID. */ public String getMessageId() { return this.messageId; } /** *

* The message ID. *

* * @param messageId * The message ID. * @return Returns a reference to this object so that method calls can be chained together. */ public ChannelMessageCallback withMessageId(String messageId) { setMessageId(messageId); return this; } /** *

* The message content. For Amazon Lex V2 bot responses, this field holds a list of messages originating from the * bot. For more information, refer to Processing * responses from an AppInstanceBot in the Amazon Chime SDK Messaging Developer Guide. *

* * @param content * The message content. For Amazon Lex V2 bot responses, this field holds a list of messages originating from * the bot. For more information, refer to Processing * responses from an AppInstanceBot in the Amazon Chime SDK Messaging Developer Guide. */ public void setContent(String content) { this.content = content; } /** *

* The message content. For Amazon Lex V2 bot responses, this field holds a list of messages originating from the * bot. For more information, refer to Processing * responses from an AppInstanceBot in the Amazon Chime SDK Messaging Developer Guide. *

* * @return The message content. For Amazon Lex V2 bot responses, this field holds a list of messages originating * from the bot. For more information, refer to Processing * responses from an AppInstanceBot in the Amazon Chime SDK Messaging Developer Guide. */ public String getContent() { return this.content; } /** *

* The message content. For Amazon Lex V2 bot responses, this field holds a list of messages originating from the * bot. For more information, refer to Processing * responses from an AppInstanceBot in the Amazon Chime SDK Messaging Developer Guide. *

* * @param content * The message content. For Amazon Lex V2 bot responses, this field holds a list of messages originating from * the bot. For more information, refer to Processing * responses from an AppInstanceBot in the Amazon Chime SDK Messaging Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public ChannelMessageCallback withContent(String content) { setContent(content); return this; } /** *

* The message metadata. *

* * @param metadata * The message metadata. */ public void setMetadata(String metadata) { this.metadata = metadata; } /** *

* The message metadata. *

* * @return The message metadata. */ public String getMetadata() { return this.metadata; } /** *

* The message metadata. *

* * @param metadata * The message metadata. * @return Returns a reference to this object so that method calls can be chained together. */ public ChannelMessageCallback withMetadata(String metadata) { setMetadata(metadata); return this; } /** *

* The push notification configuration of the message. *

* * @param pushNotification * The push notification configuration of the message. */ public void setPushNotification(PushNotificationConfiguration pushNotification) { this.pushNotification = pushNotification; } /** *

* The push notification configuration of the message. *

* * @return The push notification configuration of the message. */ public PushNotificationConfiguration getPushNotification() { return this.pushNotification; } /** *

* The push notification configuration of the message. *

* * @param pushNotification * The push notification configuration of the message. * @return Returns a reference to this object so that method calls can be chained together. */ public ChannelMessageCallback withPushNotification(PushNotificationConfiguration pushNotification) { setPushNotification(pushNotification); return this; } /** *

* The attributes for the channel message. For Amazon Lex V2 bot responses, the attributes are mapped to specific * fields from the bot. For more information, refer to Processing * responses from an AppInstanceBot in the Amazon Chime SDK Messaging Developer Guide. *

* * @return The attributes for the channel message. For Amazon Lex V2 bot responses, the attributes are mapped to * specific fields from the bot. For more information, refer to Processing * responses from an AppInstanceBot in the Amazon Chime SDK Messaging Developer Guide. */ public java.util.Map getMessageAttributes() { return messageAttributes; } /** *

* The attributes for the channel message. For Amazon Lex V2 bot responses, the attributes are mapped to specific * fields from the bot. For more information, refer to Processing * responses from an AppInstanceBot in the Amazon Chime SDK Messaging Developer Guide. *

* * @param messageAttributes * The attributes for the channel message. For Amazon Lex V2 bot responses, the attributes are mapped to * specific fields from the bot. For more information, refer to Processing * responses from an AppInstanceBot in the Amazon Chime SDK Messaging Developer Guide. */ public void setMessageAttributes(java.util.Map messageAttributes) { this.messageAttributes = messageAttributes; } /** *

* The attributes for the channel message. For Amazon Lex V2 bot responses, the attributes are mapped to specific * fields from the bot. For more information, refer to Processing * responses from an AppInstanceBot in the Amazon Chime SDK Messaging Developer Guide. *

* * @param messageAttributes * The attributes for the channel message. For Amazon Lex V2 bot responses, the attributes are mapped to * specific fields from the bot. For more information, refer to Processing * responses from an AppInstanceBot in the Amazon Chime SDK Messaging Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public ChannelMessageCallback withMessageAttributes(java.util.Map messageAttributes) { setMessageAttributes(messageAttributes); return this; } /** * Add a single MessageAttributes entry * * @see ChannelMessageCallback#withMessageAttributes * @returns a reference to this object so that method calls can be chained together. */ public ChannelMessageCallback addMessageAttributesEntry(String key, MessageAttributeValue value) { if (null == this.messageAttributes) { this.messageAttributes = new java.util.HashMap(); } if (this.messageAttributes.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.messageAttributes.put(key, value); return this; } /** * Removes all the entries added into MessageAttributes. * * @return Returns a reference to this object so that method calls can be chained together. */ public ChannelMessageCallback clearMessageAttributesEntries() { this.messageAttributes = null; return this; } /** *

* The ID of the SubChannel. *

* * @param subChannelId * The ID of the SubChannel. */ public void setSubChannelId(String subChannelId) { this.subChannelId = subChannelId; } /** *

* The ID of the SubChannel. *

* * @return The ID of the SubChannel. */ public String getSubChannelId() { return this.subChannelId; } /** *

* The ID of the SubChannel. *

* * @param subChannelId * The ID of the SubChannel. * @return Returns a reference to this object so that method calls can be chained together. */ public ChannelMessageCallback withSubChannelId(String subChannelId) { setSubChannelId(subChannelId); return this; } /** *

* The content type of the call-back message. For Amazon Lex V2 bot responses, the content type is * application/amz-chime-lex-msgs for success responses and * application/amz-chime-lex-error for failure responses. For more information, refer to Processing * responses from an AppInstanceBot in the Amazon Chime SDK Messaging Developer Guide. *

* * @param contentType * The content type of the call-back message. For Amazon Lex V2 bot responses, the content type is * application/amz-chime-lex-msgs for success responses and * application/amz-chime-lex-error for failure responses. For more information, refer to Processing * responses from an AppInstanceBot in the Amazon Chime SDK Messaging Developer Guide. */ public void setContentType(String contentType) { this.contentType = contentType; } /** *

* The content type of the call-back message. For Amazon Lex V2 bot responses, the content type is * application/amz-chime-lex-msgs for success responses and * application/amz-chime-lex-error for failure responses. For more information, refer to Processing * responses from an AppInstanceBot in the Amazon Chime SDK Messaging Developer Guide. *

* * @return The content type of the call-back message. For Amazon Lex V2 bot responses, the content type is * application/amz-chime-lex-msgs for success responses and * application/amz-chime-lex-error for failure responses. For more information, refer to Processing * responses from an AppInstanceBot in the Amazon Chime SDK Messaging Developer Guide. */ public String getContentType() { return this.contentType; } /** *

* The content type of the call-back message. For Amazon Lex V2 bot responses, the content type is * application/amz-chime-lex-msgs for success responses and * application/amz-chime-lex-error for failure responses. For more information, refer to Processing * responses from an AppInstanceBot in the Amazon Chime SDK Messaging Developer Guide. *

* * @param contentType * The content type of the call-back message. For Amazon Lex V2 bot responses, the content type is * application/amz-chime-lex-msgs for success responses and * application/amz-chime-lex-error for failure responses. For more information, refer to Processing * responses from an AppInstanceBot in the Amazon Chime SDK Messaging Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public ChannelMessageCallback withContentType(String contentType) { setContentType(contentType); 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 (getMessageId() != null) sb.append("MessageId: ").append(getMessageId()).append(","); if (getContent() != null) sb.append("Content: ").append("***Sensitive Data Redacted***").append(","); if (getMetadata() != null) sb.append("Metadata: ").append("***Sensitive Data Redacted***").append(","); if (getPushNotification() != null) sb.append("PushNotification: ").append(getPushNotification()).append(","); if (getMessageAttributes() != null) sb.append("MessageAttributes: ").append("***Sensitive Data Redacted***").append(","); if (getSubChannelId() != null) sb.append("SubChannelId: ").append(getSubChannelId()).append(","); if (getContentType() != null) sb.append("ContentType: ").append("***Sensitive Data Redacted***"); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ChannelMessageCallback == false) return false; ChannelMessageCallback other = (ChannelMessageCallback) obj; if (other.getMessageId() == null ^ this.getMessageId() == null) return false; if (other.getMessageId() != null && other.getMessageId().equals(this.getMessageId()) == 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.getMetadata() == null ^ this.getMetadata() == null) return false; if (other.getMetadata() != null && other.getMetadata().equals(this.getMetadata()) == false) return false; if (other.getPushNotification() == null ^ this.getPushNotification() == null) return false; if (other.getPushNotification() != null && other.getPushNotification().equals(this.getPushNotification()) == false) return false; if (other.getMessageAttributes() == null ^ this.getMessageAttributes() == null) return false; if (other.getMessageAttributes() != null && other.getMessageAttributes().equals(this.getMessageAttributes()) == false) return false; if (other.getSubChannelId() == null ^ this.getSubChannelId() == null) return false; if (other.getSubChannelId() != null && other.getSubChannelId().equals(this.getSubChannelId()) == false) return false; if (other.getContentType() == null ^ this.getContentType() == null) return false; if (other.getContentType() != null && other.getContentType().equals(this.getContentType()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getMessageId() == null) ? 0 : getMessageId().hashCode()); hashCode = prime * hashCode + ((getContent() == null) ? 0 : getContent().hashCode()); hashCode = prime * hashCode + ((getMetadata() == null) ? 0 : getMetadata().hashCode()); hashCode = prime * hashCode + ((getPushNotification() == null) ? 0 : getPushNotification().hashCode()); hashCode = prime * hashCode + ((getMessageAttributes() == null) ? 0 : getMessageAttributes().hashCode()); hashCode = prime * hashCode + ((getSubChannelId() == null) ? 0 : getSubChannelId().hashCode()); hashCode = prime * hashCode + ((getContentType() == null) ? 0 : getContentType().hashCode()); return hashCode; } @Override public ChannelMessageCallback clone() { try { return (ChannelMessageCallback) 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.chimesdkmessaging.model.transform.ChannelMessageCallbackMarshaller.getInstance().marshall(this, protocolMarshaller); } }