google-cloud-api_hub-v1 0.5.0 → 0.6.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.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/api_hub/v1/api_hub/paths.rb +21 -0
  3. data/lib/google/cloud/api_hub/v1/api_hub/rest/client.rb +497 -9
  4. data/lib/google/cloud/api_hub/v1/api_hub/rest/service_stub.rb +185 -0
  5. data/lib/google/cloud/api_hub/v1/api_hub_collect/credentials.rb +47 -0
  6. data/lib/google/cloud/api_hub/v1/api_hub_collect/paths.rb +218 -0
  7. data/lib/google/cloud/api_hub/v1/api_hub_collect/rest/client.rb +487 -0
  8. data/lib/google/cloud/api_hub/v1/api_hub_collect/rest/operations.rb +914 -0
  9. data/lib/google/cloud/api_hub/v1/api_hub_collect/rest/service_stub.rb +143 -0
  10. data/lib/google/cloud/api_hub/v1/api_hub_collect/rest.rb +56 -0
  11. data/lib/google/cloud/api_hub/v1/api_hub_collect.rb +50 -0
  12. data/lib/google/cloud/api_hub/v1/api_hub_curate/credentials.rb +47 -0
  13. data/lib/google/cloud/api_hub/v1/api_hub_curate/paths.rb +90 -0
  14. data/lib/google/cloud/api_hub/v1/api_hub_curate/rest/client.rb +869 -0
  15. data/lib/google/cloud/api_hub/v1/api_hub_curate/rest/service_stub.rb +388 -0
  16. data/lib/google/cloud/api_hub/v1/api_hub_curate/rest.rb +54 -0
  17. data/lib/google/cloud/api_hub/v1/api_hub_curate.rb +49 -0
  18. data/lib/google/cloud/api_hub/v1/api_hub_discovery/credentials.rb +47 -0
  19. data/lib/google/cloud/api_hub/v1/api_hub_discovery/paths.rb +90 -0
  20. data/lib/google/cloud/api_hub/v1/api_hub_discovery/rest/client.rb +750 -0
  21. data/lib/google/cloud/api_hub/v1/api_hub_discovery/rest/service_stub.rb +325 -0
  22. data/lib/google/cloud/api_hub/v1/api_hub_discovery/rest.rb +54 -0
  23. data/lib/google/cloud/api_hub/v1/api_hub_discovery.rb +49 -0
  24. data/lib/google/cloud/api_hub/v1/api_hub_plugin/paths.rb +74 -0
  25. data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb +1265 -98
  26. data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest/operations.rb +914 -0
  27. data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest/service_stub.rb +677 -0
  28. data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest.rb +1 -0
  29. data/lib/google/cloud/api_hub/v1/bindings_override.rb +2 -29
  30. data/lib/google/cloud/api_hub/v1/provisioning/rest/client.rb +96 -0
  31. data/lib/google/cloud/api_hub/v1/provisioning/rest/service_stub.rb +61 -0
  32. data/lib/google/cloud/api_hub/v1/rest.rb +3 -0
  33. data/lib/google/cloud/api_hub/v1/version.rb +1 -1
  34. data/lib/google/cloud/api_hub/v1.rb +3 -0
  35. data/lib/google/cloud/apihub/v1/apihub_service_pb.rb +4 -1
  36. data/lib/google/cloud/apihub/v1/apihub_service_services_pb.rb +35 -2
  37. data/lib/google/cloud/apihub/v1/collect_service_pb.rb +60 -0
  38. data/lib/google/cloud/apihub/v1/collect_service_services_pb.rb +47 -0
  39. data/lib/google/cloud/apihub/v1/common_fields_pb.rb +34 -1
  40. data/lib/google/cloud/apihub/v1/curate_service_pb.rb +63 -0
  41. data/lib/google/cloud/apihub/v1/curate_service_services_pb.rb +64 -0
  42. data/lib/google/cloud/apihub/v1/discovery_service_pb.rb +54 -0
  43. data/lib/google/cloud/apihub/v1/discovery_service_services_pb.rb +55 -0
  44. data/lib/google/cloud/apihub/v1/plugin_service_pb.rb +44 -1
  45. data/lib/google/cloud/apihub/v1/plugin_service_services_pb.rb +43 -1
  46. data/lib/google/cloud/apihub/v1/provisioning_service_pb.rb +3 -1
  47. data/lib/google/cloud/apihub/v1/provisioning_service_services_pb.rb +2 -0
  48. data/proto_docs/google/cloud/apihub/v1/apihub_service.rb +251 -15
  49. data/proto_docs/google/cloud/apihub/v1/collect_service.rb +188 -0
  50. data/proto_docs/google/cloud/apihub/v1/common_fields.rb +819 -28
  51. data/proto_docs/google/cloud/apihub/v1/curate_service.rb +268 -0
  52. data/proto_docs/google/cloud/apihub/v1/discovery_service.rb +124 -0
  53. data/proto_docs/google/cloud/apihub/v1/linting_service.rb +10 -4
  54. data/proto_docs/google/cloud/apihub/v1/plugin_service.rb +799 -1
  55. data/proto_docs/google/cloud/apihub/v1/provisioning_service.rb +13 -0
  56. metadata +33 -4
@@ -156,6 +156,13 @@ module Google
156
156
  @quota_project_id = @config.quota_project
157
157
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
158
158
 
159
+ @operations_client = ::Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Operations.new do |config|
160
+ config.credentials = credentials
161
+ config.quota_project = @quota_project_id
162
+ config.endpoint = @config.endpoint
163
+ config.universe_domain = @config.universe_domain
164
+ end
165
+
159
166
  @api_hub_plugin_stub = ::Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::ServiceStub.new(
160
167
  endpoint: @config.endpoint,
161
168
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
@@ -164,70 +171,1027 @@ module Google
164
171
  logger: @config.logger
165
172
  )
166
173
 
