class ZuoraConnect::AppInstance

def refresh(session = nil)

def refresh(session = nil)
  response = HTTParty.get(ZuoraConnect.configuration.url + "/api/v1/tools/tasks/#{self.id}.json",:basic_auth => auth = {:username => self.username, :password => self.password})
  if response.code == 200
    @last_refresh = Time.now.to_i
    build_task(JSON.parse(response.body), session)
  else
    raise ZuoraConnect::Exceptions::ConnectCommunicationError.new("Error Communicating with Connect", response.body, response.code)
  end
end