responsys-api 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/README.md +1 -1
- data/lib/responsys/api/table.rb +2 -2
- data/responsys-api.gemspec +7 -5
- data/spec/api/table_spec.rb +15 -0
- data/spec/fixtures/vcr_cassettes/api/table/merge_table_records_with_pk.yml +64 -0
- data/spec/test_data.yml +8 -2
- metadata +15 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cd89f23cbf40a5c8d7210e14a301b842cf73931
|
4
|
+
data.tar.gz: 076dcd58b46d61eb6e5fe28f68f1966cf12254bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fb662c64fc087e37faa8733535fafdadb6e785d035167cbde6023c8b8fb8ffd4918e50d175387ed352f719964d092832b89e0b3f92ad8a1143296cb6232ef73
|
7
|
+
data.tar.gz: 2e7678dedb96a9401960d677693bd8281905529c448140544420afd8792e7d77ae8cd576effbb12bcbdc2ca615074ce81a644ef27da03c0df2ec7c63990a7712
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# ResponsysApi ![Master branch build status](https://travis-ci.org/dandemeyere/responsys-api.svg?branch=master)
|
1
|
+
# ResponsysApi ![Master branch build status](https://travis-ci.org/dandemeyere/responsys-api.svg?branch=master) [![Code Climate](https://codeclimate.com/github/dandemeyere/responsys-api/badges/gpa.svg)](https://codeclimate.com/github/dandemeyere/responsys-api)
|
2
2
|
|
3
3
|
A gem to help you communicate to the Responsys Interact SOAP API. Currently working of Responsys Interact version 6.20.
|
4
4
|
|
data/lib/responsys/api/table.rb
CHANGED
@@ -29,8 +29,8 @@ module Responsys
|
|
29
29
|
|
30
30
|
end
|
31
31
|
|
32
|
-
def merge_table_records_with_pk
|
33
|
-
|
32
|
+
def merge_table_records_with_pk(interact_object, record_data, insert_on_no_match = true, update_on_match = "REPLACE_ALL")
|
33
|
+
api_method(:merge_table_records_with_pk, { table: interact_object.to_api, recordData: record_data.to_api, insertOnNoMatch: insert_on_no_match, updateOnMatch: update_on_match })
|
34
34
|
end
|
35
35
|
|
36
36
|
def delete_table_records
|
data/responsys-api.gemspec
CHANGED
@@ -4,11 +4,11 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "responsys-api"
|
7
|
-
spec.version = "0.2.
|
7
|
+
spec.version = "0.2.2"
|
8
8
|
spec.authors = ["Dan DeMeyere", "Florian Lorrain", "Morgan Griggs", "Mike Rocco"]
|
9
9
|
spec.email = ["dan@thredup.com", "florian.lorrain@thredup.com", "morgan@thredup.com", "michael.rocco@thredup.com"]
|
10
10
|
spec.description = "A gem to integrate with the Responsys SOAP API"
|
11
|
-
spec.summary = "
|
11
|
+
spec.summary = "See the github repository for further information about the usage and the needed configuration"
|
12
12
|
spec.homepage = "https://github.com/dandemeyere/responsys-api"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
@@ -17,14 +17,16 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.
|
20
|
+
spec.required_ruby_version = '>= 1.9.3'
|
21
|
+
|
22
|
+
spec.add_dependency "rubyntlm", "0.4.0"
|
21
23
|
spec.add_dependency "savon", "2.6.0"
|
22
24
|
spec.add_dependency "wasabi", "3.3.0"
|
23
|
-
spec.add_dependency "i18n", "~> 0.6"
|
25
|
+
spec.add_dependency "i18n", "~> 0.6.9"
|
24
26
|
spec.add_dependency "connection_pool", "2.0.0"
|
25
27
|
spec.add_development_dependency "bundler", "~> 1.3"
|
26
28
|
spec.add_development_dependency "rake", "~> 10.3"
|
27
29
|
spec.add_development_dependency "rspec", "~> 3.1.0"
|
28
|
-
spec.add_development_dependency "vcr", "~> 2.
|
30
|
+
spec.add_development_dependency "vcr", "~> 2.9.3"
|
29
31
|
spec.add_development_dependency "webmock", "~> 1.9"
|
30
32
|
end
|
data/spec/api/table_spec.rb
CHANGED
@@ -8,6 +8,7 @@ describe Responsys::Api::Table do
|
|
8
8
|
@fields = %w(RIID_ MONTHLY_PURCH)
|
9
9
|
@user_riid = DATA[:users][:user1][:RIID]
|
10
10
|
@user_purch = DATA[:pets][:pet1][:records][:user1][:MONTHLY_PURCH]
|
11
|
+
|
11
12
|
end
|
12
13
|
|
13
14
|
context "create table" do
|
@@ -57,6 +58,20 @@ describe Responsys::Api::Table do
|
|
57
58
|
expect(response[:result]).to be(true)
|
58
59
|
end
|
59
60
|
end
|
61
|
+
|
62
|
+
it "should merge table records with pk" do
|
63
|
+
VCR.use_cassette("api/table/merge_table_records_with_pk") do
|
64
|
+
@pet_id = DATA[:pets][:pet1][:id]
|
65
|
+
@pet_name = DATA[:pets][:pet1][:name]
|
66
|
+
@supplement_table_folder = DATA[:supplement_tables][:supplement_table1][:folder_name]
|
67
|
+
@supplement_table_name = DATA[:supplement_tables][:supplement_table1][:name]
|
68
|
+
@user_email = DATA[:users][:user1][:EMAIL_ADDRESS]
|
69
|
+
record_data = Responsys::Api::Object::RecordData.new([{EMAIL_ADDRESS_: @user_email, PET_ID: @pet_id, PET_NAME: @pet_name}])
|
70
|
+
table_with_pk = Responsys::Api::Object::InteractObject.new(@supplement_table_folder , @supplement_table_name)
|
71
|
+
response = Responsys::Api::Client.instance.merge_table_records_with_pk(table_with_pk, record_data)
|
72
|
+
expect(response[:status]).to eq("ok")
|
73
|
+
end
|
74
|
+
end
|
60
75
|
end
|
61
76
|
|
62
77
|
context "retrieve_profile_extension_records" do
|
@@ -0,0 +1,64 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://ws5.responsys.net/webservices/services/ResponsysWSService
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
9
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="urn:ws.rsys.com"
|
10
|
+
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><tns:login><tns:username>your_responsys_username</tns:username><tns:password>your_responsys_password</tns:password></tns:login></env:Body></env:Envelope>
|
11
|
+
headers:
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message: OK
|
16
|
+
headers:
|
17
|
+
body:
|
18
|
+
encoding: US-ASCII
|
19
|
+
string: <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><loginResponse
|
20
|
+
xmlns="urn:ws.rsys.com"><result><sessionId>DEAR_SESSION_ID</sessionId></result></loginResponse></soapenv:Body></soapenv:Envelope>
|
21
|
+
http_version:
|
22
|
+
recorded_at: Wed, 17 Dec 2014 06:22:45 GMT
|
23
|
+
- request:
|
24
|
+
method: post
|
25
|
+
uri: https://ws5.responsys.net/webservices/services/ResponsysWSService
|
26
|
+
body:
|
27
|
+
encoding: US-ASCII
|
28
|
+
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
29
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="urn:ws.rsys.com"
|
30
|
+
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header><sessionHeader><sessionId>DEAR_SESSION_ID</sessionId></sessionHeader></env:Header><env:Body><tns:mergeTableRecordsWithPK><tns:table><tns:folderName>supplement_table1_folder</tns:folderName><tns:objectName>supplement_table1_name</tns:objectName></tns:table><tns:recordData><tns:fieldNames>EMAIL_ADDRESS_</tns:fieldNames><tns:fieldNames>PET_ID</tns:fieldNames><tns:fieldNames>PET_NAME</tns:fieldNames><tns:records><tns:fieldValues>user1@email.com</tns:fieldValues><tns:fieldValues>111111111</tns:fieldValues><tns:fieldValues>rspec_pet1</tns:fieldValues></tns:records></tns:recordData><tns:insertOnNoMatch>true</tns:insertOnNoMatch><tns:updateOnMatch>REPLACE_ALL</tns:updateOnMatch></tns:mergeTableRecordsWithPK></env:Body></env:Envelope>
|
31
|
+
headers:
|
32
|
+
response:
|
33
|
+
status:
|
34
|
+
code: 200
|
35
|
+
message: OK
|
36
|
+
headers:
|
37
|
+
body:
|
38
|
+
encoding: US-ASCII
|
39
|
+
string: <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><mergeTableRecordsWithPKResponse
|
40
|
+
xmlns="urn:ws.rsys.com"><result><insertCount>1</insertCount><updateCount>0</updateCount><rejectedCount>0</rejectedCount><totalCount>1</totalCount><errorMessage
|
41
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="1" /></result></mergeTableRecordsWithPKResponse></soapenv:Body></soapenv:Envelope>
|
42
|
+
http_version:
|
43
|
+
recorded_at: Wed, 17 Dec 2014 06:22:48 GMT
|
44
|
+
- request:
|
45
|
+
method: post
|
46
|
+
uri: https://ws5.responsys.net/webservices/services/ResponsysWSService
|
47
|
+
body:
|
48
|
+
encoding: US-ASCII
|
49
|
+
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
50
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="urn:ws.rsys.com"
|
51
|
+
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header><sessionHeader><sessionId>DEAR_SESSION_ID</sessionId></sessionHeader></env:Header><env:Body><tns:logout></tns:logout></env:Body></env:Envelope>
|
52
|
+
headers:
|
53
|
+
response:
|
54
|
+
status:
|
55
|
+
code: 200
|
56
|
+
message: OK
|
57
|
+
headers:
|
58
|
+
body:
|
59
|
+
encoding: US-ASCII
|
60
|
+
string: <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><logoutResponse
|
61
|
+
xmlns="urn:ws.rsys.com"><result>true</result></logoutResponse></soapenv:Body></soapenv:Envelope>
|
62
|
+
http_version:
|
63
|
+
recorded_at: Wed, 17 Dec 2014 06:22:51 GMT
|
64
|
+
recorded_with: VCR 2.9.3
|
data/spec/test_data.yml
CHANGED
@@ -37,10 +37,16 @@
|
|
37
37
|
|
38
38
|
:pets:
|
39
39
|
:pet1:
|
40
|
+
:id: 111111111
|
40
41
|
:name: rspec_pet1
|
41
|
-
|
42
|
+
|
42
43
|
:records:
|
43
44
|
:user1:
|
44
45
|
:MONTHLY_PURCH: 300
|
45
46
|
:user2:
|
46
|
-
:MONTHLY_PURCH: 1000
|
47
|
+
:MONTHLY_PURCH: 1000
|
48
|
+
:supplement_tables:
|
49
|
+
:supplement_table1:
|
50
|
+
:name: supplement_table1_name
|
51
|
+
:folder_name: supplement_table1_folder
|
52
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: responsys-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan DeMeyere
|
@@ -11,22 +11,22 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2015-01-28 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rubyntlm
|
18
18
|
requirement: !ruby/object:Gem::Requirement
|
19
19
|
requirements:
|
20
|
-
- -
|
20
|
+
- - '='
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
22
|
+
version: 0.4.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - '='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 0.4.0
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: savon
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -61,14 +61,14 @@ dependencies:
|
|
61
61
|
requirements:
|
62
62
|
- - "~>"
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version:
|
64
|
+
version: 0.6.9
|
65
65
|
type: :runtime
|
66
66
|
prerelease: false
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
69
69
|
- - "~>"
|
70
70
|
- !ruby/object:Gem::Version
|
71
|
-
version:
|
71
|
+
version: 0.6.9
|
72
72
|
- !ruby/object:Gem::Dependency
|
73
73
|
name: connection_pool
|
74
74
|
requirement: !ruby/object:Gem::Requirement
|
@@ -131,14 +131,14 @@ dependencies:
|
|
131
131
|
requirements:
|
132
132
|
- - "~>"
|
133
133
|
- !ruby/object:Gem::Version
|
134
|
-
version:
|
134
|
+
version: 2.9.3
|
135
135
|
type: :development
|
136
136
|
prerelease: false
|
137
137
|
version_requirements: !ruby/object:Gem::Requirement
|
138
138
|
requirements:
|
139
139
|
- - "~>"
|
140
140
|
- !ruby/object:Gem::Version
|
141
|
-
version:
|
141
|
+
version: 2.9.3
|
142
142
|
- !ruby/object:Gem::Dependency
|
143
143
|
name: webmock
|
144
144
|
requirement: !ruby/object:Gem::Requirement
|
@@ -225,6 +225,7 @@ files:
|
|
225
225
|
- spec/fixtures/vcr_cassettes/api/profile_extension/retrieve_profile_extension_records.yml
|
226
226
|
- spec/fixtures/vcr_cassettes/api/table/create_with_pk.yml
|
227
227
|
- spec/fixtures/vcr_cassettes/api/table/delete_with_pk.yml
|
228
|
+
- spec/fixtures/vcr_cassettes/api/table/merge_table_records_with_pk.yml
|
228
229
|
- spec/fixtures/vcr_cassettes/member/present1.yml
|
229
230
|
- spec/fixtures/vcr_cassettes/member/present2.yml
|
230
231
|
- spec/fixtures/vcr_cassettes/member/present3.yml
|
@@ -247,7 +248,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
247
248
|
requirements:
|
248
249
|
- - ">="
|
249
250
|
- !ruby/object:Gem::Version
|
250
|
-
version:
|
251
|
+
version: 1.9.3
|
251
252
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
252
253
|
requirements:
|
253
254
|
- - ">="
|
@@ -258,7 +259,8 @@ rubyforge_project:
|
|
258
259
|
rubygems_version: 2.2.2
|
259
260
|
signing_key:
|
260
261
|
specification_version: 4
|
261
|
-
summary:
|
262
|
+
summary: See the github repository for further information about the usage and the
|
263
|
+
needed configuration
|
262
264
|
test_files:
|
263
265
|
- spec/api/campaign_spec.rb
|
264
266
|
- spec/api/client_spec.rb
|
@@ -284,6 +286,7 @@ test_files:
|
|
284
286
|
- spec/fixtures/vcr_cassettes/api/profile_extension/retrieve_profile_extension_records.yml
|
285
287
|
- spec/fixtures/vcr_cassettes/api/table/create_with_pk.yml
|
286
288
|
- spec/fixtures/vcr_cassettes/api/table/delete_with_pk.yml
|
289
|
+
- spec/fixtures/vcr_cassettes/api/table/merge_table_records_with_pk.yml
|
287
290
|
- spec/fixtures/vcr_cassettes/member/present1.yml
|
288
291
|
- spec/fixtures/vcr_cassettes/member/present2.yml
|
289
292
|
- spec/fixtures/vcr_cassettes/member/present3.yml
|