@private
@return [Boolean] true if the response is cached
@return [Float] The total number of seconds taken to make the
request and return the response.
@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
@return [Integer] Returns the number of times the request
was retried.
@param [Http::Request] #http_request @param [Http::Response] #http_request
# File lib/aws/core/response.rb, line 54 def initialize http_request = nil, http_response = nil, &block @http_request = http_request @http_response = http_response @request_builder = block @retry_count = 0 @duration = 0 rebuild_request if @request_builder && !http_request end
# File lib/aws/core/response.rb, line 99 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 91 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 64 def rebuild_request @http_request = @request_builder.call end
# File lib/aws/core/response.rb, line 106 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 69 def successful? error.nil? end
@return [Boolean] Returns true if the http request was throttled
by AWS.
# File lib/aws/core/response.rb, line 75 def throttled? if !successful? and http_response.body error = XmlGrammar.parse(http_response.body) error = error.error if error.respond_to?(:error) error.respond_to?(:code) and error.code == "Throttling" else false end end
@return [Boolean] Returns true if the http request timed out.
# File lib/aws/core/response.rb, line 86 def timeout? http_response.timeout? end