Sha256: 351fd41f10e82d33e1cad53c8b57183c8872d58e0ffb4bf315195ff5d362ae1b

Contents?: true

Size: 1.04 KB

Versions: 1024

Compression:

Stored size: 1.04 KB

Contents

module Aws
  module Resources
    class Request

      # @option options [required, String] :method_name
      # @option options [Array<RequestParams::Param>] :params ([]) A list of
      #   request params to apply to the request when called.
      def initialize(options = {})
        @method_name = options[:method_name]
        @params = options[:params] || []
      end

      # @return [String] Name of the method called on the client when this
      #   operation is called.
      attr_reader :method_name

      # @return [Array<RequestParams::Param>]
      attr_reader :params

      # @option options [required, Resource] :resource
      # @option options [Array<Mixed>] :args
      # @return [Seahorse::Client::Response]
      def call(options)
        client(options).send(@method_name, req_params(options), &options[:block])
      end

      private

      def client(options)
        Array(options[:resource]).first.client
      end

      def req_params(options)
        RequestParams::ParamHash.new(@params).build(options)
      end

    end
  end
end

Version data entries

1,024 entries across 1,024 versions & 2 rubygems

Version Path
aws-sdk-resources-2.11.632 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.631 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.630 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.629 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.628 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.627 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.626 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.625 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.624 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.623 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.622 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.621 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.620 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.619 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.618 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.617 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.616 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.615 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.614 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.613 lib/aws-sdk-resources/request.rb