class Multiwoven::Integrations::Destination::SalesforceConsumerGoodsCloud::Client

def discover(connection_config)

def discover(connection_config)
  connection_config = connection_config.with_indifferent_access
  initialize_client(connection_config)
  catalog = build_catalog(load_catalog.with_indifferent_access)
  streams = catalog[:streams]
  SALESFORCE_OBJECTS.each do |object|
    object_description = @client.describe(object)
    streams << JSON.parse(SchemaHelper.create_json_schema_for_object(object_description).to_json)
  end
  catalog.to_multiwoven_message
rescue StandardError => e
  handle_exception("SALESFORCE:CONSUMER:GOODS:ClOUD:DISCOVER:EXCEPTION", "error", e)
end