class Aws::Pager
@api private
def empty_value?(value)
def empty_value?(value) value.nil? || value == '' || value == [] || value == {} end
def initialize(options)
(**options)
-
:more_results
(String
) -- -
:limit_key
(String
) -- -
:tokens
(required, Hash
) --
def initialize(options) @tokens = options.fetch(:tokens) @limit_key = options.fetch(:limit_key, nil) @more_results = options.fetch(:more_results, nil) end
def next_tokens(response)
-
(Hash)
-
Parameters:
-
response
(Seahorse::Client::Response
) --
def next_tokens(response) @tokens.each.with_object({}) do |(source, target), next_tokens| value = JMESPath.search(source, response.data) next_tokens[target.to_sym] = value unless empty_value?(value) end end
def prev_tokens(response)
- Api: - private
def prev_tokens(response) @tokens.each.with_object({}) do |(_, target), tokens| value = JMESPath.search(target, response.context.params) tokens[target.to_sym] = value unless empty_value?(value) end end
def truncated?(response)
-
(Boolean)
-
Parameters:
-
response
(Seahorse::Client::Response
) --
def truncated?(response) if @more_results JMESPath.search(@more_results, response.data) else next_t = next_tokens(response) prev_t = prev_tokens(response) !(next_t.empty? || next_t == prev_t) end end