Class: Seahorse::Client::RequestContext
- Inherits:
-
Object
- Object
- Seahorse::Client::RequestContext
- Defined in:
- gems/aws-sdk-core/lib/seahorse/client/request_context.rb
Instance Attribute Summary collapse
-
#authorizer ⇒ Model::Authorizer
APIG SDKs only.
-
#client ⇒ Seahorse::Client::Base
-
#config ⇒ Configuration
The client configuration.
-
#http_request ⇒ Http::Request
-
#http_response ⇒ Http::Response
-
#metadata ⇒ Hash
readonly
-
#operation ⇒ Model::Operation
-
#operation_name ⇒ Symbol
Name of the API operation called.
-
#params ⇒ Hash
The hash of request parameters.
-
#retries ⇒ Integer
-
#tracer ⇒ Tracer
Instance Method Summary collapse
-
#[](key) ⇒ Object
Returns the metadata for the given
key
. -
#[]=(key, value) ⇒ Object
Sets the request context metadata for the given
key
. -
#initialize(options = {}) ⇒ RequestContext
constructor
A new instance of RequestContext.
Constructor Details
#initialize(options = {}) ⇒ RequestContext
Returns a new instance of RequestContext.
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 20 def initialize( = {}) @operation_name = [:operation_name] @operation = [:operation] @authorizer = [:authorizer] @client = [:client] @params = [:params] || {} @config = [:config] @http_request = [:http_request] || Http::Request.new @http_response = [:http_response] || Http::Response.new @retries = 0 @tracer = [:tracer] || Aws::Telemetry::NoOpTracer.new @metadata = {} end |
Instance Attribute Details
#authorizer ⇒ Model::Authorizer
Returns APIG SDKs only.
41 42 43 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 41 def @authorizer end |
#client ⇒ Seahorse::Client::Base
44 45 46 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 44 def client @client end |
#config ⇒ Configuration
Returns The client configuration.
50 51 52 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 50 def config @config end |
#http_request ⇒ Http::Request
53 54 55 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 53 def http_request @http_request end |
#http_response ⇒ Http::Response
56 57 58 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 56 def http_response @http_response end |
#metadata ⇒ Hash (readonly)
65 66 67 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 65 def @metadata end |
#operation ⇒ Model::Operation
38 39 40 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 38 def operation @operation end |
#operation_name ⇒ Symbol
Returns Name of the API operation called.
35 36 37 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 35 def operation_name @operation_name end |
#params ⇒ Hash
Returns The hash of request parameters.
47 48 49 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 47 def params @params end |
#retries ⇒ Integer
59 60 61 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 59 def retries @retries end |
#tracer ⇒ Tracer
62 63 64 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 62 def tracer @tracer end |
Instance Method Details
#[](key) ⇒ Object
Returns the metadata for the given key
.
70 71 72 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 70 def [](key) @metadata[key] end |
#[]=(key, value) ⇒ Object
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.
79 80 81 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 79 def []=(key, value) @metadata[key] = value end |