Class GetEventsApiRequest
java.lang.Object
com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
com.github.jamesnetherton.zulip.client.api.event.request.GetEventsApiRequest
- All Implemented Interfaces:
TimeoutableApiRequest<List<Event>>
public class GetEventsApiRequest
extends ZulipApiRequest
implements TimeoutableApiRequest<List<Event>>
Zulip API request builder for receiving events from an event queue.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGetEventsApiRequest(ZulipHttpClient client) Constructs aGetEventsApiRequest. -
Method Summary
Modifier and TypeMethodDescriptionexecute(int responseTimeoutSeconds) Executes the Zulip API request for receiving events from an event queue.withLastEventId(long lastEventId) Sets the id of the last consumed event.withQueueId(String queueId) Sets the id of the queue to receive events from.Methods inherited from class ZulipApiRequest
client, getParam, getParam, getParams, putParam, putParamAsJsonString, putParamAsWrappedObject
-
Field Details
-
QUEUE_ID
- See Also:
-
LAST_EVENT_ID
- See Also:
-
-
Constructor Details
-
GetEventsApiRequest
Constructs aGetEventsApiRequest.- Parameters:
client- The Zulip HTTP client
-
-
Method Details
-
withQueueId
Sets the id of the queue to receive events from.- Parameters:
queueId- The id of the queue to receive events from- Returns:
- This
GetEventsApiRequestinstance
-
withLastEventId
Sets the id of the last consumed event.- Parameters:
lastEventId- The event id of the last consumed event- Returns:
- This
GetEventsApiRequestinstance
-
execute
Executes the Zulip API request for receiving events from an event queue. Events are mapped to theEventimplementation defined byEventType. Events that have no dedicated implementation, or that cannot be mapped to it, are returned as a plainEvent.- Specified by:
executein interfaceTimeoutableApiRequest<List<Event>>- Parameters:
responseTimeoutSeconds- The timeout value in seconds for the response to timeout- Returns:
- List of
Eventreceived from the event queue - Throws:
ZulipClientException- if the request was not successful
-