class Seahorse::Client::RequestContext

Attributes

client[RW]

@return [Seahorse::Client::Base]

config[RW]

@return [Configuration] The client configuration.

http_request[RW]

@return [Http::Request]

http_response[RW]

@return [Http::Response]

metadata[R]

@return [Hash]

operation[RW]

@return [Model::Operation]

operation_name[RW]

@return [Symbol] Name of the API operation called.

params[RW]

@return [Hash] The hash of request parameters.

retries[RW]

@return [Integer]

Public Class Methods

new(options = {}) click to toggle source

@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

[](key) click to toggle source

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
[]=(key, value) click to toggle source

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