167
- @api_hub_plugin_stub.logger(stub: true)&.info do |entry|
168
- entry.set_system_name
169
- entry.set_service
170
- entry.message = "Created client for #{entry.service}"
171
- entry.set_credentials_fields credentials
172
- entry.set "customEndpoint", @config.endpoint if @config.endpoint
173
- entry.set "defaultTimeout", @config.timeout if @config.timeout
174
- entry.set "quotaProject", @quota_project_id if @quota_project_id
175
- end
174
+ @api_hub_plugin_stub.logger(stub: true)&.info do |entry|
175
+ entry.set_system_name
176
+ entry.set_service
177
+ entry.message = "Created client for #{entry.service}"
178
+ entry.set_credentials_fields credentials
179
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
180
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
181
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
182
+ end
183
+
184
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
185
+ config.credentials = credentials
186
+ config.quota_project = @quota_project_id
187
+ config.endpoint = @api_hub_plugin_stub.endpoint
188
+ config.universe_domain = @api_hub_plugin_stub.universe_domain
189
+ config.bindings_override = @config.bindings_override
190
+ config.logger = @api_hub_plugin_stub.logger if config.respond_to? :logger=
191
+ end
192
+ end
193
+
194
+ ##
195
+ # Get the associated client for long-running operations.
196
+ #
197
+ # @return [::Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Operations]
198
+ #
199
+ attr_reader :operations_client
200
+
201
+ ##
202
+ # Get the associated client for mix-in of the Locations.
203
+ #
204
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
205
+ #
206
+ attr_reader :location_client
207
+
208
+ ##
209
+ # The logger used for request/response debug logging.
210
+ #
211
+ # @return [Logger]
212
+ #
213
+ def logger
214
+ @api_hub_plugin_stub.logger
215
+ end
216
+
217
+ # Service calls
218
+
219
+ ##
220
+ # Get an API Hub plugin.
221
+ #
222
+ # @overload get_plugin(request, options = nil)
223
+ # Pass arguments to `get_plugin` via a request object, either of type
224
+ # {::Google::Cloud::ApiHub::V1::GetPluginRequest} or an equivalent Hash.
225
+ #
226
+ # @param request [::Google::Cloud::ApiHub::V1::GetPluginRequest, ::Hash]
227
+ # A request object representing the call parameters. Required. To specify no
228
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
229
+ # @param options [::Gapic::CallOptions, ::Hash]
230
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
231
+ #
232
+ # @overload get_plugin(name: nil)
233
+ # Pass arguments to `get_plugin` via keyword arguments. Note that at
234
+ # least one keyword argument is required. To specify no parameters, or to keep all
235
+ # the default parameter values, pass an empty Hash as a request object (see above).
236
+ #
237
+ # @param name [::String]
238
+ # Required. The name of the plugin to retrieve.
239
+ # Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
240
+ # @yield [result, operation] Access the result along with the TransportOperation object
241
+ # @yieldparam result [::Google::Cloud::ApiHub::V1::Plugin]
242
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
243
+ #
244
+ # @return [::Google::Cloud::ApiHub::V1::Plugin]
245
+ #
246
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
247
+ #
248
+ # @example Basic example
249
+ # require "google/cloud/api_hub/v1"
250
+ #
251
+ # # Create a client object. The client can be reused for multiple calls.
252
+ # client = Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.new
253
+ #
254
+ # # Create a request. To set request fields, pass in keyword arguments.
255
+ # request = Google::Cloud::ApiHub::V1::GetPluginRequest.new
256
+ #
257
+ # # Call the get_plugin method.
258
+ # result = client.get_plugin request
259
+ #
260
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Plugin.
261
+ # p result
262
+ #
263
+ def get_plugin request, options = nil
264
+ raise ::ArgumentError, "request must be provided" if request.nil?
265
+
266
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetPluginRequest
267
+
268
+ # Converts hash and nil to an options object
269
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
270
+
271
+ # Customize the options with defaults
272
+ call_metadata = @config.rpcs.get_plugin.metadata.to_h
273
+
274
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
275
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
276
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
277
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
278
+ transports_version_send: [:rest]
279
+
280
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
281
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
282
+
283
+ options.apply_defaults timeout: @config.rpcs.get_plugin.timeout,
284
+ metadata: call_metadata,
285
+ retry_policy: @config.rpcs.get_plugin.retry_policy
286
+
287
+ options.apply_defaults timeout: @config.timeout,
288
+ metadata: @config.metadata,
289
+ retry_policy: @config.retry_policy
290
+
291
+ @api_hub_plugin_stub.get_plugin request, options do |result, operation|
292
+ yield result, operation if block_given?
293
+ end
294
+ rescue ::Gapic::Rest::Error => e
295
+ raise ::Google::Cloud::Error.from_error(e)
296
+ end
297
+
298
+ ##
299
+ # Enables a plugin.
300
+ # The `state` of the plugin after enabling is `ENABLED`
301
+ #
302
+ # @overload enable_plugin(request, options = nil)
303
+ # Pass arguments to `enable_plugin` via a request object, either of type
304
+ # {::Google::Cloud::ApiHub::V1::EnablePluginRequest} or an equivalent Hash.
305
+ #
306
+ # @param request [::Google::Cloud::ApiHub::V1::EnablePluginRequest, ::Hash]
307
+ # A request object representing the call parameters. Required. To specify no
308
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
309
+ # @param options [::Gapic::CallOptions, ::Hash]
310
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
311
+ #
312
+ # @overload enable_plugin(name: nil)
313
+ # Pass arguments to `enable_plugin` via keyword arguments. Note that at
314
+ # least one keyword argument is required. To specify no parameters, or to keep all
315
+ # the default parameter values, pass an empty Hash as a request object (see above).
316
+ #
317
+ # @param name [::String]
318
+ # Required. The name of the plugin to enable.
319
+ # Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
320
+ # @yield [result, operation] Access the result along with the TransportOperation object
321
+ # @yieldparam result [::Google::Cloud::ApiHub::V1::Plugin]
322
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
323
+ #
324
+ # @return [::Google::Cloud::ApiHub::V1::Plugin]
325
+ #
326
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
327
+ #
328
+ # @example Basic example
329
+ # require "google/cloud/api_hub/v1"
330
+ #
331
+ # # Create a client object. The client can be reused for multiple calls.
332
+ # client = Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.new
333
+ #
334
+ # # Create a request. To set request fields, pass in keyword arguments.
335
+ # request = Google::Cloud::ApiHub::V1::EnablePluginRequest.new
336
+ #
337
+ # # Call the enable_plugin method.
338
+ # result = client.enable_plugin request
339
+ #
340
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Plugin.
341
+ # p result
342
+ #
343
+ def enable_plugin request, options = nil
344
+ raise ::ArgumentError, "request must be provided" if request.nil?
345
+
346
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::EnablePluginRequest
347
+
348
+ # Converts hash and nil to an options object
349
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
350
+
351
+ # Customize the options with defaults
352
+ call_metadata = @config.rpcs.enable_plugin.metadata.to_h
353
+
354
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
355
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
356
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
357
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
358
+ transports_version_send: [:rest]
359
+
360
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
361
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
362
+
363
+ options.apply_defaults timeout: @config.rpcs.enable_plugin.timeout,
364
+ metadata: call_metadata,
365
+ retry_policy: @config.rpcs.enable_plugin.retry_policy
366
+
367
+ options.apply_defaults timeout: @config.timeout,
368
+ metadata: @config.metadata,
369
+ retry_policy: @config.retry_policy
370
+
371
+ @api_hub_plugin_stub.enable_plugin request, options do |result, operation|
372
+ yield result, operation if block_given?
373
+ end
374
+ rescue ::Gapic::Rest::Error => e
375
+ raise ::Google::Cloud::Error.from_error(e)
376
+ end
377
+
378
+ ##
379
+ # Disables a plugin.
380
+ # The `state` of the plugin after disabling is `DISABLED`
381
+ #
382
+ # @overload disable_plugin(request, options = nil)
383
+ # Pass arguments to `disable_plugin` via a request object, either of type
384
+ # {::Google::Cloud::ApiHub::V1::DisablePluginRequest} or an equivalent Hash.
385
+ #
386
+ # @param request [::Google::Cloud::ApiHub::V1::DisablePluginRequest, ::Hash]
387
+ # A request object representing the call parameters. Required. To specify no
388
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
389
+ # @param options [::Gapic::CallOptions, ::Hash]
390
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
391
+ #
392
+ # @overload disable_plugin(name: nil)
393
+ # Pass arguments to `disable_plugin` via keyword arguments. Note that at
394
+ # least one keyword argument is required. To specify no parameters, or to keep all
395
+ # the default parameter values, pass an empty Hash as a request object (see above).
396
+ #
397
+ # @param name [::String]
398
+ # Required. The name of the plugin to disable.
399
+ # Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
400
+ # @yield [result, operation] Access the result along with the TransportOperation object
401
+ # @yieldparam result [::Google::Cloud::ApiHub::V1::Plugin]
402
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
403
+ #
404
+ # @return [::Google::Cloud::ApiHub::V1::Plugin]
405
+ #
406
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
407
+ #
408
+ # @example Basic example
409
+ # require "google/cloud/api_hub/v1"
410
+ #
411
+ # # Create a client object. The client can be reused for multiple calls.
412
+ # client = Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.new
413
+ #
414
+ # # Create a request. To set request fields, pass in keyword arguments.
415
+ # request = Google::Cloud::ApiHub::V1::DisablePluginRequest.new
416
+ #
417
+ # # Call the disable_plugin method.
418
+ # result = client.disable_plugin request
419
+ #
420
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Plugin.
421
+ # p result
422
+ #
423
+ def disable_plugin request, options = nil
424
+ raise ::ArgumentError, "request must be provided" if request.nil?
425
+
426
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::DisablePluginRequest
427
+
428
+ # Converts hash and nil to an options object
429
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
430
+
431
+ # Customize the options with defaults
432
+ call_metadata = @config.rpcs.disable_plugin.metadata.to_h
433
+
434
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
435
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
436
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
437
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
438
+ transports_version_send: [:rest]
439
+
440
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
441
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
442
+
443
+ options.apply_defaults timeout: @config.rpcs.disable_plugin.timeout,
444
+ metadata: call_metadata,
445
+ retry_policy: @config.rpcs.disable_plugin.retry_policy
446
+
447
+ options.apply_defaults timeout: @config.timeout,
448
+ metadata: @config.metadata,
449
+ retry_policy: @config.retry_policy
450
+
451
+ @api_hub_plugin_stub.disable_plugin request, options do |result, operation|
452
+ yield result, operation if block_given?
453
+ end
454
+ rescue ::Gapic::Rest::Error => e
455
+ raise ::Google::Cloud::Error.from_error(e)
456
+ end
457
+
458
+ ##
459
+ # Create an API Hub plugin resource in the API hub.
460
+ # Once a plugin is created, it can be used to create plugin instances.
461
+ #
462
+ # @overload create_plugin(request, options = nil)
463
+ # Pass arguments to `create_plugin` via a request object, either of type
464
+ # {::Google::Cloud::ApiHub::V1::CreatePluginRequest} or an equivalent Hash.
465
+ #
466
+ # @param request [::Google::Cloud::ApiHub::V1::CreatePluginRequest, ::Hash]
467
+ # A request object representing the call parameters. Required. To specify no
468
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
469
+ # @param options [::Gapic::CallOptions, ::Hash]
470
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
471
+ #
472
+ # @overload create_plugin(parent: nil, plugin_id: nil, plugin: nil)
473
+ # Pass arguments to `create_plugin` via keyword arguments. Note that at
474
+ # least one keyword argument is required. To specify no parameters, or to keep all
475
+ # the default parameter values, pass an empty Hash as a request object (see above).
476
+ #
477
+ # @param parent [::String]
478
+ # Required. The parent resource where this plugin will be created.
479
+ # Format: `projects/{project}/locations/{location}`.
480
+ # @param plugin_id [::String]
481
+ # Optional. The ID to use for the Plugin resource, which will become the
482
+ # final component of the Plugin's resource name. This field is optional.
483
+ #
484
+ # * If provided, the same will be used. The service will throw an error if
485
+ # the specified id is already used by another Plugin resource in the API hub
486
+ # instance.
487
+ # * If not provided, a system generated id will be used.
488
+ #
489
+ # This value should be 4-63 characters, overall resource name which will be
490
+ # of format
491
+ # `projects/{project}/locations/{location}/plugins/{plugin}`,
492
+ # its length is limited to 1000 characters and valid characters are
493
+ # /[a-z][A-Z][0-9]-_/.
494
+ # @param plugin [::Google::Cloud::ApiHub::V1::Plugin, ::Hash]
495
+ # Required. The plugin to create.
496
+ # @yield [result, operation] Access the result along with the TransportOperation object
497
+ # @yieldparam result [::Google::Cloud::ApiHub::V1::Plugin]
498
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
499
+ #
500
+ # @return [::Google::Cloud::ApiHub::V1::Plugin]
501
+ #
502
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
503
+ #
504
+ # @example Basic example
505
+ # require "google/cloud/api_hub/v1"
506
+ #
507
+ # # Create a client object. The client can be reused for multiple calls.
508
+ # client = Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.new
509
+ #
510
+ # # Create a request. To set request fields, pass in keyword arguments.
511
+ # request = Google::Cloud::ApiHub::V1::CreatePluginRequest.new
512
+ #
513
+ # # Call the create_plugin method.
514
+ # result = client.create_plugin request
515
+ #
516
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Plugin.
517
+ # p result
518
+ #
519
+ def create_plugin request, options = nil
520
+ raise ::ArgumentError, "request must be provided" if request.nil?
521
+
522
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::CreatePluginRequest
523
+
524
+ # Converts hash and nil to an options object
525
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
526
+
527
+ # Customize the options with defaults
528
+ call_metadata = @config.rpcs.create_plugin.metadata.to_h
529
+
530
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
531
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
532
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
533
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
534
+ transports_version_send: [:rest]
535
+
536
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
537
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
538
+
539
+ options.apply_defaults timeout: @config.rpcs.create_plugin.timeout,
540
+ metadata: call_metadata,
541
+ retry_policy: @config.rpcs.create_plugin.retry_policy
542
+
543
+ options.apply_defaults timeout: @config.timeout,
544
+ metadata: @config.metadata,
545
+ retry_policy: @config.retry_policy
546
+
547
+ @api_hub_plugin_stub.create_plugin request, options do |result, operation|
548
+ yield result, operation if block_given?
549
+ end
550
+ rescue ::Gapic::Rest::Error => e
551
+ raise ::Google::Cloud::Error.from_error(e)
552
+ end
553
+
554
+ ##
555
+ # List all the plugins in a given project and location.
556
+ #
557
+ # @overload list_plugins(request, options = nil)
558
+ # Pass arguments to `list_plugins` via a request object, either of type
559
+ # {::Google::Cloud::ApiHub::V1::ListPluginsRequest} or an equivalent Hash.
560
+ #
561
+ # @param request [::Google::Cloud::ApiHub::V1::ListPluginsRequest, ::Hash]
562
+ # A request object representing the call parameters. Required. To specify no
563
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
564
+ # @param options [::Gapic::CallOptions, ::Hash]
565
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
566
+ #
567
+ # @overload list_plugins(parent: nil, filter: nil, page_size: nil, page_token: nil)
568
+ # Pass arguments to `list_plugins` via keyword arguments. Note that at
569
+ # least one keyword argument is required. To specify no parameters, or to keep all
570
+ # the default parameter values, pass an empty Hash as a request object (see above).
571
+ #
572
+ # @param parent [::String]
573
+ # Required. The parent resource where this plugin will be created.
574
+ # Format: `projects/{project}/locations/{location}`.
575
+ # @param filter [::String]
576
+ # Optional. An expression that filters the list of plugins.
577
+ #
578
+ # A filter expression consists of a field name, a comparison
579
+ # operator, and a value for filtering. The value must be a string. The
580
+ # comparison operator must be one of: `<`, `>` or
581
+ # `=`. Filters are not case sensitive.
582
+ #
583
+ # The following fields in the `Plugins` are eligible for filtering:
584
+ #
585
+ # * `plugin_category` - The category of the Plugin. Allowed
586
+ # comparison operators: `=`.
587
+ #
588
+ # Expressions are combined with either `AND` logic operator or `OR` logical
589
+ # operator but not both of them together i.e. only one of the `AND` or `OR`
590
+ # operator can be used throughout the filter string and both the operators
591
+ # cannot be used together. No other logical operators are
592
+ # supported. At most three filter fields are allowed in the filter
593
+ # string and if provided more than that then `INVALID_ARGUMENT` error is
594
+ # returned by the API.
595
+ # Here are a few examples:
596
+ #
597
+ # * `plugin_category = ON_RAMP` - The plugin is of category
598
+ # on ramp.
599
+ # @param page_size [::Integer]
600
+ # Optional. The maximum number of hub plugins to return. The service may
601
+ # return fewer than this value. If unspecified, at most 50 hub plugins will
602
+ # be returned. The maximum value is 1000; values above 1000 will be coerced
603
+ # to 1000.
604
+ # @param page_token [::String]
605
+ # Optional. A page token, received from a previous `ListPlugins` call.
606
+ # Provide this to retrieve the subsequent page.
607
+ #
608
+ # When paginating, all other parameters (except page_size) provided to
609
+ # `ListPlugins` must match the call that provided the page token.
610
+ # @yield [result, operation] Access the result along with the TransportOperation object
611
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::Plugin>]
612
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
613
+ #
614
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::Plugin>]
615
+ #
616
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
617
+ #
618
+ # @example Basic example
619
+ # require "google/cloud/api_hub/v1"
620
+ #
621
+ # # Create a client object. The client can be reused for multiple calls.
622
+ # client = Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.new
623
+ #
624
+ # # Create a request. To set request fields, pass in keyword arguments.
625
+ # request = Google::Cloud::ApiHub::V1::ListPluginsRequest.new
626
+ #
627
+ # # Call the list_plugins method.
628
+ # result = client.list_plugins request
629
+ #
630
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
631
+ # # over elements, and API calls will be issued to fetch pages as needed.
632
+ # result.each do |item|
633
+ # # Each element is of type ::Google::Cloud::ApiHub::V1::Plugin.
634
+ # p item
635
+ # end
636
+ #
637
+ def list_plugins request, options = nil
638
+ raise ::ArgumentError, "request must be provided" if request.nil?
639
+
640
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::ListPluginsRequest
641
+
642
+ # Converts hash and nil to an options object
643
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
644
+
645
+ # Customize the options with defaults
646
+ call_metadata = @config.rpcs.list_plugins.metadata.to_h
647
+
648
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
649
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
650
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
651
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
652
+ transports_version_send: [:rest]
653
+
654
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
655
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
656
+
657
+ options.apply_defaults timeout: @config.rpcs.list_plugins.timeout,
658
+ metadata: call_metadata,
659
+ retry_policy: @config.rpcs.list_plugins.retry_policy
660
+
661
+ options.apply_defaults timeout: @config.timeout,
662
+ metadata: @config.metadata,
663
+ retry_policy: @config.retry_policy
664
+
665
+ @api_hub_plugin_stub.list_plugins request, options do |result, operation|
666
+ result = ::Gapic::Rest::PagedEnumerable.new @api_hub_plugin_stub, :list_plugins, "plugins", request, result, options
667
+ yield result, operation if block_given?
668
+ throw :response, result
669
+ end
670
+ rescue ::Gapic::Rest::Error => e
671
+ raise ::Google::Cloud::Error.from_error(e)
672
+ end
673
+
674
+ ##
675
+ # Delete a Plugin in API hub.
676
+ # Note, only user owned plugins can be deleted via this method.
677
+ #
678
+ # @overload delete_plugin(request, options = nil)
679
+ # Pass arguments to `delete_plugin` via a request object, either of type
680
+ # {::Google::Cloud::ApiHub::V1::DeletePluginRequest} or an equivalent Hash.
681
+ #
682
+ # @param request [::Google::Cloud::ApiHub::V1::DeletePluginRequest, ::Hash]
683
+ # A request object representing the call parameters. Required. To specify no
684
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
685
+ # @param options [::Gapic::CallOptions, ::Hash]
686
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
687
+ #
688
+ # @overload delete_plugin(name: nil)
689
+ # Pass arguments to `delete_plugin` via keyword arguments. Note that at
690
+ # least one keyword argument is required. To specify no parameters, or to keep all
691
+ # the default parameter values, pass an empty Hash as a request object (see above).
692
+ #
693
+ # @param name [::String]
694
+ # Required. The name of the Plugin resource to delete.
695
+ # Format: `projects/{project}/locations/{location}/plugins/{plugin}`
696
+ # @yield [result, operation] Access the result along with the TransportOperation object
697
+ # @yieldparam result [::Gapic::Operation]
698
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
699
+ #
700
+ # @return [::Gapic::Operation]
701
+ #
702
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
703
+ #
704
+ # @example Basic example
705
+ # require "google/cloud/api_hub/v1"
706
+ #
707
+ # # Create a client object. The client can be reused for multiple calls.
708
+ # client = Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.new
709
+ #
710
+ # # Create a request. To set request fields, pass in keyword arguments.
711
+ # request = Google::Cloud::ApiHub::V1::DeletePluginRequest.new
712
+ #
713
+ # # Call the delete_plugin method.
714
+ # result = client.delete_plugin request
715
+ #
716
+ # # The returned object is of type Gapic::Operation. You can use it to
717
+ # # check the status of an operation, cancel it, or wait for results.
718
+ # # Here is how to wait for a response.
719
+ # result.wait_until_done! timeout: 60
720
+ # if result.response?
721
+ # p result.response
722
+ # else
723
+ # puts "No response received."
724
+ # end
725
+ #
726
+ def delete_plugin request, options = nil
727
+ raise ::ArgumentError, "request must be provided" if request.nil?
728
+
729
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::DeletePluginRequest
730
+
731
+ # Converts hash and nil to an options object
732
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
733
+
734
+ # Customize the options with defaults
735
+ call_metadata = @config.rpcs.delete_plugin.metadata.to_h
736
+
737
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
738
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
739
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
740
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
741
+ transports_version_send: [:rest]
742
+
743
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
744
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
745
+
746
+ options.apply_defaults timeout: @config.rpcs.delete_plugin.timeout,
747
+ metadata: call_metadata,
748
+ retry_policy: @config.rpcs.delete_plugin.retry_policy
749
+
750
+ options.apply_defaults timeout: @config.timeout,
751
+ metadata: @config.metadata,
752
+ retry_policy: @config.retry_policy
753
+
754
+ @api_hub_plugin_stub.delete_plugin request, options do |result, operation|
755
+ result = ::Gapic::Operation.new result, @operations_client, options: options
756
+ yield result, operation if block_given?
757
+ throw :response, result
758
+ end
759
+ rescue ::Gapic::Rest::Error => e
760
+ raise ::Google::Cloud::Error.from_error(e)
761
+ end
762
+
763
+ ##
764
+ # Creates a Plugin instance in the API hub.
765
+ #
766
+ # @overload create_plugin_instance(request, options = nil)
767
+ # Pass arguments to `create_plugin_instance` via a request object, either of type
768
+ # {::Google::Cloud::ApiHub::V1::CreatePluginInstanceRequest} or an equivalent Hash.
769
+ #
770
+ # @param request [::Google::Cloud::ApiHub::V1::CreatePluginInstanceRequest, ::Hash]
771
+ # A request object representing the call parameters. Required. To specify no
772
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
773
+ # @param options [::Gapic::CallOptions, ::Hash]
774
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
775
+ #
776
+ # @overload create_plugin_instance(parent: nil, plugin_instance_id: nil, plugin_instance: nil)
777
+ # Pass arguments to `create_plugin_instance` via keyword arguments. Note that at
778
+ # least one keyword argument is required. To specify no parameters, or to keep all
779
+ # the default parameter values, pass an empty Hash as a request object (see above).
780
+ #
781
+ # @param parent [::String]
782
+ # Required. The parent of the plugin instance resource.
783
+ # Format: `projects/{project}/locations/{location}/plugins/{plugin}`
784
+ # @param plugin_instance_id [::String]
785
+ # Optional. The ID to use for the plugin instance, which will become the
786
+ # final component of the plugin instance's resource name. This field is
787
+ # optional.
788
+ #
789
+ # * If provided, the same will be used. The service will throw an error if
790
+ # the specified id is already used by another plugin instance in the plugin
791
+ # resource.
792
+ # * If not provided, a system generated id will be used.
793
+ #
794
+ # This value should be 4-63 characters, and valid characters
795
+ # are /[a-z][A-Z][0-9]-_/.
796
+ # @param plugin_instance [::Google::Cloud::ApiHub::V1::PluginInstance, ::Hash]
797
+ # Required. The plugin instance to create.
798
+ # @yield [result, operation] Access the result along with the TransportOperation object
799
+ # @yieldparam result [::Gapic::Operation]
800
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
801
+ #
802
+ # @return [::Gapic::Operation]
803
+ #
804
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
805
+ #
806
+ # @example Basic example
807
+ # require "google/cloud/api_hub/v1"
808
+ #
809
+ # # Create a client object. The client can be reused for multiple calls.
810
+ # client = Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.new
811
+ #
812
+ # # Create a request. To set request fields, pass in keyword arguments.
813
+ # request = Google::Cloud::ApiHub::V1::CreatePluginInstanceRequest.new
814
+ #
815
+ # # Call the create_plugin_instance method.
816
+ # result = client.create_plugin_instance request
817
+ #
818
+ # # The returned object is of type Gapic::Operation. You can use it to
819
+ # # check the status of an operation, cancel it, or wait for results.
820
+ # # Here is how to wait for a response.
821
+ # result.wait_until_done! timeout: 60
822
+ # if result.response?
823
+ # p result.response
824
+ # else
825
+ # puts "No response received."
826
+ # end
827
+ #
828
+ def create_plugin_instance request, options = nil
829
+ raise ::ArgumentError, "request must be provided" if request.nil?
830
+
831
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::CreatePluginInstanceRequest
832
+
833
+ # Converts hash and nil to an options object
834
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
835
+
836
+ # Customize the options with defaults
837
+ call_metadata = @config.rpcs.create_plugin_instance.metadata.to_h
838
+
839
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
840
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
841
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
842
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
843
+ transports_version_send: [:rest]
844
+
845
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
846
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
847
+
848
+ options.apply_defaults timeout: @config.rpcs.create_plugin_instance.timeout,
849
+ metadata: call_metadata,
850
+ retry_policy: @config.rpcs.create_plugin_instance.retry_policy
851
+
852
+ options.apply_defaults timeout: @config.timeout,
853
+ metadata: @config.metadata,
854
+ retry_policy: @config.retry_policy
855
+
856
+ @api_hub_plugin_stub.create_plugin_instance request, options do |result, operation|
857
+ result = ::Gapic::Operation.new result, @operations_client, options: options
858
+ yield result, operation if block_given?
859
+ throw :response, result
860
+ end
861
+ rescue ::Gapic::Rest::Error => e
862
+ raise ::Google::Cloud::Error.from_error(e)
863
+ end
864
+
865
+ ##
866
+ # Executes a plugin instance in the API hub.
867
+ #
868
+ # @overload execute_plugin_instance_action(request, options = nil)
869
+ # Pass arguments to `execute_plugin_instance_action` via a request object, either of type
870
+ # {::Google::Cloud::ApiHub::V1::ExecutePluginInstanceActionRequest} or an equivalent Hash.
871
+ #
872
+ # @param request [::Google::Cloud::ApiHub::V1::ExecutePluginInstanceActionRequest, ::Hash]
873
+ # A request object representing the call parameters. Required. To specify no
874
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
875
+ # @param options [::Gapic::CallOptions, ::Hash]
876
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
877
+ #
878
+ # @overload execute_plugin_instance_action(name: nil, action_execution_detail: nil)
879
+ # Pass arguments to `execute_plugin_instance_action` via keyword arguments. Note that at
880
+ # least one keyword argument is required. To specify no parameters, or to keep all
881
+ # the default parameter values, pass an empty Hash as a request object (see above).
882
+ #
883
+ # @param name [::String]
884
+ # Required. The name of the plugin instance to execute.
885
+ # Format:
886
+ # `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`
887
+ # @param action_execution_detail [::Google::Cloud::ApiHub::V1::ActionExecutionDetail, ::Hash]
888
+ # Required. The execution details for the action to execute.
889
+ # @yield [result, operation] Access the result along with the TransportOperation object
890
+ # @yieldparam result [::Gapic::Operation]
891
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
892
+ #
893
+ # @return [::Gapic::Operation]
894
+ #
895
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
896
+ #
897
+ # @example Basic example
898
+ # require "google/cloud/api_hub/v1"
899
+ #
900
+ # # Create a client object. The client can be reused for multiple calls.
901
+ # client = Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.new
902
+ #
903
+ # # Create a request. To set request fields, pass in keyword arguments.
904
+ # request = Google::Cloud::ApiHub::V1::ExecutePluginInstanceActionRequest.new
905
+ #
906
+ # # Call the execute_plugin_instance_action method.
907
+ # result = client.execute_plugin_instance_action request
908
+ #
909
+ # # The returned object is of type Gapic::Operation. You can use it to
910
+ # # check the status of an operation, cancel it, or wait for results.
911
+ # # Here is how to wait for a response.
912
+ # result.wait_until_done! timeout: 60
913
+ # if result.response?
914
+ # p result.response
915
+ # else
916
+ # puts "No response received."
917
+ # end
918
+ #
919
+ def execute_plugin_instance_action request, options = nil
920
+ raise ::ArgumentError, "request must be provided" if request.nil?
921
+
922
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::ExecutePluginInstanceActionRequest
923
+
924
+ # Converts hash and nil to an options object
925
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
926
+
927
+ # Customize the options with defaults
928
+ call_metadata = @config.rpcs.execute_plugin_instance_action.metadata.to_h
929
+
930
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
931
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
932
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
933
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
934
+ transports_version_send: [:rest]
935
+
936
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
937
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
938
+
939
+ options.apply_defaults timeout: @config.rpcs.execute_plugin_instance_action.timeout,
940
+ metadata: call_metadata,
941
+ retry_policy: @config.rpcs.execute_plugin_instance_action.retry_policy
942
+
943
+ options.apply_defaults timeout: @config.timeout,
944
+ metadata: @config.metadata,
945
+ retry_policy: @config.retry_policy
946
+
947
+ @api_hub_plugin_stub.execute_plugin_instance_action request, options do |result, operation|
948
+ result = ::Gapic::Operation.new result, @operations_client, options: options
949
+ yield result, operation if block_given?
950
+ throw :response, result
951
+ end
952
+ rescue ::Gapic::Rest::Error => e
953
+ raise ::Google::Cloud::Error.from_error(e)
954
+ end
955
+
956
+ ##
957
+ # Get an API Hub plugin instance.
958
+ #
959
+ # @overload get_plugin_instance(request, options = nil)
960
+ # Pass arguments to `get_plugin_instance` via a request object, either of type
961
+ # {::Google::Cloud::ApiHub::V1::GetPluginInstanceRequest} or an equivalent Hash.
962
+ #
963
+ # @param request [::Google::Cloud::ApiHub::V1::GetPluginInstanceRequest, ::Hash]
964
+ # A request object representing the call parameters. Required. To specify no
965
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
966
+ # @param options [::Gapic::CallOptions, ::Hash]
967
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
968
+ #
969
+ # @overload get_plugin_instance(name: nil)
970
+ # Pass arguments to `get_plugin_instance` via keyword arguments. Note that at
971
+ # least one keyword argument is required. To specify no parameters, or to keep all
972
+ # the default parameter values, pass an empty Hash as a request object (see above).
973
+ #
974
+ # @param name [::String]
975
+ # Required. The name of the plugin instance to retrieve.
976
+ # Format:
977
+ # `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`
978
+ # @yield [result, operation] Access the result along with the TransportOperation object
979
+ # @yieldparam result [::Google::Cloud::ApiHub::V1::PluginInstance]
980
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
981
+ #
982
+ # @return [::Google::Cloud::ApiHub::V1::PluginInstance]
983
+ #
984
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
985
+ #
986
+ # @example Basic example
987
+ # require "google/cloud/api_hub/v1"
988
+ #
989
+ # # Create a client object. The client can be reused for multiple calls.
990
+ # client = Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.new
991
+ #
992
+ # # Create a request. To set request fields, pass in keyword arguments.
993
+ # request = Google::Cloud::ApiHub::V1::GetPluginInstanceRequest.new
994
+ #
995
+ # # Call the get_plugin_instance method.
996
+ # result = client.get_plugin_instance request
997
+ #
998
+ # # The returned object is of type Google::Cloud::ApiHub::V1::PluginInstance.
999
+ # p result
1000
+ #
1001
+ def get_plugin_instance request, options = nil
1002
+ raise ::ArgumentError, "request must be provided" if request.nil?
1003
+
1004
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetPluginInstanceRequest
1005
+
1006
+ # Converts hash and nil to an options object
1007
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1008
+
1009
+ # Customize the options with defaults
1010
+ call_metadata = @config.rpcs.get_plugin_instance.metadata.to_h
176
1011
 
