intercom 3.8.0 → 3.8.1

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
2
  SHA256:
3
- metadata.gz: da9b3a3eada2fcf56d0d91d948bf4bed01fd27db5d5175293666be7cc702ef20
4
- data.tar.gz: e2d4b731ce51e10b3d3bcba67024e3926595aea618d4cdee7a9bde38fca45f21
3
+ metadata.gz: 82e1587dad8e896255cd493bccb9cb2a389ddf1805aead74cd1a645ebbc6eac4
4
+ data.tar.gz: 53ad03e351f26b5c67558ffc2195811732980d746d1b5d54681d7a8f98360ffa
5
5
  SHA512:
6
- metadata.gz: 3ef7cde04e9affeb408ec48d0767d39c88923aa4249ad89b6f30029f2e0e172972e105310078d1139a804bae9290b683e86f38a079beedf23441bd1fe4dafb8d
7
- data.tar.gz: 6b088e5a334fcd48df68ed57293ee3e7c0b8cfaf26e0ba67bc724d24b4d7ce7177dec4b7cd9d69f8aa893a358268109356dc0369771131aafb77c63c1240ce2f
6
+ metadata.gz: 4fa0433095b490feb4810fe1ad432a0de9c7007f1eb5bcf7cc3725658c0c23b85daf3f4339f1d71b9a9a522c4a55eaaf011c394a3543eb1c6957306389115732
7
+ data.tar.gz: f90a678af75d18574ee46c786f7ad954c9d8164642c4b161ae9dd10e15160cef319981c28b2ad0fb891f40a9fefd0df3d784c5ea10cf090dce5b916112e86b4d
data/README.md CHANGED
@@ -22,7 +22,7 @@ This version of the gem is compatible with `Ruby 2.1` and above.
22
22
 
23
23
  Using bundler:
24
24
 
25
- gem 'intercom', '~> 3.7.7'
25
+ gem 'intercom', '~> 3.8.0'
26
26
 
27
27
  ## Basic Usage
28
28
 
@@ -1,3 +1,7 @@
1
+ 3.8.0
2
+ Add support for Customer Search (currently in Unstable API Version)
3
+ https://developers.intercom.com/intercom-api-reference/v0/reference#customers
4
+
1
5
  3.7.7
2
6
  Remove deprecated features from Gemspec
3
7
 
@@ -171,7 +171,7 @@ module Intercom
171
171
  raise Intercom::BadRequestError.new(error_details['message'], error_context)
172
172
  when "not_restorable"
173
173
  raise Intercom::BlockedUserError.new(error_details['message'], error_context)
174
- when "not_found"
174
+ when "not_found", "company_not_found"
175
175
  raise Intercom::ResourceNotFound.new(error_details['message'], error_context)
176
176
  when "admin_not_found"
177
177
  raise Intercom::AdminNotFound.new(error_details['message'], error_context)
@@ -1,3 +1,3 @@
1
1
  module Intercom #:nodoc:
2
- VERSION = "3.8.0"
2
+ VERSION = "3.8.1"
3
3
  end
@@ -37,7 +37,7 @@ describe 'Intercom::Request' do
37
37
  req = Intercom::Request.get(uri, "")
38
38
  req.handle_rate_limit=true
39
39
  req.expects(:sleep).times(3).with(any_parameters)
40
- req.execute(target_base_url=uri, username: "ted", secret: "")
40
+ req.execute(uri, username: "ted", secret: "")
41
41
  }.must_raise(Intercom::RateLimitExceeded)
42
42
  end
43
43
 
@@ -48,7 +48,7 @@ describe 'Intercom::Request' do
48
48
  req = Intercom::Request.get(uri, "")
49
49
  req.handle_rate_limit=true
50
50
  req.expects(:sleep).never.with(any_parameters)
51
- req.execute(target_base_url=uri, username: "ted", secret: "")
51
+ req.execute(uri, username: "ted", secret: "")
52
52
  end
53
53
 
54
54
  it 'should call sleep for rate limit error just once' do
@@ -59,7 +59,7 @@ describe 'Intercom::Request' do
59
59
  req = Intercom::Request.get(uri, "")
60
60
  req.handle_rate_limit=true
61
61
  req.expects(:sleep).with(any_parameters)
62
- req.execute(target_base_url=uri, username: "ted", secret: "")
62
+ req.execute(uri, username: "ted", secret: "")
63
63
  end
64
64
 
65
65
  it 'should not sleep if rate limit reset time has passed' do
@@ -70,7 +70,7 @@ describe 'Intercom::Request' do
70
70
  req = Intercom::Request.get(uri, "")
71
71
  req.handle_rate_limit=true
72
72
  req.expects(:sleep).never.with(any_parameters)
73
- req.execute(target_base_url=uri, username: "ted", secret: "")
73
+ req.execute(uri, username: "ted", secret: "")
74
74
  end
75
75
  end
76
76
 
@@ -82,7 +82,7 @@ describe 'Intercom::Request' do
82
82
  stub_request(:put, uri).\
83
83
  to_return(status: [409, "Resource Already Exists"], headers: { 'X-RateLimit-Reset' => (Time.now.utc + 10).to_i.to_s }, body: {type: "error.list", errors: [ code: "resource_conflict" ]}.to_json)
84
84
  req = Intercom::Request.put(uri, "")
85
- expect { req.execute(target_base_url=uri, username: "ted", secret: "") }.must_raise(Intercom::ResourceNotUniqueError)
85
+ expect { req.execute(uri, username: "ted", secret: "") }.must_raise(Intercom::ResourceNotUniqueError)
86
86
  end
87
87
 
88
88
  it 'should raise ApiVersionInvalid error on intercom_version_invalid code' do
@@ -92,6 +92,13 @@ describe 'Intercom::Request' do
92
92
  req = Intercom::Request.put(uri, "")
93
93
  expect { req.execute(uri, username: "ted", secret: "") }.must_raise(Intercom::ApiVersionInvalid)
94
94
  end
95
+
96
+ it 'should raise ResourceNotFound error on company_not_found code' do
97
+ stub_request(:put, uri).\
98
+ to_return(status: [404, "Not Found"], headers: { 'X-RateLimit-Reset' => (Time.now.utc + 10).to_i.to_s }, body: {type: "error.list", errors: [ code: "company_not_found" ]}.to_json)
99
+ req = Intercom::Request.put(uri, "")
100
+ expect { req.execute(uri, username: "ted", secret: "") }.must_raise(Intercom::ResourceNotFound)
101
+ end
95
102
  end
96
103
 
97
104
  it 'parse_body returns nil if decoded_body is nil' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intercom
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.0
4
+ version: 3.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben McRedmond
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2019-08-01 00:00:00.000000000 Z
18
+ date: 2019-10-03 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: minitest
@@ -235,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
235
235
  version: '0'
236
236
  requirements: []
237
237
  rubyforge_project:
238
- rubygems_version: 2.7.8
238
+ rubygems_version: 2.7.6.2
239
239
  signing_key:
240
240
  specification_version: 4
241
241
  summary: Ruby bindings for the Intercom API