Class: Etl::Integrations::Destination::SalesforceCrm::Client
- Inherits:
-
DestinationConnector
- Object
- DestinationConnector
- Etl::Integrations::Destination::SalesforceCrm::Client
- Includes:
- Core::RateLimiter
- Defined in:
- lib/etl/integrations/destination/salesforce_crm/client.rb
Instance Method Summary collapse
- #check_connection(connection_config) ⇒ Object
- #discover(_connection_config = nil) ⇒ Object
- #write(sync_config, records, action = "create") ⇒ Object
Instance Method Details
#check_connection(connection_config) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/etl/integrations/destination/salesforce_crm/client.rb', line 15 def check_connection(connection_config) connection_config = connection_config.with_indifferent_access initialize_client(connection_config) authenticate_client success_status rescue StandardError => e failure_status(e) end |
#discover(_connection_config = nil) ⇒ Object
24 25 26 27 28 29 |
# File 'lib/etl/integrations/destination/salesforce_crm/client.rb', line 24 def discover(_connection_config = nil) catalog = build_catalog(load_catalog) catalog. rescue StandardError => e handle_exception("SALESFORCE:CRM:DISCOVER:EXCEPTION", "error", e) end |
#write(sync_config, records, action = "create") ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/etl/integrations/destination/salesforce_crm/client.rb', line 31 def write(sync_config, records, action = "create") @action = sync_config.stream.action || action initialize_client(sync_config.destination.connection_specification) process_records(records, sync_config.stream) rescue StandardError => e handle_exception("SALESFORCE:CRM:WRITE:EXCEPTION", "error", e) end |