177
- @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
178
- config.credentials = credentials
179
- config.quota_project = @quota_project_id
180
- config.endpoint = @api_hub_plugin_stub.endpoint
181
- config.universe_domain = @api_hub_plugin_stub.universe_domain
182
- config.bindings_override = @config.bindings_override
183
- config.logger = @api_hub_plugin_stub.logger if config.respond_to? :logger=
1012
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1013
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1014
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1015
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
1016
+ transports_version_send: [:rest]
1017
+
1018
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1019
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1020
+
1021
+ options.apply_defaults timeout: @config.rpcs.get_plugin_instance.timeout,
1022
+ metadata: call_metadata,
1023
+ retry_policy: @config.rpcs.get_plugin_instance.retry_policy
1024
+
1025
+ options.apply_defaults timeout: @config.timeout,
1026
+ metadata: @config.metadata,
1027
+ retry_policy: @config.retry_policy
1028
+
1029
+ @api_hub_plugin_stub.get_plugin_instance request, options do |result, operation|
1030
+ yield result, operation if block_given?
184
1031
  end
1032
+ rescue ::Gapic::Rest::Error => e
1033
+ raise ::Google::Cloud::Error.from_error(e)
185
1034
  end
186
1035
 
187
1036
  ##
188
- # Get the associated client for mix-in of the Locations.
1037
+ # List all the plugins in a given project and location.
1038
+ # `-` can be used as wildcard value for \\{plugin_id}
189
1039
  #
