google-cloud-api_hub-v1 0.4.1 → 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 +40 -23
@@ -0,0 +1,750 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 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/discovery_service_pb"
21
+ require "google/cloud/api_hub/v1/api_hub_discovery/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module ApiHub
27
+ module V1
28
+ module ApiHubDiscovery
29
+ module Rest
30
+ ##
31
+ # REST client for the ApiHubDiscovery service.
32
+ #
33
+ # This service exposes methods used to manage DiscoveredApiObservations
34
+ # and DiscoveredApiOperations.
35
+ #
36
+ class Client
37
+ # @private
38
+ API_VERSION = ""
39
+
40
+ # @private
41
+ DEFAULT_ENDPOINT_TEMPLATE = "apihub.$UNIVERSE_DOMAIN$"
42
+
43
+ include Paths
44
+
45
+ # @private
46
+ attr_reader :api_hub_discovery_stub
47
+
48
+ ##
49
+ # Configure the ApiHubDiscovery Client class.
50
+ #
51
+ # See {::Google::Cloud::ApiHub::V1::ApiHubDiscovery::Rest::Client::Configuration}
52
+ # for a description of the configuration fields.
53
+ #
54
+ # @example
55
+ #
56
+ # # Modify the configuration for all ApiHubDiscovery clients
57
+ # ::Google::Cloud::ApiHub::V1::ApiHubDiscovery::Rest::Client.configure do |config|
58
+ # config.timeout = 10.0
59
+ # end
60
+ #
61
+ # @yield [config] Configure the Client client.
62
+ # @yieldparam config [Client::Configuration]
63
+ #
64
+ # @return [Client::Configuration]
65
+ #
66
+ def self.configure
67
+ @configure ||= begin
68
+ namespace = ["Google", "Cloud", "ApiHub", "V1"]
69
+ parent_config = while namespace.any?
70
+ parent_name = namespace.join "::"
71
+ parent_const = const_get parent_name
72
+ break parent_const.configure if parent_const.respond_to? :configure
73
+ namespace.pop
74
+ end
75
+ default_config = Client::Configuration.new parent_config
76
+
77
+ default_config
78
+ end
79
+ yield @configure if block_given?
80
+ @configure
81
+ end
82
+
83
+ ##
84
+ # Configure the ApiHubDiscovery Client instance.
85
+ #
86
+ # The configuration is set to the derived mode, meaning that values can be changed,
87
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
88
+ # should be made on {Client.configure}.
89
+ #
90
+ # See {::Google::Cloud::ApiHub::V1::ApiHubDiscovery::Rest::Client::Configuration}
91
+ # for a description of the configuration fields.
92
+ #
93
+ # @yield [config] Configure the Client client.
94
+ # @yieldparam config [Client::Configuration]
95
+ #
96
+ # @return [Client::Configuration]
97
+ #
98
+ def configure
99
+ yield @config if block_given?
100
+ @config
101
+ end
102
+
103
+ ##
104
+ # The effective universe domain
105
+ #
106
+ # @return [String]
107
+ #
108
+ def universe_domain
109
+ @api_hub_discovery_stub.universe_domain
110
+ end
111
+
112
+ ##
113
+ # Create a new ApiHubDiscovery REST client object.
114
+ #
115
+ # @example
116
+ #
117
+ # # Create a client using the default configuration
118
+ # client = ::Google::Cloud::ApiHub::V1::ApiHubDiscovery::Rest::Client.new
119
+ #
120
+ # # Create a client using a custom configuration
121
+ # client = ::Google::Cloud::ApiHub::V1::ApiHubDiscovery::Rest::Client.new do |config|
122
+ # config.timeout = 10.0
123
+ # end
124
+ #
125
+ # @yield [config] Configure the ApiHubDiscovery client.
126
+ # @yieldparam config [Client::Configuration]
127
+ #
128
+ def initialize
129
+ # Create the configuration object
130
+ @config = Configuration.new Client.configure
131
+
132
+ # Yield the configuration if needed
133
+ yield @config if block_given?
134
+
135
+ # Create credentials
136
+ credentials = @config.credentials
137
+ # Use self-signed JWT if the endpoint is unchanged from default,
138
+ # but only if the default endpoint does not have a region prefix.
139
+ enable_self_signed_jwt = @config.endpoint.nil? ||
140
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
141
+ !@config.endpoint.split(".").first.include?("-"))
142
+ credentials ||= Credentials.default scope: @config.scope,
143
+ enable_self_signed_jwt: enable_self_signed_jwt
144
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
145
+ credentials = Credentials.new credentials, scope: @config.scope
146
+ end
147
+
148
+ @quota_project_id = @config.quota_project
149
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
150
+
151
+ @api_hub_discovery_stub = ::Google::Cloud::ApiHub::V1::ApiHubDiscovery::Rest::ServiceStub.new(
152
+ endpoint: @config.endpoint,
153
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
154
+ universe_domain: @config.universe_domain,
155
+ credentials: credentials,
156
+ logger: @config.logger
157
+ )
158
+
159
+ @api_hub_discovery_stub.logger(stub: true)&.info do |entry|
160
+ entry.set_system_name
161
+ entry.set_service
162
+ entry.message = "Created client for #{entry.service}"
163
+ entry.set_credentials_fields credentials
164
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
165
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
166
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
167
+ end
168
+
169
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
170
+ config.credentials = credentials
171
+ config.quota_project = @quota_project_id
172
+ config.endpoint = @api_hub_discovery_stub.endpoint
173
+ config.universe_domain = @api_hub_discovery_stub.universe_domain
174
+ config.bindings_override = @config.bindings_override
175
+ config.logger = @api_hub_discovery_stub.logger if config.respond_to? :logger=
176
+ end
177
+ end
178
+
179
+ ##
180
+ # Get the associated client for mix-in of the Locations.
181
+ #
182
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
183
+ #
184
+ attr_reader :location_client
185
+
186
+ ##
187
+ # The logger used for request/response debug logging.
188
+ #
189
+ # @return [Logger]
190
+ #
191
+ def logger
192
+ @api_hub_discovery_stub.logger
193
+ end
194
+
195
+ # Service calls
196
+
197
+ ##
198
+ # Lists all the DiscoveredAPIObservations in a given project and location.
199
+ #
200
+ # @overload list_discovered_api_observations(request, options = nil)
201
+ # Pass arguments to `list_discovered_api_observations` via a request object, either of type
202
+ # {::Google::Cloud::ApiHub::V1::ListDiscoveredApiObservationsRequest} or an equivalent Hash.
203
+ #
204
+ # @param request [::Google::Cloud::ApiHub::V1::ListDiscoveredApiObservationsRequest, ::Hash]
205
+ # A request object representing the call parameters. Required. To specify no
206
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
207
+ # @param options [::Gapic::CallOptions, ::Hash]
208
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
209
+ #
210
+ # @overload list_discovered_api_observations(parent: nil, page_size: nil, page_token: nil)
211
+ # Pass arguments to `list_discovered_api_observations` via keyword arguments. Note that at
212
+ # least one keyword argument is required. To specify no parameters, or to keep all
213
+ # the default parameter values, pass an empty Hash as a request object (see above).
214
+ #
215
+ # @param parent [::String]
216
+ # Required. The parent, which owns this collection of ApiObservations.
217
+ # Format:
218
+ # projects/\\{project}/locations/\\{location}
219
+ # @param page_size [::Integer]
220
+ # Optional. The maximum number of ApiObservations to return. The service may
221
+ # return fewer than this value. If unspecified, at most 10
222
+ # ApiObservations will be returned. The maximum value is 1000; values
223
+ # above 1000 will be coerced to 1000.
224
+ # @param page_token [::String]
225
+ # Optional. A page token, received from a previous `ListApiObservations`
226
+ # call. Provide this to retrieve the subsequent page.
227
+ #
228
+ # When paginating, all other parameters provided to
229
+ # `ListApiObservations` must match the call that provided the page
230
+ # token.
231
+ # @yield [result, operation] Access the result along with the TransportOperation object
232
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::DiscoveredApiObservation>]
233
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
234
+ #
235
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::DiscoveredApiObservation>]
236
+ #
237
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
238
+ #
239
+ # @example Basic example
240
+ # require "google/cloud/api_hub/v1"
241
+ #
242
+ # # Create a client object. The client can be reused for multiple calls.
243
+ # client = Google::Cloud::ApiHub::V1::ApiHubDiscovery::Rest::Client.new
244
+ #
245
+ # # Create a request. To set request fields, pass in keyword arguments.
246
+ # request = Google::Cloud::ApiHub::V1::ListDiscoveredApiObservationsRequest.new
247
+ #
248
+ # # Call the list_discovered_api_observations method.
249
+ # result = client.list_discovered_api_observations request
250
+ #
251
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
252
+ # # over elements, and API calls will be issued to fetch pages as needed.
253
+ # result.each do |item|
254
+ # # Each element is of type ::Google::Cloud::ApiHub::V1::DiscoveredApiObservation.
255
+ # p item
256
+ # end
257
+ #
258
+ def list_discovered_api_observations request, options = nil
259
+ raise ::ArgumentError, "request must be provided" if request.nil?
260
+
261
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::ListDiscoveredApiObservationsRequest
262
+
263
+ # Converts hash and nil to an options object
264
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
265
+
266
+ # Customize the options with defaults
267
+ call_metadata = @config.rpcs.list_discovered_api_observations.metadata.to_h
268
+
269
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
270
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
271
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
272
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
273
+ transports_version_send: [:rest]
274
+
275
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
276
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
277
+
278
+ options.apply_defaults timeout: @config.rpcs.list_discovered_api_observations.timeout,
279
+ metadata: call_metadata,
280
+ retry_policy: @config.rpcs.list_discovered_api_observations.retry_policy
281
+
282
+ options.apply_defaults timeout: @config.timeout,
283
+ metadata: @config.metadata,
284
+ retry_policy: @config.retry_policy
285
+
286
+ @api_hub_discovery_stub.list_discovered_api_observations request, options do |result, operation|
287
+ result = ::Gapic::Rest::PagedEnumerable.new @api_hub_discovery_stub, :list_discovered_api_observations, "discovered_api_observations", request, result, options
288
+ yield result, operation if block_given?
289
+ throw :response, result
290
+ end
291
+ rescue ::Gapic::Rest::Error => e
292
+ raise ::Google::Cloud::Error.from_error(e)
293
+ end
294
+
295
+ ##
296
+ # Gets a DiscoveredAPIObservation in a given project, location and
297
+ # ApiObservation.
298
+ #
299
+ # @overload get_discovered_api_observation(request, options = nil)
300
+ # Pass arguments to `get_discovered_api_observation` via a request object, either of type
301
+ # {::Google::Cloud::ApiHub::V1::GetDiscoveredApiObservationRequest} or an equivalent Hash.
302
+ #
303
+ # @param request [::Google::Cloud::ApiHub::V1::GetDiscoveredApiObservationRequest, ::Hash]
304
+ # A request object representing the call parameters. Required. To specify no
305
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
306
+ # @param options [::Gapic::CallOptions, ::Hash]
307
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
308
+ #
309
+ # @overload get_discovered_api_observation(name: nil)
310
+ # Pass arguments to `get_discovered_api_observation` via keyword arguments. Note that at
311
+ # least one keyword argument is required. To specify no parameters, or to keep all
312
+ # the default parameter values, pass an empty Hash as a request object (see above).
313
+ #
314
+ # @param name [::String]
315
+ # Required. The name of the DiscoveredApiObservation to retrieve.
316
+ # Format:
317
+ # projects/\\{project}/locations/\\{location}/discoveredApiObservations/\\{discovered_api_observation}
318
+ # @yield [result, operation] Access the result along with the TransportOperation object
319
+ # @yieldparam result [::Google::Cloud::ApiHub::V1::DiscoveredApiObservation]
320
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
321
+ #
322
+ # @return [::Google::Cloud::ApiHub::V1::DiscoveredApiObservation]
323
+ #
324
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
325
+ #
326
+ # @example Basic example
327
+ # require "google/cloud/api_hub/v1"
328
+ #
329
+ # # Create a client object. The client can be reused for multiple calls.
330
+ # client = Google::Cloud::ApiHub::V1::ApiHubDiscovery::Rest::Client.new
331
+ #
332
+ # # Create a request. To set request fields, pass in keyword arguments.
333
+ # request = Google::Cloud::ApiHub::V1::GetDiscoveredApiObservationRequest.new
334
+ #
335
+ # # Call the get_discovered_api_observation method.
336
+ # result = client.get_discovered_api_observation request
337
+ #
338
+ # # The returned object is of type Google::Cloud::ApiHub::V1::DiscoveredApiObservation.
339
+ # p result
340
+ #
341
+ def get_discovered_api_observation request, options = nil
342
+ raise ::ArgumentError, "request must be provided" if request.nil?
343
+
344
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetDiscoveredApiObservationRequest
345
+
346
+ # Converts hash and nil to an options object
347
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
348
+
349
+ # Customize the options with defaults
350
+ call_metadata = @config.rpcs.get_discovered_api_observation.metadata.to_h
351
+
352
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
353
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
354
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
355
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
356
+ transports_version_send: [:rest]
357
+
358
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
359
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
360
+
361
+ options.apply_defaults timeout: @config.rpcs.get_discovered_api_observation.timeout,
362
+ metadata: call_metadata,
363
+ retry_policy: @config.rpcs.get_discovered_api_observation.retry_policy
364
+
365
+ options.apply_defaults timeout: @config.timeout,
366
+ metadata: @config.metadata,
367
+ retry_policy: @config.retry_policy
368
+
369
+ @api_hub_discovery_stub.get_discovered_api_observation request, options do |result, operation|
370
+ yield result, operation if block_given?
371
+ end
372
+ rescue ::Gapic::Rest::Error => e
373
+ raise ::Google::Cloud::Error.from_error(e)
374
+ end
375
+
376
+ ##
377
+ # Lists all the DiscoveredAPIOperations in a given project, location and
378
+ # ApiObservation.
379
+ #
380
+ # @overload list_discovered_api_operations(request, options = nil)
381
+ # Pass arguments to `list_discovered_api_operations` via a request object, either of type
382
+ # {::Google::Cloud::ApiHub::V1::ListDiscoveredApiOperationsRequest} or an equivalent Hash.
383
+ #
384
+ # @param request [::Google::Cloud::ApiHub::V1::ListDiscoveredApiOperationsRequest, ::Hash]
385
+ # A request object representing the call parameters. Required. To specify no
386
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
387
+ # @param options [::Gapic::CallOptions, ::Hash]
388
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
389
+ #
390
+ # @overload list_discovered_api_operations(parent: nil, page_size: nil, page_token: nil)
391
+ # Pass arguments to `list_discovered_api_operations` via keyword arguments. Note that at
392
+ # least one keyword argument is required. To specify no parameters, or to keep all
393
+ # the default parameter values, pass an empty Hash as a request object (see above).
394
+ #
395
+ # @param parent [::String]
396
+ # Required. The parent, which owns this collection of
397
+ # DiscoveredApiOperations. Format:
398
+ # projects/\\{project}/locations/\\{location}/discoveredApiObservations/\\{discovered_api_observation}
399
+ # @param page_size [::Integer]
400
+ # Optional. DiscoveredApiOperations will be returned. The maximum value is
401
+ # 1000; values above 1000 will be coerced to 1000.
402
+ # @param page_token [::String]
403
+ # Optional. A page token, received from a previous
404
+ # `ListDiscoveredApiApiOperations` call. Provide this to retrieve the
405
+ # subsequent page.
406
+ #
407
+ # When paginating, all other parameters provided to
408
+ # `ListDiscoveredApiApiOperations` must match the call that provided the page
409
+ # token.
410
+ # @yield [result, operation] Access the result along with the TransportOperation object
411
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::DiscoveredApiOperation>]
412
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
413
+ #
414
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::DiscoveredApiOperation>]
415
+ #
416
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
417
+ #
418
+ # @example Basic example
419
+ # require "google/cloud/api_hub/v1"
420
+ #
421
+ # # Create a client object. The client can be reused for multiple calls.
422
+ # client = Google::Cloud::ApiHub::V1::ApiHubDiscovery::Rest::Client.new
423
+ #
424
+ # # Create a request. To set request fields, pass in keyword arguments.
425
+ # request = Google::Cloud::ApiHub::V1::ListDiscoveredApiOperationsRequest.new
426
+ #
427
+ # # Call the list_discovered_api_operations method.
428
+ # result = client.list_discovered_api_operations request
429
+ #
430
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
431
+ # # over elements, and API calls will be issued to fetch pages as needed.
432
+ # result.each do |item|
433
+ # # Each element is of type ::Google::Cloud::ApiHub::V1::DiscoveredApiOperation.
434
+ # p item
435
+ # end
436
+ #
437
+ def list_discovered_api_operations request, options = nil
438
+ raise ::ArgumentError, "request must be provided" if request.nil?
439
+
440
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::ListDiscoveredApiOperationsRequest
441
+
442
+ # Converts hash and nil to an options object
443
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
444
+
445
+ # Customize the options with defaults
446
+ call_metadata = @config.rpcs.list_discovered_api_operations.metadata.to_h
447
+
448
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
449
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
450
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
451
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
452
+ transports_version_send: [:rest]
453
+
454
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
455
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
456
+
457
+ options.apply_defaults timeout: @config.rpcs.list_discovered_api_operations.timeout,
458
+ metadata: call_metadata,
459
+ retry_policy: @config.rpcs.list_discovered_api_operations.retry_policy
460
+
461
+ options.apply_defaults timeout: @config.timeout,
462
+ metadata: @config.metadata,
463
+ retry_policy: @config.retry_policy
464
+
465
+ @api_hub_discovery_stub.list_discovered_api_operations request, options do |result, operation|
466
+ result = ::Gapic::Rest::PagedEnumerable.new @api_hub_discovery_stub, :list_discovered_api_operations, "discovered_api_operations", request, result, options
467
+ yield result, operation if block_given?
468
+ throw :response, result
469
+ end
470
+ rescue ::Gapic::Rest::Error => e
471
+ raise ::Google::Cloud::Error.from_error(e)
472
+ end
473
+
474
+ ##
475
+ # Gets a DiscoveredAPIOperation in a given project, location,
476
+ # ApiObservation and ApiOperation.
477
+ #
478
+ # @overload get_discovered_api_operation(request, options = nil)
479
+ # Pass arguments to `get_discovered_api_operation` via a request object, either of type
480
+ # {::Google::Cloud::ApiHub::V1::GetDiscoveredApiOperationRequest} or an equivalent Hash.
481
+ #
482
+ # @param request [::Google::Cloud::ApiHub::V1::GetDiscoveredApiOperationRequest, ::Hash]
483
+ # A request object representing the call parameters. Required. To specify no
484
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
485
+ # @param options [::Gapic::CallOptions, ::Hash]
486
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
487
+ #
488
+ # @overload get_discovered_api_operation(name: nil)
489
+ # Pass arguments to `get_discovered_api_operation` via keyword arguments. Note that at
490
+ # least one keyword argument is required. To specify no parameters, or to keep all
491
+ # the default parameter values, pass an empty Hash as a request object (see above).
492
+ #
493
+ # @param name [::String]
494
+ # Required. The name of the DiscoveredApiOperation to retrieve.
495
+ # Format:
496
+ # projects/\\{project}/locations/\\{location}/discoveredApiObservations/\\{discovered_api_observation}/discoveredApiOperations/\\{discovered_api_operation}
497
+ # @yield [result, operation] Access the result along with the TransportOperation object
498
+ # @yieldparam result [::Google::Cloud::ApiHub::V1::DiscoveredApiOperation]
499
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
500
+ #
501
+ # @return [::Google::Cloud::ApiHub::V1::DiscoveredApiOperation]
502
+ #
503
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
504
+ #
505
+ # @example Basic example
506
+ # require "google/cloud/api_hub/v1"
507
+ #
508
+ # # Create a client object. The client can be reused for multiple calls.
509
+ # client = Google::Cloud::ApiHub::V1::ApiHubDiscovery::Rest::Client.new
510
+ #
511
+ # # Create a request. To set request fields, pass in keyword arguments.
512
+ # request = Google::Cloud::ApiHub::V1::GetDiscoveredApiOperationRequest.new
513
+ #
514
+ # # Call the get_discovered_api_operation method.
515
+ # result = client.get_discovered_api_operation request
516
+ #
517
+ # # The returned object is of type Google::Cloud::ApiHub::V1::DiscoveredApiOperation.
518
+ # p result
519
+ #
520
+ def get_discovered_api_operation request, options = nil
521
+ raise ::ArgumentError, "request must be provided" if request.nil?
522
+
523
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetDiscoveredApiOperationRequest
524
+
525
+ # Converts hash and nil to an options object
526
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
527
+
528
+ # Customize the options with defaults
529
+ call_metadata = @config.rpcs.get_discovered_api_operation.metadata.to_h
530
+
531
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
532
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
533
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
534
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
535
+ transports_version_send: [:rest]
536
+
537
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
538
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
539
+
540
+ options.apply_defaults timeout: @config.rpcs.get_discovered_api_operation.timeout,
541
+ metadata: call_metadata,
542
+ retry_policy: @config.rpcs.get_discovered_api_operation.retry_policy
543
+
544
+ options.apply_defaults timeout: @config.timeout,
545
+ metadata: @config.metadata,
546
+ retry_policy: @config.retry_policy
547
+
548
+ @api_hub_discovery_stub.get_discovered_api_operation request, options do |result, operation|
549
+ yield result, operation if block_given?
550
+ end
551
+ rescue ::Gapic::Rest::Error => e
552
+ raise ::Google::Cloud::Error.from_error(e)
553
+ end
554
+
555
+ ##
556
+ # Configuration class for the ApiHubDiscovery REST API.
557
+ #
558
+ # This class represents the configuration for ApiHubDiscovery REST,
559
+ # providing control over timeouts, retry behavior, logging, transport
560
+ # parameters, and other low-level controls. Certain parameters can also be
561
+ # applied individually to specific RPCs. See
562
+ # {::Google::Cloud::ApiHub::V1::ApiHubDiscovery::Rest::Client::Configuration::Rpcs}
563
+ # for a list of RPCs that can be configured independently.
564
+ #
565
+ # Configuration can be applied globally to all clients, or to a single client
566
+ # on construction.
567
+ #
568
+ # @example
569
+ #
570
+ # # Modify the global config, setting the timeout for
571
+ # # list_discovered_api_observations to 20 seconds,
572
+ # # and all remaining timeouts to 10 seconds.
573
+ # ::Google::Cloud::ApiHub::V1::ApiHubDiscovery::Rest::Client.configure do |config|
574
+ # config.timeout = 10.0
575
+ # config.rpcs.list_discovered_api_observations.timeout = 20.0
576
+ # end
577
+ #
578
+ # # Apply the above configuration only to a new client.
579
+ # client = ::Google::Cloud::ApiHub::V1::ApiHubDiscovery::Rest::Client.new do |config|
580
+ # config.timeout = 10.0
581
+ # config.rpcs.list_discovered_api_observations.timeout = 20.0
582
+ # end
583
+ #
584
+ # @!attribute [rw] endpoint
585
+ # A custom service endpoint, as a hostname or hostname:port. The default is
586
+ # nil, indicating to use the default endpoint in the current universe domain.
587
+ # @return [::String,nil]
588
+ # @!attribute [rw] credentials
589
+ # Credentials to send with calls. You may provide any of the following types:
590
+ # * (`String`) The path to a service account key file in JSON format
591
+ # * (`Hash`) A service account key as a Hash
592
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
593
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
594
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
595
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
596
+ # * (`nil`) indicating no credentials
597
+ #
598
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
599
+ # external source for authentication to Google Cloud, you must validate it before
600
+ # providing it to a Google API client library. Providing an unvalidated credential
601
+ # configuration to Google APIs can compromise the security of your systems and data.
602
+ # For more information, refer to [Validate credential configurations from external
603
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
604
+ # @return [::Object]
605
+ # @!attribute [rw] scope
606
+ # The OAuth scopes
607
+ # @return [::Array<::String>]
608
+ # @!attribute [rw] lib_name
609
+ # The library name as recorded in instrumentation and logging
610
+ # @return [::String]
611
+ # @!attribute [rw] lib_version
612
+ # The library version as recorded in instrumentation and logging
613
+ # @return [::String]
614
+ # @!attribute [rw] timeout
615
+ # The call timeout in seconds.
616
+ # @return [::Numeric]
617
+ # @!attribute [rw] metadata
618
+ # Additional headers to be sent with the call.
619
+ # @return [::Hash{::Symbol=>::String}]
620
+ # @!attribute [rw] retry_policy
621
+ # The retry policy. The value is a hash with the following keys:
622
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
623
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
624
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
625
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
626
+ # trigger a retry.
627
+ # @return [::Hash]
628
+ # @!attribute [rw] quota_project
629
+ # A separate project against which to charge quota.
630
+ # @return [::String]
631
+ # @!attribute [rw] universe_domain
632
+ # The universe domain within which to make requests. This determines the
633
+ # default endpoint URL. The default value of nil uses the environment
634
+ # universe (usually the default "googleapis.com" universe).
635
+ # @return [::String,nil]
636
+ # @!attribute [rw] logger
637
+ # A custom logger to use for request/response debug logging, or the value
638
+ # `:default` (the default) to construct a default logger, or `nil` to
639
+ # explicitly disable logging.
640
+ # @return [::Logger,:default,nil]
641
+ #
642
+ class Configuration
643
+ extend ::Gapic::Config
644
+
645
+ # @private
646
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
647
+ DEFAULT_ENDPOINT = "apihub.googleapis.com"
648
+
649
+ config_attr :endpoint, nil, ::String, nil
650
+ config_attr :credentials, nil do |value|
651
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
652
+ allowed.any? { |klass| klass === value }
653
+ end
654
+ config_attr :scope, nil, ::String, ::Array, nil
655
+ config_attr :lib_name, nil, ::String, nil
656
+ config_attr :lib_version, nil, ::String, nil
657
+ config_attr :timeout, nil, ::Numeric, nil
658
+ config_attr :metadata, nil, ::Hash, nil
659
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
660
+ config_attr :quota_project, nil, ::String, nil
661
+ config_attr :universe_domain, nil, ::String, nil
662
+
663
+ # @private
664
+ # Overrides for http bindings for the RPCs of this service
665
+ # are only used when this service is used as mixin, and only
666
+ # by the host service.
667
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
668
+ config_attr :bindings_override, {}, ::Hash, nil
669
+ config_attr :logger, :default, ::Logger, nil, :default
670
+
671
+ # @private
672
+ def initialize parent_config = nil
673
+ @parent_config = parent_config unless parent_config.nil?
674
+
675
+ yield self if block_given?
676
+ end
677
+
678
+ ##
679
+ # Configurations for individual RPCs
680
+ # @return [Rpcs]
681
+ #
682
+ def rpcs
683
+ @rpcs ||= begin
684
+ parent_rpcs = nil
685
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
686
+ Rpcs.new parent_rpcs
687
+ end
688
+ end
689
+
690
+ ##
691
+ # Configuration RPC class for the ApiHubDiscovery API.
692
+ #
693
+ # Includes fields providing the configuration for each RPC in this service.
694
+ # Each configuration object is of type `Gapic::Config::Method` and includes
695
+ # the following configuration fields:
696
+ #
697
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
698
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
699
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
700
+ # include the following keys:
701
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
702
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
703
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
704
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
705
+ # trigger a retry.
706
+ #
707
+ class Rpcs
708
+ ##
709
+ # RPC-specific configuration for `list_discovered_api_observations`
710
+ # @return [::Gapic::Config::Method]
711
+ #
712
+ attr_reader :list_discovered_api_observations
713
+ ##
714
+ # RPC-specific configuration for `get_discovered_api_observation`
715
+ # @return [::Gapic::Config::Method]
716
+ #
717
+ attr_reader :get_discovered_api_observation
718
+ ##
719
+ # RPC-specific configuration for `list_discovered_api_operations`
720
+ # @return [::Gapic::Config::Method]
721
+ #
722
+ attr_reader :list_discovered_api_operations
723
+ ##
724
+ # RPC-specific configuration for `get_discovered_api_operation`
725
+ # @return [::Gapic::Config::Method]
726
+ #
727
+ attr_reader :get_discovered_api_operation
728
+
729
+ # @private
730
+ def initialize parent_rpcs = nil
731
+ list_discovered_api_observations_config = parent_rpcs.list_discovered_api_observations if parent_rpcs.respond_to? :list_discovered_api_observations
732
+ @list_discovered_api_observations = ::Gapic::Config::Method.new list_discovered_api_observations_config
733
+ get_discovered_api_observation_config = parent_rpcs.get_discovered_api_observation if parent_rpcs.respond_to? :get_discovered_api_observation
734
+ @get_discovered_api_observation = ::Gapic::Config::Method.new get_discovered_api_observation_config
735
+ list_discovered_api_operations_config = parent_rpcs.list_discovered_api_operations if parent_rpcs.respond_to? :list_discovered_api_operations
736
+ @list_discovered_api_operations = ::Gapic::Config::Method.new list_discovered_api_operations_config
737
+ get_discovered_api_operation_config = parent_rpcs.get_discovered_api_operation if parent_rpcs.respond_to? :get_discovered_api_operation
738
+ @get_discovered_api_operation = ::Gapic::Config::Method.new get_discovered_api_operation_config
739
+
740
+ yield self if block_given?
741
+ end
742
+ end
743
+ end
744
+ end
745
+ end
746
+ end
747
+ end
748
+ end
749
+ end
750
+ end