Sha256: 08bae27beafaeec9bd36c50a1a30292afb88881daea1ba6c5f614cc5e1b8046c

Contents?: true

Size: 1.97 KB

Versions: 10

Compression:

Stored size: 1.97 KB

Contents

require 'stringio'

module Seahorse
  module Client
    class RequestContext

      # @option options [required,String] :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.
      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

      # @return [String] Name of the API operation called.
      attr_accessor :operation_name

      # @return [Model::Operation]
      attr_accessor :operation

      # @return [Seahorse::Client::Base]
      attr_accessor :client

      # @return [Hash] The hash of request parameters.
      attr_accessor :params

      # @return [Configuration] The client configuration.
      attr_accessor :config

      # @return [Http::Request]
      attr_accessor :http_request

      # @return [Http::Response]
      attr_accessor :http_response

      # @return [Integer]
      attr_accessor :retries

      # Returns the metadata for the given `key`.
      # @param [Symbol] key
      # @return [Object]
      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
      def []=(key, value)
        @metadata[key] = value
      end

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
aws-sdk-core-2.0.0.rc10 vendor/seahorse/lib/seahorse/client/request_context.rb
aws-sdk-core-2.0.0.rc9 vendor/seahorse/lib/seahorse/client/request_context.rb
aws-sdk-core-2.0.0.rc8 vendor/seahorse/lib/seahorse/client/request_context.rb
aws-sdk-core-2.0.0.rc7 vendor/seahorse/lib/seahorse/client/request_context.rb
aws-sdk-core-2.0.0.rc6 vendor/seahorse/lib/seahorse/client/request_context.rb
aws-sdk-core-2.0.0.rc5 vendor/seahorse/lib/seahorse/client/request_context.rb
aws-sdk-core-2.0.0.rc4 vendor/seahorse/lib/seahorse/client/request_context.rb
aws-sdk-core-2.0.0.rc3 vendor/seahorse/lib/seahorse/client/request_context.rb
aws-sdk-core-2.0.0.rc2 vendor/seahorse/lib/seahorse/client/request_context.rb
aws-sdk-core-2.0.0.rc1 vendor/seahorse/lib/seahorse/client/request_context.rb