190
- # @return [Google::Cloud::Location::Locations::Rest::Client]
1040
+ # @overload list_plugin_instances(request, options = nil)
1041
+ # Pass arguments to `list_plugin_instances` via a request object, either of type
1042
+ # {::Google::Cloud::ApiHub::V1::ListPluginInstancesRequest} or an equivalent Hash.
191
1043
  #
192
- attr_reader :location_client
193
-
194
- ##
195
- # The logger used for request/response debug logging.
1044
+ # @param request [::Google::Cloud::ApiHub::V1::ListPluginInstancesRequest, ::Hash]
1045
+ # A request object representing the call parameters. Required. To specify no
1046
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1047
+ # @param options [::Gapic::CallOptions, ::Hash]
1048
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
196
1049
  #
197
- # @return [Logger]
1050
+ # @overload list_plugin_instances(parent: nil, filter: nil, page_size: nil, page_token: nil)
1051
+ # Pass arguments to `list_plugin_instances` via keyword arguments. Note that at
1052
+ # least one keyword argument is required. To specify no parameters, or to keep all
1053
+ # the default parameter values, pass an empty Hash as a request object (see above).
198
1054
  #
199
- def logger
200
- @api_hub_plugin_stub.logger
201
- end
1055
+ # @param parent [::String]
1056
+ # Required. The parent resource where this plugin will be created.
1057
+ # Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
1058
+ # To list plugin instances for multiple plugins,
1059
+ # use the - character instead of the plugin ID.
1060
+ # @param filter [::String]
1061
+ # Optional. An expression that filters the list of plugin instances.
1062
+ #
1063
+ # A filter expression consists of a field name, a comparison
1064
+ # operator, and a value for filtering. The value must be a string. The
1065
+ # comparison operator must be one of: `<`, `>` or
1066
+ # `=`. Filters are not case sensitive.
1067
+ #
1068
+ # The following fields in the `PluginInstances` are eligible for filtering:
1069
+ #
1070
+ # * `state` - The state of the Plugin Instance. Allowed
1071
+ # comparison operators: `=`.
1072
+ #
1073
+ # A filter function is also supported in the filter string. The filter
1074
+ # function is `id(name)`. The `id(name)` function returns the id of the
1075
+ # resource name. For example, `id(name) = \"plugin-instance-1\"` is
1076
+ # equivalent to `name =
1077
+ # \"projects/test-project-id/locations/test-location-id/plugins/plugin-1/instances/plugin-instance-1\"`
1078
+ # provided the parent is
1079
+ # `projects/test-project-id/locations/test-location-id/plugins/plugin-1`.
1080
+ #
1081
+ # Expressions are combined with either `AND` logic operator or `OR` logical
1082
+ # operator but not both of them together i.e. only one of the `AND` or `OR`
1083
+ # operator can be used throughout the filter string and both the operators
1084
+ # cannot be used together. No other logical operators are
1085
+ # supported. At most three filter fields are allowed in the filter
1086
+ # string and if provided more than that then `INVALID_ARGUMENT` error is
1087
+ # returned by the API.
1088
+ # Here are a few examples:
1089
+ #
1090
+ # * `state = ENABLED` - The plugin instance is in enabled state.
1091
+ # @param page_size [::Integer]
1092
+ # Optional. The maximum number of hub plugins to return. The service may
1093
+ # return fewer than this value. If unspecified, at most 50 hub plugins will
1094
+ # be returned. The maximum value is 1000; values above 1000 will be coerced
1095
+ # to 1000.
1096
+ # @param page_token [::String]
1097
+ # Optional. A page token, received from a previous `ListPluginInstances`
1098
+ # call. Provide this to retrieve the subsequent page.
1099
+ #
1100
+ # When paginating, all other parameters provided to `ListPluginInstances`
1101
+ # must match the call that provided the page token.
1102
+ # @yield [result, operation] Access the result along with the TransportOperation object
1103
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::PluginInstance>]
1104
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1105
+ #
1106
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::PluginInstance>]
1107
+ #
1108
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1109
+ #
1110
+ # @example Basic example
1111
+ # require "google/cloud/api_hub/v1"
1112
+ #
1113
+ # # Create a client object. The client can be reused for multiple calls.
1114
+ # client = Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.new
1115
+ #
1116
+ # # Create a request. To set request fields, pass in keyword arguments.
1117
+ # request = Google::Cloud::ApiHub::V1::ListPluginInstancesRequest.new
1118
+ #
1119
+ # # Call the list_plugin_instances method.
1120
+ # result = client.list_plugin_instances request
1121
+ #
1122
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1123
+ # # over elements, and API calls will be issued to fetch pages as needed.
1124
+ # result.each do |item|
1125
+ # # Each element is of type ::Google::Cloud::ApiHub::V1::PluginInstance.
1126
+ # p item
1127
+ # end
1128
+ #
1129
+ def list_plugin_instances request, options = nil
1130
+ raise ::ArgumentError, "request must be provided" if request.nil?
202
1131
 
