google-cloud-api_hub 0.1.0 → 0.3.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: 1a8f651e00491a91b51395796ad84c1fbd4336077c9ea53723fabbaee3a731be
4
- data.tar.gz: 64426e3e9c50e7a67e67c213e90bb4485f0b89d7479c97388fff95f61cab1723
3
+ metadata.gz: 9f859dcdabe4328f3c31d4a18b2534bcaebfdbd33279cfce2f38ea77d74af7a5
4
+ data.tar.gz: e625d874e667b85802a880e9b30e177730d079345672e057a14f43bfc3a610dd
5
5
  SHA512:
6
- metadata.gz: a7e6f5781ca4993547d6709bde20561ca9bc4991350ecd18410cb529fc06dc25be43748c2a66a078d67ad14223cfbe5e7769e954b5adff2aca856aba551f36cc
7
- data.tar.gz: ac30e127b2db5ae7a69244353c128e8b05ae77bc6d3484594ac91c520bc0d3737b64df3a154158ac95a09083e89b5300b2065b85ab555c1a657a904d5399b69d
6
+ metadata.gz: 1499b4c308edecadcb3888ceea4d1c2d1fdf9e13a64f9f9b0b659abd0edabe772b6ffc105db6c4b8bf398d4df949721905afc65dbe8286b2fa1fc247566a0b9a
7
+ data.tar.gz: fc68bdedb3826f9ff3392a187cd221dbd9f22e247e8d5787d7333549bc330ef8e43a344b246d1fda1ae18ab703fc00a9fe5d3c7dfbb664fd8cf1b42857b150d2
data/README.md CHANGED
@@ -34,9 +34,39 @@ 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
+ ## Debug Logging
38
+
39
+ This library comes with opt-in Debug Logging that can help you troubleshoot
40
+ your application's integration with the API. When logging is activated, key
41
+ events such as requests and responses, along with data payloads and metadata
42
+ such as headers and client configuration, are logged to the standard error
43
+ stream.
44
+
45
+ **WARNING:** Client Library Debug Logging includes your data payloads in
46
+ plaintext, which could include sensitive data such as PII for yourself or your
47
+ customers, private keys, or other security data that could be compromising if
48
+ leaked. Always practice good data hygiene with your application logs, and follow
49
+ the principle of least access. Google also recommends that Client Library Debug
50
+ Logging be enabled only temporarily during active debugging, and not used
51
+ permanently in production.
52
+
53
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
54
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
55
+ list of client library gem names. This will select the default logging behavior,
56
+ which writes logs to the standard error stream. On a local workstation, this may
57
+ result in logs appearing on the console. When running on a Google Cloud hosting
58
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
59
+ results in logs appearing alongside your application logs in the
60
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
61
+
62
+ Debug logging also requires that the versioned clients for this service be
63
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
64
+ working, try updating the versioned clients in your bundle or installed gems:
65
+ [google-cloud-api_hub-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest).
66
+
37
67
  ## Supported Ruby Versions
38
68
 
39
- This library is supported on Ruby 2.7+.
69
+ This library is supported on Ruby 3.0+.
40
70
 
41
71
  Google provides official support for Ruby versions that are actively supported
42
72
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Cloud
22
22
  module ApiHub
23
- VERSION = "0.1.0"
23
+ VERSION = "0.3.0"
24
24
  end
25
25
  end
26
26
  end
@@ -34,7 +34,6 @@ require "google/cloud/config"
34
34
  config.add_field! :scope, nil, match: [::Array, ::String]
35
35
  config.add_field! :lib_name, nil, match: ::String
36
36
  config.add_field! :lib_version, nil, match: ::String
37
- config.add_field! :interceptors, nil, match: ::Array
38
37
  config.add_field! :timeout, nil, match: ::Numeric
39
38
  config.add_field! :metadata, nil, match: ::Hash
40
39
  config.add_field! :retry_policy, nil, match: [::Hash, ::Proc]
@@ -49,14 +48,17 @@ module Google
49
48
  # Create a new client object for ApiHub.
50
49
  #
51
50
  # By default, this returns an instance of
