Class: Aws::Resources::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-sdk-resources/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Request

Returns a new instance of Request.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :method_name (required, String)
  • :params (Array<RequestParams::Param>) — default: []

    A list of request params to apply to the request when called.



8
9
10
11
# File 'lib/aws-sdk-resources/request.rb', line 8

def initialize(options = {})
  @method_name = options[:method_name]
  @params = options[:params] || []
end

Instance Attribute Details

#method_nameString (readonly)

Returns Name of the method called on the client when this operation is called.

Returns:

  • (String)

    Name of the method called on the client when this operation is called.



15
16
17
# File 'lib/aws-sdk-resources/request.rb', line 15

def method_name
  @method_name
end

#paramsArray<RequestParams::Param> (readonly)

Returns:



18
19
20
# File 'lib/aws-sdk-resources/request.rb', line 18

def params
  @params
end

Instance Method Details

#call(options) ⇒ Seahorse::Client::Response

Parameters:

  • options (Hash)

    a customizable set of options

Options Hash (options):

  • :resource (required, Resource)
  • :args (Array<Mixed>)

Returns:

  • (Seahorse::Client::Response)


23
24
25
# File 'lib/aws-sdk-resources/request.rb', line 23

def call(options)
  client(options).send(@method_name, req_params(options), &options[:block])
end