203
- # Service calls
1132
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::ListPluginInstancesRequest
1133
+
1134
+ # Converts hash and nil to an options object
1135
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1136
+
1137
+ # Customize the options with defaults
1138
+ call_metadata = @config.rpcs.list_plugin_instances.metadata.to_h
1139
+
1140
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1141
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1142
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1143
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
1144
+ transports_version_send: [:rest]
1145
+
1146
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1147
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1148
+
1149
+ options.apply_defaults timeout: @config.rpcs.list_plugin_instances.timeout,
1150
+ metadata: call_metadata,
1151
+ retry_policy: @config.rpcs.list_plugin_instances.retry_policy
1152
+
1153
+ options.apply_defaults timeout: @config.timeout,
1154
+ metadata: @config.metadata,
1155
+ retry_policy: @config.retry_policy
1156
+
1157
+ @api_hub_plugin_stub.list_plugin_instances request, options do |result, operation|
1158
+ result = ::Gapic::Rest::PagedEnumerable.new @api_hub_plugin_stub, :list_plugin_instances, "plugin_instances", request, result, options
1159
+ yield result, operation if block_given?
1160
+ throw :response, result
1161
+ end
1162
+ rescue ::Gapic::Rest::Error => e
1163
+ raise ::Google::Cloud::Error.from_error(e)
1164
+ end
204
1165
 
