Class: Etl::Integrations::Core::BaseConnector
- Inherits:
-
Object
- Object
- Etl::Integrations::Core::BaseConnector
- Defined in:
- lib/etl/integrations/core/base_connector.rb
Direct Known Subclasses
Constant Summary
Constants included from Constants
Constants::AIRTABLE_BASES_ENDPOINT, Constants::AIRTABLE_GET_BASE_SCHEMA_ENDPOINT, Constants::AIRTABLE_URL_BASE, Constants::CATALOG_SPEC_PATH, Constants::CONNECTOR_SPEC_PATH, Constants::DATABRICKS_DRIVER_PATH, Constants::DATABRICKS_MAC_DRIVER_PATH, Constants::FACEBOOK_AUDIENCE_GET_ALL_ACCOUNTS, Constants::GOOGLE_SHEETS_SCOPE, Constants::GOOGLE_SPREADSHEET_ID_REGEX, Constants::HTTP_DELETE, Constants::HTTP_GET, Constants::HTTP_POST, Constants::HTTP_PUT, Constants::JSON_SCHEMA_URL, Constants::KLAVIYO_AUTH_ENDPOINT, Constants::KLAVIYO_AUTH_PAYLOAD, Constants::META_DATA_PATH, Constants::SNOWFLAKE_DRIVER_PATH, Constants::SNOWFLAKE_MAC_DRIVER_PATH
Constants included from Protocol
Protocol::ConnectionStatusType, Protocol::ConnectorQueryType, Protocol::ConnectorType, Protocol::ControlMessageType, Protocol::DestinationSyncMode, Protocol::LogLevel, Protocol::ModelQueryType, Protocol::MultiwovenMessageType, Protocol::RequestRateLimitingUnit, Protocol::SchemaMode, Protocol::StreamAction, Protocol::StreamType, Protocol::SyncMode, Protocol::SyncStatus
Instance Method Summary collapse
-
#check_connection(_connection_config) ⇒ Object
Connection config is a hash.
- #connector_spec ⇒ Object
-
#discover(_connection_config) ⇒ Object
Connection config is a hash.
- #meta_data ⇒ Object
- #relative_path ⇒ Object
Methods included from Utils
#build_catalog, #build_stream, #convert_to_json_schema, #create_log_message, #extract_data, #handle_exception, #keys_to_symbols, #logger, #map_type_to_json_schema, #success?
Instance Method Details
#check_connection(_connection_config) ⇒ Object
Connection config is a hash
37 38 39 40 |
# File 'lib/etl/integrations/core/base_connector.rb', line 37 def check_connection(_connection_config) raise "Not implemented" # returns Protocol.ConnectionStatus end |
#connector_spec ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/etl/integrations/core/base_connector.rb', line 10 def connector_spec @connector_spec ||= begin spec_json = keys_to_symbols(read_json(CONNECTOR_SPEC_PATH)).to_json # returns Protocol::ConnectorSpecification ConnectorSpecification.from_json(spec_json) end end |
#discover(_connection_config) ⇒ Object
Connection config is a hash
43 44 45 46 |
# File 'lib/etl/integrations/core/base_connector.rb', line 43 def discover(_connection_config) raise "Not implemented" # returns Protocol::Catalog end |
#meta_data ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/etl/integrations/core/base_connector.rb', line 18 def = read_json(META_DATA_PATH).deep_symbolize_keys icon_name = [:data][:icon] icon_url = "https://raw.githubusercontent.com/Etl/multiwoven/main/integrations#{relative_path}/#{icon_name}" [:data][:icon] = icon_url # returns hash @meta_data ||= end |
#relative_path ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/etl/integrations/core/base_connector.rb', line 27 def relative_path path = Object.const_source_location(self.class.to_s)[0] connector_folder = File.dirname(path) marker = "/lib/multiwoven/integrations/" parts = connector_folder.split(marker) marker + parts.last if parts.length > 1 end |