52
- # [Google::Cloud::ApiHub::V1::ApiHub::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-ApiHub-Client)
53
- # for a gRPC client for version V1 of the API.
51
+ # [Google::Cloud::ApiHub::V1::ApiHub::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-ApiHub-Rest-Client)
52
+ # for a REST client for version V1 of the API.
54
53
  # However, you can specify a different API version by passing it in the
55
54
  # `version` parameter. If the ApiHub service is
56
55
  # supported by that API version, and the corresponding gem is available, the
57
56
  # appropriate versioned client will be returned.
58
- # You can also specify a different transport by passing `:rest` or `:grpc` in
59
- # the `transport` parameter.
57
+ #
58
+ # Raises an exception if the currently installed versioned client gem for the
59
+ # given API version does not support the ApiHub service.
60
+ # You can determine whether the method will succeed by calling
61
+ # {Google::Cloud::ApiHub.api_hub_available?}.
60
62
  #
61
63
  # ## About ApiHub
62
64
  #
@@ -64,10 +66,9 @@ module Google
64
66
  #
65
67
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
66
68
  # Defaults to `:v1`.
67
- # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
68
69
  # @return [::Object] A client object for the specified version.
69
70
  #
70
- def self.api_hub version: :v1, transport: :grpc, &block
71
+ def self.api_hub version: :v1, &block
71
72
  require "google/cloud/api_hub/#{version.to_s.downcase}"
72
73
 
73
74
  package_name = Google::Cloud::ApiHub
@@ -75,22 +76,52 @@ module Google
75
76
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
76
77
  .first
77
78
  service_module = Google::Cloud::ApiHub.const_get(package_name).const_get(:ApiHub)
78
- service_module = service_module.const_get(:Rest) if transport == :rest
79
- service_module.const_get(:Client).new(&block)
79
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
80
+ end
81
+
82
+ ##
83
+ # Determines whether the ApiHub service is supported by the current client.
84
+ # If true, you can retrieve a client object by calling {Google::Cloud::ApiHub.api_hub}.
85
+ # If false, that method will raise an exception. This could happen if the given
86
+ # API version does not exist or does not support the ApiHub service,
87
+ # or if the versioned client gem needs an update to support the ApiHub service.
88
+ #
89
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
90
+ # Defaults to `:v1`.
91
+ # @return [boolean] Whether the service is available.
92
+ #
93
+ def self.api_hub_available? version: :v1
94
+ require "google/cloud/api_hub/#{version.to_s.downcase}"
95
+ package_name = Google::Cloud::ApiHub
96
+ .constants
97
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
98
+ .first
99
+ return false unless package_name
100
+ service_module = Google::Cloud::ApiHub.const_get package_name
101
+ return false unless service_module.const_defined? :ApiHub
102
+ service_module = service_module.const_get :ApiHub
103
+ return false unless service_module.const_defined? :Rest
104
+ service_module = service_module.const_get :Rest
105
+ service_module.const_defined? :Client
106
+ rescue ::LoadError
107
+ false
80
108
  end
81
109
 
82
110
  ##
83
111
  # Create a new client object for ApiHubDependencies.
84
112
  #
85
113
  # By default, this returns an instance of
86
- # [Google::Cloud::ApiHub::V1::ApiHubDependencies::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-ApiHubDependencies-Client)
87
- # for a gRPC client for version V1 of the API.
114
+ # [Google::Cloud::ApiHub::V1::ApiHubDependencies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-ApiHubDependencies-Rest-Client)
115
+ # for a REST client for version V1 of the API.
88
116
  # However, you can specify a different API version by passing it in the
89
117
  # `version` parameter. If the ApiHubDependencies service is
90
118
  # supported by that API version, and the corresponding gem is available, the
91
119
  # appropriate versioned client will be returned.
92
- # You can also specify a different transport by passing `:rest` or `:grpc` in
93
- # the `transport` parameter.
120
+ #
121
+ # Raises an exception if the currently installed versioned client gem for the
122
+ # given API version does not support the ApiHubDependencies service.
123
+ # You can determine whether the method will succeed by calling
124
+ # {Google::Cloud::ApiHub.api_hub_dependencies_available?}.
94
125
  #
