intercom 3.5.7 → 3.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/lib/intercom/service/admin.rb +6 -0
- data/lib/intercom/version.rb +1 -1
- data/spec/unit/intercom/admin_spec.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4aa22d119110687f4cd14e26a4c116b4a4fe11c8
|
4
|
+
data.tar.gz: 7245527c6570404ce74af1faf5a8f54cd37fc042
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5db50d94e9e04420c02fb8cd7b96226b1308506ca196888256d732fe05e815caf9178e6daed40d3c12ba28589583ab0acb095289c84be00a7b7922711cfb33e
|
7
|
+
data.tar.gz: 42d5567d7b9e2a7e9df56861d4e62e116f58a91e688e5e1c1c5ddd82f8b40f36a1cd0e8b2c4b1f74649c64117b6869d72cc03728bade435755e90fad98c5d7dc
|
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.5.
|
25
|
+
gem 'intercom', "~> 3.5.8"
|
26
26
|
|
27
27
|
## Basic Usage
|
28
28
|
|
@@ -109,7 +109,7 @@ result = = intercom.users.scroll.next("0730e341-63ef-44da-ab9c-9113f886326d");
|
|
109
109
|
#Bulk operations.
|
110
110
|
# Submit bulk job to create users. If any of the items in create_items match an existing user that user will be updated
|
111
111
|
intercom.users.submit_bulk_job(create_items: [{user_id: 25, email: "alice@example.com"}, {user_id: 25, email: "bob@example.com"}])
|
112
|
-
# Submit bulk job to create users with companies. Companies must be sent as an array of objects nested within each applicable user object
|
112
|
+
# Submit bulk job to create users with companies. Companies must be sent as an array of objects nested within each applicable user object
|
113
113
|
intercom.users.submit_bulk_job(create_items: [{user_id: 25, email: "alice@example.com", companies: [{:company_id => 9, :name => "Test Company"}]}])
|
114
114
|
# Submit bulk job, to delete users
|
115
115
|
intercom.users.submit_bulk_job(delete_items: [{user_id: 25, email: "alice@example.com"}, {user_id: 25, email: "bob@example.com"}])
|
@@ -119,6 +119,8 @@ intercom.users.submit_bulk_job(create_items: [{user_id: 25, email: "alice@exampl
|
|
119
119
|
|
120
120
|
#### Admins
|
121
121
|
```ruby
|
122
|
+
# Find access token owner (only with Personal Access Token and OAuth)
|
123
|
+
intercom.admins.me
|
122
124
|
# Find an admin by id
|
123
125
|
intercom.admins.find(:id => admin_id)
|
124
126
|
# Iterate over all admins
|
@@ -11,6 +11,12 @@ module Intercom
|
|
11
11
|
def collection_class
|
12
12
|
Intercom::Admin
|
13
13
|
end
|
14
|
+
|
15
|
+
def me
|
16
|
+
response = @client.get("/me", {})
|
17
|
+
raise Intercom::HttpError.new('Http Error - No response entity returned') unless response
|
18
|
+
from_api(response)
|
19
|
+
end
|
14
20
|
end
|
15
21
|
end
|
16
22
|
end
|
data/lib/intercom/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe "Intercom::Admin" do
|
4
|
-
let (:client) { Intercom::Client.new(
|
4
|
+
let (:client) { Intercom::Client.new(token: 'token') }
|
5
5
|
|
6
6
|
it "returns a CollectionProxy for all without making any requests" do
|
7
7
|
client.expects(:execute_request).never
|
@@ -9,6 +9,11 @@ describe "Intercom::Admin" do
|
|
9
9
|
all.must_be_instance_of(Intercom::ClientCollectionProxy)
|
10
10
|
end
|
11
11
|
|
12
|
+
it "gets me (access token method only)" do
|
13
|
+
client.expects(:get).with("/me", {}).returns(test_admin)
|
14
|
+
client.admins.me
|
15
|
+
end
|
16
|
+
|
12
17
|
it 'gets an admin list' do
|
13
18
|
client.expects(:get).with("/admins", {}).returns(test_admin_list)
|
14
19
|
client.admins.all.each { |a| }
|
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.5.
|
4
|
+
version: 3.5.8
|
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: 2016-10-
|
18
|
+
date: 2016-10-27 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: minitest
|