Class: Markety::Client
- Inherits:
-
Object
- Object
- Markety::Client
- Includes:
- Markety::Command::GetCustomObject, Markety::Command::GetLead, Markety::Command::ListOperation, Markety::Command::SyncCustomObject, Markety::Command::SyncLead, Markety::Command::SyncMultipleLeads
- Defined in:
- lib/markety/client.rb
Overview
All of the Markety::Command modules are mixed in to Client, so see the documentation for those modules.
Instance Attribute Summary collapse
-
#target_workspace ⇒ Object
readonly
Returns the value of attribute target_workspace.
Instance Method Summary collapse
-
#initialize(access_key, secret_key, end_point, options = {}) ⇒ Client
constructor
Supported
options
:.
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
Methods included from Markety::Command::SyncLead
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, = {}) api_version = .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 .fetch(:log, false) end @auth_header = Markety::AuthenticationHeader.new(access_key, secret_key) @client_options = {} @client_options[:target_workspace] = .has_key?(:target_workspace) ? [:target_workspace] : {} end |
Instance Attribute Details
#target_workspace ⇒ Object (readonly)
Returns the value of attribute target_workspace.
14 15 16 |
# File 'lib/markety/client.rb', line 14 def target_workspace @target_workspace end |