@return [Builder]
@return [Symbol, nil]
@option options [required, Request] :request @option options [required, Builder] :builder @option options [Symbol] :limit_key
# File lib/aws-sdk-resources/operations.rb, line 97 def initialize(options) @limit_key = options[:limit_key] super end
@api private @return [Enumerator<Batch>]
# File lib/aws-sdk-resources/operations.rb, line 116 def batches(options, &block) if options[:limit] enum_for(:limited_batches, options[:limit], options, &block) else enum_for(:all_batches, options, &block) end end
@option (see Base#call) @return [Collection]
# File lib/aws-sdk-resources/operations.rb, line 110 def call(options) Collection.new(self, options) end
# File lib/aws-sdk-resources/operations.rb, line 126 def all_batches(options, &block) @request.call(options).each do |response| yield(@builder.build(options.merge(response:response))) end end
# File lib/aws-sdk-resources/operations.rb, line 132 def limited_batches(limit, options, &block) remaining = limit all_batches(options) do |batch| if batch.size < remaining yield(batch) remaining -= batch.size else yield(batch.first(remaining)) return end end end