Class Reader<T extends Resource>

    • Constructor Detail

      • Reader

        public Reader()
    • Method Detail

      • read

        public ResourceSet<T> read()
        Execute a request using default client.
        Returns:
        ResourceSet of objects
      • read

        public abstract ResourceSet<T> read​(TwilioRestClient client)
        Execute a request using specified client.
        Parameters:
        client - client used to make request
        Returns:
        ResourceSet of objects
      • readAsync

        public CompletableFuture<ResourceSet<T>> readAsync()
        Execute an async request using default client.
        Returns:
        future that resolves to the ResourceSet of objects
      • readAsync

        public CompletableFuture<ResourceSet<T>> readAsync​(TwilioRestClient client)
        Execute an async request using specified client.
        Parameters:
        client - client used to make request
        Returns:
        future that resolves to the ResourceSet of objects
      • firstPage

        public Page<T> firstPage()
        Fetch the first page of resources.
        Returns:
        Page containing the first pageSize of resources
      • firstPage

        public abstract Page<T> firstPage​(TwilioRestClient client)
        Fetch the first page of resources using specified client.
        Parameters:
        client - client used to fetch
        Returns:
        Page containing the first pageSize of resources
      • getPage

        public Page<T> getPage​(String targetUrl)
        Retrieve the target page of resources.
        Parameters:
        targetUrl - API-generated URL for the requested results page
        Returns:
        Page containing the target pageSize of resources
      • getPage

        public abstract Page<T> getPage​(String targetUrl,
                                        TwilioRestClient client)
        Retrieve the target page of resources.
        Parameters:
        targetUrl - API-generated URL for the requested results page
        client - client used to fetch
        Returns:
        Page containing the target pageSize of resources
      • nextPage

        public Page<T> nextPage​(Page<T> page)
        Fetch the following page of resources.
        Parameters:
        page - current page of resources
        Returns:
        Page containing the next pageSize of resources
      • nextPage

        public abstract Page<T> nextPage​(Page<T> page,
                                         TwilioRestClient client)
        Fetch the following page of resources using specified client.
        Parameters:
        page - current page of resources
        client - client used to fetch
        Returns:
        Page containing the next pageSize of resources
      • previousPage

        public Page<T> previousPage​(Page<T> page)
        Fetch the prior page of resources.
        Parameters:
        page - current page of resources
        Returns:
        Page containing the previous pageSize of resources
      • previousPage

        public abstract Page<T> previousPage​(Page<T> page,
                                             TwilioRestClient client)
        Fetch the prior page of resources using specified client.
        Parameters:
        page - current page of resources
        client - client used to fetch
        Returns:
        Page containing the previous pageSize of resources
      • getPageSize

        public Integer getPageSize()
      • pageSize

        public Reader<T> pageSize​(int pageSize)
      • getLimit

        public Long getLimit()
      • limit

        public Reader<T> limit​(long limit)
        Sets the max number of records to read.
        Parameters:
        limit - max number of records to read
        Returns:
        this reader