95
126
  # ## About ApiHubDependencies
96
127
  #
@@ -99,10 +130,9 @@ module Google
99
130
  #
100
131
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
101
132
  # Defaults to `:v1`.
102
- # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
103
133
  # @return [::Object] A client object for the specified version.
104
134
  #
105
- def self.api_hub_dependencies version: :v1, transport: :grpc, &block
135
+ def self.api_hub_dependencies version: :v1, &block
106
136
  require "google/cloud/api_hub/#{version.to_s.downcase}"
107
137
 
108
138
  package_name = Google::Cloud::ApiHub
@@ -110,22 +140,52 @@ module Google
110
140
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
111
141
  .first
112
142
  service_module = Google::Cloud::ApiHub.const_get(package_name).const_get(:ApiHubDependencies)
113
- service_module = service_module.const_get(:Rest) if transport == :rest
114
- service_module.const_get(:Client).new(&block)
143
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
144
+ end
145
+
146
+ ##
147
+ # Determines whether the ApiHubDependencies service is supported by the current client.
148
+ # If true, you can retrieve a client object by calling {Google::Cloud::ApiHub.api_hub_dependencies}.
149
+ # If false, that method will raise an exception. This could happen if the given
150
+ # API version does not exist or does not support the ApiHubDependencies service,
151
+ # or if the versioned client gem needs an update to support the ApiHubDependencies service.
152
+ #
153
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
154
+ # Defaults to `:v1`.
155
+ # @return [boolean] Whether the service is available.
156
+ #
157
+ def self.api_hub_dependencies_available? version: :v1
158
+ require "google/cloud/api_hub/#{version.to_s.downcase}"
159
+ package_name = Google::Cloud::ApiHub
160
+ .constants
161
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
162
+ .first
163
+ return false unless package_name
164
+ service_module = Google::Cloud::ApiHub.const_get package_name
165
+ return false unless service_module.const_defined? :ApiHubDependencies
166
+ service_module = service_module.const_get :ApiHubDependencies
167
+ return false unless service_module.const_defined? :Rest
168
+ service_module = service_module.const_get :Rest
169
+ service_module.const_defined? :Client
170
+ rescue ::LoadError
171
+ false
115
172
  end
116
173
 
117
174
  ##
118
175
  # Create a new client object for HostProjectRegistrationService.
119
176
  #
120
177
  # By default, this returns an instance of
121
- # [Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-HostProjectRegistrationService-Client)
122
- # for a gRPC client for version V1 of the API.
178
+ # [Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-HostProjectRegistrationService-Rest-Client)
179
+ # for a REST client for version V1 of the API.
123
180
  # However, you can specify a different API version by passing it in the
124
181
  # `version` parameter. If the HostProjectRegistrationService service is
125
182
  # supported by that API version, and the corresponding gem is available, the
126
183
  # appropriate versioned client will be returned.
127
- # You can also specify a different transport by passing `:rest` or `:grpc` in
128
- # the `transport` parameter.
184
+ #
185
+ # Raises an exception if the currently installed versioned client gem for the
186
+ # given API version does not support the HostProjectRegistrationService service.
187
+ # You can determine whether the method will succeed by calling
188
+ # {Google::Cloud::ApiHub.host_project_registration_service_available?}.
129
189
  #
130
190
  # ## About HostProjectRegistrationService
131
191
  #
@@ -133,10 +193,9 @@ module Google
133
193
  #
134
194
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
135
195
  # Defaults to `:v1`.
136
- # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
137
196
  # @return [::Object] A client object for the specified version.
138
197
  #
139
- def self.host_project_registration_service version: :v1, transport: :grpc, &block
198
+ def self.host_project_registration_service version: :v1, &block
140
199
  require "google/cloud/api_hub/#{version.to_s.downcase}"
141
200
 
142
201
  package_name = Google::Cloud::ApiHub
@@ -144,22 +203,52 @@ module Google
144
203
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
145
204
  .first
