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
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.
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 17 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 @metadata = {} end |
Instance Attribute Details
#authorizer ⇒ Model::Authorizer
Returns APIG SDKs only.
37 38 39 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 37 def @authorizer end |
#client ⇒ Seahorse::Client::Base
40 41 42 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 40 def client @client end |
#config ⇒ Configuration
Returns The client configuration.
46 47 48 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 46 def config @config end |
#http_request ⇒ Http::Request
49 50 51 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 49 def http_request @http_request end |
#http_response ⇒ Http::Response
52 53 54 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 52 def http_response @http_response end |
#metadata ⇒ Hash (readonly)
58 59 60 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 58 def @metadata end |
#operation ⇒ Model::Operation
34 35 36 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 34 def operation @operation end |
#operation_name ⇒ Symbol
Returns Name of the API operation called.
31 32 33 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 31 def operation_name @operation_name end |
#params ⇒ Hash
Returns The hash of request parameters.
43 44 45 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 43 def params @params end |
#retries ⇒ Integer
55 56 57 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 55 def retries @retries end |
Instance Method Details
#[](key) ⇒ Object
Returns the metadata for the given key
.
63 64 65 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 63 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.
72 73 74 |
# File 'gems/aws-sdk-core/lib/seahorse/client/request_context.rb', line 72 def []=(key, value) @metadata[key] = value end |