/* * 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 details of a message in a channel. *
*/ public class ChannelMessage implements Serializable { /** ** The ARN of the channel. *
*
* Constraints:
* Length: 5 - 1600
* Pattern:
* arn:[a-z0-9-\.]{1,63}:[a-z0-9-\.]{0,63}:[a-z0-9-\.]{0,63}:
* [a-z0-9-\.]{0,63}:[^/].{0,1023}
*/
private String channelArn;
/**
*
* The ID of a message. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [-_a-zA-Z0-9]*
*/
private String messageId;
/**
*
* The content of the channel message. 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. *
*
* Constraints:
* Length: 0 - 4096
* Pattern: [\s\S]*
*/
private String content;
/**
*
* The message metadata. *
*
* Constraints:
* Length: 0 - 1024
* Pattern: .*
*/
private String metadata;
/**
*
* The message type. *
*
* Constraints:
* Allowed Values: STANDARD, CONTROL
*/
private String type;
/**
*
* The time at which the message was created. *
*/ private java.util.Date createdTimestamp; /** ** The time at which a message was edited. *
*/ private java.util.Date lastEditedTimestamp; /** ** The time at which a message was updated. *
*/ private java.util.Date lastUpdatedTimestamp; /** ** The message sender. *
*/ private Identity sender; /** ** Hides the content of a message. *
*/ private Boolean redacted; /** ** The persistence setting for a channel message. *
*
* Constraints:
* Allowed Values: PERSISTENT, NON_PERSISTENT
*/
private String persistence;
/**
*
* The status of the channel message. *
*/ private ChannelMessageStatusStructure status; /** ** 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* The ID of the SubChannel. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [-_a-zA-Z0-9]*
*/
private String subChannelId;
/**
*
* The content type of the channel 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.
*
* Constraints:
* Length: 0 - 45
* Pattern: [\s\S]*
*/
private String contentType;
/**
*
* The target of a message, a sender, a user, or a bot. Only the target and * the sender can view targeted messages. Only users who can see targeted * messages can take actions on them. However, administrators can delete * targeted messages that they can’t see. *
*/ private java.util.List* The ARN of the channel. *
*
* Constraints:
* Length: 5 - 1600
* Pattern:
* arn:[a-z0-9-\.]{1,63}:[a-z0-9-\.]{0,63}:[a-z0-9-\.]{0,63}:
* [a-z0-9-\.]{0,63}:[^/].{0,1023}
*
* @return
* The ARN of the channel. *
*/ public String getChannelArn() { return channelArn; } /** ** The ARN of the channel. *
*
* Constraints:
* Length: 5 - 1600
* Pattern:
* arn:[a-z0-9-\.]{1,63}:[a-z0-9-\.]{0,63}:[a-z0-9-\.]{0,63}:
* [a-z0-9-\.]{0,63}:[^/].{0,1023}
*
* @param channelArn
* The ARN of the channel. *
*/ public void setChannelArn(String channelArn) { this.channelArn = channelArn; } /** ** The ARN of the channel. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 5 - 1600
* Pattern:
* arn:[a-z0-9-\.]{1,63}:[a-z0-9-\.]{0,63}:[a-z0-9-\.]{0,63}:
* [a-z0-9-\.]{0,63}:[^/].{0,1023}
*
* @param channelArn
* The ARN of the channel. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ChannelMessage withChannelArn(String channelArn) { this.channelArn = channelArn; return this; } /** ** The ID of a message. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [-_a-zA-Z0-9]*
*
* @return
* The ID of a message. *
*/ public String getMessageId() { return messageId; } /** ** The ID of a message. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [-_a-zA-Z0-9]*
*
* @param messageId
* The ID of a message. *
*/ public void setMessageId(String messageId) { this.messageId = messageId; } /** ** The ID of a message. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 128
* Pattern: [-_a-zA-Z0-9]*
*
* @param messageId
* The ID of a message. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ChannelMessage withMessageId(String messageId) { this.messageId = messageId; return this; } /** ** The content of the channel message. 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. *
*
* Constraints:
* Length: 0 - 4096
* Pattern: [\s\S]*
*
* @return
* The content of the channel message. 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 content; } /** ** The content of the channel message. 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. *
*
* Constraints:
* Length: 0 - 4096
* Pattern: [\s\S]*
*
* @param content
* The content of the channel message. 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 content of the channel message. 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. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 0 - 4096
* Pattern: [\s\S]*
*
* @param content
* The content of the channel message. 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 A reference to this updated object so that method calls can be * chained together. */ public ChannelMessage withContent(String content) { this.content = content; return this; } /** ** The message metadata. *
*
* Constraints:
* Length: 0 - 1024
* Pattern: .*
*
* @return
* The message metadata. *
*/ public String getMetadata() { return metadata; } /** ** The message metadata. *
*
* Constraints:
* Length: 0 - 1024
* Pattern: .*
*
* @param metadata
* The message metadata. *
*/ public void setMetadata(String metadata) { this.metadata = metadata; } /** ** The message metadata. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 0 - 1024
* Pattern: .*
*
* @param metadata
* The message metadata. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ChannelMessage withMetadata(String metadata) { this.metadata = metadata; return this; } /** ** The message type. *
*
* Constraints:
* Allowed Values: STANDARD, CONTROL
*
* @return
* The message type. *
* @see ChannelMessageType */ public String getType() { return type; } /** ** The message type. *
*
* Constraints:
* Allowed Values: STANDARD, CONTROL
*
* @param type
* The message type. *
* @see ChannelMessageType */ public void setType(String type) { this.type = type; } /** ** The message type. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: STANDARD, CONTROL
*
* @param type
* The message type. *
* @return A reference to this updated object so that method calls can be * chained together. * @see ChannelMessageType */ public ChannelMessage withType(String type) { this.type = type; return this; } /** ** The message type. *
*
* Constraints:
* Allowed Values: STANDARD, CONTROL
*
* @param type
* The message type. *
* @see ChannelMessageType */ public void setType(ChannelMessageType type) { this.type = type.toString(); } /** ** The message type. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: STANDARD, CONTROL
*
* @param type
* The message type. *
* @return A reference to this updated object so that method calls can be * chained together. * @see ChannelMessageType */ public ChannelMessage withType(ChannelMessageType type) { this.type = type.toString(); return this; } /** ** The time at which the message was created. *
* * @return* The time at which the message was created. *
*/ public java.util.Date getCreatedTimestamp() { return createdTimestamp; } /** ** The time at which the message was created. *
* * @param createdTimestamp* The time at which the message was created. *
*/ public void setCreatedTimestamp(java.util.Date createdTimestamp) { this.createdTimestamp = createdTimestamp; } /** ** The time at which the message was created. *
** Returns a reference to this object so that method calls can be chained * together. * * @param createdTimestamp
* The time at which the message was created. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ChannelMessage withCreatedTimestamp(java.util.Date createdTimestamp) { this.createdTimestamp = createdTimestamp; return this; } /** ** The time at which a message was edited. *
* * @return* The time at which a message was edited. *
*/ public java.util.Date getLastEditedTimestamp() { return lastEditedTimestamp; } /** ** The time at which a message was edited. *
* * @param lastEditedTimestamp* The time at which a message was edited. *
*/ public void setLastEditedTimestamp(java.util.Date lastEditedTimestamp) { this.lastEditedTimestamp = lastEditedTimestamp; } /** ** The time at which a message was edited. *
** Returns a reference to this object so that method calls can be chained * together. * * @param lastEditedTimestamp
* The time at which a message was edited. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ChannelMessage withLastEditedTimestamp(java.util.Date lastEditedTimestamp) { this.lastEditedTimestamp = lastEditedTimestamp; return this; } /** ** The time at which a message was updated. *
* * @return* The time at which a message was updated. *
*/ public java.util.Date getLastUpdatedTimestamp() { return lastUpdatedTimestamp; } /** ** The time at which a message was updated. *
* * @param lastUpdatedTimestamp* The time at which a message was updated. *
*/ public void setLastUpdatedTimestamp(java.util.Date lastUpdatedTimestamp) { this.lastUpdatedTimestamp = lastUpdatedTimestamp; } /** ** The time at which a message was updated. *
** Returns a reference to this object so that method calls can be chained * together. * * @param lastUpdatedTimestamp
* The time at which a message was updated. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ChannelMessage withLastUpdatedTimestamp(java.util.Date lastUpdatedTimestamp) { this.lastUpdatedTimestamp = lastUpdatedTimestamp; return this; } /** ** The message sender. *
* * @return* The message sender. *
*/ public Identity getSender() { return sender; } /** ** The message sender. *
* * @param sender* The message sender. *
*/ public void setSender(Identity sender) { this.sender = sender; } /** ** The message sender. *
** Returns a reference to this object so that method calls can be chained * together. * * @param sender
* The message sender. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ChannelMessage withSender(Identity sender) { this.sender = sender; return this; } /** ** Hides the content of a message. *
* * @return* Hides the content of a message. *
*/ public Boolean isRedacted() { return redacted; } /** ** Hides the content of a message. *
* * @return* Hides the content of a message. *
*/ public Boolean getRedacted() { return redacted; } /** ** Hides the content of a message. *
* * @param redacted* Hides the content of a message. *
*/ public void setRedacted(Boolean redacted) { this.redacted = redacted; } /** ** Hides the content of a message. *
** Returns a reference to this object so that method calls can be chained * together. * * @param redacted
* Hides the content of a message. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ChannelMessage withRedacted(Boolean redacted) { this.redacted = redacted; return this; } /** ** The persistence setting for a channel message. *
*
* Constraints:
* Allowed Values: PERSISTENT, NON_PERSISTENT
*
* @return
* The persistence setting for a channel message. *
* @see ChannelMessagePersistenceType */ public String getPersistence() { return persistence; } /** ** The persistence setting for a channel message. *
*
* Constraints:
* Allowed Values: PERSISTENT, NON_PERSISTENT
*
* @param persistence
* The persistence setting for a channel message. *
* @see ChannelMessagePersistenceType */ public void setPersistence(String persistence) { this.persistence = persistence; } /** ** The persistence setting for a channel message. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: PERSISTENT, NON_PERSISTENT
*
* @param persistence
* The persistence setting for a channel message. *
* @return A reference to this updated object so that method calls can be * chained together. * @see ChannelMessagePersistenceType */ public ChannelMessage withPersistence(String persistence) { this.persistence = persistence; return this; } /** ** The persistence setting for a channel message. *
*
* Constraints:
* Allowed Values: PERSISTENT, NON_PERSISTENT
*
* @param persistence
* The persistence setting for a channel message. *
* @see ChannelMessagePersistenceType */ public void setPersistence(ChannelMessagePersistenceType persistence) { this.persistence = persistence.toString(); } /** ** The persistence setting for a channel message. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: PERSISTENT, NON_PERSISTENT
*
* @param persistence
* The persistence setting for a channel message. *
* @return A reference to this updated object so that method calls can be * chained together. * @see ChannelMessagePersistenceType */ public ChannelMessage withPersistence(ChannelMessagePersistenceType persistence) { this.persistence = persistence.toString(); return this; } /** ** The status of the channel message. *
* * @return* The status of the channel message. *
*/ public ChannelMessageStatusStructure getStatus() { return status; } /** ** The status of the channel message. *
* * @param status* The status of the channel message. *
*/ public void setStatus(ChannelMessageStatusStructure status) { this.status = status; } /** ** The status of the channel message. *
** Returns a reference to this object so that method calls can be chained * together. * * @param status
* The status of the channel message. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ChannelMessage withStatus(ChannelMessageStatusStructure status) { this.status = status; 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* 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* 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. *
** Returns a reference to this object so that method calls can be chained * together. * * @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 A reference to this updated object so that method calls can be * chained together. */ public ChannelMessage withMessageAttributes( java.util.Map* 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. *
*
* The method adds a new key-value pair into MessageAttributes parameter,
* and returns a reference to this object so that method calls can be
* chained together.
*
* @param key The key of the entry to be added into MessageAttributes.
* @param value The corresponding value of the entry to be added into
* MessageAttributes.
* @return A reference to this updated object so that method calls can be
* chained together.
*/
public ChannelMessage addMessageAttributesEntry(String key, MessageAttributeValue value) {
if (null == this.messageAttributes) {
this.messageAttributes = new java.util.HashMap
* Returns a reference to this object so that method calls can be chained
* together.
*/
public ChannelMessage clearMessageAttributesEntries() {
this.messageAttributes = null;
return this;
}
/**
*
* The ID of the SubChannel.
*
* Constraints:
* The ID of the SubChannel.
*
* The ID of the SubChannel.
*
* Constraints:
* The ID of the SubChannel.
*
* The ID of the SubChannel.
*
* Returns a reference to this object so that method calls can be chained
* together.
*
* Constraints:
* The ID of the SubChannel.
*
* The content type of the channel message. For Amazon Lex V2 bot responses,
* the content type is
* Constraints:
* The content type of the channel message. For Amazon Lex V2 bot
* responses, the content type is
*
* The content type of the channel message. For Amazon Lex V2 bot responses,
* the content type is
* Constraints:
* The content type of the channel message. For Amazon Lex V2 bot
* responses, the content type is
*
* The content type of the channel message. For Amazon Lex V2 bot responses,
* the content type is
* Returns a reference to this object so that method calls can be chained
* together.
*
* Constraints:
* The content type of the channel message. For Amazon Lex V2 bot
* responses, the content type is
*
* The target of a message, a sender, a user, or a bot. Only the target and
* the sender can view targeted messages. Only users who can see targeted
* messages can take actions on them. However, administrators can delete
* targeted messages that they can’t see.
*
* The target of a message, a sender, a user, or a bot. Only the
* target and the sender can view targeted messages. Only users who
* can see targeted messages can take actions on them. However,
* administrators can delete targeted messages that they can’t see.
*
* The target of a message, a sender, a user, or a bot. Only the target and
* the sender can view targeted messages. Only users who can see targeted
* messages can take actions on them. However, administrators can delete
* targeted messages that they can’t see.
*
* The target of a message, a sender, a user, or a bot. Only the
* target and the sender can view targeted messages. Only users
* who can see targeted messages can take actions on them.
* However, administrators can delete targeted messages that they
* can’t see.
*
* The target of a message, a sender, a user, or a bot. Only the target and
* the sender can view targeted messages. Only users who can see targeted
* messages can take actions on them. However, administrators can delete
* targeted messages that they can’t see.
*
* Returns a reference to this object so that method calls can be chained
* together.
*
* @param target
* The target of a message, a sender, a user, or a bot. Only the
* target and the sender can view targeted messages. Only users
* who can see targeted messages can take actions on them.
* However, administrators can delete targeted messages that they
* can’t see.
*
* The target of a message, a sender, a user, or a bot. Only the target and
* the sender can view targeted messages. Only users who can see targeted
* messages can take actions on them. However, administrators can delete
* targeted messages that they can’t see.
*
* Returns a reference to this object so that method calls can be chained
* together.
*
* @param target
* The target of a message, a sender, a user, or a bot. Only the
* target and the sender can view targeted messages. Only users
* who can see targeted messages can take actions on them.
* However, administrators can delete targeted messages that they
* can’t see.
*
* Length: 1 - 128
* Pattern: [-_a-zA-Z0-9]*
*
* @return
* Length: 1 - 128
* Pattern: [-_a-zA-Z0-9]*
*
* @param subChannelId
* Length: 1 - 128
* Pattern: [-_a-zA-Z0-9]*
*
* @param subChannelId 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.
*
* Length: 0 - 45
* Pattern: [\s\S]*
*
* @return 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.
* 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.
*
* Length: 0 - 45
* Pattern: [\s\S]*
*
* @param contentType 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.
* 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.
*
* Length: 0 - 45
* Pattern: [\s\S]*
*
* @param contentType 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.
*