def handle(response, responses_spec, call_params)
      if responses_spec.key?(response.status_code)
        response_spec = responses_spec[response.status_code]
        handler = response_spec['handler']
        Handlers.send(handler, response, response_spec, call_params)
      else
        message = "Unexpected response\nstatus code: #{response.status_code}\nheaders: #{response.headers}\nbody: #{response.body}"
        result = Result.new(message, response)
        raise RubyAem::Error.new(message, result)
      end
    end
def handle(response, responses_spec, call_params)
      if responses_spec.key?(response.status_code)
        response_spec = responses_spec[response.status_code]
        handler = response_spec['handler']
        Handlers.send(handler, response, response_spec, call_params)
      else
        message = "Unexpected response\nstatus code: #{response.status_code}\nheaders: #{response.headers}\nbody: #{response.body}"
        result = Result.new(message, response)
        raise RubyAem::Error.new(message, result)
      end
    end
Handle a response based on status code and a given list of response specifications.
 If none of the response specifications contains the status code, a failure result
 will then be returned.

 @param response response containing HTTP status code, body, and headers
 @param responses_spec a list of response specifications as configured in conf/spec.yaml
 @param call_params API call parameters
 @return RubyAem::Result
 @raise RubyAem::Error when the response status code is unexpected