Class GetMessagesApiRequest
java.lang.Object
com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
com.github.jamesnetherton.zulip.client.api.message.request.GetMessagesApiRequest
- All Implemented Interfaces:
ExecutableApiRequest<List<Message>>,NarrowableApiRequest<GetMessagesApiRequest>
public class GetMessagesApiRequest
extends ZulipApiRequest
implements NarrowableApiRequest<GetMessagesApiRequest>, ExecutableApiRequest<List<Message>>
Zulip API request builder for searching and getting messages.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGetMessagesApiRequest(ZulipHttpClient client) Constructs aGetMessagesApiRequest. -
Method Summary
Modifier and TypeMethodDescriptionexecute()Executes the Zulip API request for searching and getting messages.withAllowEmptyTopicName(boolean allowEmptyTopicName) Sets whether to allow empty topic names to be returned.withAnchor(long messageId) Sets the optional message id anchor to filter and restrict messages.withAnchor(Anchor anchor) Sets the optionalAnchorto filter and restrict messages.withGravatar(boolean clientGravatar) Sets the optional choice of whether to return the users gravatar URL int the response.withIncludeAnchor(boolean includeAnchor) Whether a message with the specified ID matching the narrow should be included.withMarkdown(boolean applyMarkdown) Sets the optional choice of message content should be returned in the rendered HTML format.withMessageIds(List<Long> messageIds) Sets the list of message IDs to fetch.withNarrows(Narrow... narrows) Sets the optional narrow to fetch messages from.withNumAfter(int numAfter) Sets the mandatory number of messages with ids greater than the anchor to retrieve.withNumBefore(int numBefore) Sets the mandatory number of messages with ids less than the anchor to retrieve.Methods inherited from class com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
client, getParam, getParam, getParams, putParam, putParamAsJsonString, putParamAsWrappedObject
-
Field Details
-
ALLOW_EMPTY_TOPIC_NAME
- See Also:
-
ANCHOR
- See Also:
-
GRAVATAR
- See Also:
-
INCLUDE_ANCHOR
- See Also:
-
MARKDOWN
- See Also:
-
MESSAGE_IDS
- See Also:
-
NARROW
- See Also:
-
NUM_AFTER
- See Also:
-
NUM_BEFORE
- See Also:
-
-
Constructor Details
-
GetMessagesApiRequest
Constructs aGetMessagesApiRequest.- Parameters:
client- The Zulip HTTP client
-
-
Method Details
-
withAllowEmptyTopicName
Sets whether to allow empty topic names to be returned.- Parameters:
allowEmptyTopicName-trueto allow empty topic names.falseto disallow empty topic names- Returns:
- This
GetMessagesApiRequestinstance - See Also:
-
withAnchor
Sets the optionalAnchorto filter and restrict messages.- Parameters:
anchor- The anchor value- Returns:
- This
GetMessagesApiRequestinstance - See Also:
-
withAnchor
Sets the optional message id anchor to filter and restrict messages.- Parameters:
messageId- The message id anchor value- Returns:
- This
GetMessagesApiRequestinstance - See Also:
-
withIncludeAnchor
Whether a message with the specified ID matching the narrow should be included.- Parameters:
includeAnchor-trueif a message with the specified ID matching the narrow should be included.Falseif a message with the specified ID matching the narrow should not be included- Returns:
- This
GetMessagesApiRequestinstance - See Also:
-
withMessageIds
Sets the list of message IDs to fetch.- Parameters:
messageIds- The message IDs to fetch and match against- Returns:
- This
GetMessagesApiRequestinstance - See Also:
-
withNumBefore
Sets the mandatory number of messages with ids less than the anchor to retrieve.- Parameters:
numBefore- The number of messages with ids less than the anchor to retrieve- Returns:
- This
GetMessagesApiRequestinstance - See Also:
-
withNumAfter
Sets the mandatory number of messages with ids greater than the anchor to retrieve.- Parameters:
numAfter- The number of messages with ids greater than the anchor to retrieve- Returns:
- This
GetMessagesApiRequestinstance - See Also:
-
withNarrows
Sets the optional narrow to fetch messages from.- Specified by:
withNarrowsin interfaceNarrowableApiRequest<GetMessagesApiRequest>- Parameters:
narrows- One or moreNarrowexpressions- Returns:
- This
GetMessagesApiRequestinstance - See Also:
-
withGravatar
Sets the optional choice of whether to return the users gravatar URL int the response.- Parameters:
clientGravatar-trueif the gravatar should be included in the response.Falseif the gravatar should not be included- Returns:
- This
GetMessagesApiRequestinstance - See Also:
-
withMarkdown
Sets the optional choice of message content should be returned in the rendered HTML format.- Parameters:
applyMarkdown-trueif to return rendered HTML.falseif markdown should be returned- Returns:
- This
GetMessagesApiRequestinstance - See Also:
-
execute
Executes the Zulip API request for searching and getting messages.- Specified by:
executein interfaceExecutableApiRequest<List<Message>>- Returns:
- List of
Messageobjects that matched the search criteria - Throws:
ZulipClientException- if the request was not successful
-