205
1166
  ##
206
- # Get details about an API Hub plugin.
1167
+ # Enables a plugin instance in the API hub.
207
1168
  #
208
- # @overload get_plugin(request, options = nil)
209
- # Pass arguments to `get_plugin` via a request object, either of type
210
- # {::Google::Cloud::ApiHub::V1::GetPluginRequest} or an equivalent Hash.
1169
+ # @overload enable_plugin_instance_action(request, options = nil)
1170
+ # Pass arguments to `enable_plugin_instance_action` via a request object, either of type
1171
+ # {::Google::Cloud::ApiHub::V1::EnablePluginInstanceActionRequest} or an equivalent Hash.
211
1172
  #
212
- # @param request [::Google::Cloud::ApiHub::V1::GetPluginRequest, ::Hash]
1173
+ # @param request [::Google::Cloud::ApiHub::V1::EnablePluginInstanceActionRequest, ::Hash]
213
1174
  # A request object representing the call parameters. Required. To specify no
214
1175
  # parameters, or to keep all the default parameter values, pass an empty Hash.
215
1176
  # @param options [::Gapic::CallOptions, ::Hash]
216
1177
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
217
1178
  #
218
- # @overload get_plugin(name: nil)
219
- # Pass arguments to `get_plugin` via keyword arguments. Note that at
1179
+ # @overload enable_plugin_instance_action(name: nil, action_id: nil)
1180
+ # Pass arguments to `enable_plugin_instance_action` via keyword arguments. Note that at
220
1181
  # least one keyword argument is required. To specify no parameters, or to keep all
221
1182
  # the default parameter values, pass an empty Hash as a request object (see above).
222
1183
  #
223
1184
  # @param name [::String]
224
- # Required. The name of the plugin to retrieve.
225
- # Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
1185
+ # Required. The name of the plugin instance to enable.
1186
+ # Format:
1187
+ # `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`
1188
+ # @param action_id [::String]
1189
+ # Required. The action id to enable.
226
1190
  # @yield [result, operation] Access the result along with the TransportOperation object
227
- # @yieldparam result [::Google::Cloud::ApiHub::V1::Plugin]
1191
+ # @yieldparam result [::Gapic::Operation]
228
1192
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
229
1193
  #
230
- # @return [::Google::Cloud::ApiHub::V1::Plugin]
1194
+ # @return [::Gapic::Operation]
231
1195
  #
232
1196
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
233
1197
  #
@@ -238,24 +1202,31 @@ module Google
238
1202
  # client = Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.new
239
1203
  #
240
1204
  # # Create a request. To set request fields, pass in keyword arguments.
241
- # request = Google::Cloud::ApiHub::V1::GetPluginRequest.new
242
- #
243
- # # Call the get_plugin method.
244
- # result = client.get_plugin request
245
- #
246
- # # The returned object is of type Google::Cloud::ApiHub::V1::Plugin.
247
- # p result
1205
+ # request = Google::Cloud::ApiHub::V1::EnablePluginInstanceActionRequest.new
1206
+ #
1207
+ # # Call the enable_plugin_instance_action method.
1208
+ # result = client.enable_plugin_instance_action request
1209
+ #
1210
+ # # The returned object is of type Gapic::Operation. You can use it to
1211
+ # # check the status of an operation, cancel it, or wait for results.
1212
+ # # Here is how to wait for a response.
1213
+ # result.wait_until_done! timeout: 60
1214
+ # if result.response?
1215
+ # p result.response
1216
+ # else
1217
+ # puts "No response received."
1218
+ # end
248
1219
  #
249
- def get_plugin request, options = nil
1220
+ def enable_plugin_instance_action request, options = nil
250
1221
  raise ::ArgumentError, "request must be provided" if request.nil?
251
1222
 
252
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetPluginRequest
1223
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::EnablePluginInstanceActionRequest
253
1224
 
254
1225
  # Converts hash and nil to an options object
255
1226
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
256
1227
 
257
1228
  # Customize the options with defaults
258
- call_metadata = @config.rpcs.get_plugin.metadata.to_h
1229
+ call_metadata = @config.rpcs.enable_plugin_instance_action.metadata.to_h
259
1230
 
260
1231
  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
261
1232
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -266,48 +1237,52 @@ module Google
266
1237
  call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
267
1238
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
268
1239
 
269
- options.apply_defaults timeout: @config.rpcs.get_plugin.timeout,
1240
+ options.apply_defaults timeout: @config.rpcs.enable_plugin_instance_action.timeout,
270
1241
  metadata: call_metadata,
271
- retry_policy: @config.rpcs.get_plugin.retry_policy
1242
+ retry_policy: @config.rpcs.enable_plugin_instance_action.retry_policy
272
1243
 
273
1244
  options.apply_defaults timeout: @config.timeout,
274
1245
  metadata: @config.metadata,
275
1246
  retry_policy: @config.retry_policy
276
1247
 
277
- @api_hub_plugin_stub.get_plugin request, options do |result, operation|
1248
+ @api_hub_plugin_stub.enable_plugin_instance_action request, options do |result, operation|
1249
+ result = ::Gapic::Operation.new result, @operations_client, options: options
278
1250
  yield result, operation if block_given?
1251
+ throw :response, result
279
1252
  end
280
1253
  rescue ::Gapic::Rest::Error => e
281
1254
  raise ::Google::Cloud::Error.from_error(e)
282
1255
  end
283
1256
 
284
1257
  ##
285
- # Enables a plugin.
286
- # The `state` of the plugin after enabling is `ENABLED`
1258
+ # Disables a plugin instance in the API hub.
287
1259
  #
288
- # @overload enable_plugin(request, options = nil)
289
- # Pass arguments to `enable_plugin` via a request object, either of type
290
- # {::Google::Cloud::ApiHub::V1::EnablePluginRequest} or an equivalent Hash.
1260
+ # @overload disable_plugin_instance_action(request, options = nil)
1261
+ # Pass arguments to `disable_plugin_instance_action` via a request object, either of type
1262
+ # {::Google::Cloud::ApiHub::V1::DisablePluginInstanceActionRequest} or an equivalent Hash.
291
1263
  #
292
- # @param request [::Google::Cloud::ApiHub::V1::EnablePluginRequest, ::Hash]
1264
+ # @param request [::Google::Cloud::ApiHub::V1::DisablePluginInstanceActionRequest, ::Hash]
293
1265
  # A request object representing the call parameters. Required. To specify no
294
1266
  # parameters, or to keep all the default parameter values, pass an empty Hash.
295
1267
  # @param options [::Gapic::CallOptions, ::Hash]
296
1268
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
297
1269
  #
298
- # @overload enable_plugin(name: nil)
299
- # Pass arguments to `enable_plugin` via keyword arguments. Note that at
1270
+ # @overload disable_plugin_instance_action(name: nil, action_id: nil)
1271
+ # Pass arguments to `disable_plugin_instance_action` via keyword arguments. Note that at
300
1272
  # least one keyword argument is required. To specify no parameters, or to keep all
301
1273
  # the default parameter values, pass an empty Hash as a request object (see above).
302
1274
  #
303
1275
  # @param name [::String]
304
- # Required. The name of the plugin to enable.
305
- # Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
1276
+ # Required. The name of the plugin instance to disable.
1277
+ # Format:
1278
+ # `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`
1279
+ # @param action_id [::String]
1280
+ # Required. The action id to disable.
306
1281
  # @yield [result, operation] Access the result along with the TransportOperation object
307
- # @yieldparam result [::Google::Cloud::ApiHub::V1::Plugin]
1282
+ # @yieldparam result [::Gapic::Operation]
308
1283
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
309
1284
  #
310
- # @return [::Google::Cloud::ApiHub::V1::Plugin]
1285
+ # @return [::Gapic::Operation]
311
1286
  #
