google-cloud-resource_manager 0.27.0 → 0.28.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: '060830c577107ff755cdf39c28ddc22a60f97a3d'
4
- data.tar.gz: b6e3cc0914f424055ec28e48e12b04f96c4cb475
2
+ SHA256:
3
+ metadata.gz: f14d8ad4d2c7037398aee52815b98ec143a5578925ac85c75072132cb425d2db
4
+ data.tar.gz: 551fe2be47bcb38054ad62d7045b285a785491e24081e4977a9a840a06faf4b2
5
5
  SHA512:
6
- metadata.gz: 31c11ff6696dae1baa98e75da32f152fccce3f1e08b47cecf8d8b9e6165cc6b88d7079fdc2125cd17736538ffd107c1d635d70526974fd6ed19eb3ba44b4ba8c
7
- data.tar.gz: '08636b712c01d526f943642fc3475c05a6f3c06a595103217d1717bca038145a920983c7426d8a82275c1dee051123d3f9ea651900abb9346a2526f23a8e6453'
6
+ metadata.gz: 3382c7586ffbb2970fc042716cb262bb3ce9714a753a306827beb5d25383aeb52ade9e65e6c111da6a30e559798d755c4475faa52a502109a64cb20b2da0f7e7
7
+ data.tar.gz: 57860ebfabfe514dc895bcda275c91dbe5ba741f5bb5a60887ff906a37a5a9230a79b6c1c8eb76575a0ab934cf8398bd00b9d58333ac14343d5470d3db00eff2
@@ -13,9 +13,10 @@
13
13
  # limitations under the License.
14
14
 
15
15
  ##
16
- # This file is here to be autorequired by bundler, so that the .bigquery and
17
- # #bigquery methods can be available, but the library and all dependencies won't
18
- # be loaded until required and used.
16
+ # This file is here to be autorequired by bundler, so that the
17
+ # Google::Cloud.resource_manager and Google::Cloud#resource_manager methods can
18
+ # be available, but the library and all dependencies won't be loaded until
19
+ # required and used.
19
20
 
20
21
 
21
22
  gem "google-cloud-core"
@@ -74,8 +75,9 @@ module Google
74
75
  # For more information on connecting to Google Cloud see the [Authentication
75
76
  # Guide](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/guides/authentication).
76
77
  #
77
- # @param [String, Hash] keyfile Keyfile downloaded from Google Cloud. If
78
- # file path the file must be readable.
78
+ # @param [String, Hash, Google::Auth::Credentials] credentials The path to
79
+ # the keyfile as a String, the contents of the keyfile as a Hash, or a
80
+ # Google::Auth::Credentials object. (See {ResourceManager::Credentials})
79
81
  # @param [String, Array<String>] scope The OAuth 2.0 scopes controlling the
80
82
  # set of resources and operations that the connection can access. See
81
83
  # [Using OAuth 2.0 to Access Google
@@ -98,10 +100,10 @@ module Google
98
100
  # puts projects.project_id
99
101
  # end
100
102
  #
101
- def self.resource_manager keyfile = nil, scope: nil, retries: nil,
103
+ def self.resource_manager credentials = nil, scope: nil, retries: nil,
102
104
  timeout: nil
103
105
  require "google/cloud/resource_manager"
104
- Google::Cloud::ResourceManager.new keyfile: keyfile, scope: scope,
106
+ Google::Cloud::ResourceManager.new credentials: credentials, scope: scope,
105
107
  retries: retries, timeout: timeout
106
108
  end
107
109
  end
@@ -228,8 +228,9 @@ module Google
228
228
  # [Authentication
229
229
  # Guide](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/guides/authentication).
230
230
  #
231
- # @param [String, Hash] keyfile Keyfile downloaded from Google Cloud. If
232
- # file path the file must be readable.
231
+ # @param [String, Hash, Google::Auth::Credentials] credentials The path to
232
+ # the keyfile as a String, the contents of the keyfile as a Hash, or a
233
+ # Google::Auth::Credentials object. (See {ResourceManager::Credentials})
233
234
  # @param [String, Array<String>] scope The OAuth 2.0 scopes controlling
234
235
  # the set of resources and operations that the connection can access.
235
236
  # See [Using OAuth 2.0 to Access Google
@@ -241,6 +242,8 @@ module Google
241
242
  # @param [Integer] retries Number of times to retry requests on server
242
243
  # error. The default value is `3`. Optional.
243
244
  # @param [Integer] timeout Default timeout to use in requests. Optional.
245
+ # @param [String] keyfile Alias for the `credentials` argument.
246
+ # Deprecated.
244
247
  #
245
248
  # @return [Google::Cloud::ResourceManager::Manager]
246
249
  #
@@ -252,16 +255,17 @@ module Google
252
255
  # puts projects.project_id
253
256
  # end
254
257
  #
