google-cloud-api_hub 0.3.1 → 0.4.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 +4 -4
- data/README.md +8 -0
- data/lib/google/cloud/api_hub/version.rb +1 -1
- data/lib/google/cloud/api_hub.rb +193 -0
- 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: 8ec0a757f7971a838cae68ea8e41ba36ac2af46e504084468e7c4e79ea1b9966
|
4
|
+
data.tar.gz: 926cba73eefdb16e0af67b06376cd5ceea41b3bdb4bf872adb69231f91e7f69b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc9b0552f4da5303172403d3f8b5da76612fcb9694fa0c0662cdef5a2d95a05f9ff00e236b16fffc2c3cdbe635607768c4949d787c267438ea2fc0ec48d70e59
|
7
|
+
data.tar.gz: 6db8afdf7baa5a65061f9d645d0e18fa1562985136400549d150a15578f1e79de9addd9ca3bd6606163c056741c54f0c069c9e683b87b09c4adb14e8b2b3543c
|
data/README.md
CHANGED
@@ -34,6 +34,14 @@ In order to use this library, you first need to go through the following steps:
|
|
34
34
|
1. [Enable the API.](https://console.cloud.google.com/apis/library/apihub.googleapis.com)
|
35
35
|
1. {file:AUTHENTICATION.md Set up authentication.}
|
36
36
|
|
37
|
+
```ruby
|
38
|
+
require "google/cloud/api_hub"
|
39
|
+
|
40
|
+
client = Google::Cloud::ApiHub.api_hub
|
41
|
+
request = ::Google::Cloud::ApiHub::V1::CreateApiRequest.new # (request fields as keyword arguments...)
|
42
|
+
response = client.create_api request
|
43
|
+
```
|
44
|
+
|
37
45
|
## Debug Logging
|
38
46
|
|
39
47
|
This library comes with opt-in Debug Logging that can help you troubleshoot
|
data/lib/google/cloud/api_hub.rb
CHANGED
@@ -171,6 +171,199 @@ module Google
|
|
171
171
|
false
|
172
172
|
end
|
173
173
|
|
174
|
+
##
|
175
|
+
# Create a new client object for ApiHubCollect.
|
176
|
+
#
|
177
|
+
# By default, this returns an instance of
|
178
|
+
# [Google::Cloud::ApiHub::V1::ApiHubCollect::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-ApiHubCollect-Rest-Client)
|
179
|
+
# for a REST client for version V1 of the API.
|
180
|
+
# However, you can specify a different API version by passing it in the
|
181
|
+
# `version` parameter. If the ApiHubCollect service is
|
182
|
+
# supported by that API version, and the corresponding gem is available, the
|
183
|
+
# appropriate versioned client will be returned.
|
184
|
+
#
|
185
|
+
# Raises an exception if the currently installed versioned client gem for the
|
186
|
+
# given API version does not support the ApiHubCollect service.
|
187
|
+
# You can determine whether the method will succeed by calling
|
188
|
+
# {Google::Cloud::ApiHub.api_hub_collect_available?}.
|
189
|
+
#
|
190
|
+
# ## About ApiHubCollect
|
191
|
+
#
|
192
|
+
# This service exposes methods used for collecting various types of data from
|
193
|
+
# different first party and third party sources and push it to Hub's collect
|
194
|
+
# layer.
|
195
|
+
#
|
196
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
197
|
+
# Defaults to `:v1`.
|
198
|
+
# @return [::Object] A client object for the specified version.
|
199
|
+
#
|
200
|
+
def self.api_hub_collect version: :v1, &block
|
201
|
+
require "google/cloud/api_hub/#{version.to_s.downcase}"
|
202
|
+
|
203
|
+
package_name = Google::Cloud::ApiHub
|
204
|
+
.constants
|
205
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
206
|
+
.first
|
207
|
+
service_module = Google::Cloud::ApiHub.const_get(package_name).const_get(:ApiHubCollect)
|
208
|
+
service_module.const_get(:Rest).const_get(:Client).new(&block)
|
209
|
+
end
|
210
|
+
|
211
|
+
##
|
212
|
+
# Determines whether the ApiHubCollect service is supported by the current client.
|
213
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::ApiHub.api_hub_collect}.
|
214
|
+
# If false, that method will raise an exception. This could happen if the given
|
215
|
+
# API version does not exist or does not support the ApiHubCollect service,
|
216
|
+
# or if the versioned client gem needs an update to support the ApiHubCollect service.
|
217
|
+
#
|
218
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
219
|
+
# Defaults to `:v1`.
|
220
|
+
# @return [boolean] Whether the service is available.
|
221
|
+
#
|
222
|
+
def self.api_hub_collect_available? version: :v1
|
223
|
+
require "google/cloud/api_hub/#{version.to_s.downcase}"
|
224
|
+
package_name = Google::Cloud::ApiHub
|
225
|
+
.constants
|
226
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
227
|
+
.first
|
228
|
+
return false unless package_name
|
229
|
+
service_module = Google::Cloud::ApiHub.const_get package_name
|
230
|
+
return false unless service_module.const_defined? :ApiHubCollect
|
231
|
+
service_module = service_module.const_get :ApiHubCollect
|
232
|
+
return false unless service_module.const_defined? :Rest
|
233
|
+
service_module = service_module.const_get :Rest
|
234
|
+
service_module.const_defined? :Client
|
235
|
+
rescue ::LoadError
|
236
|
+
false
|
237
|
+
end
|
238
|
+
|
239
|
+
##
|
240
|
+
# Create a new client object for ApiHubCurate.
|
241
|
+
#
|
242
|
+
# By default, this returns an instance of
|
243
|
+
# [Google::Cloud::ApiHub::V1::ApiHubCurate::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-ApiHubCurate-Rest-Client)
|
244
|
+
# for a REST client for version V1 of the API.
|
245
|
+
# However, you can specify a different API version by passing it in the
|
246
|
+
# `version` parameter. If the ApiHubCurate service is
|
247
|
+
# supported by that API version, and the corresponding gem is available, the
|
248
|
+
# appropriate versioned client will be returned.
|
249
|
+
#
|
250
|
+
# Raises an exception if the currently installed versioned client gem for the
|
251
|
+
# given API version does not support the ApiHubCurate service.
|
252
|
+
# You can determine whether the method will succeed by calling
|
253
|
+
# {Google::Cloud::ApiHub.api_hub_curate_available?}.
|
254
|
+
#
|
255
|
+
# ## About ApiHubCurate
|
256
|
+
#
|
257
|
+
# This service is used for managing curations for processing API data consumed
|
258
|
+
# from collect layer.
|
259
|
+
#
|
260
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
261
|
+
# Defaults to `:v1`.
|
262
|
+
# @return [::Object] A client object for the specified version.
|
263
|
+
#
|
264
|
+
def self.api_hub_curate version: :v1, &block
|
265
|
+
require "google/cloud/api_hub/#{version.to_s.downcase}"
|
266
|
+
|
267
|
+
package_name = Google::Cloud::ApiHub
|
268
|
+
.constants
|
269
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
270
|
+
.first
|
271
|
+
service_module = Google::Cloud::ApiHub.const_get(package_name).const_get(:ApiHubCurate)
|
272
|
+
service_module.const_get(:Rest).const_get(:Client).new(&block)
|
273
|
+
end
|
274
|
+
|
275
|
+
##
|
276
|
+
# Determines whether the ApiHubCurate service is supported by the current client.
|
277
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::ApiHub.api_hub_curate}.
|
278
|
+
# If false, that method will raise an exception. This could happen if the given
|
279
|
+
# API version does not exist or does not support the ApiHubCurate service,
|
280
|
+
# or if the versioned client gem needs an update to support the ApiHubCurate service.
|
281
|
+
#
|
282
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
283
|
+
# Defaults to `:v1`.
|
284
|
+
# @return [boolean] Whether the service is available.
|
285
|
+
#
|
286
|
+
def self.api_hub_curate_available? version: :v1
|
287
|
+
require "google/cloud/api_hub/#{version.to_s.downcase}"
|
288
|
+
package_name = Google::Cloud::ApiHub
|
289
|
+
.constants
|
290
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
291
|
+
.first
|
292
|
+
return false unless package_name
|
293
|
+
service_module = Google::Cloud::ApiHub.const_get package_name
|
294
|
+
return false unless service_module.const_defined? :ApiHubCurate
|
295
|
+
service_module = service_module.const_get :ApiHubCurate
|
296
|
+
return false unless service_module.const_defined? :Rest
|
297
|
+
service_module = service_module.const_get :Rest
|
298
|
+
service_module.const_defined? :Client
|
299
|
+
rescue ::LoadError
|
300
|
+
false
|
301
|
+
end
|
302
|
+
|
303
|
+
##
|
304
|
+
# Create a new client object for ApiHubDiscovery.
|
305
|
+
#
|
306
|
+
# By default, this returns an instance of
|
307
|
+
# [Google::Cloud::ApiHub::V1::ApiHubDiscovery::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-ApiHubDiscovery-Rest-Client)
|
308
|
+
# for a REST client for version V1 of the API.
|
309
|
+
# However, you can specify a different API version by passing it in the
|
310
|
+
# `version` parameter. If the ApiHubDiscovery service is
|
311
|
+
# supported by that API version, and the corresponding gem is available, the
|
312
|
+
# appropriate versioned client will be returned.
|
313
|
+
#
|
314
|
+
# Raises an exception if the currently installed versioned client gem for the
|
315
|
+
# given API version does not support the ApiHubDiscovery service.
|
316
|
+
# You can determine whether the method will succeed by calling
|
317
|
+
# {Google::Cloud::ApiHub.api_hub_discovery_available?}.
|
318
|
+
#
|
319
|
+
# ## About ApiHubDiscovery
|
320
|
+
#
|
321
|
+
# This service exposes methods used to manage DiscoveredApiObservations
|
322
|
+
# and DiscoveredApiOperations.
|
323
|
+
#
|
324
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
325
|
+
# Defaults to `:v1`.
|
326
|
+
# @return [::Object] A client object for the specified version.
|
327
|
+
#
|
328
|
+
def self.api_hub_discovery version: :v1, &block
|
329
|
+
require "google/cloud/api_hub/#{version.to_s.downcase}"
|
330
|
+
|
331
|
+
package_name = Google::Cloud::ApiHub
|
332
|
+
.constants
|
333
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
334
|
+
.first
|
335
|
+
service_module = Google::Cloud::ApiHub.const_get(package_name).const_get(:ApiHubDiscovery)
|
336
|
+
service_module.const_get(:Rest).const_get(:Client).new(&block)
|
337
|
+
end
|
338
|
+
|
339
|
+
##
|
340
|
+
# Determines whether the ApiHubDiscovery service is supported by the current client.
|
341
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::ApiHub.api_hub_discovery}.
|
342
|
+
# If false, that method will raise an exception. This could happen if the given
|
343
|
+
# API version does not exist or does not support the ApiHubDiscovery service,
|
344
|
+
# or if the versioned client gem needs an update to support the ApiHubDiscovery service.
|
345
|
+
#
|
346
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
347
|
+
# Defaults to `:v1`.
|
348
|
+
# @return [boolean] Whether the service is available.
|
349
|
+
#
|
350
|
+
def self.api_hub_discovery_available? version: :v1
|
351
|
+
require "google/cloud/api_hub/#{version.to_s.downcase}"
|
352
|
+
package_name = Google::Cloud::ApiHub
|
353
|
+
.constants
|
354
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
355
|
+
.first
|
356
|
+
return false unless package_name
|
357
|
+
service_module = Google::Cloud::ApiHub.const_get package_name
|
358
|
+
return false unless service_module.const_defined? :ApiHubDiscovery
|
359
|
+
service_module = service_module.const_get :ApiHubDiscovery
|
360
|
+
return false unless service_module.const_defined? :Rest
|
361
|
+
service_module = service_module.const_get :Rest
|
362
|
+
service_module.const_defined? :Client
|
363
|
+
rescue ::LoadError
|
364
|
+
false
|
365
|
+
end
|
366
|
+
|
174
367
|
##
|
175
368
|
# Create a new client object for HostProjectRegistrationService.
|
176
369
|
#
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-api_hub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: '0'
|
80
80
|
requirements: []
|
81
|
-
rubygems_version: 3.6.
|
81
|
+
rubygems_version: 3.6.9
|
82
82
|
specification_version: 4
|
83
83
|
summary: API Client library for the API hub API
|
84
84
|
test_files: []
|