146
205
  service_module = Google::Cloud::ApiHub.const_get(package_name).const_get(:HostProjectRegistrationService)
147
- service_module = service_module.const_get(:Rest) if transport == :rest
148
- service_module.const_get(:Client).new(&block)
206
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
207
+ end
208
+
209
+ ##
210
+ # Determines whether the HostProjectRegistrationService service is supported by the current client.
211
+ # If true, you can retrieve a client object by calling {Google::Cloud::ApiHub.host_project_registration_service}.
212
+ # If false, that method will raise an exception. This could happen if the given
213
+ # API version does not exist or does not support the HostProjectRegistrationService service,
214
+ # or if the versioned client gem needs an update to support the HostProjectRegistrationService service.
215
+ #
216
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
217
+ # Defaults to `:v1`.
218
+ # @return [boolean] Whether the service is available.
219
+ #
220
+ def self.host_project_registration_service_available? version: :v1
221
+ require "google/cloud/api_hub/#{version.to_s.downcase}"
222
+ package_name = Google::Cloud::ApiHub
223
+ .constants
224
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
225
+ .first
226
+ return false unless package_name
227
+ service_module = Google::Cloud::ApiHub.const_get package_name
228
+ return false unless service_module.const_defined? :HostProjectRegistrationService
229
+ service_module = service_module.const_get :HostProjectRegistrationService
230
+ return false unless service_module.const_defined? :Rest
231
+ service_module = service_module.const_get :Rest
232
+ service_module.const_defined? :Client
233
+ rescue ::LoadError
234
+ false
149
235
  end
150
236
 
151
237
  ##
152
238
  # Create a new client object for LintingService.
153
239
  #
154
240
  # By default, this returns an instance of
155
- # [Google::Cloud::ApiHub::V1::LintingService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-LintingService-Client)
156
- # for a gRPC client for version V1 of the API.
241
+ # [Google::Cloud::ApiHub::V1::LintingService::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-LintingService-Rest-Client)
242
+ # for a REST client for version V1 of the API.
157
243
  # However, you can specify a different API version by passing it in the
158
244
  # `version` parameter. If the LintingService service is
159
245
  # supported by that API version, and the corresponding gem is available, the
160
246
  # appropriate versioned client will be returned.
161
- # You can also specify a different transport by passing `:rest` or `:grpc` in
162
- # the `transport` parameter.
247
+ #
248
+ # Raises an exception if the currently installed versioned client gem for the
249
+ # given API version does not support the LintingService service.
250
+ # You can determine whether the method will succeed by calling
251
+ # {Google::Cloud::ApiHub.linting_service_available?}.
163
252
  #
164
253
  # ## About LintingService
165
254
  #
@@ -167,10 +256,9 @@ module Google
167
256
  #
168
257
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
169
258
  # Defaults to `:v1`.
170
- # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
171
259
  # @return [::Object] A client object for the specified version.
172
260
  #
173
- def self.linting_service version: :v1, transport: :grpc, &block
261
+ def self.linting_service version: :v1, &block
174
262
  require "google/cloud/api_hub/#{version.to_s.downcase}"
175
263
 
176
264
  package_name = Google::Cloud::ApiHub
@@ -178,22 +266,52 @@ module Google
178
266
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
179
267
  .first
180
268
  service_module = Google::Cloud::ApiHub.const_get(package_name).const_get(:LintingService)
181
- service_module = service_module.const_get(:Rest) if transport == :rest
182
- service_module.const_get(:Client).new(&block)
269
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
270
+ end
271
+
272
+ ##
273
+ # Determines whether the LintingService service is supported by the current client.
274
+ # If true, you can retrieve a client object by calling {Google::Cloud::ApiHub.linting_service}.
275
+ # If false, that method will raise an exception. This could happen if the given
276
+ # API version does not exist or does not support the LintingService service,
277
+ # or if the versioned client gem needs an update to support the LintingService service.
278
+ #
279
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
280
+ # Defaults to `:v1`.
281
+ # @return [boolean] Whether the service is available.
282
+ #
283
+ def self.linting_service_available? version: :v1
284
+ require "google/cloud/api_hub/#{version.to_s.downcase}"
285
+ package_name = Google::Cloud::ApiHub
286
+ .constants
287
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
288
+ .first
289
+ return false unless package_name
290
+ service_module = Google::Cloud::ApiHub.const_get package_name
291
+ return false unless service_module.const_defined? :LintingService
292
+ service_module = service_module.const_get :LintingService
293
+ return false unless service_module.const_defined? :Rest
294
+ service_module = service_module.const_get :Rest
295
+ service_module.const_defined? :Client
296
+ rescue ::LoadError
297
+ false
183
298
  end
