Class SendMessageApiRequest
java.lang.Object
com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
com.github.jamesnetherton.zulip.client.api.message.request.SendMessageApiRequest
- All Implemented Interfaces:
ExecutableApiRequest<Long>
Zulip API request builder for sending a message.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSendMessageApiRequest
(ZulipHttpClient client, String content, long... to) Constructs aSendMessageApiRequest
for sending a direct message.SendMessageApiRequest
(ZulipHttpClient client, String content, long streamId, String topic) Constructs aSendMessageApiRequest
.SendMessageApiRequest
(ZulipHttpClient client, String content, long streamId, String topic, MessageType type) Constructs aSendMessageApiRequest
.SendMessageApiRequest
(ZulipHttpClient client, String content, String... to) Constructs aSendMessageApiRequest
for sending a direct message.SendMessageApiRequest
(ZulipHttpClient client, String content, String streamName, String topic) Constructs aSendMessageApiRequest
for sending a message to a stream.SendMessageApiRequest
(ZulipHttpClient client, String content, String streamName, String topic, MessageType type) Constructs aSendMessageApiRequest
for sending a message to a stream. -
Method Summary
Modifier and TypeMethodDescriptionexecute()
Executes the Zulip API request for sending a message.withLocalId
(String localId) The optional local id associated with the message.withQueueId
(String queueId) The optional queue id associated with the message.withReadBySender
(boolean readBySender) The optional value of whether the message should be initially marked read by its sender.Methods inherited from class com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
client, getParam, getParams, putParam, putParamAsJsonString, putParamAsWrappedObject
-
Field Details
-
CONTENT
- See Also:
-
LOCAL_ID
- See Also:
-
QUEUE_ID
- See Also:
-
READ_BY_SENDER
- See Also:
-
TO
- See Also:
-
TO_DIRECT
- See Also:
-
TO_STREAM
- See Also:
-
TOPIC
- See Also:
-
TYPE
- See Also:
-
-
Constructor Details
-
SendMessageApiRequest
Constructs aSendMessageApiRequest
for sending a direct message.- Parameters:
client
- The Zulip HTTP clientcontent
- The message contentto
- One or more user email addresses for which the direct message should be sent to
-
SendMessageApiRequest
Constructs aSendMessageApiRequest
for sending a direct message.- Parameters:
client
- The Zulip HTTP clientcontent
- The message contentto
- One or more user ids for which the direct message should be sent to
-
SendMessageApiRequest
public SendMessageApiRequest(ZulipHttpClient client, String content, String streamName, String topic) Constructs aSendMessageApiRequest
for sending a message to a stream.- Parameters:
client
- The Zulip HTTP clientcontent
- The message contentstreamName
- The name of the stream to which the stream should be sent totopic
- The name od the topic to post the message under
-
SendMessageApiRequest
Constructs aSendMessageApiRequest
.- Parameters:
client
- The Zulip HTTP clientcontent
- The message contentstreamId
- The id of the stream to which the stream should be sent totopic
- The name od the topic to post the message under
-
SendMessageApiRequest
public SendMessageApiRequest(ZulipHttpClient client, String content, String streamName, String topic, MessageType type) Constructs aSendMessageApiRequest
for sending a message to a stream.- Parameters:
client
- The Zulip HTTP clientcontent
- The message contentstreamName
- The name of the stream to which the stream should be sent totopic
- The name od the topic to post the message undertype
- TheMessageType
for the type of message to send
-
SendMessageApiRequest
public SendMessageApiRequest(ZulipHttpClient client, String content, long streamId, String topic, MessageType type) Constructs aSendMessageApiRequest
.- Parameters:
client
- The Zulip HTTP clientcontent
- The message contentstreamId
- The id of the stream to which the stream should be sent totopic
- The name od the topic to post the message undertype
- TheMessageType
for the type of message to send
-
-
Method Details
-
withLocalId
The optional local id associated with the message.- Parameters:
localId
- The local id to associate with the message- Returns:
- This
SendMessageApiRequest
instance - See Also:
-
withQueueId
The optional queue id associated with the message.- Parameters:
queueId
- The queue id to associate with the message- Returns:
- This
SendMessageApiRequest
instance - See Also:
-
withReadBySender
The optional value of whether the message should be initially marked read by its sender.- Parameters:
readBySender
- Whether the message should be initially marked read by its sender- Returns:
- This
SendMessageApiRequest
instance - See Also:
-
execute
Executes the Zulip API request for sending a message.- Specified by:
execute
in interfaceExecutableApiRequest<Long>
- Returns:
- The id of the message
- Throws:
ZulipClientException
- if the request was not successful
-