class Multiwoven::Integrations::Destination::GoogleSheets::Client

def prepare_chunk_values(chunk, stream)

We need to format the data to adhere to google sheets API format. This converts the sync mapped data to 2D array format expected by google sheets API
def prepare_chunk_values(chunk, stream)
  last_column_index = spread_sheet_value(stream.name).count
  fields = fetch_column_names(stream.name, last_column_index)
  chunk.map do |row|
    row_values = Array.new(fields.size, nil)
    row.each do |key, value|
      index = fields.index(key.to_s)
      row_values[index] = value if index
    end
    row_values
  end
end