google_directory 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/google_directory/connection.rb +7 -4
- data/lib/google_directory/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: af0f64951d31c627a0b44faadf1ceda3bde2308239aa2415fe9412797969de13
|
|
4
|
+
data.tar.gz: cced9b505a5c5c4e977eb5010e3acd2f64ceb3bdebbafdfc3be4ddbcbcec908c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a54f6af95e42fa2fc08cef6fd87a4d9c6a4f10644163bacf3f67e92cd87ebc674963280050c57da6c5614a9e52f3b9c374d28ccd3161460657a5c3ce0404755a
|
|
7
|
+
data.tar.gz: '001096745cae6ec49dcee64c36b32ad06822fb70735076df3e27597203420351e606815691cb5ddfca7d521194b99ab7b6d5442345ce3476351ad87c319601ad'
|
|
@@ -27,7 +27,9 @@ module GoogleDirectory
|
|
|
27
27
|
CLIENT_SECRETS_PATH = ENV['CLIENT_SECRETS_PATH'] || 'client_secret.json'
|
|
28
28
|
|
|
29
29
|
# Scope options - https://www.googleapis.com/auth/admin.directory.user
|
|
30
|
+
# https://developers.google.com/admin-sdk/directory/v1/guides/authorizing
|
|
30
31
|
SCOPE = Google::Apis::AdminDirectoryV1::AUTH_ADMIN_DIRECTORY_USER
|
|
32
|
+
# SCOPE = 'https://www.googleapis.com/auth/admin.directory.user'
|
|
31
33
|
|
|
32
34
|
# Initialize the API
|
|
33
35
|
# https://www.rubydoc.info/github/google/google-api-ruby-client/Google/Apis/AdminDirectoryV1/DirectoryService
|
|
@@ -48,12 +50,13 @@ module GoogleDirectory
|
|
|
48
50
|
# @param attributes [Hash] attributes needed to perform command
|
|
49
51
|
# @return [Hash] formatted as: `{success: {command: :command, attributes: {primary_email: "user@domain"}, response: GoogleAnswer} }`
|
|
50
52
|
def run( command:, attributes: {} )
|
|
51
|
-
response = {
|
|
53
|
+
response = {}
|
|
52
54
|
begin
|
|
53
|
-
response
|
|
55
|
+
response = send( command, attributes: attributes )
|
|
56
|
+
response[:status] = 'success'
|
|
54
57
|
rescue Google::Apis::ClientError => error
|
|
55
|
-
response
|
|
56
|
-
|
|
58
|
+
response = {response: error, command: command,
|
|
59
|
+
attributes: attributes, status: 'error'}
|
|
57
60
|
end
|
|
58
61
|
response
|
|
59
62
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: google_directory
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bill Tihen
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2018-
|
|
12
|
+
date: 2018-06-13 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: google-api-client
|