184
299
 
185
300
  ##
186
301
  # Create a new client object for ApiHubPlugin.
187
302
  #
188
303
  # By default, this returns an instance of
189
- # [Google::Cloud::ApiHub::V1::ApiHubPlugin::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-ApiHubPlugin-Client)
190
- # for a gRPC client for version V1 of the API.
304
+ # [Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-ApiHubPlugin-Rest-Client)
305
+ # for a REST client for version V1 of the API.
191
306
  # However, you can specify a different API version by passing it in the
192
307
  # `version` parameter. If the ApiHubPlugin service is
193
308
  # supported by that API version, and the corresponding gem is available, the
194
309
  # appropriate versioned client will be returned.
195
- # You can also specify a different transport by passing `:rest` or `:grpc` in
196
- # the `transport` parameter.
310
+ #
311
+ # Raises an exception if the currently installed versioned client gem for the
312
+ # given API version does not support the ApiHubPlugin service.
313
+ # You can determine whether the method will succeed by calling
314
+ # {Google::Cloud::ApiHub.api_hub_plugin_available?}.
197
315
  #
198
316
  # ## About ApiHubPlugin
199
317
  #
@@ -201,10 +319,9 @@ module Google
201
319
  #
202
320
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
203
321
  # Defaults to `:v1`.
204
- # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
205
322
  # @return [::Object] A client object for the specified version.
206
323
  #
207
- def self.api_hub_plugin version: :v1, transport: :grpc, &block
324
+ def self.api_hub_plugin version: :v1, &block
208
325
  require "google/cloud/api_hub/#{version.to_s.downcase}"
209
326
 
210
327
  package_name = Google::Cloud::ApiHub
@@ -212,22 +329,52 @@ module Google
212
329
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
213
330
  .first
214
331
  service_module = Google::Cloud::ApiHub.const_get(package_name).const_get(:ApiHubPlugin)
215
- service_module = service_module.const_get(:Rest) if transport == :rest
216
- service_module.const_get(:Client).new(&block)
332
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
333
+ end
334
+
335
+ ##
336
+ # Determines whether the ApiHubPlugin service is supported by the current client.
337
+ # If true, you can retrieve a client object by calling {Google::Cloud::ApiHub.api_hub_plugin}.
338
+ # If false, that method will raise an exception. This could happen if the given
339
+ # API version does not exist or does not support the ApiHubPlugin service,
340
+ # or if the versioned client gem needs an update to support the ApiHubPlugin service.
341
+ #
342
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
343
+ # Defaults to `:v1`.
344
+ # @return [boolean] Whether the service is available.
345
+ #
346
+ def self.api_hub_plugin_available? version: :v1
347
+ require "google/cloud/api_hub/#{version.to_s.downcase}"
348
+ package_name = Google::Cloud::ApiHub
349
+ .constants
350
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
351
+ .first
352
+ return false unless package_name
353
+ service_module = Google::Cloud::ApiHub.const_get package_name
354
+ return false unless service_module.const_defined? :ApiHubPlugin
355
+ service_module = service_module.const_get :ApiHubPlugin
356
+ return false unless service_module.const_defined? :Rest
357
+ service_module = service_module.const_get :Rest
358
+ service_module.const_defined? :Client
359
+ rescue ::LoadError
360
+ false
217
361
  end
218
362
 
219
363
  ##
220
364
  # Create a new client object for Provisioning.
221
365
  #
222
366
  # By default, this returns an instance of