312
1287
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
313
1288
  #
@@ -318,24 +1293,130 @@ module Google
318
1293
  # client = Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.new
319
1294
  #
320
1295
  # # Create a request. To set request fields, pass in keyword arguments.
321
- # request = Google::Cloud::ApiHub::V1::EnablePluginRequest.new
1296
+ # request = Google::Cloud::ApiHub::V1::DisablePluginInstanceActionRequest.new
1297
+ #
1298
+ # # Call the disable_plugin_instance_action method.
1299
+ # result = client.disable_plugin_instance_action request
1300
+ #
1301
+ # # The returned object is of type Gapic::Operation. You can use it to
1302
+ # # check the status of an operation, cancel it, or wait for results.
1303
+ # # Here is how to wait for a response.
1304
+ # result.wait_until_done! timeout: 60
1305
+ # if result.response?
1306
+ # p result.response
1307
+ # else
1308
+ # puts "No response received."
1309
+ # end
322
1310
  #
323
- # # Call the enable_plugin method.
324
- # result = client.enable_plugin request
1311
+ def disable_plugin_instance_action request, options = nil
1312
+ raise ::ArgumentError, "request must be provided" if request.nil?
1313
+
1314
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::DisablePluginInstanceActionRequest
1315
+
1316
+ # Converts hash and nil to an options object
1317
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1318
+
1319
+ # Customize the options with defaults
1320
+ call_metadata = @config.rpcs.disable_plugin_instance_action.metadata.to_h
1321
+
1322
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1323
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1324
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1325
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
1326
+ transports_version_send: [:rest]
1327
+
1328
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1329
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1330
+
1331
+ options.apply_defaults timeout: @config.rpcs.disable_plugin_instance_action.timeout,
1332
+ metadata: call_metadata,
1333
+ retry_policy: @config.rpcs.disable_plugin_instance_action.retry_policy
1334
+
1335
+ options.apply_defaults timeout: @config.timeout,
1336
+ metadata: @config.metadata,
1337
+ retry_policy: @config.retry_policy
1338
+
1339
+ @api_hub_plugin_stub.disable_plugin_instance_action request, options do |result, operation|
1340
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1341
+ yield result, operation if block_given?
1342
+ throw :response, result
1343
+ end
1344
+ rescue ::Gapic::Rest::Error => e
1345
+ raise ::Google::Cloud::Error.from_error(e)
1346
+ end
1347
+
1348
+ ##
1349
+ # Updates a plugin instance in the API hub.
1350
+ # The following fields in the
1351
+ # {::Google::Cloud::ApiHub::V1::PluginInstance plugin_instance} can be updated
1352
+ # currently:
1353
+ #
1354
+ # * {::Google::Cloud::ApiHub::V1::PluginInstance#display_name display_name}
1355
+ # * [schedule_cron_expression][PluginInstance.actions.schedule_cron_expression]
1356
+ #
1357
+ # The
1358
+ # {::Google::Cloud::ApiHub::V1::UpdatePluginInstanceRequest#update_mask update_mask}
1359
+ # should be used to specify the fields being updated.
1360
+ #
1361
+ # To update the
1362
+ # {::Google::Cloud::ApiHub::V1::PluginInstance#auth_config auth_config} and
1363
+ # {::Google::Cloud::ApiHub::V1::PluginInstance#additional_config additional_config}
1364
+ # of the plugin instance, use the
1365
+ # [ApplyPluginInstanceConfig][google.cloud.apihub.v1.ApiHubPlugin.ApplyPluginInstanceConfig]
1366
+ # method.
1367
+ #
1368
+ # @overload update_plugin_instance(request, options = nil)
1369
+ # Pass arguments to `update_plugin_instance` via a request object, either of type
1370
+ # {::Google::Cloud::ApiHub::V1::UpdatePluginInstanceRequest} or an equivalent Hash.
1371
+ #
1372
+ # @param request [::Google::Cloud::ApiHub::V1::UpdatePluginInstanceRequest, ::Hash]
1373
+ # A request object representing the call parameters. Required. To specify no
1374
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1375
+ # @param options [::Gapic::CallOptions, ::Hash]
1376
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
325
1377
  #
326
- # # The returned object is of type Google::Cloud::ApiHub::V1::Plugin.
1378
+ # @overload update_plugin_instance(plugin_instance: nil, update_mask: nil)
1379
+ # Pass arguments to `update_plugin_instance` via keyword arguments. Note that at
1380
+ # least one keyword argument is required. To specify no parameters, or to keep all
1381
+ # the default parameter values, pass an empty Hash as a request object (see above).
1382
+ #
1383
+ # @param plugin_instance [::Google::Cloud::ApiHub::V1::PluginInstance, ::Hash]
1384
+ # Required. The plugin instance to update.
1385
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1386
+ # Optional. The list of fields to update.
1387
+ # @yield [result, operation] Access the result along with the TransportOperation object
1388
+ # @yieldparam result [::Google::Cloud::ApiHub::V1::PluginInstance]
1389
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1390
+ #
1391
+ # @return [::Google::Cloud::ApiHub::V1::PluginInstance]
1392
+ #
1393
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1394
+ #
1395
+ # @example Basic example
1396
+ # require "google/cloud/api_hub/v1"
1397
+ #
1398
+ # # Create a client object. The client can be reused for multiple calls.
1399
+ # client = Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.new
1400
+ #
1401
+ # # Create a request. To set request fields, pass in keyword arguments.
1402
+ # request = Google::Cloud::ApiHub::V1::UpdatePluginInstanceRequest.new
1403
+ #
1404
+ # # Call the update_plugin_instance method.
1405
+ # result = client.update_plugin_instance request
1406
+ #
1407
+ # # The returned object is of type Google::Cloud::ApiHub::V1::PluginInstance.
327
1408
  # p result
328
1409
  #
329
- def enable_plugin request, options = nil
1410
+ def update_plugin_instance request, options = nil
330
1411
  raise ::ArgumentError, "request must be provided" if request.nil?
331
1412
 
332
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::EnablePluginRequest
1413
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::UpdatePluginInstanceRequest
333
1414
 
334
1415
  # Converts hash and nil to an options object
335
1416
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
336
1417
 
337
1418
  # Customize the options with defaults
338
- call_metadata = @config.rpcs.enable_plugin.metadata.to_h
1419
+ call_metadata = @config.rpcs.update_plugin_instance.metadata.to_h
339
1420
 
340
1421
  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
341
1422
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -346,15 +1427,15 @@ module Google
346
1427
  call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
347
1428
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
348
1429
 
349
- options.apply_defaults timeout: @config.rpcs.enable_plugin.timeout,
1430
+ options.apply_defaults timeout: @config.rpcs.update_plugin_instance.timeout,
350
1431
  metadata: call_metadata,
351
- retry_policy: @config.rpcs.enable_plugin.retry_policy
1432
+ retry_policy: @config.rpcs.update_plugin_instance.retry_policy
352
1433
 
353
1434
  options.apply_defaults timeout: @config.timeout,
354
1435
  metadata: @config.metadata,
355
1436
  retry_policy: @config.retry_policy
356
1437
 
357
- @api_hub_plugin_stub.enable_plugin request, options do |result, operation|
1438
+ @api_hub_plugin_stub.update_plugin_instance request, options do |result, operation|
358
1439
  yield result, operation if block_given?
359
1440
  end
360
1441
  rescue ::Gapic::Rest::Error => e
@@ -362,32 +1443,32 @@ module Google
362
1443
  end
363
1444
 
364
1445
  ##
365
- # Disables a plugin.
366
- # The `state` of the plugin after disabling is `DISABLED`
1446
+ # Deletes a plugin instance in the API hub.
367
1447
  #
368
- # @overload disable_plugin(request, options = nil)
369
- # Pass arguments to `disable_plugin` via a request object, either of type
370
- # {::Google::Cloud::ApiHub::V1::DisablePluginRequest} or an equivalent Hash.
1448
+ # @overload delete_plugin_instance(request, options = nil)
1449
+ # Pass arguments to `delete_plugin_instance` via a request object, either of type
1450
+ # {::Google::Cloud::ApiHub::V1::DeletePluginInstanceRequest} or an equivalent Hash.
371
1451
  #
372
- # @param request [::Google::Cloud::ApiHub::V1::DisablePluginRequest, ::Hash]
1452
+ # @param request [::Google::Cloud::ApiHub::V1::DeletePluginInstanceRequest, ::Hash]
373
1453
  # A request object representing the call parameters. Required. To specify no
374
1454
  # parameters, or to keep all the default parameter values, pass an empty Hash.
375
1455
  # @param options [::Gapic::CallOptions, ::Hash]
376
1456
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
377
1457
  #
378
- # @overload disable_plugin(name: nil)
379
- # Pass arguments to `disable_plugin` via keyword arguments. Note that at
1458
+ # @overload delete_plugin_instance(name: nil)
1459
+ # Pass arguments to `delete_plugin_instance` via keyword arguments. Note that at
380
1460
  # least one keyword argument is required. To specify no parameters, or to keep all
381
1461
  # the default parameter values, pass an empty Hash as a request object (see above).
382
1462
  #
383
1463
  # @param name [::String]
