Class: Markety::Client

Overview

All of the Markety::Command modules are mixed in to Client, so see the documentation for those modules.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Markety::Command::ListOperation

#add_to_list, #is_member_of_list, #remove_from_list

Methods included from Markety::Command::SyncCustomObject

#sync_custom_object, #sync_custom_objects

Methods included from Markety::Command::GetCustomObject

#convert_keys, #get_custom_object_by_keys

Methods included from Markety::Command::SyncMultipleLeads

#sync_multiple_leads

Methods included from Markety::Command::SyncLead

#sync_lead

Methods included from Markety::Command::GetLead

#get_lead_by_cookie, #get_lead_by_idnum, #get_leads_by_email

Constructor Details

#initialize(access_key, secret_key, end_point, options = {}) ⇒ Client

Supported options:

  • :log (bool) - enable/disable Savon logging (default: true)

  • :target_workspace (string) - name of workspace to use, if any



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/markety/client.rb', line 20

def initialize(access_key, secret_key, end_point, options = {})
  api_version = options.fetch(:api_version, '2_3')

  @client = Savon.client do
    endpoint end_point
    wsdl "http://app.marketo.com/soap/mktows/#{api_version}?WSDL"
    namespaces({"xmlns:ns1" => "http://www.marketo.com/mktows/"})
    env_namespace "SOAP-ENV"
    pretty_print_xml true
    log options.fetch(:log, false)
  end

  @auth_header = Markety::AuthenticationHeader.new(access_key, secret_key)
  @client_options = {}
  @client_options[:target_workspace] = options.has_key?(:target_workspace) ? options[:target_workspace] : {}
end

Instance Attribute Details

#target_workspaceObject (readonly)

Returns the value of attribute target_workspace.



14
15
16
# File 'lib/markety/client.rb', line 14

def target_workspace
  @target_workspace
end