require 'flydata/source/sync_generate_table_ddl' require 'flydata/source_zendesk/zendesk_flydata_tabledefs' module Flydata module SourceZendesk class SyncGenerateTableDdl < Source::SyncGenerateTableDdl def run_compatibility_check #TODO Check version "Zendesk v2 API" end def generate_flydata_tabledef(tables, options) flydata_tabledefs = [] error_list = [] zendesk_resource_names = ZENDESK_FLYDATA_TABLEDEFS.keys.join(" ") tables.each do |tablename| flydata_tabledef = ZENDESK_FLYDATA_TABLEDEFS[tablename] if !flydata_tabledef error_list << { error: "Invalid Zendesk resource name specified. Flydata supports following Zendesk resources: #{zendesk_resource_names}", table: tablename } next end flydata_tabledefs << flydata_tabledef end [flydata_tabledefs, error_list] end end end end