223
- # [Google::Cloud::ApiHub::V1::Provisioning::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-Provisioning-Client)
224
- # for a gRPC client for version V1 of the API.
367
+ # [Google::Cloud::ApiHub::V1::Provisioning::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-Provisioning-Rest-Client)
368
+ # for a REST client for version V1 of the API.
225
369
  # However, you can specify a different API version by passing it in the
226
370
  # `version` parameter. If the Provisioning service is
227
371
  # supported by that API version, and the corresponding gem is available, the
228
372
  # appropriate versioned client will be returned.
229
- # You can also specify a different transport by passing `:rest` or `:grpc` in
230
- # the `transport` parameter.
373
+ #
374
+ # Raises an exception if the currently installed versioned client gem for the
375
+ # given API version does not support the Provisioning service.
376
+ # You can determine whether the method will succeed by calling
377
+ # {Google::Cloud::ApiHub.provisioning_available?}.
231
378
  #
232
379
  # ## About Provisioning
233
380
  #
@@ -235,10 +382,9 @@ module Google
235
382
  #
236
383
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
237
384
  # Defaults to `:v1`.
238
- # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
239
385
  # @return [::Object] A client object for the specified version.
240
386
  #
241
- def self.provisioning version: :v1, transport: :grpc, &block
387
+ def self.provisioning version: :v1, &block
242
388
  require "google/cloud/api_hub/#{version.to_s.downcase}"
243
389
 
244
390
  package_name = Google::Cloud::ApiHub
@@ -246,22 +392,52 @@ module Google
246
392
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
247
393
  .first
248
394
  service_module = Google::Cloud::ApiHub.const_get(package_name).const_get(:Provisioning)
249
- service_module = service_module.const_get(:Rest) if transport == :rest
250
- service_module.const_get(:Client).new(&block)
395
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
396
+ end
397
+
398
+ ##
399
+ # Determines whether the Provisioning service is supported by the current client.
400
+ # If true, you can retrieve a client object by calling {Google::Cloud::ApiHub.provisioning}.
401
+ # If false, that method will raise an exception. This could happen if the given
402
+ # API version does not exist or does not support the Provisioning service,
403
+ # or if the versioned client gem needs an update to support the Provisioning service.
404
+ #
405
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
406
+ # Defaults to `:v1`.
407
+ # @return [boolean] Whether the service is available.
408
+ #
409
+ def self.provisioning_available? version: :v1
410
+ require "google/cloud/api_hub/#{version.to_s.downcase}"
411
+ package_name = Google::Cloud::ApiHub
412
+ .constants
413
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
414
+ .first
415
+ return false unless package_name
416
+ service_module = Google::Cloud::ApiHub.const_get package_name
417
+ return false unless service_module.const_defined? :Provisioning
418
+ service_module = service_module.const_get :Provisioning
419
+ return false unless service_module.const_defined? :Rest
420
+ service_module = service_module.const_get :Rest
421
+ service_module.const_defined? :Client
422
+ rescue ::LoadError
423
+ false
251
424
  end
252
425
 
253
426
  ##
254
427
  # Create a new client object for RuntimeProjectAttachmentService.
255
428
  #
256
429
  # By default, this returns an instance of
257
- # [Google::Cloud::ApiHub::V1::RuntimeProjectAttachmentService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-RuntimeProjectAttachmentService-Client)
258
- # for a gRPC client for version V1 of the API.
430
+ # [Google::Cloud::ApiHub::V1::RuntimeProjectAttachmentService::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-RuntimeProjectAttachmentService-Rest-Client)
431
+ # for a REST client for version V1 of the API.
259
432
  # However, you can specify a different API version by passing it in the
260
433
  # `version` parameter. If the RuntimeProjectAttachmentService service is
261
434
  # supported by that API version, and the corresponding gem is available, the
262
435
  # appropriate versioned client will be returned.
263
- # You can also specify a different transport by passing `:rest` or `:grpc` in
264
- # the `transport` parameter.
436
+ #
437
+ # Raises an exception if the currently installed versioned client gem for the
438
+ # given API version does not support the RuntimeProjectAttachmentService service.
439
+ # You can determine whether the method will succeed by calling
440
+ # {Google::Cloud::ApiHub.runtime_project_attachment_service_available?}.
265
441
  #
