Class SendScheduledMessageApiRequest
java.lang.Object
com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
com.github.jamesnetherton.zulip.client.api.message.request.SendScheduledMessageApiRequest
- All Implemented Interfaces:
ExecutableApiRequest<Long>
public class SendScheduledMessageApiRequest
extends ZulipApiRequest
implements ExecutableApiRequest<Long>
Zulip API request builder for sending a scheduled message.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSendScheduledMessageApiRequest(ZulipHttpClient client, MessageType type, String content, Instant deliveryTimestamp, long... to) Constructs aSendScheduledMessageApiRequestfor sending a scheduled message. -
Method Summary
Modifier and TypeMethodDescriptionexecute()Executes the Zulip API request for sending a scheduled message.withReadBySender(boolean readBySender) Sets optional the value of whether the message should be initially marked read by its sender.Sets the topic of the message.Methods inherited from class ZulipApiRequest
client, getParam, getParam, getParams, putParam, putParamAsJsonString, putParamAsWrappedObject
-
Field Details
-
CONTENT
- See Also:
-
READ_BY_SENDER
- See Also:
-
SCHEDULED_DELIVERY_TIMESTAMP
- See Also:
-
TO
- See Also:
-
TOPIC
- See Also:
-
TYPE
- See Also:
-
-
Constructor Details
-
SendScheduledMessageApiRequest
public SendScheduledMessageApiRequest(ZulipHttpClient client, MessageType type, String content, Instant deliveryTimestamp, long... to) Constructs aSendScheduledMessageApiRequestfor sending a scheduled message.- Parameters:
client- The Zulip HTTP clienttype- The type of scheduled message to be sentcontent- The content of the messagedeliveryTimestamp- The UNIX epoch timestamp for when the message will be sentto- If the type is 'stream' then this is the id of the stream. Else one or more user ids may be specified
-
-
Method Details
-
withReadBySender
Sets optional the 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
SendScheduledMessageApiRequestinstance - See Also:
-
withTopic
Sets the topic of the message. Only required if 'type' is 'stream'.- Parameters:
topic- The topic that the scheduled message should be sent to- Returns:
- This
SendScheduledMessageApiRequestinstance - See Also:
-
execute
Executes the Zulip API request for sending a scheduled message.- Specified by:
executein interfaceExecutableApiRequest<Long>- Returns:
- The id of the scheduled message
- Throws:
ZulipClientException- if the request was not successful
-