Class EventReader

    • Constructor Detail

      • EventReader

        public EventReader​(String pathWorkspaceSid)
        Construct a new EventReader.
        Parameters:
        pathWorkspaceSid - Filter events by those pertaining to a particular workspace
    • Method Detail

      • setEndDate

        public EventReader setEndDate​(org.joda.time.DateTime endDate)
        Filter events by an end date. This is helpful for defining a range of events to capture. Input is a GMT ISO 8601 Timestamp..
        Parameters:
        endDate - Filter events by an end date.
        Returns:
        this
      • setEventType

        public EventReader setEventType​(String eventType)
        Filter events by those of a certain event type.
        Parameters:
        eventType - Filter events by those of a certain event type
        Returns:
        this
      • setMinutes

        public EventReader setMinutes​(Integer minutes)
        Filter events by up to 'x' minutes in the past. This is helpful for events for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. Defaults to 15 minutes..
        Parameters:
        minutes - Filter events by up to 'x' minutes in the past.
        Returns:
        this
      • setReservationSid

        public EventReader setReservationSid​(String reservationSid)
        Filter events by those pertaining to a particular reservation.
        Parameters:
        reservationSid - Filter events by those pertaining to a particular reservation
        Returns:
        this
      • setStartDate

        public EventReader setStartDate​(org.joda.time.DateTime startDate)
        Filter events by a start date. This is helpful for defining a range of events to capture. Input is a GMT ISO 8601 Timestamp..
        Parameters:
        startDate - Filter events by a start date.
        Returns:
        this
      • setTaskQueueSid

        public EventReader setTaskQueueSid​(String taskQueueSid)
        Filter events by those pertaining to a particular queue.
        Parameters:
        taskQueueSid - Filter events by those pertaining to a particular queue
        Returns:
        this
      • setTaskSid

        public EventReader setTaskSid​(String taskSid)
        Filter events by those pertaining to a particular task.
        Parameters:
        taskSid - Filter events by those pertaining to a particular task
        Returns:
        this
      • setWorkerSid

        public EventReader setWorkerSid​(String workerSid)
        Filter events by those pertaining to a particular worker.
        Parameters:
        workerSid - Filter events by those pertaining to a particular worker
        Returns:
        this
      • setWorkflowSid

        public EventReader setWorkflowSid​(String workflowSid)
        Filter events by those pertaining to a particular workflow.
        Parameters:
        workflowSid - Filter events by those pertaining to a particular workflow
        Returns:
        this
      • setTaskChannel

        public EventReader setTaskChannel​(String taskChannel)
        Filter events by those pertaining to a particular task channel.
        Parameters:
        taskChannel - Filter events by those pertaining to a particular task channel
        Returns:
        this
      • setSid

        public EventReader setSid​(String sid)
        Filter events by those pertaining to a particular event.
        Parameters:
        sid - Filter events by those pertaining to a particular event
        Returns:
        this
      • read

        public ResourceSet<Event> read​(TwilioRestClient client)
        Make the request to the Twilio API to perform the read.
        Specified by:
        read in class Reader<Event>
        Parameters:
        client - TwilioRestClient with which to make the request
        Returns:
        Event ResourceSet
      • firstPage

        public Page<Event> firstPage​(TwilioRestClient client)
        Make the request to the Twilio API to perform the read.
        Specified by:
        firstPage in class Reader<Event>
        Parameters:
        client - TwilioRestClient with which to make the request
        Returns:
        Event ResourceSet
      • getPage

        public Page<Event> getPage​(String targetUrl,
                                   TwilioRestClient client)
        Retrieve the target page from the Twilio API.
        Specified by:
        getPage in class Reader<Event>
        Parameters:
        targetUrl - API-generated URL for the requested results page
        client - TwilioRestClient with which to make the request
        Returns:
        Event ResourceSet
      • nextPage

        public Page<Event> nextPage​(Page<Event> page,
                                    TwilioRestClient client)
        Retrieve the next page from the Twilio API.
        Specified by:
        nextPage in class Reader<Event>
        Parameters:
        page - current page
        client - TwilioRestClient with which to make the request
        Returns:
        Next Page
      • previousPage

        public Page<Event> previousPage​(Page<Event> page,
                                        TwilioRestClient client)
        Retrieve the previous page from the Twilio API.
        Specified by:
        previousPage in class Reader<Event>
        Parameters:
        page - current page
        client - TwilioRestClient with which to make the request
        Returns:
        Previous Page