266
442
  # ## About RuntimeProjectAttachmentService
267
443
  #
@@ -269,10 +445,9 @@ module Google
269
445
  #
270
446
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
271
447
  # Defaults to `:v1`.
272
- # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
273
448
  # @return [::Object] A client object for the specified version.
274
449
  #
275
- def self.runtime_project_attachment_service version: :v1, transport: :grpc, &block
450
+ def self.runtime_project_attachment_service version: :v1, &block
276
451
  require "google/cloud/api_hub/#{version.to_s.downcase}"
277
452
 
278
453
  package_name = Google::Cloud::ApiHub
@@ -280,8 +455,35 @@ module Google
280
455
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
281
456
  .first
282
457
  service_module = Google::Cloud::ApiHub.const_get(package_name).const_get(:RuntimeProjectAttachmentService)
283
- service_module = service_module.const_get(:Rest) if transport == :rest
284
- service_module.const_get(:Client).new(&block)
458
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
459
+ end
460
+
461
+ ##
462
+ # Determines whether the RuntimeProjectAttachmentService service is supported by the current client.
463
+ # If true, you can retrieve a client object by calling {Google::Cloud::ApiHub.runtime_project_attachment_service}.
464
+ # If false, that method will raise an exception. This could happen if the given
465
+ # API version does not exist or does not support the RuntimeProjectAttachmentService service,
466
+ # or if the versioned client gem needs an update to support the RuntimeProjectAttachmentService service.
467
+ #
468
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
469
+ # Defaults to `:v1`.
470
+ # @return [boolean] Whether the service is available.
471
+ #
472
+ def self.runtime_project_attachment_service_available? version: :v1
473
+ require "google/cloud/api_hub/#{version.to_s.downcase}"
474
+ package_name = Google::Cloud::ApiHub
475
+ .constants
476
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
477
+ .first
478
+ return false unless package_name
479
+ service_module = Google::Cloud::ApiHub.const_get package_name
480
+ return false unless service_module.const_defined? :RuntimeProjectAttachmentService
481
+ service_module = service_module.const_get :RuntimeProjectAttachmentService
482
+ return false unless service_module.const_defined? :Rest
483
+ service_module = service_module.const_get :Rest
484
+ service_module.const_defined? :Client
485
+ rescue ::LoadError
486
+ false
285
487
  end
286
488
 
287
489
  ##
@@ -296,8 +498,6 @@ module Google
296
498
  # The library name as recorded in instrumentation and logging.
297
499
  # * `lib_version` (*type:* `String`) -
298
500
  # The library version as recorded in instrumentation and logging.
299
- # * `interceptors` (*type:* `Array<GRPC::ClientInterceptor>`) -
300
- # An array of interceptors that are run before calls are executed.
301
501
  # * `timeout` (*type:* `Numeric`) -
302
502
  # Default timeout in seconds.
303
503
  # * `metadata` (*type:* `Hash{Symbol=>String}`) -
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-api_hub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-08-12 00:00:00.000000000 Z
10
+ date: 2025-01-29 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: google-cloud-api_hub-v1
@@ -65,7 +64,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
65
64
  licenses:
66
65
  - Apache-2.0
67
66
  metadata: {}
68
- post_install_message:
69
67
  rdoc_options: []
70
68
  require_paths:
71
69
  - lib
@@ -73,15 +71,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
73
71
  requirements:
74
72
  - - ">="
75
73
  - !ruby/object:Gem::Version
76
- version: '2.7'
74
+ version: '3.0'
77
75
  required_rubygems_version: !ruby/object:Gem::Requirement
78
76
  requirements:
79
77
  - - ">="
80
78
  - !ruby/object:Gem::Version
81
79
  version: '0'
82
80
  requirements: []
83
- rubygems_version: 3.5.6
84
- signing_key:
81
+ rubygems_version: 3.6.2
85
82
  specification_version: 4
86
83
  summary: API Client library for the API hub API
87
84
  test_files: []