class Multiwoven::Integrations::Destination::Slack::Client

def write(sync_config, records, action = "create")

def write(sync_config, records, action = "create")
  # Currently as we only create a message for each record in slack, we are not using actions.
  # This will be changed in future.
  @action = sync_config.stream.action || action
  connection_config = sync_config.destination.connection_specification.with_indifferent_access
  configure_slack(connection_config[:api_token])
  @client = ::Slack::Web::Client.new
  @channel_id = connection_config[:channel_id]
  process_records(records, sync_config.stream)
rescue StandardError => e
  handle_exception("SLACK:WRITE:EXCEPTION", "error", e)
end