markety 1.3.4 → 1.3.5
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 +15 -0
- data/lib/markety/client.rb +26 -25
- data/lib/markety/lead_record.rb +3 -1
- data/lib/markety/version.rb +1 -1
- metadata +15 -18
- data/bin/markety +0 -8
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NDdjZmNjYjRhM2Q5NTAzMTY3YmNkZTg1ODY5OWE1YTU4MGU1NTQwZA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
Y2YwMzhiZDNjZWMxMmRhYWE4YjljMjA4MWQwODU0ZjRiZmRkNGIwZA==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NmY2YWI2ZTQyMWU3NTAyMmNhYmFiYThkOGExNWNlMGZhOTBjZDFkYWQ4MGEx
|
10
|
+
NWY5OTU5MzM1Zjg3NGRlNmRlNzQzNTVkZGJlMjM0OTIyNTJlOTc1Yzg1YTA2
|
11
|
+
ZGVmYTBmMmE4NTAwZDY3YzI0NmFlZTBjNDQ2YzcwYTc5MjYwNmM=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
M2ZjODM4M2JiYWRjYWQzMjM0MThmYzM0ZThjOGFkMTg3N2ZiYjRmMzMwZGFh
|
14
|
+
ZDRkMDYwOTNjMjJkZmNiZjg4M2I4ZjQ4YzMzMmE2ZjllMzE0YjBmMDkwOTdl
|
15
|
+
MWJmOTAwMGJlNDBmN2U3MjNmYTAzNmQ4MGNhNzYyMzg2ZmVlYjc=
|
data/lib/markety/client.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Markety
|
2
|
-
def self.new_client(access_key, secret_key, end_point, api_version = '
|
2
|
+
def self.new_client(access_key, secret_key, end_point, api_version = '2_3')
|
3
3
|
client = Savon.client do
|
4
4
|
endpoint end_point
|
5
5
|
wsdl "http://app.marketo.com/soap/mktows/#{api_version}?WSDL"
|
@@ -7,10 +7,10 @@ module Markety
|
|
7
7
|
namespaces({"xmlns:ns1" => "http://www.marketo.com/mktows/"})
|
8
8
|
pretty_print_xml true
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
Client.new(client, Markety::AuthenticationHeader.new(access_key, secret_key))
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
class Client
|
15
15
|
def initialize(savon_client, authentication_header)
|
16
16
|
@client = savon_client
|
@@ -46,18 +46,19 @@ module Markety
|
|
46
46
|
begin
|
47
47
|
attributes = []
|
48
48
|
lead_record.each_attribute_pair do |name, value|
|
49
|
-
attributes << {:
|
49
|
+
attributes << {attr_name: name, attr_value: value, attr_type: lead_record.get_attribute_type(name) }
|
50
50
|
end
|
51
51
|
|
52
52
|
response = send_request(:sync_lead, {
|
53
|
-
:
|
54
|
-
:
|
55
|
-
:
|
56
|
-
:
|
57
|
-
:
|
53
|
+
return_lead: true,
|
54
|
+
lead_record: {
|
55
|
+
email: lead_record.email,
|
56
|
+
lead_attribute_list: {
|
57
|
+
attribute: attributes
|
58
58
|
}
|
59
59
|
}
|
60
60
|
})
|
61
|
+
|
61
62
|
return LeadRecord.from_hash(response[:success_sync_lead][:result][:lead_record])
|
62
63
|
rescue Exception => e
|
63
64
|
@logger.log(e) if @logger
|
@@ -72,17 +73,17 @@ module Markety
|
|
72
73
|
begin
|
73
74
|
attributes = []
|
74
75
|
lead_record.each_attribute_pair do |name, value|
|
75
|
-
attributes << {:
|
76
|
+
attributes << {attr_name: name, attr_value: value}
|
76
77
|
end
|
77
78
|
|
78
|
-
attributes << {:
|
79
|
+
attributes << {attr_name: 'Id', attr_type: 'string', attr_value: idnum.to_s}
|
79
80
|
|
80
81
|
response = send_request(:sync_lead, {
|
81
|
-
:
|
82
|
-
:
|
82
|
+
return_lead: true,
|
83
|
+
lead_record:
|
83
84
|
{
|
84
|
-
:
|
85
|
-
:
|
85
|
+
lead_attribute_list: { attribute: attributes},
|
86
|
+
id: idnum
|
86
87
|
}
|
87
88
|
})
|
88
89
|
return LeadRecord.from_hash(response[:success_sync_lead][:result][:lead_record])
|
@@ -108,16 +109,16 @@ module Markety
|
|
108
109
|
def list_operation(list_name, list_operation_type, idnum)
|
109
110
|
begin
|
110
111
|
response = send_request(:list_operation, {
|
111
|
-
:
|
112
|
-
:
|
113
|
-
:
|
114
|
-
:
|
115
|
-
:
|
112
|
+
list_operation: list_operation_type,
|
113
|
+
strict: 'false',
|
114
|
+
list_key: {
|
115
|
+
key_type: 'MKTOLISTNAME',
|
116
|
+
key_value: list_name
|
116
117
|
},
|
117
|
-
:
|
118
|
-
:
|
119
|
-
:
|
120
|
-
:
|
118
|
+
list_member_list: {
|
119
|
+
lead_key: [{
|
120
|
+
key_type: 'IDNUM',
|
121
|
+
key_value: idnum
|
121
122
|
}
|
122
123
|
]
|
123
124
|
}
|
@@ -147,7 +148,7 @@ module Markety
|
|
147
148
|
end
|
148
149
|
|
149
150
|
def request(namespace, message, header)
|
150
|
-
@client.call(namespace, :
|
151
|
+
@client.call(namespace, message: message, soap_header: header)
|
151
152
|
end
|
152
153
|
end
|
153
154
|
end
|
data/lib/markety/lead_record.rb
CHANGED
@@ -13,9 +13,11 @@ module Markety
|
|
13
13
|
# hydrates an instance from a savon hash returned form the marketo API
|
14
14
|
def self.from_hash(savon_hash)
|
15
15
|
lead_record = LeadRecord.new(savon_hash[:email], savon_hash[:id].to_i)
|
16
|
+
|
16
17
|
savon_hash[:lead_attribute_list][:attribute].each do |attribute|
|
17
18
|
lead_record.set_attribute(attribute[:attr_name], attribute[:attr_value], attribute[:attr_type])
|
18
|
-
end
|
19
|
+
end
|
20
|
+
|
19
21
|
lead_record
|
20
22
|
end
|
21
23
|
|
data/lib/markety/version.rb
CHANGED
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: markety
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
5
|
-
prerelease:
|
4
|
+
version: 1.3.5
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- David Santoso
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2014-
|
11
|
+
date: 2014-05-14 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: savon
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - '='
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - '='
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: wasabi
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - '='
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - '='
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,56 +41,58 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rspec
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.3'
|
51
48
|
- - ! '>='
|
52
49
|
- !ruby/object:Gem::Version
|
53
50
|
version: 2.3.0
|
54
51
|
type: :development
|
55
52
|
prerelease: false
|
56
53
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
54
|
requirements:
|
55
|
+
- - ~>
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '2.3'
|
59
58
|
- - ! '>='
|
60
59
|
- !ruby/object:Gem::Version
|
61
60
|
version: 2.3.0
|
62
61
|
description: A client to allow easy integration with Marketo's SOAP API
|
63
62
|
email: david.e.santoso@gmail.com
|
64
|
-
executables:
|
65
|
-
- markety
|
63
|
+
executables: []
|
66
64
|
extensions: []
|
67
65
|
extra_rdoc_files: []
|
68
66
|
files:
|
67
|
+
- lib/markety.rb
|
69
68
|
- lib/markety/authentication_header.rb
|
70
69
|
- lib/markety/client.rb
|
71
70
|
- lib/markety/enums.rb
|
72
71
|
- lib/markety/lead_key.rb
|
73
72
|
- lib/markety/lead_record.rb
|
74
73
|
- lib/markety/version.rb
|
75
|
-
- lib/markety.rb
|
76
|
-
- bin/markety
|
77
74
|
homepage: https://github.com/davidsantoso/markety
|
78
|
-
licenses:
|
75
|
+
licenses:
|
76
|
+
- MIT
|
77
|
+
metadata: {}
|
79
78
|
post_install_message:
|
80
79
|
rdoc_options: []
|
81
80
|
require_paths:
|
82
81
|
- lib
|
83
82
|
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
-
none: false
|
85
83
|
requirements:
|
86
84
|
- - ! '>='
|
87
85
|
- !ruby/object:Gem::Version
|
88
86
|
version: 1.9.3
|
89
87
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
|
-
none: false
|
91
88
|
requirements:
|
92
89
|
- - ! '>='
|
93
90
|
- !ruby/object:Gem::Version
|
94
91
|
version: '0'
|
95
92
|
requirements: []
|
96
93
|
rubyforge_project:
|
97
|
-
rubygems_version:
|
94
|
+
rubygems_version: 2.2.2
|
98
95
|
signing_key:
|
99
|
-
specification_version:
|
96
|
+
specification_version: 4
|
100
97
|
summary: Marketo SOAP API integration
|
101
98
|
test_files: []
|