255
- def self.new keyfile: nil, scope: nil, retries: nil, timeout: nil
256
- if keyfile.nil?
257
- credentials = Google::Cloud::ResourceManager::Credentials.default(
258
- scope: scope)
259
- else
260
- credentials = Google::Cloud::ResourceManager::Credentials.new(
261
- keyfile, scope: scope)
258
+ def self.new credentials: nil, scope: nil, retries: nil, timeout: nil,
259
+ keyfile: nil
260
+ credentials ||= keyfile
261
+ credentials ||= ResourceManager::Credentials.default(scope: scope)
262
+ unless credentials.is_a? Google::Auth::Credentials
263
+ credentials = ResourceManager::Credentials.new credentials,
264
+ scope: scope
262
265
  end
263
- Google::Cloud::ResourceManager::Manager.new(
264
- Google::Cloud::ResourceManager::Service.new(
266
+
267
+ ResourceManager::Manager.new(
268
+ ResourceManager::Service.new(
265
269
  credentials, retries: retries, timeout: timeout))
266
270
  end
267
271
  end
@@ -13,19 +13,41 @@
13
13
  # limitations under the License.
14
14
 
15
15
 
16
- require "google/cloud/credentials"
16
+ require "googleauth"
17
17
 
18
18
  module Google
19
19
  module Cloud
20
20
  module ResourceManager
21
21
  ##
22
- # @private Represents the Oauth2 signing logic for Resource Manager.
23
- class Credentials < Google::Cloud::Credentials
22
+ # # Credentials
23
+ #
24
+ # Represents the authentication and authorization used to connect to the
25
+ # Resource Manager API.
26
+ #
27
+ # @example
28
+ # require "google/cloud/resource_manager"
29
+ #
30
+ # keyfile = "/path/to/keyfile.json"
31
+ # creds = Google::Cloud::ResourceManager::Credentials.new keyfile
32
+ #
33
+ # resource_manager = Google::Cloud::ResourceManager.new(
34
+ # credentials: creds
35
+ # )
36
+ #
37
+ class Credentials < Google::Auth::Credentials
24
38
  SCOPE = ["https://www.googleapis.com/auth/cloud-platform"]
25
- PATH_ENV_VARS = %w(RESOURCE_MANAGER_KEYFILE
26
- GOOGLE_CLOUD_KEYFILE GCLOUD_KEYFILE)
27
- JSON_ENV_VARS = %w(RESOURCE_MANAGER_KEYFILE_JSON
28
- GOOGLE_CLOUD_KEYFILE_JSON GCLOUD_KEYFILE_JSON)
39
+ PATH_ENV_VARS = %w(RESOURCE_MANAGER_CREDENTIALS
40
+ RESOURCE_MANAGER_KEYFILE
41
+ GOOGLE_CLOUD_CREDENTIALS
42
+ GOOGLE_CLOUD_KEYFILE
43
+ GCLOUD_KEYFILE)
44
+ JSON_ENV_VARS = %w(RESOURCE_MANAGER_CREDENTIALS_JSON
45
+ RESOURCE_MANAGER_KEYFILE_JSON
46
+ GOOGLE_CLOUD_CREDENTIALS_JSON
47
+ GOOGLE_CLOUD_KEYFILE_JSON
48
+ GCLOUD_KEYFILE_JSON)
49
+ DEFAULT_PATHS = \
50
+ ["~/.config/gcloud/application_default_credentials.json"]
29
51
  end
30
52
  end
31
53
  end
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module ResourceManager
19
- VERSION = "0.27.0"
19
+ VERSION = "0.28.0"
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-resource_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.0
4
+ version: 0.28.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-09-29 00:00:00.000000000 Z
12
+ date: 2017-11-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-cloud-core
@@ -17,28 +17,42 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '1.0'
20
+ version: '1.1'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '1.0'
27
+ version: '1.1'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: google-api-client
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 0.14.0
34
+ version: 0.17.0
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: 0.17.0
42
+ - !ruby/object:Gem::Dependency
43
+ name: googleauth
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: 0.6.2
35
49
  type: :runtime
36
50
  prerelease: false
37
51
  version_requirements: !ruby/object:Gem::Requirement
38
52
  requirements:
39
53
  - - "~>"
40
54
  - !ruby/object:Gem::Version
41
- version: 0.14.0
55
+ version: 0.6.2
42
56
  - !ruby/object:Gem::Dependency
43
57
  name: minitest
44
58
  requirement: !ruby/object:Gem::Requirement
@@ -207,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
221
  version: '0'
208
222
  requirements: []
209
223
  rubyforge_project:
210
- rubygems_version: 2.6.13
224
+ rubygems_version: 2.7.2
211
225
  signing_key:
212
226
  specification_version: 4
213
227
  summary: API Client library for Google Cloud Resource Manager