def parse_response(response)
      case response.code
      when 200 # OK
        response
      else
        handler = ERROR_HANDLERS[response.code]
        raise handler.first.new(response.parsed_response), handler.last
      end
    end
def parse_response(response)
      case response.code
      when 200 # OK
        response
      else
        handler = ERROR_HANDLERS[response.code]
        raise handler.first.new(response.parsed_response), handler.last
      end
    end
Parses a HTTParty Response object and returns it if it was successful.

 @param response [HTTParty::Response] The response object to parse.
 @return [HTTParty::Response] The same response object that was passed
   in, if the request was successful.

 @raise [RequestError] If a `400` response code was returned from the
   request.
 @raise [AuthenticationError] If a `401` response code was returned
   from the request.
 @raise [ForbiddenError] If a `403` response code was returned from the
   request.
 @raise [NotFoundError] If a `404` response code was returned from the
   request.
 @raise [RateLimitError] If a `429` response code was returned from the
   request.
 @raise [ApiError] If an unknown response code was returned from the
   request.