/* * 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; import com.amazonaws.AmazonWebServiceRequest; /** *
* Sends a message to a particular channel that the member is a part of. *
*
* The x-amz-chime-bearer
request header is mandatory. Use the ARN
* of the AppInstanceUser
or AppInstanceBot
that makes
* the API call as the value in the header.
*
* Also, STANDARD
messages can be up to 4KB in size and contain
* metadata. Metadata is arbitrary, and you can use it in a variety of ways,
* such as containing a link to an attachment.
*
* CONTROL
messages are limited to 30 bytes and do not contain
* metadata.
*
* 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 content of the channel message. *
*
* Constraints:
* Length: 1 -
* Pattern: [\s\S]*
*/
private String content;
/**
*
* The type of message, STANDARD
or CONTROL
.
*
* STANDARD
messages can be up to 4KB in size and contain
* metadata. Metadata is arbitrary, and you can use it in a variety of ways,
* such as containing a link to an attachment.
*
* CONTROL
messages are limited to 30 bytes and do not contain
* metadata.
*
* Constraints:
* Allowed Values: STANDARD, CONTROL
*/
private String type;
/**
*
* Boolean that controls whether the message is persisted on the back end. * Required. *
*
* Constraints:
* Allowed Values: PERSISTENT, NON_PERSISTENT
*/
private String persistence;
/**
*
* The optional metadata for each message. *
*
* Constraints:
* Length: 0 - 1024
* Pattern: .*
*/
private String metadata;
/**
*
* The Idempotency
token for each client request.
*
* Constraints:
* Length: 2 - 64
* Pattern: [-_a-zA-Z0-9]*
*/
private String clientRequestToken;
/**
*
* The ARN of the AppInstanceUser
or
* AppInstanceBot
that makes the API call.
*
* 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 chimeBearer;
/**
*
* The push notification configuration of the message. *
*/ private PushNotificationConfiguration pushNotification; /** *
* The attributes for the message, used for message filtering along with a
* FilterRule
defined in the
* PushNotificationPreferences
.
*
* The ID of the SubChannel in the request. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [-_a-zA-Z0-9]*
*/
private String subChannelId;
/**
*
* The content type of the channel message. *
*
* Constraints:
* Length: 0 - 45
* Pattern: [\s\S]*
*/
private String contentType;
/**
*
* The target of a message. Must be a member of the channel, such as another * user, a bot, or the sender. 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 SendChannelMessageRequest withChannelArn(String channelArn) { this.channelArn = channelArn; return this; } /** ** The content of the channel message. *
*
* Constraints:
* Length: 1 -
* Pattern: [\s\S]*
*
* @return
* The content of the channel message. *
*/ public String getContent() { return content; } /** ** The content of the channel message. *
*
* Constraints:
* Length: 1 -
* Pattern: [\s\S]*
*
* @param content
* The content of the channel message. *
*/ public void setContent(String content) { this.content = content; } /** ** The content of the channel message. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 -
* Pattern: [\s\S]*
*
* @param content
* The content of the channel message. *
* @return A reference to this updated object so that method calls can be * chained together. */ public SendChannelMessageRequest withContent(String content) { this.content = content; return this; } /** *
* The type of message, STANDARD
or CONTROL
.
*
* STANDARD
messages can be up to 4KB in size and contain
* metadata. Metadata is arbitrary, and you can use it in a variety of ways,
* such as containing a link to an attachment.
*
* CONTROL
messages are limited to 30 bytes and do not contain
* metadata.
*
* Constraints:
* Allowed Values: STANDARD, CONTROL
*
* @return
* The type of message, STANDARD
or
* CONTROL
.
*
* STANDARD
messages can be up to 4KB in size and
* contain metadata. Metadata is arbitrary, and you can use it in a
* variety of ways, such as containing a link to an attachment.
*
* CONTROL
messages are limited to 30 bytes and do not
* contain metadata.
*
* The type of message, STANDARD
or CONTROL
.
*
* STANDARD
messages can be up to 4KB in size and contain
* metadata. Metadata is arbitrary, and you can use it in a variety of ways,
* such as containing a link to an attachment.
*
* CONTROL
messages are limited to 30 bytes and do not contain
* metadata.
*
* Constraints:
* Allowed Values: STANDARD, CONTROL
*
* @param type
* The type of message, STANDARD
or
* CONTROL
.
*
* STANDARD
messages can be up to 4KB in size and
* contain metadata. Metadata is arbitrary, and you can use it in
* a variety of ways, such as containing a link to an attachment.
*
* CONTROL
messages are limited to 30 bytes and do
* not contain metadata.
*
* The type of message, STANDARD
or CONTROL
.
*
* STANDARD
messages can be up to 4KB in size and contain
* metadata. Metadata is arbitrary, and you can use it in a variety of ways,
* such as containing a link to an attachment.
*
* CONTROL
messages are limited to 30 bytes and do not contain
* metadata.
*
* Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: STANDARD, CONTROL
*
* @param type
* The type of message, STANDARD
or
* CONTROL
.
*
* STANDARD
messages can be up to 4KB in size and
* contain metadata. Metadata is arbitrary, and you can use it in
* a variety of ways, such as containing a link to an attachment.
*
* CONTROL
messages are limited to 30 bytes and do
* not contain metadata.
*
* The type of message, STANDARD
or CONTROL
.
*
* STANDARD
messages can be up to 4KB in size and contain
* metadata. Metadata is arbitrary, and you can use it in a variety of ways,
* such as containing a link to an attachment.
*
* CONTROL
messages are limited to 30 bytes and do not contain
* metadata.
*
* Constraints:
* Allowed Values: STANDARD, CONTROL
*
* @param type
* The type of message, STANDARD
or
* CONTROL
.
*
* STANDARD
messages can be up to 4KB in size and
* contain metadata. Metadata is arbitrary, and you can use it in
* a variety of ways, such as containing a link to an attachment.
*
* CONTROL
messages are limited to 30 bytes and do
* not contain metadata.
*
* The type of message, STANDARD
or CONTROL
.
*
* STANDARD
messages can be up to 4KB in size and contain
* metadata. Metadata is arbitrary, and you can use it in a variety of ways,
* such as containing a link to an attachment.
*
* CONTROL
messages are limited to 30 bytes and do not contain
* metadata.
*
* Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: STANDARD, CONTROL
*
* @param type
* The type of message, STANDARD
or
* CONTROL
.
*
* STANDARD
messages can be up to 4KB in size and
* contain metadata. Metadata is arbitrary, and you can use it in
* a variety of ways, such as containing a link to an attachment.
*
* CONTROL
messages are limited to 30 bytes and do
* not contain metadata.
*
* Boolean that controls whether the message is persisted on the back end. * Required. *
*
* Constraints:
* Allowed Values: PERSISTENT, NON_PERSISTENT
*
* @return
* Boolean that controls whether the message is persisted on the * back end. Required. *
* @see ChannelMessagePersistenceType */ public String getPersistence() { return persistence; } /** ** Boolean that controls whether the message is persisted on the back end. * Required. *
*
* Constraints:
* Allowed Values: PERSISTENT, NON_PERSISTENT
*
* @param persistence
* Boolean that controls whether the message is persisted on the * back end. Required. *
* @see ChannelMessagePersistenceType */ public void setPersistence(String persistence) { this.persistence = persistence; } /** ** Boolean that controls whether the message is persisted on the back end. * Required. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: PERSISTENT, NON_PERSISTENT
*
* @param persistence
* Boolean that controls whether the message is persisted on the * back end. Required. *
* @return A reference to this updated object so that method calls can be * chained together. * @see ChannelMessagePersistenceType */ public SendChannelMessageRequest withPersistence(String persistence) { this.persistence = persistence; return this; } /** ** Boolean that controls whether the message is persisted on the back end. * Required. *
*
* Constraints:
* Allowed Values: PERSISTENT, NON_PERSISTENT
*
* @param persistence
* Boolean that controls whether the message is persisted on the * back end. Required. *
* @see ChannelMessagePersistenceType */ public void setPersistence(ChannelMessagePersistenceType persistence) { this.persistence = persistence.toString(); } /** ** Boolean that controls whether the message is persisted on the back end. * Required. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: PERSISTENT, NON_PERSISTENT
*
* @param persistence
* Boolean that controls whether the message is persisted on the * back end. Required. *
* @return A reference to this updated object so that method calls can be * chained together. * @see ChannelMessagePersistenceType */ public SendChannelMessageRequest withPersistence(ChannelMessagePersistenceType persistence) { this.persistence = persistence.toString(); return this; } /** ** The optional metadata for each message. *
*
* Constraints:
* Length: 0 - 1024
* Pattern: .*
*
* @return
* The optional metadata for each message. *
*/ public String getMetadata() { return metadata; } /** ** The optional metadata for each message. *
*
* Constraints:
* Length: 0 - 1024
* Pattern: .*
*
* @param metadata
* The optional metadata for each message. *
*/ public void setMetadata(String metadata) { this.metadata = metadata; } /** ** The optional metadata for each message. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 0 - 1024
* Pattern: .*
*
* @param metadata
* The optional metadata for each message. *
* @return A reference to this updated object so that method calls can be * chained together. */ public SendChannelMessageRequest withMetadata(String metadata) { this.metadata = metadata; return this; } /** *
* The Idempotency
token for each client request.
*
* Constraints:
* Length: 2 - 64
* Pattern: [-_a-zA-Z0-9]*
*
* @return
* The Idempotency
token for each client request.
*
* The Idempotency
token for each client request.
*
* Constraints:
* Length: 2 - 64
* Pattern: [-_a-zA-Z0-9]*
*
* @param clientRequestToken
* The Idempotency
token for each client request.
*
* The Idempotency
token for each client request.
*
* Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 2 - 64
* Pattern: [-_a-zA-Z0-9]*
*
* @param clientRequestToken
* The Idempotency
token for each client request.
*
* The ARN of the AppInstanceUser
or
* AppInstanceBot
that makes the API call.
*
* 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 AppInstanceUser
or
* AppInstanceBot
that makes the API call.
*
* The ARN of the AppInstanceUser
or
* AppInstanceBot
that makes the API call.
*
* 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 chimeBearer
* The ARN of the AppInstanceUser
or
* AppInstanceBot
that makes the API call.
*
* The ARN of the AppInstanceUser
or
* AppInstanceBot
that makes the API call.
*
* 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 chimeBearer
* The ARN of the AppInstanceUser
or
* AppInstanceBot
that makes the API call.
*
* The push notification configuration of the message. *
* * @return* The push notification configuration of the message. *
*/ public PushNotificationConfiguration getPushNotification() { return pushNotification; } /** ** 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. *
** Returns a reference to this object so that method calls can be chained * together. * * @param pushNotification
* The push notification configuration of the message. *
* @return A reference to this updated object so that method calls can be * chained together. */ public SendChannelMessageRequest withPushNotification( PushNotificationConfiguration pushNotification) { this.pushNotification = pushNotification; return this; } /** *
* The attributes for the message, used for message filtering along with a
* FilterRule
defined in the
* PushNotificationPreferences
.
*
* The attributes for the message, used for message filtering along
* with a FilterRule
defined in the
* PushNotificationPreferences
.
*
* The attributes for the message, used for message filtering along with a
* FilterRule
defined in the
* PushNotificationPreferences
.
*
* The attributes for the message, used for message filtering
* along with a FilterRule
defined in the
* PushNotificationPreferences
.
*
* The attributes for the message, used for message filtering along with a
* FilterRule
defined in the
* PushNotificationPreferences
.
*
* Returns a reference to this object so that method calls can be chained * together. * * @param messageAttributes
* The attributes for the message, used for message filtering
* along with a FilterRule
defined in the
* PushNotificationPreferences
.
*
* The attributes for the message, used for message filtering along with a
* FilterRule
defined in the
* PushNotificationPreferences
.
*
* 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 SendChannelMessageRequest 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 SendChannelMessageRequest clearMessageAttributesEntries() {
this.messageAttributes = null;
return this;
}
/**
*
* The ID of the SubChannel in the request.
*
* Constraints:
* The ID of the SubChannel in the request.
*
* The ID of the SubChannel in the request.
*
* Constraints:
* The ID of the SubChannel in the request.
*
* The ID of the SubChannel in the request.
*
* Returns a reference to this object so that method calls can be chained
* together.
*
* Constraints:
* The ID of the SubChannel in the request.
*
* The content type of the channel message.
*
* Constraints:
* The content type of the channel message.
*
* The content type of the channel message.
*
* Constraints:
* The content type of the channel message.
*
* The content type of the channel message.
*
* Returns a reference to this object so that method calls can be chained
* together.
*
* Constraints:
* The content type of the channel message.
*
* The target of a message. Must be a member of the channel, such as another
* user, a bot, or the sender. 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. Must be a member of the channel, such as
* another user, a bot, or the sender. 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. Must be a member of the channel, such as another
* user, a bot, or the sender. 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. Must be a member of the channel, such
* as another user, a bot, or the sender. 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. Must be a member of the channel, such as another
* user, a bot, or the sender. 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. Must be a member of the channel, such
* as another user, a bot, or the sender. 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. Must be a member of the channel, such as another
* user, a bot, or the sender. 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. Must be a member of the channel, such
* as another user, a bot, or the sender. 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
* Length: 0 - 45
* Pattern: [\s\S]*
*
* @return
* Length: 0 - 45
* Pattern: [\s\S]*
*
* @param contentType
* Length: 0 - 45
* Pattern: [\s\S]*
*
* @param contentType