Class UsageRecordReader

    • Constructor Detail

      • UsageRecordReader

        public UsageRecordReader()
    • Method Detail

      • setEnd

        public UsageRecordReader setEnd​(org.joda.time.DateTime end)
        Only include usage that has occurred on or before this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)..
        Parameters:
        end - Only include usage that has occurred on or before this date
        Returns:
        this
      • setStart

        public UsageRecordReader setStart​(org.joda.time.DateTime start)
        Only include usage that has occurred on or after this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)..
        Parameters:
        start - Only include usage that has occurred on or after this date
        Returns:
        this
      • setGranularity

        public UsageRecordReader setGranularity​(UsageRecord.Granularity granularity)
        How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. A value of `all` returns one Usage Record that describes the usage for the entire period..
        Parameters:
        granularity - The time-based grouping that results are aggregated by
        Returns:
        this
      • firstPage

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

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