Class: Multiwoven::Integrations::Core::BaseConnector

Inherits:
Object
  • Object
show all
Includes:
Constants, Utils, Protocol
Defined in:
lib/multiwoven/integrations/core/base_connector.rb

Direct Known Subclasses

DestinationConnector, SourceConnector

Constant Summary

Constants included from Constants

Constants::CATALOG_SPEC_PATH, Constants::CONNECTOR_SPEC_PATH, Constants::FACEBOOK_AUDIENCE_GET_ALL_ACCOUNTS, Constants::HTTP_DELETE, Constants::HTTP_GET, Constants::HTTP_POST, Constants::HTTP_PUT, Constants::INTEGRATIONS_PATH, Constants::KLAVIYO_AUTH_ENDPOINT, Constants::KLAVIYO_AUTH_PAYLOAD, Constants::MAIN_BRANCH_SHA, Constants::META_DATA_PATH, Constants::SNOWFLAKE_DRIVER_PATH, Constants::SNOWFLAKE_MAC_DRIVER_PATH

Constants included from Protocol

Protocol::ConnectionStatusType, Protocol::ConnectorType, Protocol::ControlMessageType, Protocol::DestinationSyncMode, Protocol::LogLevel, Protocol::ModelQueryType, Protocol::MultiwovenMessageType, Protocol::StreamAction, Protocol::StreamType, Protocol::SyncMode, Protocol::SyncStatus

Instance Method Summary collapse

Methods included from Utils

#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



26
27
28
29
# File 'lib/multiwoven/integrations/core/base_connector.rb', line 26

def check_connection(_connection_config)
  raise "Not implemented"
  # returns Protocol.ConnectionStatus
end

#connector_specObject



10
11
12
13
14
15
# File 'lib/multiwoven/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
    ConnectorSpecification.from_json(spec_json)
  end
end

#discover(_connection_config) ⇒ Object



31
32
33
# File 'lib/multiwoven/integrations/core/base_connector.rb', line 31

def discover(_connection_config)
  raise "Not implemented"
end

#meta_dataObject



17
18
19
20
21
22
23
24
# File 'lib/multiwoven/integrations/core/base_connector.rb', line 17

def 
   = read_json(META_DATA_PATH).deep_symbolize_keys
  icon_name = [:data][:icon]
  icon_url = "https://raw.githubusercontent.com/Multiwoven/multiwoven-integrations/#{MAIN_BRANCH_SHA}/assets/images/connectors/#{icon_name}"
  [:data][:icon] = icon_url

  @meta_data ||= 
end