Sha256: c39c73d09bd159779e2ff2a8ad6827abbfdcaaff91b490960837b71095d51e05

Contents?: true

Size: 705 Bytes

Versions: 105

Compression:

Stored size: 705 Bytes

Contents

module ForestLiana
  class IntercomConversationGetter < IntegrationBaseGetter
    attr_accessor :record

    def initialize(params)
      @params = params
      @access_token = ForestLiana.integrations[:intercom][:access_token]
      @intercom = ::Intercom::Client.new(token: @access_token)
    end

    def perform
      begin
        @record = @intercom.conversations.find(id: @params[:conversation_id])
      rescue Intercom::ResourceNotFound
        @record = nil
      rescue Intercom::UnexpectedError => exception
        FOREST_REPORTER.report exception
        FOREST_LOGGER.error "Cannot retrieve the Intercom conversation: #{exception.message}"
        @record = nil
      end
    end
  end
end

Version data entries

105 entries across 105 versions & 1 rubygems

Version Path
forest_liana-8.0.11 app/services/forest_liana/intercom_conversation_getter.rb
forest_liana-8.0.10 app/services/forest_liana/intercom_conversation_getter.rb
forest_liana-8.0.9 app/services/forest_liana/intercom_conversation_getter.rb
forest_liana-8.0.8 app/services/forest_liana/intercom_conversation_getter.rb
forest_liana-8.0.7 app/services/forest_liana/intercom_conversation_getter.rb
forest_liana-8.0.6 app/services/forest_liana/intercom_conversation_getter.rb
forest_liana-8.0.5 app/services/forest_liana/intercom_conversation_getter.rb
forest_liana-8.0.4 app/services/forest_liana/intercom_conversation_getter.rb
forest_liana-8.0.3 app/services/forest_liana/intercom_conversation_getter.rb
forest_liana-8.0.2 app/services/forest_liana/intercom_conversation_getter.rb
forest_liana-8.0.1 app/services/forest_liana/intercom_conversation_getter.rb
forest_liana-8.0.0 app/services/forest_liana/intercom_conversation_getter.rb
forest_liana-7.8.1 app/services/forest_liana/intercom_conversation_getter.rb
forest_liana-8.0.0.beta.4 app/services/forest_liana/intercom_conversation_getter.rb
forest_liana-8.0.0.beta.3 app/services/forest_liana/intercom_conversation_getter.rb
forest_liana-8.0.0.beta.2 app/services/forest_liana/intercom_conversation_getter.rb
forest_liana-8.0.0.beta.1 app/services/forest_liana/intercom_conversation_getter.rb
forest_liana-7.8.0 app/services/forest_liana/intercom_conversation_getter.rb
forest_liana-7.7.3 app/services/forest_liana/intercom_conversation_getter.rb
forest_liana-7.7.2 app/services/forest_liana/intercom_conversation_getter.rb