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.552 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.551 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.550 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.549 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.548 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.547 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.546 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.545 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.544 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.543 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.542 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.541 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.540 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.539 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.538 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.537 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.536 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.535 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.534 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.533 lib/aws-sdk-resources/request.rb