connected.rb 529 B

123456789101112131415161718192021222324
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. class Sequencer
  3. class Unit
  4. module Freshdesk
  5. class Connected < Sequencer::Unit::Common::Provider::Named
  6. extend ::Sequencer::Unit::Import::Freshdesk::Requester
  7. private
  8. def connected
  9. response = self.class.perform_request(
  10. api_path: 'agents/me',
  11. )
  12. response.is_a?(Net::HTTPOK)
  13. rescue => e
  14. logger.error e
  15. nil
  16. end
  17. end
  18. end
  19. end
  20. end