google-cloud-api_hub-v1 0.a → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/api_hub/v1/api_hub/client.rb +4514 -0
  6. data/lib/google/cloud/api_hub/v1/api_hub/credentials.rb +47 -0
  7. data/lib/google/cloud/api_hub/v1/api_hub/paths.rb +216 -0
  8. data/lib/google/cloud/api_hub/v1/api_hub/rest/client.rb +4251 -0
  9. data/lib/google/cloud/api_hub/v1/api_hub/rest/service_stub.rb +2147 -0
  10. data/lib/google/cloud/api_hub/v1/api_hub/rest.rb +53 -0
  11. data/lib/google/cloud/api_hub/v1/api_hub.rb +55 -0
  12. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/client.rb +906 -0
  13. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/credentials.rb +47 -0
  14. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/paths.rb +88 -0
  15. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/rest/client.rb +853 -0
  16. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/rest/service_stub.rb +366 -0
  17. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/rest.rb +54 -0
  18. data/lib/google/cloud/api_hub/v1/api_hub_dependencies.rb +56 -0
  19. data/lib/google/cloud/api_hub/v1/api_hub_plugin/client.rb +640 -0
  20. data/lib/google/cloud/api_hub/v1/api_hub_plugin/credentials.rb +47 -0
  21. data/lib/google/cloud/api_hub/v1/api_hub_plugin/paths.rb +52 -0
  22. data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb +601 -0
  23. data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest/service_stub.rb +248 -0
  24. data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest.rb +53 -0
  25. data/lib/google/cloud/api_hub/v1/api_hub_plugin.rb +55 -0
  26. data/lib/google/cloud/api_hub/v1/bindings_override.rb +102 -0
  27. data/lib/google/cloud/api_hub/v1/host_project_registration_service/client.rb +689 -0
  28. data/lib/google/cloud/api_hub/v1/host_project_registration_service/credentials.rb +47 -0
  29. data/lib/google/cloud/api_hub/v1/host_project_registration_service/paths.rb +83 -0
  30. data/lib/google/cloud/api_hub/v1/host_project_registration_service/rest/client.rb +650 -0
  31. data/lib/google/cloud/api_hub/v1/host_project_registration_service/rest/service_stub.rb +247 -0
  32. data/lib/google/cloud/api_hub/v1/host_project_registration_service/rest.rb +53 -0
  33. data/lib/google/cloud/api_hub/v1/host_project_registration_service.rb +55 -0
  34. data/lib/google/cloud/api_hub/v1/linting_service/client.rb +744 -0
  35. data/lib/google/cloud/api_hub/v1/linting_service/credentials.rb +47 -0
  36. data/lib/google/cloud/api_hub/v1/linting_service/paths.rb +75 -0
  37. data/lib/google/cloud/api_hub/v1/linting_service/rest/client.rb +698 -0
  38. data/lib/google/cloud/api_hub/v1/linting_service/rest/service_stub.rb +307 -0
  39. data/lib/google/cloud/api_hub/v1/linting_service/rest.rb +53 -0
  40. data/lib/google/cloud/api_hub/v1/linting_service.rb +55 -0
  41. data/lib/google/cloud/api_hub/v1/provisioning/client.rb +676 -0
  42. data/lib/google/cloud/api_hub/v1/provisioning/credentials.rb +47 -0
  43. data/lib/google/cloud/api_hub/v1/provisioning/operations.rb +809 -0
  44. data/lib/google/cloud/api_hub/v1/provisioning/paths.rb +69 -0
  45. data/lib/google/cloud/api_hub/v1/provisioning/rest/client.rb +637 -0
  46. data/lib/google/cloud/api_hub/v1/provisioning/rest/operations.rb +902 -0
  47. data/lib/google/cloud/api_hub/v1/provisioning/rest/service_stub.rb +247 -0
  48. data/lib/google/cloud/api_hub/v1/provisioning/rest.rb +54 -0
  49. data/lib/google/cloud/api_hub/v1/provisioning.rb +56 -0
  50. data/lib/google/cloud/api_hub/v1/rest.rb +44 -0
  51. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/client.rb +885 -0
  52. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/credentials.rb +47 -0
  53. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/paths.rb +83 -0
  54. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/rest/client.rb +832 -0
  55. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/rest/service_stub.rb +365 -0
  56. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/rest.rb +53 -0
  57. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service.rb +55 -0
  58. data/lib/google/cloud/api_hub/v1/version.rb +7 -2
  59. data/lib/google/cloud/api_hub/v1.rb +51 -0
  60. data/lib/google/cloud/apihub/v1/apihub_service_pb.rb +102 -0
  61. data/lib/google/cloud/apihub/v1/apihub_service_services_pb.rb +288 -0
  62. data/lib/google/cloud/apihub/v1/common_fields_pb.rb +92 -0
  63. data/lib/google/cloud/apihub/v1/host_project_registration_service_pb.rb +53 -0
  64. data/lib/google/cloud/apihub/v1/host_project_registration_service_services_pb.rb +53 -0
  65. data/lib/google/cloud/apihub/v1/linting_service_pb.rb +56 -0
  66. data/lib/google/cloud/apihub/v1/linting_service_services_pb.rb +53 -0
  67. data/lib/google/cloud/apihub/v1/plugin_service_pb.rb +53 -0
  68. data/lib/google/cloud/apihub/v1/plugin_service_services_pb.rb +51 -0
  69. data/lib/google/cloud/apihub/v1/provisioning_service_pb.rb +53 -0
  70. data/lib/google/cloud/apihub/v1/provisioning_service_services_pb.rb +50 -0
  71. data/lib/google/cloud/apihub/v1/runtime_project_attachment_service_pb.rb +57 -0
  72. data/lib/google/cloud/apihub/v1/runtime_project_attachment_service_services_pb.rb +55 -0
  73. data/lib/google-cloud-api_hub-v1.rb +21 -0
  74. data/proto_docs/README.md +4 -0
  75. data/proto_docs/google/api/client.rb +420 -0
  76. data/proto_docs/google/api/field_behavior.rb +85 -0
  77. data/proto_docs/google/api/launch_stage.rb +71 -0
  78. data/proto_docs/google/api/resource.rb +227 -0
  79. data/proto_docs/google/cloud/apihub/v1/apihub_service.rb +1317 -0
  80. data/proto_docs/google/cloud/apihub/v1/common_fields.rb +1296 -0
  81. data/proto_docs/google/cloud/apihub/v1/host_project_registration_service.rb +146 -0
  82. data/proto_docs/google/cloud/apihub/v1/linting_service.rb +103 -0
  83. data/proto_docs/google/cloud/apihub/v1/plugin_service.rb +104 -0
  84. data/proto_docs/google/cloud/apihub/v1/provisioning_service.rb +87 -0
  85. data/proto_docs/google/cloud/apihub/v1/runtime_project_attachment_service.rb +182 -0
  86. data/proto_docs/google/longrunning/operations.rb +164 -0
  87. data/proto_docs/google/protobuf/any.rb +145 -0
  88. data/proto_docs/google/protobuf/duration.rb +98 -0
  89. data/proto_docs/google/protobuf/empty.rb +34 -0
  90. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  91. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  92. data/proto_docs/google/rpc/status.rb +48 -0
  93. metadata +155 -10
