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
@@ -0,0 +1,869 @@
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/curate_service_pb"
21
+ require "google/cloud/api_hub/v1/api_hub_curate/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module ApiHub
27
+ module V1
28
+ module ApiHubCurate
29
+ module Rest
30
+ ##
31
+ # REST client for the ApiHubCurate service.
32
+ #
33
+ # This service is used for managing curations for processing API data consumed
34
+ # from collect layer.
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_curate_stub
47
+
48
+ ##
49
+ # Configure the ApiHubCurate Client class.
50
+ #
51
+ # See {::Google::Cloud::ApiHub::V1::ApiHubCurate::Rest::Client::Configuration}
52
+ # for a description of the configuration fields.
53
+ #
54
+ # @example
55
+ #
56
+ # # Modify the configuration for all ApiHubCurate clients
57
+ # ::Google::Cloud::ApiHub::V1::ApiHubCurate::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 ApiHubCurate 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::ApiHubCurate::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_curate_stub.universe_domain
110
+ end
111
+
112
+ ##
113
+ # Create a new ApiHubCurate REST client object.
114
+ #
115
+ # @example
116
+ #
117
+ # # Create a client using the default configuration
118
+ # client = ::Google::Cloud::ApiHub::V1::ApiHubCurate::Rest::Client.new
119
+ #
120
+ # # Create a client using a custom configuration
121
+ # client = ::Google::Cloud::ApiHub::V1::ApiHubCurate::Rest::Client.new do |config|
122
+ # config.timeout = 10.0
123
+ # end
124
+ #
125
+ # @yield [config] Configure the ApiHubCurate 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_curate_stub = ::Google::Cloud::ApiHub::V1::ApiHubCurate::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_curate_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_curate_stub.endpoint
173
+ config.universe_domain = @api_hub_curate_stub.universe_domain
174
+ config.bindings_override = @config.bindings_override
175
+ config.logger = @api_hub_curate_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_curate_stub.logger
193
+ end
194
+
195
+ # Service calls
196
+
197
+ ##
198
+ # Create a curation resource in the API hub.
199
+ # Once a curation resource is created, plugin instances can start using it.
200
+ #
201
+ # @overload create_curation(request, options = nil)
202
+ # Pass arguments to `create_curation` via a request object, either of type
203
+ # {::Google::Cloud::ApiHub::V1::CreateCurationRequest} or an equivalent Hash.
204
+ #
205
+ # @param request [::Google::Cloud::ApiHub::V1::CreateCurationRequest, ::Hash]
206
+ # A request object representing the call parameters. Required. To specify no
207
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
208
+ # @param options [::Gapic::CallOptions, ::Hash]
209
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
210
+ #
211
+ # @overload create_curation(parent: nil, curation_id: nil, curation: nil)
212
+ # Pass arguments to `create_curation` via keyword arguments. Note that at
213
+ # least one keyword argument is required. To specify no parameters, or to keep all
214
+ # the default parameter values, pass an empty Hash as a request object (see above).
215
+ #
216
+ # @param parent [::String]
217
+ # Required. The parent resource for the curation resource.
218
+ # Format: `projects/{project}/locations/{location}`
219
+ # @param curation_id [::String]
220
+ # Optional. The ID to use for the curation resource, which will become the
221
+ # final component of the curations's resource name. This field is optional.
222
+ #
223
+ # * If provided, the same will be used. The service will throw an error if
224
+ # the specified ID is already used by another curation resource in the API
225
+ # hub.
226
+ # * If not provided, a system generated ID will be used.
227
+ #
228
+ # This value should be 4-500 characters, and valid characters
229
+ # are /[a-z][A-Z][0-9]-_/.
230
+ # @param curation [::Google::Cloud::ApiHub::V1::Curation, ::Hash]
231
+ # Required. The curation resource to create.
232
+ # @yield [result, operation] Access the result along with the TransportOperation object
233
+ # @yieldparam result [::Google::Cloud::ApiHub::V1::Curation]
234
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
235
+ #
236
+ # @return [::Google::Cloud::ApiHub::V1::Curation]
237
+ #
238
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
239
+ #
240
+ # @example Basic example
241
+ # require "google/cloud/api_hub/v1"
242
+ #
243
+ # # Create a client object. The client can be reused for multiple calls.
244
+ # client = Google::Cloud::ApiHub::V1::ApiHubCurate::Rest::Client.new
245
+ #
246
+ # # Create a request. To set request fields, pass in keyword arguments.
247
+ # request = Google::Cloud::ApiHub::V1::CreateCurationRequest.new
248
+ #
249
+ # # Call the create_curation method.
250
+ # result = client.create_curation request
251
+ #
252
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Curation.
253
+ # p result
254
+ #
255
+ def create_curation request, options = nil
256
+ raise ::ArgumentError, "request must be provided" if request.nil?
257
+
258
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::CreateCurationRequest
259
+
260
+ # Converts hash and nil to an options object
261
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
262
+
263
+ # Customize the options with defaults
264
+ call_metadata = @config.rpcs.create_curation.metadata.to_h
265
+
266
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
267
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
268
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
269
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
270
+ transports_version_send: [:rest]
271
+
272
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
273
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
274
+
275
+ options.apply_defaults timeout: @config.rpcs.create_curation.timeout,
276
+ metadata: call_metadata,
277
+ retry_policy: @config.rpcs.create_curation.retry_policy
278
+
279
+ options.apply_defaults timeout: @config.timeout,
280
+ metadata: @config.metadata,
281
+ retry_policy: @config.retry_policy
282
+
283
+ @api_hub_curate_stub.create_curation request, options do |result, operation|
284
+ yield result, operation if block_given?
285
+ end
286
+ rescue ::Gapic::Rest::Error => e
287
+ raise ::Google::Cloud::Error.from_error(e)
288
+ end
289
+
290
+ ##
291
+ # Get curation resource details.
292
+ #
293
+ # @overload get_curation(request, options = nil)
294
+ # Pass arguments to `get_curation` via a request object, either of type
295
+ # {::Google::Cloud::ApiHub::V1::GetCurationRequest} or an equivalent Hash.
296
+ #
297
+ # @param request [::Google::Cloud::ApiHub::V1::GetCurationRequest, ::Hash]
298
+ # A request object representing the call parameters. Required. To specify no
299
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
300
+ # @param options [::Gapic::CallOptions, ::Hash]
301
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
302
+ #
303
+ # @overload get_curation(name: nil)
304
+ # Pass arguments to `get_curation` via keyword arguments. Note that at
305
+ # least one keyword argument is required. To specify no parameters, or to keep all
306
+ # the default parameter values, pass an empty Hash as a request object (see above).
307
+ #
308
+ # @param name [::String]
309
+ # Required. The name of the curation resource to retrieve.
310
+ # Format: `projects/{project}/locations/{location}/curations/{curation}`
311
+ # @yield [result, operation] Access the result along with the TransportOperation object
312
+ # @yieldparam result [::Google::Cloud::ApiHub::V1::Curation]
313
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
314
+ #
315
+ # @return [::Google::Cloud::ApiHub::V1::Curation]
316
+ #
317
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
318
+ #
319
+ # @example Basic example
320
+ # require "google/cloud/api_hub/v1"
321
+ #
322
+ # # Create a client object. The client can be reused for multiple calls.
323
+ # client = Google::Cloud::ApiHub::V1::ApiHubCurate::Rest::Client.new
324
+ #
325
+ # # Create a request. To set request fields, pass in keyword arguments.
326
+ # request = Google::Cloud::ApiHub::V1::GetCurationRequest.new
327
+ #
328
+ # # Call the get_curation method.
329
+ # result = client.get_curation request
330
+ #
331
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Curation.
332
+ # p result
333
+ #
334
+ def get_curation request, options = nil
335
+ raise ::ArgumentError, "request must be provided" if request.nil?
336
+
337
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetCurationRequest
338
+
339
+ # Converts hash and nil to an options object
340
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
341
+
342
+ # Customize the options with defaults
343
+ call_metadata = @config.rpcs.get_curation.metadata.to_h
344
+
345
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
346
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
347
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
348
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
349
+ transports_version_send: [:rest]
350
+
351
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
352
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
353
+
354
+ options.apply_defaults timeout: @config.rpcs.get_curation.timeout,
355
+ metadata: call_metadata,
356
+ retry_policy: @config.rpcs.get_curation.retry_policy
357
+
358
+ options.apply_defaults timeout: @config.timeout,
359
+ metadata: @config.metadata,
360
+ retry_policy: @config.retry_policy
361
+
362
+ @api_hub_curate_stub.get_curation request, options do |result, operation|
363
+ yield result, operation if block_given?
364
+ end
365
+ rescue ::Gapic::Rest::Error => e
366
+ raise ::Google::Cloud::Error.from_error(e)
367
+ end
368
+
369
+ ##
370
+ # List curation resources in the API hub.
371
+ #
372
+ # @overload list_curations(request, options = nil)
373
+ # Pass arguments to `list_curations` via a request object, either of type
374
+ # {::Google::Cloud::ApiHub::V1::ListCurationsRequest} or an equivalent Hash.
375
+ #
376
+ # @param request [::Google::Cloud::ApiHub::V1::ListCurationsRequest, ::Hash]
377
+ # A request object representing the call parameters. Required. To specify no
378
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
379
+ # @param options [::Gapic::CallOptions, ::Hash]
380
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
381
+ #
382
+ # @overload list_curations(parent: nil, filter: nil, page_size: nil, page_token: nil)
383
+ # Pass arguments to `list_curations` via keyword arguments. Note that at
384
+ # least one keyword argument is required. To specify no parameters, or to keep all
385
+ # the default parameter values, pass an empty Hash as a request object (see above).
386
+ #
387
+ # @param parent [::String]
388
+ # Required. The parent, which owns this collection of curation resources.
389
+ # Format: `projects/{project}/locations/{location}`
390
+ # @param filter [::String]
391
+ # Optional. An expression that filters the list of curation resources.
392
+ #
393
+ # A filter expression consists of a field name, a comparison
394
+ # operator, and a value for filtering. The value must be a string. The
395
+ # comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are case
396
+ # insensitive.
397
+ #
398
+ # The following fields in the `curation resource` are eligible for filtering:
399
+ #
400
+ # * `create_time` - The time at which the curation was created.
401
+ # The value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
402
+ # format. Allowed comparison operators: `>` and `<`.
403
+ # * `display_name` - The display name of the curation. Allowed
404
+ # comparison operators: `=`.
405
+ # * `state` - The state of the curation. Allowed comparison operators: `=`.
406
+ #
407
+ # Expressions are combined with either `AND` logic operator or `OR` logical
408
+ # operator but not both of them together i.e. only one of the `AND` or `OR`
409
+ # operator can be used throughout the filter string and both the operators
410
+ # cannot be used together. No other logical operators are supported. At most
411
+ # three filter fields are allowed in the filter string and if provided
412
+ # more than that then `INVALID_ARGUMENT` error is returned by the API.
413
+ #
414
+ # Here are a few examples:
415
+ #
416
+ # * `create_time < \"2021-08-15T14:50:00Z\" AND create_time >
417
+ # \"2021-08-10T12:00:00Z\"` -
418
+ # The curation resource was created before _2021-08-15 14:50:00 UTC_ and
419
+ # after _2021-08-10 12:00:00 UTC_.
420
+ # @param page_size [::Integer]
421
+ # Optional. The maximum number of curation resources to return. The service
422
+ # may return fewer than this value. If unspecified, at most 50 curations will
423
+ # be returned. The maximum value is 1000; values above 1000 will be coerced
424
+ # to 1000.
425
+ # @param page_token [::String]
426
+ # Optional. A page token, received from a previous `ListCurations` call.
427
+ # Provide this to retrieve the subsequent page.
428
+ #
429
+ # When paginating, all other parameters (except page_size) provided to
430
+ # `ListCurations` must match the call that provided the page token.
431
+ # @yield [result, operation] Access the result along with the TransportOperation object
432
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::Curation>]
433
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
434
+ #
435
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::Curation>]
436
+ #
437
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
438
+ #
439
+ # @example Basic example
440
+ # require "google/cloud/api_hub/v1"
441
+ #
442
+ # # Create a client object. The client can be reused for multiple calls.
443
+ # client = Google::Cloud::ApiHub::V1::ApiHubCurate::Rest::Client.new
444
+ #
445
+ # # Create a request. To set request fields, pass in keyword arguments.
446
+ # request = Google::Cloud::ApiHub::V1::ListCurationsRequest.new
447
+ #
448
+ # # Call the list_curations method.
449
+ # result = client.list_curations request
450
+ #
451
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
452
+ # # over elements, and API calls will be issued to fetch pages as needed.
453
+ # result.each do |item|
454
+ # # Each element is of type ::Google::Cloud::ApiHub::V1::Curation.
455
+ # p item
456
+ # end
457
+ #
458
+ def list_curations request, options = nil
459
+ raise ::ArgumentError, "request must be provided" if request.nil?
460
+
461
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::ListCurationsRequest
462
+
463
+ # Converts hash and nil to an options object
464
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
465
+
466
+ # Customize the options with defaults
467
+ call_metadata = @config.rpcs.list_curations.metadata.to_h
468
+
469
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
470
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
471
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
472
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
473
+ transports_version_send: [:rest]
474
+
475
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
476
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
477
+
478
+ options.apply_defaults timeout: @config.rpcs.list_curations.timeout,
479
+ metadata: call_metadata,
480
+ retry_policy: @config.rpcs.list_curations.retry_policy
481
+
482
+ options.apply_defaults timeout: @config.timeout,
483
+ metadata: @config.metadata,
484
+ retry_policy: @config.retry_policy
485
+
486
+ @api_hub_curate_stub.list_curations request, options do |result, operation|
487
+ result = ::Gapic::Rest::PagedEnumerable.new @api_hub_curate_stub, :list_curations, "curations", request, result, options
488
+ yield result, operation if block_given?
489
+ throw :response, result
490
+ end
491
+ rescue ::Gapic::Rest::Error => e
492
+ raise ::Google::Cloud::Error.from_error(e)
493
+ end
494
+
495
+ ##
496
+ # Update a curation resource in the API hub. The following fields in the
497
+ # {::Google::Cloud::ApiHub::V1::Curation curation} can be updated:
498
+ #
499
+ # * {::Google::Cloud::ApiHub::V1::Curation#display_name display_name}
500
+ # * {::Google::Cloud::ApiHub::V1::Curation#description description}
501
+ #
502
+ # The
503
+ # {::Google::Cloud::ApiHub::V1::UpdateApiRequest#update_mask update_mask}
504
+ # should be used to specify the fields being updated.
505
+ #
506
+ # @overload update_curation(request, options = nil)
507
+ # Pass arguments to `update_curation` via a request object, either of type
508
+ # {::Google::Cloud::ApiHub::V1::UpdateCurationRequest} or an equivalent Hash.
509
+ #
510
+ # @param request [::Google::Cloud::ApiHub::V1::UpdateCurationRequest, ::Hash]
511
+ # A request object representing the call parameters. Required. To specify no
512
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
513
+ # @param options [::Gapic::CallOptions, ::Hash]
514
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
515
+ #
516
+ # @overload update_curation(curation: nil, update_mask: nil)
517
+ # Pass arguments to `update_curation` via keyword arguments. Note that at
518
+ # least one keyword argument is required. To specify no parameters, or to keep all
519
+ # the default parameter values, pass an empty Hash as a request object (see above).
520
+ #
521
+ # @param curation [::Google::Cloud::ApiHub::V1::Curation, ::Hash]
522
+ # Required. The curation resource to update.
523
+ #
524
+ # The curation resource's `name` field is used to identify the curation
525
+ # resource to update.
526
+ # Format: `projects/{project}/locations/{location}/curations/{curation}`
527
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
528
+ # Optional. The list of fields to update.
529
+ # @yield [result, operation] Access the result along with the TransportOperation object
530
+ # @yieldparam result [::Google::Cloud::ApiHub::V1::Curation]
531
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
532
+ #
533
+ # @return [::Google::Cloud::ApiHub::V1::Curation]
534
+ #
535
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
536
+ #
537
+ # @example Basic example
538
+ # require "google/cloud/api_hub/v1"
539
+ #
540
+ # # Create a client object. The client can be reused for multiple calls.
541
+ # client = Google::Cloud::ApiHub::V1::ApiHubCurate::Rest::Client.new
542
+ #
543
+ # # Create a request. To set request fields, pass in keyword arguments.
544
+ # request = Google::Cloud::ApiHub::V1::UpdateCurationRequest.new
545
+ #
546
+ # # Call the update_curation method.
547
+ # result = client.update_curation request
548
+ #
549
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Curation.
550
+ # p result
551
+ #
552
+ def update_curation request, options = nil
553
+ raise ::ArgumentError, "request must be provided" if request.nil?
554
+
555
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::UpdateCurationRequest
556
+
557
+ # Converts hash and nil to an options object
558
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
559
+
560
+ # Customize the options with defaults
561
+ call_metadata = @config.rpcs.update_curation.metadata.to_h
562
+
563
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
564
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
565
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
566
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
567
+ transports_version_send: [:rest]
568
+
569
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
570
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
571
+
572
+ options.apply_defaults timeout: @config.rpcs.update_curation.timeout,
573
+ metadata: call_metadata,
574
+ retry_policy: @config.rpcs.update_curation.retry_policy
575
+
576
+ options.apply_defaults timeout: @config.timeout,
577
+ metadata: @config.metadata,
578
+ retry_policy: @config.retry_policy
579
+
580
+ @api_hub_curate_stub.update_curation request, options do |result, operation|
581
+ yield result, operation if block_given?
582
+ end
583
+ rescue ::Gapic::Rest::Error => e
584
+ raise ::Google::Cloud::Error.from_error(e)
585
+ end
586
+
587
+ ##
588
+ # Delete a curation resource in the API hub. A curation can only be deleted
589
+ # if it's not being used by any plugin instance.
590
+ #
591
+ # @overload delete_curation(request, options = nil)
592
+ # Pass arguments to `delete_curation` via a request object, either of type
593
+ # {::Google::Cloud::ApiHub::V1::DeleteCurationRequest} or an equivalent Hash.
594
+ #
595
+ # @param request [::Google::Cloud::ApiHub::V1::DeleteCurationRequest, ::Hash]
596
+ # A request object representing the call parameters. Required. To specify no
597
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
598
+ # @param options [::Gapic::CallOptions, ::Hash]
599
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
600
+ #
601
+ # @overload delete_curation(name: nil)
602
+ # Pass arguments to `delete_curation` via keyword arguments. Note that at
603
+ # least one keyword argument is required. To specify no parameters, or to keep all
604
+ # the default parameter values, pass an empty Hash as a request object (see above).
605
+ #
606
+ # @param name [::String]
607
+ # Required. The name of the curation resource to delete.
608
+ # Format: `projects/{project}/locations/{location}/curations/{curation}`
609
+ # @yield [result, operation] Access the result along with the TransportOperation object
610
+ # @yieldparam result [::Google::Protobuf::Empty]
611
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
612
+ #
613
+ # @return [::Google::Protobuf::Empty]
614
+ #
615
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
616
+ #
617
+ # @example Basic example
618
+ # require "google/cloud/api_hub/v1"
619
+ #
620
+ # # Create a client object. The client can be reused for multiple calls.
621
+ # client = Google::Cloud::ApiHub::V1::ApiHubCurate::Rest::Client.new
622
+ #
623
+ # # Create a request. To set request fields, pass in keyword arguments.
624
+ # request = Google::Cloud::ApiHub::V1::DeleteCurationRequest.new
625
+ #
626
+ # # Call the delete_curation method.
627
+ # result = client.delete_curation request
628
+ #
629
+ # # The returned object is of type Google::Protobuf::Empty.
630
+ # p result
631
+ #
632
+ def delete_curation request, options = nil
633
+ raise ::ArgumentError, "request must be provided" if request.nil?
634
+
635
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::DeleteCurationRequest
636
+
637
+ # Converts hash and nil to an options object
638
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
639
+
640
+ # Customize the options with defaults
641
+ call_metadata = @config.rpcs.delete_curation.metadata.to_h
642
+
643
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
644
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
645
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
646
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
647
+ transports_version_send: [:rest]
648
+
649
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
650
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
651
+
652
+ options.apply_defaults timeout: @config.rpcs.delete_curation.timeout,
653
+ metadata: call_metadata,
654
+ retry_policy: @config.rpcs.delete_curation.retry_policy
655
+
656
+ options.apply_defaults timeout: @config.timeout,
657
+ metadata: @config.metadata,
658
+ retry_policy: @config.retry_policy
659
+
660
+ @api_hub_curate_stub.delete_curation request, options do |result, operation|
661
+ yield result, operation if block_given?
662
+ end
663
+ rescue ::Gapic::Rest::Error => e
664
+ raise ::Google::Cloud::Error.from_error(e)
665
+ end
666
+
667
+ ##
668
+ # Configuration class for the ApiHubCurate REST API.
669
+ #
670
+ # This class represents the configuration for ApiHubCurate REST,
671
+ # providing control over timeouts, retry behavior, logging, transport
672
+ # parameters, and other low-level controls. Certain parameters can also be
673
+ # applied individually to specific RPCs. See
674
+ # {::Google::Cloud::ApiHub::V1::ApiHubCurate::Rest::Client::Configuration::Rpcs}
675
+ # for a list of RPCs that can be configured independently.
676
+ #
677
+ # Configuration can be applied globally to all clients, or to a single client
678
+ # on construction.
679
+ #
680
+ # @example
681
+ #
682
+ # # Modify the global config, setting the timeout for
683
+ # # create_curation to 20 seconds,
684
+ # # and all remaining timeouts to 10 seconds.
685
+ # ::Google::Cloud::ApiHub::V1::ApiHubCurate::Rest::Client.configure do |config|
686
+ # config.timeout = 10.0
687
+ # config.rpcs.create_curation.timeout = 20.0
688
+ # end
689
+ #
690
+ # # Apply the above configuration only to a new client.
691
+ # client = ::Google::Cloud::ApiHub::V1::ApiHubCurate::Rest::Client.new do |config|
692
+ # config.timeout = 10.0
693
+ # config.rpcs.create_curation.timeout = 20.0
694
+ # end
695
+ #
696
+ # @!attribute [rw] endpoint
697
+ # A custom service endpoint, as a hostname or hostname:port. The default is
698
+ # nil, indicating to use the default endpoint in the current universe domain.
699
+ # @return [::String,nil]
700
+ # @!attribute [rw] credentials
701
+ # Credentials to send with calls. You may provide any of the following types:
702
+ # * (`String`) The path to a service account key file in JSON format
703
+ # * (`Hash`) A service account key as a Hash
704
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
705
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
706
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
707
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
708
+ # * (`nil`) indicating no credentials
709
+ #
710
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
711
+ # external source for authentication to Google Cloud, you must validate it before
712
+ # providing it to a Google API client library. Providing an unvalidated credential
713
+ # configuration to Google APIs can compromise the security of your systems and data.
714
+ # For more information, refer to [Validate credential configurations from external
715
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
716
+ # @return [::Object]
717
+ # @!attribute [rw] scope
718
+ # The OAuth scopes
719
+ # @return [::Array<::String>]
720
+ # @!attribute [rw] lib_name
721
+ # The library name as recorded in instrumentation and logging
722
+ # @return [::String]
723
+ # @!attribute [rw] lib_version
724
+ # The library version as recorded in instrumentation and logging
725
+ # @return [::String]
726
+ # @!attribute [rw] timeout
727
+ # The call timeout in seconds.
728
+ # @return [::Numeric]
729
+ # @!attribute [rw] metadata
730
+ # Additional headers to be sent with the call.
731
+ # @return [::Hash{::Symbol=>::String}]
732
+ # @!attribute [rw] retry_policy
733
+ # The retry policy. The value is a hash with the following keys:
734
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
735
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
736
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
737
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
738
+ # trigger a retry.
739
+ # @return [::Hash]
740
+ # @!attribute [rw] quota_project
741
+ # A separate project against which to charge quota.
742
+ # @return [::String]
743
+ # @!attribute [rw] universe_domain
744
+ # The universe domain within which to make requests. This determines the
745
+ # default endpoint URL. The default value of nil uses the environment
746
+ # universe (usually the default "googleapis.com" universe).
747
+ # @return [::String,nil]
748
+ # @!attribute [rw] logger
749
+ # A custom logger to use for request/response debug logging, or the value
750
+ # `:default` (the default) to construct a default logger, or `nil` to
751
+ # explicitly disable logging.
752
+ # @return [::Logger,:default,nil]
753
+ #
754
+ class Configuration
755
+ extend ::Gapic::Config
756
+
757
+ # @private
758
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
759
+ DEFAULT_ENDPOINT = "apihub.googleapis.com"
760
+
761
+ config_attr :endpoint, nil, ::String, nil
762
+ config_attr :credentials, nil do |value|
763
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
764
+ allowed.any? { |klass| klass === value }
765
+ end
766
+ config_attr :scope, nil, ::String, ::Array, nil
767
+ config_attr :lib_name, nil, ::String, nil
768
+ config_attr :lib_version, nil, ::String, nil
769
+ config_attr :timeout, nil, ::Numeric, nil
770
+ config_attr :metadata, nil, ::Hash, nil
771
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
772
+ config_attr :quota_project, nil, ::String, nil
773
+ config_attr :universe_domain, nil, ::String, nil
774
+
775
+ # @private
776
+ # Overrides for http bindings for the RPCs of this service
777
+ # are only used when this service is used as mixin, and only
778
+ # by the host service.
779
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
780
+ config_attr :bindings_override, {}, ::Hash, nil
781
+ config_attr :logger, :default, ::Logger, nil, :default
782
+
783
+ # @private
784
+ def initialize parent_config = nil
785
+ @parent_config = parent_config unless parent_config.nil?
786
+
787
+ yield self if block_given?
788
+ end
789
+
790
+ ##
791
+ # Configurations for individual RPCs
792
+ # @return [Rpcs]
793
+ #
794
+ def rpcs
795
+ @rpcs ||= begin
796
+ parent_rpcs = nil
797
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
798
+ Rpcs.new parent_rpcs
799
+ end
800
+ end
801
+
802
+ ##
803
+ # Configuration RPC class for the ApiHubCurate API.
804
+ #
805
+ # Includes fields providing the configuration for each RPC in this service.
806
+ # Each configuration object is of type `Gapic::Config::Method` and includes
807
+ # the following configuration fields:
808
+ #
809
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
810
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
811
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
812
+ # include the following keys:
813
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
814
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
815
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
816
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
817
+ # trigger a retry.
818
+ #
819
+ class Rpcs
820
+ ##
821
+ # RPC-specific configuration for `create_curation`
822
+ # @return [::Gapic::Config::Method]
823
+ #
824
+ attr_reader :create_curation
825
+ ##
826
+ # RPC-specific configuration for `get_curation`
827
+ # @return [::Gapic::Config::Method]
828
+ #
829
+ attr_reader :get_curation
830
+ ##
831
+ # RPC-specific configuration for `list_curations`
832
+ # @return [::Gapic::Config::Method]
833
+ #
834
+ attr_reader :list_curations
835
+ ##
836
+ # RPC-specific configuration for `update_curation`
837
+ # @return [::Gapic::Config::Method]
838
+ #
839
+ attr_reader :update_curation
840
+ ##
841
+ # RPC-specific configuration for `delete_curation`
842
+ # @return [::Gapic::Config::Method]
843
+ #
844
+ attr_reader :delete_curation
845
+
846
+ # @private
847
+ def initialize parent_rpcs = nil
848
+ create_curation_config = parent_rpcs.create_curation if parent_rpcs.respond_to? :create_curation
849
+ @create_curation = ::Gapic::Config::Method.new create_curation_config
850
+ get_curation_config = parent_rpcs.get_curation if parent_rpcs.respond_to? :get_curation
851
+ @get_curation = ::Gapic::Config::Method.new get_curation_config
852
+ list_curations_config = parent_rpcs.list_curations if parent_rpcs.respond_to? :list_curations
853
+ @list_curations = ::Gapic::Config::Method.new list_curations_config
854
+ update_curation_config = parent_rpcs.update_curation if parent_rpcs.respond_to? :update_curation
855
+ @update_curation = ::Gapic::Config::Method.new update_curation_config
856
+ delete_curation_config = parent_rpcs.delete_curation if parent_rpcs.respond_to? :delete_curation
857
+ @delete_curation = ::Gapic::Config::Method.new delete_curation_config
858
+
859
+ yield self if block_given?
860
+ end
861
+ end
862
+ end
863
+ end
864
+ end
865
+ end
866
+ end
867
+ end
868
+ end
869
+ end