Class EditMessageApiRequest
java.lang.Object
com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
com.github.jamesnetherton.zulip.client.api.message.request.EditMessageApiRequest
- All Implemented Interfaces:
ExecutableApiRequest<List<DetachedUpload>>
public class EditMessageApiRequest
extends ZulipApiRequest
implements ExecutableApiRequest<List<DetachedUpload>>
Zulip API request builder for editing a message.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEditMessageApiRequest(ZulipHttpClient client, long messageId) Constructs aEditMessageApiRequest. -
Method Summary
Modifier and TypeMethodDescriptionexecute()Executes the Zulip API request for editing a message.withContent(String content) Sets the optional edited message content.withPrevContentSha256(String prevContentSha256) Sets the SHA256 hash of the previous raw content of the message that the client has at the time of the request.Sets the optional propagation mode.withSendNotificationToNewThread(boolean send) Sets the optional flag for whether to send a message to the new thread to notify users where the message came from.withSendNotificationToOldThread(boolean send) Sets the optional flag for whether to send a message to the old thread to notify users where the message has moved to.withStreamId(long streamId) Sets the optional id of the stream to move the message to.Sets the optional name of the topic to move the message to.Methods inherited from class com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
client, getParam, getParam, getParams, putParam, putParamAsJsonString, putParamAsWrappedObject
-
Field Details
-
CONTENT
- See Also:
-
PREV_CONTENT_SHA256
- See Also:
-
PROPAGATE_MODE
- See Also:
-
SEND_NOTIFICATION_TO_OLD_THREAD
- See Also:
-
SEND_NOTIFICATION_TO_NEW_THREAD
- See Also:
-
STREAM_ID
- See Also:
-
TOPIC
- See Also:
-
-
Constructor Details
-
EditMessageApiRequest
Constructs aEditMessageApiRequest.- Parameters:
client- The Zulip HTTP clientmessageId- The id of the message to edit
-
-
Method Details
-
withContent
Sets the optional edited message content.- Parameters:
content- The modified message content- Returns:
- This
EditMessageApiRequestinstance - See Also:
-
withPrevContentSha256
Sets the SHA256 hash of the previous raw content of the message that the client has at the time of the request.- Parameters:
prevContentSha256- The SHA-256 hash of the previous raw content- Returns:
- This
EditMessageApiRequestinstance - See Also:
-
withPropagateMode
Sets the optional propagation mode. Controls which messages(s) should be deleted.- Parameters:
mode- The propagation mode to use- Returns:
- This
EditMessageApiRequestinstance - See Also:
-
withSendNotificationToOldThread
Sets the optional flag for whether to send a message to the old thread to notify users where the message has moved to.- Parameters:
send-trueto send message notifications to the old thread.falseto not send any notification- Returns:
- This
EditMessageApiRequestinstance - See Also:
-
withSendNotificationToNewThread
Sets the optional flag for whether to send a message to the new thread to notify users where the message came from.- Parameters:
send-trueto send message notifications to the new thread.falseto not send any notification- Returns:
- This
EditMessageApiRequestinstance - See Also:
-
withStreamId
Sets the optional id of the stream to move the message to.- Parameters:
streamId- The id of the stream to which the message should be moved to- Returns:
- This
EditMessageApiRequestinstance - See Also:
-
withTopic
Sets the optional name of the topic to move the message to.- Parameters:
topic- The name of the topic that the message should use- Returns:
- This
EditMessageApiRequestinstance - See Also:
-
execute
Executes the Zulip API request for editing a message.- Specified by:
executein interfaceExecutableApiRequest<List<DetachedUpload>>- Returns:
- The response for type T
- Throws:
ZulipClientException- if the request was not successful
-