@@ -0,0 +1,640 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/apihub/v1/plugin_service_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module ApiHub
26
+ module V1
27
+ module ApiHubPlugin
28
+ ##
29
+ # Client for the ApiHubPlugin service.
30
+ #
31
+ # This service is used for managing plugins inside the API Hub.
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "apihub.$UNIVERSE_DOMAIN$"
39
+
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :api_hub_plugin_stub
44
+
45
+ ##
46
+ # Configure the ApiHubPlugin Client class.
47
+ #
48
+ # See {::Google::Cloud::ApiHub::V1::ApiHubPlugin::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all ApiHubPlugin clients
54
+ # ::Google::Cloud::ApiHub::V1::ApiHubPlugin::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Cloud", "ApiHub", "V1"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config.rpcs.get_plugin.timeout = 60.0
75
+ default_config.rpcs.get_plugin.retry_policy = {
76
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
77
+ }
78
+
79
+ default_config.rpcs.enable_plugin.timeout = 60.0
80
+
81
+ default_config.rpcs.disable_plugin.timeout = 60.0
82
+
83
+ default_config
84
+ end
85
+ yield @configure if block_given?
86
+ @configure
87
+ end
88
+
89
+ ##
90
+ # Configure the ApiHubPlugin Client instance.
91
+ #
92
+ # The configuration is set to the derived mode, meaning that values can be changed,
93
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
94
+ # should be made on {Client.configure}.
95
+ #
96
+ # See {::Google::Cloud::ApiHub::V1::ApiHubPlugin::Client::Configuration}
97
+ # for a description of the configuration fields.
98
+ #
99
+ # @yield [config] Configure the Client client.
100
+ # @yieldparam config [Client::Configuration]
101
+ #
102
+ # @return [Client::Configuration]
103
+ #
104
+ def configure
105
+ yield @config if block_given?
106
+ @config
107
+ end
108
+
109
+ ##
110
+ # The effective universe domain
111
+ #
112
+ # @return [String]
113
+ #
114
+ def universe_domain
115
+ @api_hub_plugin_stub.universe_domain
116
+ end
117
+
118
+ ##
119
+ # Create a new ApiHubPlugin client object.
120
+ #
121
+ # @example
122
+ #
123
+ # # Create a client using the default configuration
124
+ # client = ::Google::Cloud::ApiHub::V1::ApiHubPlugin::Client.new
125
+ #
126
+ # # Create a client using a custom configuration
127
+ # client = ::Google::Cloud::ApiHub::V1::ApiHubPlugin::Client.new do |config|
128
+ # config.timeout = 10.0
129
+ # end
130
+ #
131
+ # @yield [config] Configure the ApiHubPlugin client.
132
+ # @yieldparam config [Client::Configuration]
133
+ #
134
+ def initialize
135
+ # These require statements are intentionally placed here to initialize
136
+ # the gRPC module only when it's required.
137
+ # See https://github.com/googleapis/toolkit/issues/446
138
+ require "gapic/grpc"
139
+ require "google/cloud/apihub/v1/plugin_service_services_pb"
140
+
141
+ # Create the configuration object
142
+ @config = Configuration.new Client.configure
143
+
144
+ # Yield the configuration if needed
145
+ yield @config if block_given?
146
+
147
+ # Create credentials
148
+ credentials = @config.credentials
149
+ # Use self-signed JWT if the endpoint is unchanged from default,
150
+ # but only if the default endpoint does not have a region prefix.
151
+ enable_self_signed_jwt = @config.endpoint.nil? ||
152
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
153
+ !@config.endpoint.split(".").first.include?("-"))
154
+ credentials ||= Credentials.default scope: @config.scope,
155
+ enable_self_signed_jwt: enable_self_signed_jwt
156
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
157
+ credentials = Credentials.new credentials, scope: @config.scope
158
+ end
159
+ @quota_project_id = @config.quota_project
160
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
161
+
162
+ @api_hub_plugin_stub = ::Gapic::ServiceStub.new(
163
+ ::Google::Cloud::ApiHub::V1::ApiHubPlugin::Stub,
164
+ credentials: credentials,
165
+ endpoint: @config.endpoint,
166
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
167
+ universe_domain: @config.universe_domain,
168
+ channel_args: @config.channel_args,
169
+ interceptors: @config.interceptors,
170
+ channel_pool_config: @config.channel_pool
171
+ )
172
+
173
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
174
+ config.credentials = credentials
175
+ config.quota_project = @quota_project_id
176
+ config.endpoint = @api_hub_plugin_stub.endpoint
177
+ config.universe_domain = @api_hub_plugin_stub.universe_domain
178
+ end
179
+ end
180
+
181
+ ##
182
+ # Get the associated client for mix-in of the Locations.
183
+ #
184
+ # @return [Google::Cloud::Location::Locations::Client]
185
+ #
186
+ attr_reader :location_client
187
+
188
+ # Service calls
189
+
190
+ ##
191
+ # Get details about an API Hub plugin.
192
+ #
193
+ # @overload get_plugin(request, options = nil)
194
+ # Pass arguments to `get_plugin` via a request object, either of type
195
+ # {::Google::Cloud::ApiHub::V1::GetPluginRequest} or an equivalent Hash.
196
+ #
197
+ # @param request [::Google::Cloud::ApiHub::V1::GetPluginRequest, ::Hash]
198
+ # A request object representing the call parameters. Required. To specify no
199
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
200
+ # @param options [::Gapic::CallOptions, ::Hash]
201
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
202
+ #
203
+ # @overload get_plugin(name: nil)
204
+ # Pass arguments to `get_plugin` via keyword arguments. Note that at
205
+ # least one keyword argument is required. To specify no parameters, or to keep all
206
+ # the default parameter values, pass an empty Hash as a request object (see above).
207
+ #
208
+ # @param name [::String]
209
+ # Required. The name of the plugin to retrieve.
210
+ # Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
211
+ #
212
+ # @yield [response, operation] Access the result along with the RPC operation
213
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::Plugin]
214
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
215
+ #
216
+ # @return [::Google::Cloud::ApiHub::V1::Plugin]
217
+ #
218
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
219
+ #
220
+ # @example Basic example
221
+ # require "google/cloud/api_hub/v1"
222
+ #
223
+ # # Create a client object. The client can be reused for multiple calls.
224
+ # client = Google::Cloud::ApiHub::V1::ApiHubPlugin::Client.new
225
+ #
226
+ # # Create a request. To set request fields, pass in keyword arguments.
227
+ # request = Google::Cloud::ApiHub::V1::GetPluginRequest.new
228
+ #
229
+ # # Call the get_plugin method.
230
+ # result = client.get_plugin request
231
+ #
232
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Plugin.
233
+ # p result
234
+ #
235
+ def get_plugin request, options = nil
236
+ raise ::ArgumentError, "request must be provided" if request.nil?
237
+
238
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetPluginRequest
239
+
240
+ # Converts hash and nil to an options object
241
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
242
+
243
+ # Customize the options with defaults
244
+ metadata = @config.rpcs.get_plugin.metadata.to_h
245
+
246
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
247
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
248
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
249
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
250
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
251
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
252
+
253
+ header_params = {}
254
+ if request.name
255
+ header_params["name"] = request.name
256
+ end
257
+
258
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
259
+ metadata[:"x-goog-request-params"] ||= request_params_header
260
+
261
+ options.apply_defaults timeout: @config.rpcs.get_plugin.timeout,
262
+ metadata: metadata,
263
+ retry_policy: @config.rpcs.get_plugin.retry_policy
264
+
265
+ options.apply_defaults timeout: @config.timeout,
266
+ metadata: @config.metadata,
267
+ retry_policy: @config.retry_policy
268
+
269
+ @api_hub_plugin_stub.call_rpc :get_plugin, request, options: options do |response, operation|
270
+ yield response, operation if block_given?
271
+ return response
272
+ end
273
+ rescue ::GRPC::BadStatus => e
274
+ raise ::Google::Cloud::Error.from_error(e)
275
+ end
276
+
277
+ ##
278
+ # Enables a plugin.
279
+ # The `state` of the plugin after enabling is `ENABLED`
280
+ #
281
+ # @overload enable_plugin(request, options = nil)
282
+ # Pass arguments to `enable_plugin` via a request object, either of type
283
+ # {::Google::Cloud::ApiHub::V1::EnablePluginRequest} or an equivalent Hash.
284
+ #
285
+ # @param request [::Google::Cloud::ApiHub::V1::EnablePluginRequest, ::Hash]
286
+ # A request object representing the call parameters. Required. To specify no
287
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
288
+ # @param options [::Gapic::CallOptions, ::Hash]
289
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
290
+ #
291
+ # @overload enable_plugin(name: nil)
292
+ # Pass arguments to `enable_plugin` via keyword arguments. Note that at
293
+ # least one keyword argument is required. To specify no parameters, or to keep all
294
+ # the default parameter values, pass an empty Hash as a request object (see above).
295
+ #
296
+ # @param name [::String]
297
+ # Required. The name of the plugin to enable.
298
+ # Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
299
+ #
300
+ # @yield [response, operation] Access the result along with the RPC operation
301
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::Plugin]
302
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
303
+ #
304
+ # @return [::Google::Cloud::ApiHub::V1::Plugin]
305
+ #
306
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
307
+ #
308
+ # @example Basic example
309
+ # require "google/cloud/api_hub/v1"
310
+ #
311
+ # # Create a client object. The client can be reused for multiple calls.
312
+ # client = Google::Cloud::ApiHub::V1::ApiHubPlugin::Client.new
313
+ #
314
+ # # Create a request. To set request fields, pass in keyword arguments.
315
+ # request = Google::Cloud::ApiHub::V1::EnablePluginRequest.new
316
+ #
317
+ # # Call the enable_plugin method.
318
+ # result = client.enable_plugin request
319
+ #
320
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Plugin.
321
+ # p result
322
+ #
323
+ def enable_plugin request, options = nil
324
+ raise ::ArgumentError, "request must be provided" if request.nil?
325
+
326
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::EnablePluginRequest
327
+
328
+ # Converts hash and nil to an options object
329
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
330
+
331
+ # Customize the options with defaults
332
+ metadata = @config.rpcs.enable_plugin.metadata.to_h
333
+
334
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
335
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
336
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
337
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
338
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
339
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
340
+
341
+ header_params = {}
342
+ if request.name
343
+ header_params["name"] = request.name
344
+ end
345
+
346
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
347
+ metadata[:"x-goog-request-params"] ||= request_params_header
348
+
349
+ options.apply_defaults timeout: @config.rpcs.enable_plugin.timeout,
350
+ metadata: metadata,
351
+ retry_policy: @config.rpcs.enable_plugin.retry_policy
352
+
353
+ options.apply_defaults timeout: @config.timeout,
354
+ metadata: @config.metadata,
355
+ retry_policy: @config.retry_policy
356
+
357
+ @api_hub_plugin_stub.call_rpc :enable_plugin, request, options: options do |response, operation|
358
+ yield response, operation if block_given?
359
+ return response
360
+ end
361
+ rescue ::GRPC::BadStatus => e
362
+ raise ::Google::Cloud::Error.from_error(e)
363
+ end
364
+
365
+ ##
366
+ # Disables a plugin.
367
+ # The `state` of the plugin after disabling is `DISABLED`
368
+ #
369
+ # @overload disable_plugin(request, options = nil)
370
+ # Pass arguments to `disable_plugin` via a request object, either of type
371
+ # {::Google::Cloud::ApiHub::V1::DisablePluginRequest} or an equivalent Hash.
372
+ #
373
+ # @param request [::Google::Cloud::ApiHub::V1::DisablePluginRequest, ::Hash]
374
+ # A request object representing the call parameters. Required. To specify no
375
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
376
+ # @param options [::Gapic::CallOptions, ::Hash]
377
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
378
+ #
379
+ # @overload disable_plugin(name: nil)
380
+ # Pass arguments to `disable_plugin` via keyword arguments. Note that at
381
+ # least one keyword argument is required. To specify no parameters, or to keep all
382
+ # the default parameter values, pass an empty Hash as a request object (see above).
383
+ #
384
+ # @param name [::String]
385
+ # Required. The name of the plugin to disable.
386
+ # Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
387
+ #
388
+ # @yield [response, operation] Access the result along with the RPC operation
389
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::Plugin]
390
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
391
+ #
392
+ # @return [::Google::Cloud::ApiHub::V1::Plugin]
393
+ #
394
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
395
+ #
396
+ # @example Basic example
397
+ # require "google/cloud/api_hub/v1"
398
+ #
399
+ # # Create a client object. The client can be reused for multiple calls.
400
+ # client = Google::Cloud::ApiHub::V1::ApiHubPlugin::Client.new
401
+ #
402
+ # # Create a request. To set request fields, pass in keyword arguments.
403
+ # request = Google::Cloud::ApiHub::V1::DisablePluginRequest.new
404
+ #
405
+ # # Call the disable_plugin method.
406
+ # result = client.disable_plugin request
407
+ #
408
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Plugin.
409
+ # p result
410
+ #
411
+ def disable_plugin request, options = nil
412
+ raise ::ArgumentError, "request must be provided" if request.nil?
413
+
414
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::DisablePluginRequest
415
+
416
+ # Converts hash and nil to an options object
417
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
418
+
419
+ # Customize the options with defaults
420
+ metadata = @config.rpcs.disable_plugin.metadata.to_h
421
+
422
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
423
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
424
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
425
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
426
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
427
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
428
+
429
+ header_params = {}
430
+ if request.name
431
+ header_params["name"] = request.name
432
+ end
433
+
434
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
435
+ metadata[:"x-goog-request-params"] ||= request_params_header
436
+
437
+ options.apply_defaults timeout: @config.rpcs.disable_plugin.timeout,
438
+ metadata: metadata,
439
+ retry_policy: @config.rpcs.disable_plugin.retry_policy
440
+
441
+ options.apply_defaults timeout: @config.timeout,
442
+ metadata: @config.metadata,
443
+ retry_policy: @config.retry_policy
444
+
445
+ @api_hub_plugin_stub.call_rpc :disable_plugin, request, options: options do |response, operation|
446
+ yield response, operation if block_given?
447
+ return response
448
+ end
449
+ rescue ::GRPC::BadStatus => e
450
+ raise ::Google::Cloud::Error.from_error(e)
451
+ end
452
+
453
+ ##
454
+ # Configuration class for the ApiHubPlugin API.
455
+ #
456
+ # This class represents the configuration for ApiHubPlugin,
457
+ # providing control over timeouts, retry behavior, logging, transport
458
+ # parameters, and other low-level controls. Certain parameters can also be
459
+ # applied individually to specific RPCs. See
460
+ # {::Google::Cloud::ApiHub::V1::ApiHubPlugin::Client::Configuration::Rpcs}
461
+ # for a list of RPCs that can be configured independently.
462
+ #
463
+ # Configuration can be applied globally to all clients, or to a single client
464
+ # on construction.
465
+ #
466
+ # @example
467
+ #
468
+ # # Modify the global config, setting the timeout for
469
+ # # get_plugin to 20 seconds,
470
+ # # and all remaining timeouts to 10 seconds.
471
+ # ::Google::Cloud::ApiHub::V1::ApiHubPlugin::Client.configure do |config|
472
+ # config.timeout = 10.0
473
+ # config.rpcs.get_plugin.timeout = 20.0
474
+ # end
475
+ #
476
+ # # Apply the above configuration only to a new client.
477
+ # client = ::Google::Cloud::ApiHub::V1::ApiHubPlugin::Client.new do |config|
478
+ # config.timeout = 10.0
479
+ # config.rpcs.get_plugin.timeout = 20.0
480
+ # end
481
+ #
482
+ # @!attribute [rw] endpoint
483
+ # A custom service endpoint, as a hostname or hostname:port. The default is
484
+ # nil, indicating to use the default endpoint in the current universe domain.
485
+ # @return [::String,nil]
486
+ # @!attribute [rw] credentials
487
+ # Credentials to send with calls. You may provide any of the following types:
488
+ # * (`String`) The path to a service account key file in JSON format
489
+ # * (`Hash`) A service account key as a Hash
490
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
491
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
492
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
493
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
494
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
495
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
496
+ # * (`nil`) indicating no credentials
497
+ # @return [::Object]
498
+ # @!attribute [rw] scope
499
+ # The OAuth scopes
500
+ # @return [::Array<::String>]
501
+ # @!attribute [rw] lib_name
502
+ # The library name as recorded in instrumentation and logging
503
+ # @return [::String]
504
+ # @!attribute [rw] lib_version
505
+ # The library version as recorded in instrumentation and logging
506
+ # @return [::String]
507
+ # @!attribute [rw] channel_args
508
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
509
+ # `GRPC::Core::Channel` object is provided as the credential.
510
+ # @return [::Hash]
511
+ # @!attribute [rw] interceptors
512
+ # An array of interceptors that are run before calls are executed.
513
+ # @return [::Array<::GRPC::ClientInterceptor>]
514
+ # @!attribute [rw] timeout
515
+ # The call timeout in seconds.
516
+ # @return [::Numeric]
517
+ # @!attribute [rw] metadata
518
+ # Additional gRPC headers to be sent with the call.
519
+ # @return [::Hash{::Symbol=>::String}]
520
+ # @!attribute [rw] retry_policy
521
+ # The retry policy. The value is a hash with the following keys:
522
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
523
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
524
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
525
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
526
+ # trigger a retry.
527
+ # @return [::Hash]
528
+ # @!attribute [rw] quota_project
529
+ # A separate project against which to charge quota.
530
+ # @return [::String]
531
+ # @!attribute [rw] universe_domain
532
+ # The universe domain within which to make requests. This determines the
533
+ # default endpoint URL. The default value of nil uses the environment
534
+ # universe (usually the default "googleapis.com" universe).
535
+ # @return [::String,nil]
536
+ #
537
+ class Configuration
538
+ extend ::Gapic::Config
539
+
540
+ # @private
541
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
542
+ DEFAULT_ENDPOINT = "apihub.googleapis.com"
543
+
544
+ config_attr :endpoint, nil, ::String, nil
545
+ config_attr :credentials, nil do |value|
546
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
547
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
548
+ allowed.any? { |klass| klass === value }
549
+ end
550
+ config_attr :scope, nil, ::String, ::Array, nil
551
+ config_attr :lib_name, nil, ::String, nil
552
+ config_attr :lib_version, nil, ::String, nil
553
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
554
+ config_attr :interceptors, nil, ::Array, nil
555
+ config_attr :timeout, nil, ::Numeric, nil
556
+ config_attr :metadata, nil, ::Hash, nil
557
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
558
+ config_attr :quota_project, nil, ::String, nil
559
+ config_attr :universe_domain, nil, ::String, nil
560
+
561
+ # @private
562
+ def initialize parent_config = nil
563
+ @parent_config = parent_config unless parent_config.nil?
564
+
565
+ yield self if block_given?
566
+ end
567
+
568
+ ##
569
+ # Configurations for individual RPCs
570
+ # @return [Rpcs]
571
+ #
572
+ def rpcs
573
+ @rpcs ||= begin
574
+ parent_rpcs = nil
575
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
576
+ Rpcs.new parent_rpcs
577
+ end
578
+ end
579
+
580
+ ##
581
+ # Configuration for the channel pool
582
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
583
+ #
584
+ def channel_pool
585
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
586
+ end
587
+
588
+ ##
589
+ # Configuration RPC class for the ApiHubPlugin API.
590
+ #
591
+ # Includes fields providing the configuration for each RPC in this service.
592
+ # Each configuration object is of type `Gapic::Config::Method` and includes
593
+ # the following configuration fields:
594
+ #
595
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
596
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
597
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
598
+ # include the following keys:
599
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
600
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
601
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
602
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
603
+ # trigger a retry.
604
+ #
605
+ class Rpcs
606
+ ##
607
+ # RPC-specific configuration for `get_plugin`
608
+ # @return [::Gapic::Config::Method]
609
+ #
610
+ attr_reader :get_plugin
611
+ ##
612
+ # RPC-specific configuration for `enable_plugin`
613
+ # @return [::Gapic::Config::Method]
614
+ #
615
+ attr_reader :enable_plugin
616
+ ##
617
+ # RPC-specific configuration for `disable_plugin`
618
+ # @return [::Gapic::Config::Method]
619
+ #
620
+ attr_reader :disable_plugin
621
+
622
+ # @private
623
+ def initialize parent_rpcs = nil
624
+ get_plugin_config = parent_rpcs.get_plugin if parent_rpcs.respond_to? :get_plugin
625
+ @get_plugin = ::Gapic::Config::Method.new get_plugin_config
626
+ enable_plugin_config = parent_rpcs.enable_plugin if parent_rpcs.respond_to? :enable_plugin
627
+ @enable_plugin = ::Gapic::Config::Method.new enable_plugin_config
628
+ disable_plugin_config = parent_rpcs.disable_plugin if parent_rpcs.respond_to? :disable_plugin
629
+ @disable_plugin = ::Gapic::Config::Method.new disable_plugin_config
630
+
631
+ yield self if block_given?
632
+ end
633
+ end
634
+ end
635
+ end
636
+ end
637
+ end
638
+ end
639
+ end
640
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module ApiHub
24
+ module V1
25
+ module ApiHubPlugin
26
+ # Credentials for the ApiHubPlugin API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform"
30
+ ]
31
+ self.env_vars = [
32
+ "GOOGLE_CLOUD_CREDENTIALS",
33
+ "GOOGLE_CLOUD_KEYFILE",
34
+ "GCLOUD_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
36
+ "GOOGLE_CLOUD_KEYFILE_JSON",
37
+ "GCLOUD_KEYFILE_JSON"
38
+ ]
39
+ self.paths = [
40
+ "~/.config/google_cloud/application_default_credentials.json"
41
+ ]
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end