Class MessageReader

    • Constructor Detail

      • MessageReader

        public MessageReader()
        Construct a new MessageReader.
      • MessageReader

        public MessageReader​(String pathAccountSid)
        Construct a new MessageReader.
        Parameters:
        pathAccountSid - The SID of the Account that created the resources to read
    • Method Detail

      • setTo

        public MessageReader setTo​(PhoneNumber to)
        Read messages sent to only this phone number..
        Parameters:
        to - Filter by messages sent to this number
        Returns:
        this
      • setTo

        public MessageReader setTo​(String to)
        Read messages sent to only this phone number..
        Parameters:
        to - Filter by messages sent to this number
        Returns:
        this
      • setFrom

        public MessageReader setFrom​(PhoneNumber from)
        Read messages sent from only this phone number or alphanumeric sender ID..
        Parameters:
        from - Filter by from number
        Returns:
        this
      • setFrom

        public MessageReader setFrom​(String from)
        Read messages sent from only this phone number or alphanumeric sender ID..
        Parameters:
        from - Filter by from number
        Returns:
        this
      • setDateSent

        public MessageReader setDateSent​(org.joda.time.DateTime absoluteDateSent)
        The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date..
        Parameters:
        absoluteDateSent - Filter by date sent
        Returns:
        this
      • setDateSent

        public MessageReader setDateSent​(com.google.common.collect.Range<org.joda.time.DateTime> rangeDateSent)
        The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date..
        Parameters:
        rangeDateSent - Filter by date sent
        Returns:
        this
      • read

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

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

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