chatmeter 1.3.0 → 1.3.1.rc
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 +5 -5
- data/chatmeter.gemspec +1 -1
- data/lib/chatmeter/api.rb +1 -0
- data/lib/chatmeter/api/contact.rb +32 -0
- data/lib/chatmeter/api/mock.rb +1 -0
- data/lib/chatmeter/api/mock/campaign.rb +16 -16
- data/lib/chatmeter/api/mock/contact.rb +52 -0
- data/lib/chatmeter/version.rb +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: efa927550523e362eeed86211b99aa51be90e55f5d0c933e467f5261f8229d24
|
4
|
+
data.tar.gz: acf47f4b88fc54268130b3377dee908884eddc7d8f39295a9688b299e1db9e81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 714692ac61136878cc22a426bdc0803372c0edc13ac4e8133ef00c6e8223616c5167dff342ee493e4c5d07c14d69b90c885b250ed4f18cbc498473704ae3c92e
|
7
|
+
data.tar.gz: c7f966dd6ac610d8c955f785efd2f0e216c9979da1e043b56e32b61157ce14494b97f9fce60f2b841a0ef8269cc6747197279bf6fee255085a2b52428236e515
|
data/chatmeter.gemspec
CHANGED
@@ -6,7 +6,7 @@ require "chatmeter/version"
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "chatmeter"
|
8
8
|
spec.version = Chatmeter::VERSION
|
9
|
-
spec.authors = ["Levi Brown", "Kyle Rose", "Pablo Rodriguez", "Kirk Stennett"]
|
9
|
+
spec.authors = ["Levi Brown", "Kyle Rose", "Pablo Rodriguez", "Kirk Stennett, Sheena Gygax"]
|
10
10
|
spec.email = ["levi.brown@getg5.com"]
|
11
11
|
|
12
12
|
spec.summary = %q{A ruby wrapper for the chatmeter API.}
|
data/lib/chatmeter/api.rb
CHANGED
@@ -18,6 +18,7 @@ require "chatmeter/api/user_group_access"
|
|
18
18
|
require "chatmeter/api/user_location_access"
|
19
19
|
require "chatmeter/api/login"
|
20
20
|
require "chatmeter/api/campaign"
|
21
|
+
require "chatmeter/api/contact"
|
21
22
|
require "chatmeter/api/competitors"
|
22
23
|
require "chatmeter/api/listings"
|
23
24
|
require "chatmeter/api/mock"
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Chatmeter
|
2
|
+
class API
|
3
|
+
# POST /reviewBuilder/campaign/contact/create
|
4
|
+
def create_new_contact(params)
|
5
|
+
request(
|
6
|
+
expects: 201,
|
7
|
+
method: :post,
|
8
|
+
path: "/reviewBuilder/campaign/contact/create",
|
9
|
+
body: params.to_json
|
10
|
+
)
|
11
|
+
end
|
12
|
+
|
13
|
+
# GET /reviewBuilder/campaign/contact/get/{contactId}
|
14
|
+
def get_contact_by_id(contact_id)
|
15
|
+
request(
|
16
|
+
expects: 200,
|
17
|
+
method: :get,
|
18
|
+
path: "/reviewBuilder/campaign/contact/get/#{contact_id}"
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
# PUT reviewBuilder/campaign/contact/update/{contactId}
|
23
|
+
def update_contact(contact_id, params)
|
24
|
+
request(
|
25
|
+
expects: 200,
|
26
|
+
method: :put,
|
27
|
+
path: "/reviewBuilder/campaign/contact/update/#{contact_id}",
|
28
|
+
body: params.to_json
|
29
|
+
)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/chatmeter/api/mock.rb
CHANGED
@@ -8,6 +8,7 @@ require 'chatmeter/api/mock/location'
|
|
8
8
|
require 'chatmeter/api/mock/review'
|
9
9
|
require 'chatmeter/api/mock/account'
|
10
10
|
require 'chatmeter/api/mock/campaign'
|
11
|
+
require 'chatmeter/api/mock/contact'
|
11
12
|
require 'chatmeter/api/mock/competitors'
|
12
13
|
require 'chatmeter/api/mock/listings'
|
13
14
|
|
@@ -93,22 +93,22 @@ module Chatmeter
|
|
93
93
|
}
|
94
94
|
end
|
95
95
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
96
|
+
campaign_body = {
|
97
|
+
"name": "anotherCampaign",
|
98
|
+
"accountId": "56a184a6d4c61f5267b3f386",
|
99
|
+
"isActive": false,
|
100
|
+
"deliveryMethods": [
|
101
|
+
{
|
102
|
+
"deliveryDelay": 0,
|
103
|
+
"fromAddress": "support@chatmeter.com",
|
104
|
+
"subject": "Please tell us your thoughts!",
|
105
|
+
"templateId": "5748e778d4c680e898e308a9",
|
106
|
+
"type": "email",
|
107
|
+
"message": "Please tell us your thoughts! \n {{ formUrl }}"
|
108
|
+
}
|
109
|
+
],
|
110
|
+
"formId": "574ddfdcd4c6e2402ff37e0c"
|
111
|
+
}
|
112
112
|
|
113
113
|
|
114
114
|
# stub GET /reviewBuilder/campaign/get/#{campaign_id}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module Chatmeter
|
2
|
+
class API
|
3
|
+
module Mock
|
4
|
+
contact_body = {
|
5
|
+
"_id": {
|
6
|
+
"$oid": "123"
|
7
|
+
},
|
8
|
+
"name": "Lucy Diamond",
|
9
|
+
"email": "lucy.diamond@testemail.com",
|
10
|
+
"phone": "5412345678",
|
11
|
+
"campaignId": "5be1d1121ad2341fbca4e45a",
|
12
|
+
"locationId": "100497362",
|
13
|
+
}
|
14
|
+
|
15
|
+
# Stub POST /reviewBuilder/campaign/contact/create
|
16
|
+
Excon.stub(expects: 201, method: :post, path: '/v5/reviewBuilder/campaign/contact/create') do |params|
|
17
|
+
request_params, mock_data = parse_stub_params(params)
|
18
|
+
{
|
19
|
+
body: contact_body,
|
20
|
+
status: 201
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
# Stub GET /reviewBuilder/campaign/contact/get/{contactId}
|
25
|
+
Excon.stub(expects: 200, method: :get, path: %r{^/v5/reviewBuilder/campaign/contact/get/([^/]+)$}) do |params|
|
26
|
+
request_params, mock_data = parse_stub_params(params)
|
27
|
+
{
|
28
|
+
body: contact_body,
|
29
|
+
status: 200
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Stub PUT /reviewBuilder/campaign/contact/update/{contactId}
|
34
|
+
Excon.stub(expects: 200, method: :put, path: %r{^/v5/reviewBuilder/campaign/contact/update/([^/]+)$}) do |params|
|
35
|
+
request_params, mock_data = parse_stub_params(params)
|
36
|
+
{
|
37
|
+
body: contact_body,
|
38
|
+
status: 200
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
# Stub DELETE /reviewBuilder/campaign/contact/delete
|
43
|
+
Excon.stub(expects: 200, method: :delete, path: %r{^/v5/reviewBuilder/campaign/contact/delete/([^/]+)$}) do |params|
|
44
|
+
request_params, mock_data = parse_stub_params(params)
|
45
|
+
{
|
46
|
+
body: contact_body,
|
47
|
+
status: 200
|
48
|
+
}
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
data/lib/chatmeter/version.rb
CHANGED
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chatmeter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1.rc
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Levi Brown
|
8
8
|
- Kyle Rose
|
9
9
|
- Pablo Rodriguez
|
10
|
-
- Kirk Stennett
|
10
|
+
- Kirk Stennett, Sheena Gygax
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2019-05-
|
14
|
+
date: 2019-05-06 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|
@@ -134,6 +134,7 @@ files:
|
|
134
134
|
- lib/chatmeter/api/account.rb
|
135
135
|
- lib/chatmeter/api/campaign.rb
|
136
136
|
- lib/chatmeter/api/competitors.rb
|
137
|
+
- lib/chatmeter/api/contact.rb
|
137
138
|
- lib/chatmeter/api/errors.rb
|
138
139
|
- lib/chatmeter/api/group.rb
|
139
140
|
- lib/chatmeter/api/listings.rb
|
@@ -143,6 +144,7 @@ files:
|
|
143
144
|
- lib/chatmeter/api/mock/account.rb
|
144
145
|
- lib/chatmeter/api/mock/campaign.rb
|
145
146
|
- lib/chatmeter/api/mock/competitors.rb
|
147
|
+
- lib/chatmeter/api/mock/contact.rb
|
146
148
|
- lib/chatmeter/api/mock/group.rb
|
147
149
|
- lib/chatmeter/api/mock/listings.rb
|
148
150
|
- lib/chatmeter/api/mock/location.rb
|
@@ -173,14 +175,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
173
175
|
version: '0'
|
174
176
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
175
177
|
requirements:
|
176
|
-
- - "
|
178
|
+
- - ">"
|
177
179
|
- !ruby/object:Gem::Version
|
178
|
-
version:
|
180
|
+
version: 1.3.1
|
179
181
|
requirements: []
|
180
182
|
rubyforge_project:
|
181
|
-
rubygems_version: 2.
|
183
|
+
rubygems_version: 2.7.7
|
182
184
|
signing_key:
|
183
185
|
specification_version: 4
|
184
186
|
summary: A ruby wrapper for the chatmeter API.
|
185
187
|
test_files: []
|
186
|
-
has_rdoc:
|