google-cloud-compute 1.13.0 → 1.14.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
2
  SHA256:
3
- metadata.gz: '016800b94a9df611606ac8008564ebc8f666bb4ec224a9006195712701fcf62b'
4
- data.tar.gz: 50d797366758b24b774846494fb502c6ea781bd89ec9493d2929c7cf4880c9d3
3
+ metadata.gz: 90f4ddb04d1a5438bb0ce789c1480e219a57f291209cdcdd7f48292d5dcb503f
4
+ data.tar.gz: edf050eb82c3e547d6458084d0e2f60bf03f1baf46014ea29ec3352161b00bd7
5
5
  SHA512:
6
- metadata.gz: a55ee1eb23380117733c4728182289d8facd69110f8a58ffa00ad5d8af4e0ae6eb3ba30d8405db28b37130f2f05fb36a4d4fc0170616f6f6a8c55bd00cb21110
7
- data.tar.gz: aee0aef86a23681bf06f45c69b4f5e7b1b5b5309c2f1aa4d8f65a4905fc29e4e9ec190e55e69b7bb3328c26a7e7cacd49ba4d032d53d66b7d4dd20e0bf0d41ef
6
+ metadata.gz: ede765a3831b399ce944dfe8f2e538ca8e6dff56aa727116b26b07534d50c011ceb01ffc4e0827245e4f7858a58634b95d490a9e260014f1482b5a32b560ba8a
7
+ data.tar.gz: 4bda8e07c9f3e7a7065929a82037c57907e2e93db1595c2594519e1eec401399983715db8135a47f2b40571d8ce5cf024187075959128ad24f52ed745514b0f4
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Cloud
22
22
  module Compute
23
- VERSION = "1.13.0"
23
+ VERSION = "1.14.0"
24
24
  end
25
25
  end
26
26
  end
@@ -172,6 +172,69 @@ module Google
172
172
  false
173
173
  end
174
174
 
175
+ ##
176
+ # Create a new client object for Advice.
177
+ #
178
+ # By default, this returns an instance of
179
+ # [Google::Cloud::Compute::V1::Advice::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Advice-Rest-Client)
180
+ # for a REST client for version V1 of the API.
181
+ # However, you can specify a different API version by passing it in the
182
+ # `version` parameter. If the Advice service is
183
+ # supported by that API version, and the corresponding gem is available, the
184
+ # appropriate versioned client will be returned.
185
+ #
186
+ # Raises an exception if the currently installed versioned client gem for the
187
+ # given API version does not support the Advice service.
188
+ # You can determine whether the method will succeed by calling
189
+ # {Google::Cloud::Compute.advice_available?}.
190
+ #
191
+ # ## About Advice
192
+ #
193
+ # The Advice API.
194
+ #
195
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
196
+ # Defaults to `:v1`.
197
+ # @return [::Object] A client object for the specified version.
198
+ #
199
+ def self.advice version: :v1, &block
200
+ require "google/cloud/compute/#{version.to_s.downcase}"
201
+
202
+ package_name = Google::Cloud::Compute
203
+ .constants
204
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
205
+ .first
206
+ service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Advice)
207
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
208
+ end
209
+
210
+ ##
211
+ # Determines whether the Advice service is supported by the current client.
212
+ # If true, you can retrieve a client object by calling {Google::Cloud::Compute.advice}.
213
+ # If false, that method will raise an exception. This could happen if the given
214
+ # API version does not exist or does not support the Advice service,
215
+ # or if the versioned client gem needs an update to support the Advice service.
216
+ #
217
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
218
+ # Defaults to `:v1`.
219
+ # @return [boolean] Whether the service is available.
220
+ #
221
+ def self.advice_available? version: :v1
222
+ require "google/cloud/compute/#{version.to_s.downcase}"
223
+ package_name = Google::Cloud::Compute
224
+ .constants
225
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
226
+ .first
227
+ return false unless package_name
228
+ service_module = Google::Cloud::Compute.const_get package_name
229
+ return false unless service_module.const_defined? :Advice
230
+ service_module = service_module.const_get :Advice
231
+ return false unless service_module.const_defined? :Rest
232
+ service_module = service_module.const_get :Rest
233
+ service_module.const_defined? :Client
234
+ rescue ::LoadError
235
+ false
236
+ end
237
+
175
238
  ##
176
239
  # Create a new client object for Autoscalers.
177
240
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-compute
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.0
4
+ version: 1.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC