/* * 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.AmazonWebServiceRequest; /** * * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class SendChannelMessageRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The ARN of the channel. *
*/ private String channelArn; /** ** The content of the channel message. *
*/ 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.
*
* Boolean that controls whether the message is persisted on the back end. Required. *
*/ private String persistence; /** ** The optional metadata for each message. *
*/ private String metadata; /** *
* The Idempotency
token for each client request.
*
* The ARN of the AppInstanceUser
or AppInstanceBot
that makes the API call.
*
* 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. *
*/ private String subChannelId; /** ** The content type of the channel message. *
*/ 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. *
* * @param channelArn * The ARN of the channel. */ public void setChannelArn(String channelArn) { this.channelArn = channelArn; } /** ** The ARN of the channel. *
* * @return The ARN of the channel. */ public String getChannelArn() { return this.channelArn; } /** ** The ARN of the channel. *
* * @param channelArn * The ARN of the channel. * @return Returns a reference to this object so that method calls can be chained together. */ public SendChannelMessageRequest withChannelArn(String channelArn) { setChannelArn(channelArn); return this; } /** ** The content of the channel message. *
* * @param content * The content of the channel message. */ public void setContent(String content) { this.content = content; } /** ** The content of the channel message. *
* * @return The content of the channel message. */ public String getContent() { return this.content; } /** ** The content of the channel message. *
* * @param content * The content of the channel message. * @return Returns a reference to this object so that method calls can be chained together. */ public SendChannelMessageRequest withContent(String content) { setContent(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.
*
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.
* @see ChannelMessageType
*/
public void setType(String type) {
this.type = 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.
*
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.
* @see ChannelMessageType
*/
public String getType() {
return this.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.
*
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.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ChannelMessageType
*/
public SendChannelMessageRequest withType(String type) {
setType(type);
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.
*
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.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ChannelMessageType
*/
public SendChannelMessageRequest withType(ChannelMessageType type) {
this.type = type.toString();
return this;
}
/**
*
* Boolean that controls whether the message is persisted on the back end. Required. *
* * @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. *
* * @return Boolean that controls whether the message is persisted on the back end. Required. * @see ChannelMessagePersistenceType */ public String getPersistence() { return this.persistence; } /** ** Boolean that controls whether the message is persisted on the back end. Required. *
* * @param persistence * Boolean that controls whether the message is persisted on the back end. Required. * @return Returns a reference to this object so that method calls can be chained together. * @see ChannelMessagePersistenceType */ public SendChannelMessageRequest withPersistence(String persistence) { setPersistence(persistence); return this; } /** ** Boolean that controls whether the message is persisted on the back end. Required. *
* * @param persistence * Boolean that controls whether the message is persisted on the back end. Required. * @return Returns a reference to this 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. *
* * @param metadata * The optional metadata for each message. */ public void setMetadata(String metadata) { this.metadata = metadata; } /** ** The optional metadata for each message. *
* * @return The optional metadata for each message. */ public String getMetadata() { return this.metadata; } /** ** The optional metadata for each message. *
* * @param metadata * The optional metadata for each message. * @return Returns a reference to this object so that method calls can be chained together. */ public SendChannelMessageRequest withMetadata(String metadata) { setMetadata(metadata); return this; } /** *
* The Idempotency
token for each client request.
*
Idempotency
token for each client request.
*/
public void setClientRequestToken(String clientRequestToken) {
this.clientRequestToken = clientRequestToken;
}
/**
*
* The Idempotency
token for each client request.
*
Idempotency
token for each client request.
*/
public String getClientRequestToken() {
return this.clientRequestToken;
}
/**
*
* The Idempotency
token for each client request.
*
Idempotency
token for each client request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SendChannelMessageRequest withClientRequestToken(String clientRequestToken) {
setClientRequestToken(clientRequestToken);
return this;
}
/**
*
* The ARN of the AppInstanceUser
or AppInstanceBot
that makes the API call.
*
AppInstanceUser
or AppInstanceBot
that makes the API call.
*/
public void setChimeBearer(String chimeBearer) {
this.chimeBearer = chimeBearer;
}
/**
*
* The ARN of the AppInstanceUser
or AppInstanceBot
that makes the API call.
*
AppInstanceUser
or AppInstanceBot
that makes the API call.
*/
public String getChimeBearer() {
return this.chimeBearer;
}
/**
*
* The ARN of the AppInstanceUser
or AppInstanceBot
that makes the API call.
*
AppInstanceUser
or AppInstanceBot
that makes the API call.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SendChannelMessageRequest withChimeBearer(String chimeBearer) {
setChimeBearer(chimeBearer);
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 SendChannelMessageRequest withPushNotification(PushNotificationConfiguration pushNotification) { setPushNotification(pushNotification); return this; } /** *
* The attributes for the message, used for message filtering along with a FilterRule
defined in the
* PushNotificationPreferences
.
*
FilterRule
defined
* in the PushNotificationPreferences
.
*/
public java.util.Map
* The attributes for the message, used for message filtering along with a FilterRule
defined in the
* PushNotificationPreferences
.
*
FilterRule
defined in
* the PushNotificationPreferences
.
*/
public void setMessageAttributes(java.util.Map
* The attributes for the message, used for message filtering along with a FilterRule
defined in the
* PushNotificationPreferences
.
*
FilterRule
defined in
* the PushNotificationPreferences
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SendChannelMessageRequest withMessageAttributes(java.util.Map* The ID of the SubChannel in the request. *
* * @param subChannelId * The ID of the SubChannel in the request. */ public void setSubChannelId(String subChannelId) { this.subChannelId = subChannelId; } /** ** The ID of the SubChannel in the request. *
* * @return The ID of the SubChannel in the request. */ public String getSubChannelId() { return this.subChannelId; } /** ** The ID of the SubChannel in the request. *
* * @param subChannelId * The ID of the SubChannel in the request. * @return Returns a reference to this object so that method calls can be chained together. */ public SendChannelMessageRequest withSubChannelId(String subChannelId) { setSubChannelId(subChannelId); return this; } /** ** The content type of the channel message. *
* * @param contentType * The content type of the channel message. */ public void setContentType(String contentType) { this.contentType = contentType; } /** ** The content type of the channel message. *
* * @return The content type of the channel message. */ public String getContentType() { return this.contentType; } /** ** The content type of the channel message. *
* * @param contentType * The content type of the channel message. * @return Returns a reference to this object so that method calls can be chained together. */ public SendChannelMessageRequest withContentType(String contentType) { setContentType(contentType); return this; } /** ** 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. *
* * @return 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. */ public java.util.List* 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. *
* * @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. */ public void setTarget(java.util.Collection* 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. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setTarget(java.util.Collection)} or {@link #withTarget(java.util.Collection)} if you want to override the * existing values. *
* * @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. * @return Returns a reference to this object so that method calls can be chained together. */ public SendChannelMessageRequest withTarget(Target... target) { if (this.target == null) { setTarget(new java.util.ArrayList* 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. *
* * @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. * @return Returns a reference to this object so that method calls can be chained together. */ public SendChannelMessageRequest withTarget(java.util.Collection