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.612 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.611 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.610 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.609 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.608 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.607 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.606 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.605 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.604 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.603 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.602 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.601 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.600 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.599 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.598 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.597 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.596 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.595 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.594 lib/aws-sdk-resources/request.rb
aws-sdk-resources-2.11.593 lib/aws-sdk-resources/request.rb