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 Details

  • Constructor Details

  • Method Details

    • withQueueId

      public GetEventsApiRequest withQueueId(String queueId)
      Sets the id of the queue to receive events from.
      Parameters:
      queueId - The id of the queue to receive events from
      Returns:
      This GetEventsApiRequest instance
    • withLastEventId

      public GetEventsApiRequest withLastEventId(long lastEventId)
      Sets the id of the last consumed event.
      Parameters:
      lastEventId - The event id of the last consumed event
      Returns:
      This GetEventsApiRequest instance
    • execute

      public List<Event> execute(int responseTimeoutSeconds) throws ZulipClientException
      Executes the Zulip API request for receiving events from an event queue. Events are mapped to the Event implementation defined by EventType. Events that have no dedicated implementation, or that cannot be mapped to it, are returned as a plain Event.
      Specified by:
      execute in interface TimeoutableApiRequest<List<Event>>
      Parameters:
      responseTimeoutSeconds - The timeout value in seconds for the response to timeout
      Returns:
      List of Event received from the event queue
      Throws:
      ZulipClientException - if the request was not successful