class Multiwoven::Integrations::Destination::Sftp::Client

def write_uncompressed_data(connection_config, file_path, local_file_name, csv_content, records_size)

def write_uncompressed_data(connection_config, file_path, local_file_name, csv_content, records_size)
  write_success = 0
  Tempfile.create([local_file_name, ".csv"]) do |tempfile|
    tempfile.write(csv_content)
    tempfile.close
    with_sftp_client(connection_config) do |sftp|
      sftp.upload!(tempfile.path, file_path)
      write_success = records_size
    rescue StandardError => e
      # TODO: add sync_id and sync_run_id to the log
      handle_exception(e, {
                         context: "SFTP:RECORD:WRITE:EXCEPTION",
                         type: "error",
                         sync_id: @sync_config.sync_id,
                         sync_run_id: @sync_config.sync_run_id
                       })
      write_success = 0
    end
  end
  write_success
end