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

def process_record_chunks(records, sync_config)

Batch has a limit of sending 2MB data. So creating a chunk of records to meet that limit
def process_record_chunks(records, sync_config)
  log_message_array = []
  write_success = 0
  write_failure = 0
  records.each_slice(MAX_CHUNK_SIZE) do |chunk|
    values = prepare_chunk_values(chunk, sync_config.stream)
    request, response = *update_sheet_values(values, sync_config.stream.name)
    write_success += values.size
    log_message_array << log_request_response("info", request, response)
  rescue StandardError => e
    handle_exception(e, {
                       context: "GOOGLE_SHEETS:RECORD:WRITE:EXCEPTION",
                       type: "error",
                       sync_id: sync_config.sync_id,
                       sync_run_id: sync_config.sync_run_id
                     })
    write_failure += chunk.size
    log_message_array << log_request_response("error", request, e.message)
  end
  tracking_message(write_success, write_failure, log_message_array)
end