class Seahorse::Client::RequestContext
Attributes
@return [Seahorse::Client::Base]
@return [Configuration] The client configuration.
@return [Http::Request]
@return [Http::Response]
@return [Hash]
@return [Model::Operation]
@return [Symbol] Name of the API operation called.
@return [Hash] The hash of request parameters.
@return [Integer]
Public Class Methods
@option options [required,Symbol] :operation_name (nil) @option options [required,Model::Operation] :operation (nil) @option options [Hash] :params ({}) @option options [Configuration] :config (nil) @option options [Http::Request] :http_request (Http::Request.new) @option options [Http::Response] :http_response (Http::Response.new)
and #rewind.
# File lib/seahorse/client/request_context.rb, line 14 def initialize(options = {}) @operation_name = options[:operation_name] @operation = options[:operation] @client = options[:client] @params = options[:params] || {} @config = options[:config] @http_request = options[:http_request] || Http::Request.new @http_response = options[:http_response] || Http::Response.new @retries = 0 @metadata = {} end
Public Instance Methods
Returns the metadata for the given `key`. @param [Symbol] key @return [Object]
# File lib/seahorse/client/request_context.rb, line 56 def [](key) @metadata[key] end
Sets the request context metadata for the given `key`. Request metadata useful for handlers that need to keep state on the request, without sending that data with the request over HTTP. @param [Symbol] key @param [Object] value
# File lib/seahorse/client/request_context.rb, line 65 def []=(key, value) @metadata[key] = value end