384
- # Required. The name of the plugin to disable.
385
- # Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
1464
+ # Required. The name of the plugin instance to delete.
1465
+ # Format:
1466
+ # `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`.
386
1467
  # @yield [result, operation] Access the result along with the TransportOperation object
387
- # @yieldparam result [::Google::Cloud::ApiHub::V1::Plugin]
1468
+ # @yieldparam result [::Gapic::Operation]
388
1469
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
389
1470
  #
390
- # @return [::Google::Cloud::ApiHub::V1::Plugin]
1471
+ # @return [::Gapic::Operation]
391
1472
  #
392
1473
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
393
1474
  #
@@ -398,24 +1479,31 @@ module Google
398
1479
  # client = Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.new
399
1480
  #
400
1481
  # # Create a request. To set request fields, pass in keyword arguments.
401
- # request = Google::Cloud::ApiHub::V1::DisablePluginRequest.new
402
- #
403
- # # Call the disable_plugin method.
404
- # result = client.disable_plugin request
405
- #
406
- # # The returned object is of type Google::Cloud::ApiHub::V1::Plugin.
407
- # p result
1482
+ # request = Google::Cloud::ApiHub::V1::DeletePluginInstanceRequest.new
1483
+ #
1484
+ # # Call the delete_plugin_instance method.
1485
+ # result = client.delete_plugin_instance request
1486
+ #
1487
+ # # The returned object is of type Gapic::Operation. You can use it to
1488
+ # # check the status of an operation, cancel it, or wait for results.
1489
+ # # Here is how to wait for a response.
1490
+ # result.wait_until_done! timeout: 60
1491
+ # if result.response?
1492
+ # p result.response
1493
+ # else
1494
+ # puts "No response received."
1495
+ # end
408
1496
  #
409
- def disable_plugin request, options = nil
1497
+ def delete_plugin_instance request, options = nil
410
1498
  raise ::ArgumentError, "request must be provided" if request.nil?
411
1499
 
412
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::DisablePluginRequest
1500
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::DeletePluginInstanceRequest
413
1501
 
414
1502
  # Converts hash and nil to an options object
415
1503
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
416
1504
 
417
1505
  # Customize the options with defaults
418
- call_metadata = @config.rpcs.disable_plugin.metadata.to_h
1506
+ call_metadata = @config.rpcs.delete_plugin_instance.metadata.to_h
419
1507
 
420
1508
  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
421
1509
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -426,16 +1514,18 @@ module Google
426
1514
  call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
427
1515
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
428
1516
 
429
- options.apply_defaults timeout: @config.rpcs.disable_plugin.timeout,
1517
+ options.apply_defaults timeout: @config.rpcs.delete_plugin_instance.timeout,
430
1518
  metadata: call_metadata,
431
- retry_policy: @config.rpcs.disable_plugin.retry_policy
1519
+ retry_policy: @config.rpcs.delete_plugin_instance.retry_policy
432
1520
 
433
1521
  options.apply_defaults timeout: @config.timeout,
434
1522
  metadata: @config.metadata,
435
1523
  retry_policy: @config.retry_policy
436
1524
 
437
- @api_hub_plugin_stub.disable_plugin request, options do |result, operation|
1525
+ @api_hub_plugin_stub.delete_plugin_instance request, options do |result, operation|
1526
+ result = ::Gapic::Operation.new result, @operations_client, options: options
438
1527
  yield result, operation if block_given?
1528
+ throw :response, result
439
1529
  end
440
1530
  rescue ::Gapic::Rest::Error => e
441
1531
  raise ::Google::Cloud::Error.from_error(e)
@@ -609,6 +1699,61 @@ module Google
609
1699
  # @return [::Gapic::Config::Method]
610
1700
  #
611
1701
  attr_reader :disable_plugin
1702
+ ##
1703
+ # RPC-specific configuration for `create_plugin`
1704
+ # @return [::Gapic::Config::Method]
1705
+ #
1706
+ attr_reader :create_plugin
1707
+ ##
1708
+ # RPC-specific configuration for `list_plugins`
1709
+ # @return [::Gapic::Config::Method]
1710
+ #
1711
+ attr_reader :list_plugins
1712
+ ##
1713
+ # RPC-specific configuration for `delete_plugin`
1714
+ # @return [::Gapic::Config::Method]
1715
+ #
1716
+ attr_reader :delete_plugin
1717
+ ##
1718
+ # RPC-specific configuration for `create_plugin_instance`
1719
+ # @return [::Gapic::Config::Method]
1720
+ #
1721
+ attr_reader :create_plugin_instance
1722
+ ##
1723
+ # RPC-specific configuration for `execute_plugin_instance_action`
1724
+ # @return [::Gapic::Config::Method]
1725
+ #
1726
+ attr_reader :execute_plugin_instance_action
1727
+ ##
1728
+ # RPC-specific configuration for `get_plugin_instance`
1729
+ # @return [::Gapic::Config::Method]
1730
+ #
1731
+ attr_reader :get_plugin_instance
1732
+ ##
1733
+ # RPC-specific configuration for `list_plugin_instances`
1734
+ # @return [::Gapic::Config::Method]
1735
+ #
1736
+ attr_reader :list_plugin_instances
1737
+ ##
1738
+ # RPC-specific configuration for `enable_plugin_instance_action`
1739
+ # @return [::Gapic::Config::Method]
1740
+ #
1741
+ attr_reader :enable_plugin_instance_action
1742
+ ##
1743
+ # RPC-specific configuration for `disable_plugin_instance_action`
1744
+ # @return [::Gapic::Config::Method]
1745
+ #
1746
+ attr_reader :disable_plugin_instance_action
1747
+ ##
1748
+ # RPC-specific configuration for `update_plugin_instance`
1749
+ # @return [::Gapic::Config::Method]
1750
+ #
1751
+ attr_reader :update_plugin_instance
1752
+ ##
1753
+ # RPC-specific configuration for `delete_plugin_instance`
1754
+ # @return [::Gapic::Config::Method]
1755
+ #
1756
+ attr_reader :delete_plugin_instance
612
1757
 
613
1758
  # @private
614
1759
  def initialize parent_rpcs = nil
@@ -618,6 +1763,28 @@ module Google
618
1763
  @enable_plugin = ::Gapic::Config::Method.new enable_plugin_config
619
1764
  disable_plugin_config = parent_rpcs.disable_plugin if parent_rpcs.respond_to? :disable_plugin
620
1765
  @disable_plugin = ::Gapic::Config::Method.new disable_plugin_config
1766
+ create_plugin_config = parent_rpcs.create_plugin if parent_rpcs.respond_to? :create_plugin
1767
+ @create_plugin = ::Gapic::Config::Method.new create_plugin_config
1768
+ list_plugins_config = parent_rpcs.list_plugins if parent_rpcs.respond_to? :list_plugins
1769
+ @list_plugins = ::Gapic::Config::Method.new list_plugins_config
1770
+ delete_plugin_config = parent_rpcs.delete_plugin if parent_rpcs.respond_to? :delete_plugin
1771
+ @delete_plugin = ::Gapic::Config::Method.new delete_plugin_config
1772
+ create_plugin_instance_config = parent_rpcs.create_plugin_instance if parent_rpcs.respond_to? :create_plugin_instance
1773
+ @create_plugin_instance = ::Gapic::Config::Method.new create_plugin_instance_config
1774
+ execute_plugin_instance_action_config = parent_rpcs.execute_plugin_instance_action if parent_rpcs.respond_to? :execute_plugin_instance_action
1775
+ @execute_plugin_instance_action = ::Gapic::Config::Method.new execute_plugin_instance_action_config
1776
+ get_plugin_instance_config = parent_rpcs.get_plugin_instance if parent_rpcs.respond_to? :get_plugin_instance
1777
+ @get_plugin_instance = ::Gapic::Config::Method.new get_plugin_instance_config
1778
+ list_plugin_instances_config = parent_rpcs.list_plugin_instances if parent_rpcs.respond_to? :list_plugin_instances
1779
+ @list_plugin_instances = ::Gapic::Config::Method.new list_plugin_instances_config
1780
+ enable_plugin_instance_action_config = parent_rpcs.enable_plugin_instance_action if parent_rpcs.respond_to? :enable_plugin_instance_action
1781
+ @enable_plugin_instance_action = ::Gapic::Config::Method.new enable_plugin_instance_action_config
1782
+ disable_plugin_instance_action_config = parent_rpcs.disable_plugin_instance_action if parent_rpcs.respond_to? :disable_plugin_instance_action
1783
+ @disable_plugin_instance_action = ::Gapic::Config::Method.new disable_plugin_instance_action_config
1784
+ update_plugin_instance_config = parent_rpcs.update_plugin_instance if parent_rpcs.respond_to? :update_plugin_instance
1785
+ @update_plugin_instance = ::Gapic::Config::Method.new update_plugin_instance_config
1786
+ delete_plugin_instance_config = parent_rpcs.delete_plugin_instance if parent_rpcs.respond_to? :delete_plugin_instance
1787
+ @delete_plugin_instance = ::Gapic::Config::Method.new delete_plugin_instance_config
621
1788
 
622
1789
  yield self if block_given?
623
1790
  end