module Aws::PageableResponse
def self.extended(base)
def self.extended(base) base.send(:extend, Enumerable) base.send(:extend, UnsafeEnumerableMethods) base.instance_variable_set("@last_page", nil) base.instance_variable_set("@more_results", nil) end
def each(&block)
-
(Enumerable, nil)
- Returns a new Enumerable if no block is given.
Other tags:
- Yieldparam: response -
def each(&block) return enum_for(:each_page) unless block_given? response = self yield(response) until response.last_page? response = response.next_page yield(response) end end
def last_page?
-
(Boolean)
-
def last_page? if @last_page.nil? @last_page = !@pager.truncated?(self) end @last_page end
def next_page(params = {})
-
(Seahorse::Client::Response)
-
def next_page(params = {}) if last_page? raise LastPageError.new(self) else next_response(params) end end
def next_page?
-
(Boolean)
-
def next_page? !last_page? end
def next_page_params(params)
-
(Hash)
- Returns the hash of request parameters for the
Parameters:
-
params
(Hash
) -- A hash of additional request params to
def next_page_params(params) context[:original_params].merge(@pager.next_tokens(self).merge(params)) end
def next_response(params)
-
(Seahorse::Client::Response)
- Returns the next page of
Parameters:
-
params
(Hash
) -- A hash of additional request params to
def next_response(params) params = next_page_params(params) request = context.client.build_request(context.operation_name, params) request.send_request end