@private
@return [Boolean] true if the response is cached
@return [AWS::Error] Returns nil unless the request failed.
Normally this will be nil unless you are using the Asynchronous interface.
@return [Http::Request] the HTTP request object
@return [Http::Response] the HTTP response object
@return [Hash] The hash of options passed to the low level request
method that generated this response.
@return [Symbol] The low-level request method that generated
this response
@param [Http::Request] #http_request @param [Http::Response] #http_request
# File lib/aws/core/response.rb, line 46 def initialize http_request = nil, http_response = nil, &block @http_request = http_request @http_response = http_response @request_builder = block rebuild_request if @request_builder && !http_request end
# File lib/aws/core/response.rb, line 87 def cache_key [http_request.access_key_id, http_request.host, request_type, serialized_options].join(":") end
@private
# File lib/aws/core/response.rb, line 79 def inspect if request_type "<#{self.class}:#{request_type}>" else "<#{self.class}>" end end
Rebuilds the HTTP request using the block passed to the initializer
# File lib/aws/core/response.rb, line 54 def rebuild_request @http_request = @request_builder.call end
# File lib/aws/core/response.rb, line 94 def serialized_options serialize_options_hash(request_options) end
@return [Boolean] Returns true unless there is a response error.
# File lib/aws/core/response.rb, line 59 def successful? error.nil? end
@return [Boolean] Returns true if the http request was throttled
by AWS.
# File lib/aws/core/response.rb, line 65 def throttled? !successful? and http_response.body and parsed_body = XmlGrammar.parse(http_response.body) and parsed_body.respond_to?(:code) and parsed_body.code == "Throttling" end
@return [Boolean] Returns true if the http request timed out.
# File lib/aws/core/response.rb, line 74 def timeout? http_response.timeout? end