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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3eddbb3710e316e34a6ceedead992c7c1e8be108
|
4
|
+
data.tar.gz: 3c1e882cb6859d1f2a701ae4bb3663faa0338c15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
@@ -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.
|
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
|