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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d86ee0111c267589f1aa6def23aa09c6f809621
4
- data.tar.gz: 111d6098366a5ddcaa614182fa53bc9319fed8c5
3
+ metadata.gz: 4aa22d119110687f4cd14e26a4c116b4a4fe11c8
4
+ data.tar.gz: 7245527c6570404ce74af1faf5a8f54cd37fc042
5
5
  SHA512:
6
- metadata.gz: 6beb6afb91f74bc321c165cb49018a7f1d7640934b0f38a3fa0b00efa925097f2833543f553f5456e7bc692e383b6ce0cfdaa39e5e656d26767b3ccb67427eb7
7
- data.tar.gz: f62b9dac85b825b399c46c40f116b404d8542dc12152cecd09cd8ad77b37e38fb504c267b04a5d6b6cd4f6acace3a71bd8db0380e41cdffe7452ab0450a4e6a4
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.6"
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
@@ -1,3 +1,3 @@
1
1
  module Intercom #:nodoc:
2
- VERSION = "3.5.7"
2
+ VERSION = "3.5.8"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe "Intercom::Admin" do
4
- let (:client) { Intercom::Client.new(app_id: 'app_id', api_key: 'api_key') }
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.7
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-26 00:00:00.000000000 Z
18
+ date: 2016-10-27 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: minitest