chatmeter 1.3.0 → 1.3.1.rc

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 370cef80c0d815b4fd947100547be2e3f40caea8
4
- data.tar.gz: 6f55c1e37858106db2d74eb901710d88b6dab0f7
2
+ SHA256:
3
+ metadata.gz: efa927550523e362eeed86211b99aa51be90e55f5d0c933e467f5261f8229d24
4
+ data.tar.gz: acf47f4b88fc54268130b3377dee908884eddc7d8f39295a9688b299e1db9e81
5
5
  SHA512:
6
- metadata.gz: dec2b8969570b04bdedcb9eb2e9f913a01081517ac37bd8e26658178dc7dcf99860fac920222da50aad92fcadca0dc4d57076a29205cb7ecc2e9f6068b856253
7
- data.tar.gz: 69a161332a1dda1e71b037d3b3d703a2727a7a76e1a896b33b69ebec6e0083e8d7f31e315c653e02d673cdc7d0ca3ac201cd266936e852d157348eb5888e1612
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
@@ -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
- 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
- }
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
@@ -1,3 +1,3 @@
1
1
  module Chatmeter
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1.rc"
3
3
  end
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.0
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-01 00:00:00.000000000 Z
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: '0'
180
+ version: 1.3.1
179
181
  requirements: []
180
182
  rubyforge_project:
181
- rubygems_version: 2.6.14
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: