markety 1.4.1 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjNhMzgyYWQ2MzE3MzJiZDhjZmViZWZmNTYxNjU2MjNmODMzMjk1Ng==
4
+ ZDU0YTMyNDk3MmYzZjYxNTk5OGRkZjhhNzg5MGViNTIwMGNmMzY5Mg==
5
5
  data.tar.gz: !binary |-
6
- YTdhZDU4YzVlZmIyMDE3YWFmMzJjYjM5N2VhMmQyM2FjYWZmMGQzNw==
6
+ NzVlOTk5OGQ1ZDUyNjU4Y2UzMmI2N2Q3NTM5ZDBhYzA0YjMzZjA2ZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OTY2MmM2YjE4Yjc5M2IyMmVjMzAzNTNmNzVjZjFjZTM3OGI4OTJmOWVmMjIx
10
- YTQ2YzZlOWNhNDI2MTg3M2Y2MzMxYjA1YWZiODA4OWIxZWY5YjFmMmE5MjRk
11
- NjNiNjEyZjIwZTZkYjc3ZmQyOTJlMTVjMDgyY2JhZjY4OTIxNTE=
9
+ MmUxYWM3MTk3NzM5ZDQ3NTE0MmM0MzA5MGFmMzQxYmZiZGU4ODRhYzk3NTZm
10
+ MDJlOTUxNWZiMjRkMjc0YjlhZDYwODEzMTljYjgwMGQ2ZDMzY2ZmZDM5NGE3
11
+ ZjUxNWExOGQyZjYxNDYxYzI3M2VmNTljNDcyZDkxOWY3ZDMxOGI=
12
12
  data.tar.gz: !binary |-
13
- ZjMwMDAwYThlYmZiYmY1OTgzZTQzODhkMWUyZThiNzgyMDg0YmZlMWFiM2Yz
14
- YmEyMThkZjkyNzQzOTU0OWY3ZjAzYWE1ZWM3MmZlNWIzNmE1OTBjY2Y0MzU4
15
- YTgwMTViOWUyNjM2MDhiMTRhYjk4M2MwZjE4OWI1M2MwYmQ5ZDQ=
13
+ ZjczYTUwYzkxMDhhMTBkZGI0NzcwODI0NThlODQwZGNlNzlmYjNjNGQyMjY3
14
+ YWNjM2I0NjlmNWQ0YTllNTQ5YWJkMTJlYWIyY2FlZGE1ZThhZWEyN2UyYTdi
15
+ YjYyOTRjYWM4MTVjNGMzNGZmMmI0YjNhNmQxMGZmN2I0MzgyZjc=
data/README.md CHANGED
@@ -47,3 +47,10 @@ client.remove_from_list('The_List_Name', lead.idnum)
47
47
 
48
48
  [1] Note that [the Marketo API does not let you create custom fields] (https://community.marketo.com/MarketoDiscussionDetail?id=90650000000PpyEAAS#j_id0:j_id2:j_id9:j_id10:apexideas:j_id248) at this time. In order to set a custom attribute through the API, it must first be added from the Admin interface.
49
49
  _(Admin » Field Management » New Custom Field)_
50
+
51
+ ## Options
52
+
53
+ ```ruby
54
+ # Turn of Savon logging - logging is helpful during development, but outputs a lot of text which you may not want in production
55
+ client = Markety.new_client(USER_ID, ENCRYPTION_KEY, END_POINT, { log: false })
56
+ ```
@@ -1,11 +1,14 @@
1
1
  module Markety
2
- def self.new_client(access_key, secret_key, end_point, api_version = '2_3')
2
+ def self.new_client(access_key, secret_key, end_point, options = {})
3
+ api_version = options.fetch(:api_version, '2_3')
4
+
3
5
  client = Savon.client do
4
6
  endpoint end_point
5
7
  wsdl "http://app.marketo.com/soap/mktows/#{api_version}?WSDL"
6
8
  env_namespace "SOAP-ENV"
7
9
  namespaces({"xmlns:ns1" => "http://www.marketo.com/mktows/"})
8
10
  pretty_print_xml true
11
+ log false if options[:log] == false
9
12
  end
10
13
 
11
14
  Client.new(client, Markety::AuthenticationHeader.new(access_key, secret_key))
@@ -106,24 +109,24 @@ module Markety
106
109
  end
107
110
 
108
111
  private
109
- def list_operation(list_name, list_operation_type, idnum)
110
- begin
111
- response = send_request(:list_operation, {
112
- list_operation: list_operation_type,
113
- strict: 'false',
114
- list_key: {
115
- key_type: 'MKTOLISTNAME',
116
- key_value: list_name
117
- },
118
- list_member_list: {
119
- lead_key: [{
120
- key_type: 'IDNUM',
121
- key_value: idnum
122
- }
123
- ]
124
- }
112
+
113
+ def list_operation(list_name, list_operation_type, idnum)
114
+ begin
115
+ response = send_request(:list_operation, {
116
+ list_operation: list_operation_type,
117
+ strict: 'false',
118
+ list_key: {
119
+ key_type: 'MKTOLISTNAME',
120
+ key_value: list_name
121
+ },
122
+ list_member_list: {
123
+ lead_key: [{
124
+ key_type: 'IDNUM',
125
+ key_value: idnum
126
+ }
127
+ ]
125
128
  }
126
- )
129
+ })
127
130
  return response
128
131
  rescue Exception => e
129
132
  @logger.log(e) if @logger
@@ -1,5 +1,5 @@
1
1
  module Markety
2
2
 
3
- VERSION = "1.4.1"
3
+ VERSION = "1.4.2"
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markety
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Santoso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-24 00:00:00.000000000 Z
11
+ date: 2014-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler