google-wrapper 0.0.3 → 0.0.4

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: c12f283c78195065d6aafb86b984a872d030a539
4
- data.tar.gz: 1c35b4809df163658c6120aa9afe06310bba6562
3
+ metadata.gz: 3eddbb3710e316e34a6ceedead992c7c1e8be108
4
+ data.tar.gz: 3c1e882cb6859d1f2a701ae4bb3663faa0338c15
5
5
  SHA512:
6
- metadata.gz: 1f50fd11aa9e3720624e0ff820a8ee6f1387875ce51319fa7c40bd68235bc675e43414f9cbe6b37e6d83625af14c39e30920a5493c3e1901151b4d7741c1d372
7
- data.tar.gz: ae16d4efb1415ea59f8b52405c0cfe58b17e82d6255090413e6177574a9ba39300958cd52c15191531b2b78efdca18c8c0944e14c3ee7f13f02c099bc0e1ba70
6
+ metadata.gz: ceed911817da4c84995aa09c1d9ee0ab846a97c4531819278863878a334f2f7d836e556dee937ab78800b89e5a6dc47b486ffb479e34ce932565f825ed707427
7
+ data.tar.gz: c4e86f3e6267ca0091676761edb4fa629dac2c1d9019bb2f1699689e528c166336c037d9445750c736cff4d07b310a4d18ed47b572680f237ae1dcc96e613dd0
@@ -2,7 +2,13 @@ require "google/directory/user/badges"
2
2
 
3
3
  module Google
4
4
  module Directory
5
- module User
5
+ class User < BaseApi
6
+ def get(user_key)
7
+ parameters = { userKey: user_key, projection: "full" }
8
+
9
+ client.execute!(api_method: directory_api.users.get,
10
+ parameters: default_query.merge(parameters)).data
11
+ end
6
12
  end
7
13
  end
8
14
  end
@@ -1,6 +1,6 @@
1
1
  module Google
2
2
  module Directory
3
- module User
3
+ class User < BaseApi
4
4
  class Badges < BaseApi
5
5
  # Update a users badges
6
6
  #
@@ -1,5 +1,5 @@
1
1
  module Google
2
2
  module Wrapper
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
 
3
- module Google::Directory::User
4
- describe Badges do
3
+ module Google::Directory
4
+ describe User::Badges do
5
5
  subject(:badges_api) { described_class.new(client_spy) }
6
6
  let(:client_spy) { Google::DummyClient.new }
7
7
 
@@ -0,0 +1,27 @@
1
+ require "spec_helper"
2
+
3
+ module Google::Directory
4
+ describe User do
5
+ subject(:user_api) { described_class.new(client_spy) }
6
+ let(:client_spy) { Google::DummyClient.new }
7
+
8
+ before do
9
+ allow(ENV).to receive(:fetch).with("GOOGLE_ADMIN_CUSTOMER_ID").and_return("1234")
10
+ end
11
+
12
+ it "proxies a get with full project to a google api client when no extra arguments are sent" do
13
+ result = user_api.get("john.bohn@alphasights.com")
14
+
15
+ api_method = result.api_method
16
+ parameters = result.parameters
17
+
18
+ expect(api_method.name).to eql("admin.users.get")
19
+ expect(parameters).to eql({
20
+ customer: "my_customer",
21
+ customerId: "1234",
22
+ userKey: "john.bohn@alphasights.com",
23
+ projection: "full",
24
+ })
25
+ end
26
+ end
27
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Bohn
@@ -112,6 +112,7 @@ files:
112
112
  - spec/google/client_builder_spec.rb
113
113
  - spec/google/directory/schema_spec.rb
114
114
  - spec/google/directory/user/badges_spec.rb
115
+ - spec/google/directory/user_spec.rb
115
116
  - spec/google/dummy_client_spec.rb
116
117
  - spec/spec_helper.rb
117
118
  homepage: https://engineering.alphasights.com/
@@ -143,5 +144,6 @@ test_files:
143
144
  - spec/google/client_builder_spec.rb
144
145
  - spec/google/directory/schema_spec.rb
145
146
  - spec/google/directory/user/badges_spec.rb
147
+ - spec/google/directory/user_spec.rb
146
148
  - spec/google/dummy_client_spec.rb
147
149
  - spec/spec_helper.rb