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.
- checksums.yaml +4 -4
- data/lib/google/cloud/api_hub/v1/api_hub/paths.rb +21 -0
- data/lib/google/cloud/api_hub/v1/api_hub/rest/client.rb +497 -9
- data/lib/google/cloud/api_hub/v1/api_hub/rest/service_stub.rb +185 -0
- data/lib/google/cloud/api_hub/v1/api_hub_collect/credentials.rb +47 -0
- data/lib/google/cloud/api_hub/v1/api_hub_collect/paths.rb +218 -0
- data/lib/google/cloud/api_hub/v1/api_hub_collect/rest/client.rb +487 -0
- data/lib/google/cloud/api_hub/v1/api_hub_collect/rest/operations.rb +914 -0
- data/lib/google/cloud/api_hub/v1/api_hub_collect/rest/service_stub.rb +143 -0
- data/lib/google/cloud/api_hub/v1/api_hub_collect/rest.rb +56 -0
- data/lib/google/cloud/api_hub/v1/api_hub_collect.rb +50 -0
- data/lib/google/cloud/api_hub/v1/api_hub_curate/credentials.rb +47 -0
- data/lib/google/cloud/api_hub/v1/api_hub_curate/paths.rb +90 -0
- data/lib/google/cloud/api_hub/v1/api_hub_curate/rest/client.rb +869 -0
- data/lib/google/cloud/api_hub/v1/api_hub_curate/rest/service_stub.rb +388 -0
- data/lib/google/cloud/api_hub/v1/api_hub_curate/rest.rb +54 -0
- data/lib/google/cloud/api_hub/v1/api_hub_curate.rb +49 -0
- data/lib/google/cloud/api_hub/v1/api_hub_discovery/credentials.rb +47 -0
- data/lib/google/cloud/api_hub/v1/api_hub_discovery/paths.rb +90 -0
- data/lib/google/cloud/api_hub/v1/api_hub_discovery/rest/client.rb +750 -0
- data/lib/google/cloud/api_hub/v1/api_hub_discovery/rest/service_stub.rb +325 -0
- data/lib/google/cloud/api_hub/v1/api_hub_discovery/rest.rb +54 -0
- data/lib/google/cloud/api_hub/v1/api_hub_discovery.rb +49 -0
- data/lib/google/cloud/api_hub/v1/api_hub_plugin/paths.rb +74 -0
- data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb +1265 -98
- data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest/operations.rb +914 -0
- data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest/service_stub.rb +677 -0
- data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest.rb +1 -0
- data/lib/google/cloud/api_hub/v1/bindings_override.rb +2 -29
- data/lib/google/cloud/api_hub/v1/provisioning/rest/client.rb +96 -0
- data/lib/google/cloud/api_hub/v1/provisioning/rest/service_stub.rb +61 -0
- data/lib/google/cloud/api_hub/v1/rest.rb +3 -0
- data/lib/google/cloud/api_hub/v1/version.rb +1 -1
- data/lib/google/cloud/api_hub/v1.rb +3 -0
- data/lib/google/cloud/apihub/v1/apihub_service_pb.rb +4 -1
- data/lib/google/cloud/apihub/v1/apihub_service_services_pb.rb +35 -2
- data/lib/google/cloud/apihub/v1/collect_service_pb.rb +60 -0
- data/lib/google/cloud/apihub/v1/collect_service_services_pb.rb +47 -0
- data/lib/google/cloud/apihub/v1/common_fields_pb.rb +34 -1
- data/lib/google/cloud/apihub/v1/curate_service_pb.rb +63 -0
- data/lib/google/cloud/apihub/v1/curate_service_services_pb.rb +64 -0
- data/lib/google/cloud/apihub/v1/discovery_service_pb.rb +54 -0
- data/lib/google/cloud/apihub/v1/discovery_service_services_pb.rb +55 -0
- data/lib/google/cloud/apihub/v1/plugin_service_pb.rb +44 -1
- data/lib/google/cloud/apihub/v1/plugin_service_services_pb.rb +43 -1
- data/lib/google/cloud/apihub/v1/provisioning_service_pb.rb +3 -1
- data/lib/google/cloud/apihub/v1/provisioning_service_services_pb.rb +2 -0
- data/proto_docs/google/cloud/apihub/v1/apihub_service.rb +251 -15
- data/proto_docs/google/cloud/apihub/v1/collect_service.rb +188 -0
- data/proto_docs/google/cloud/apihub/v1/common_fields.rb +819 -28
- data/proto_docs/google/cloud/apihub/v1/curate_service.rb +268 -0
- data/proto_docs/google/cloud/apihub/v1/discovery_service.rb +124 -0
- data/proto_docs/google/cloud/apihub/v1/linting_service.rb +10 -4
- data/proto_docs/google/cloud/apihub/v1/plugin_service.rb +799 -1
- data/proto_docs/google/cloud/apihub/v1/provisioning_service.rb +13 -0
- metadata +33 -4
@@ -0,0 +1,487 @@
|
|
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/collect_service_pb"
|
21
|
+
require "google/cloud/api_hub/v1/api_hub_collect/rest/service_stub"
|
22
|
+
require "google/cloud/location/rest"
|
23
|
+
|
24
|
+
module Google
|
25
|
+
module Cloud
|
26
|
+
module ApiHub
|
27
|
+
module V1
|
28
|
+
module ApiHubCollect
|
29
|
+
module Rest
|
30
|
+
##
|
31
|
+
# REST client for the ApiHubCollect service.
|
32
|
+
#
|
33
|
+
# This service exposes methods used for collecting various types of data from
|
34
|
+
# different first party and third party sources and push it to Hub's collect
|
35
|
+
# layer.
|
36
|
+
#
|
37
|
+
class Client
|
38
|
+
# @private
|
39
|
+
API_VERSION = ""
|
40
|
+
|
41
|
+
# @private
|
42
|
+
DEFAULT_ENDPOINT_TEMPLATE = "apihub.$UNIVERSE_DOMAIN$"
|
43
|
+
|
44
|
+
include Paths
|
45
|
+
|
46
|
+
# @private
|
47
|
+
attr_reader :api_hub_collect_stub
|
48
|
+
|
49
|
+
##
|
50
|
+
# Configure the ApiHubCollect Client class.
|
51
|
+
#
|
52
|
+
# See {::Google::Cloud::ApiHub::V1::ApiHubCollect::Rest::Client::Configuration}
|
53
|
+
# for a description of the configuration fields.
|
54
|
+
#
|
55
|
+
# @example
|
56
|
+
#
|
57
|
+
# # Modify the configuration for all ApiHubCollect clients
|
58
|
+
# ::Google::Cloud::ApiHub::V1::ApiHubCollect::Rest::Client.configure do |config|
|
59
|
+
# config.timeout = 10.0
|
60
|
+
# end
|
61
|
+
#
|
62
|
+
# @yield [config] Configure the Client client.
|
63
|
+
# @yieldparam config [Client::Configuration]
|
64
|
+
#
|
65
|
+
# @return [Client::Configuration]
|
66
|
+
#
|
67
|
+
def self.configure
|
68
|
+
@configure ||= begin
|
69
|
+
namespace = ["Google", "Cloud", "ApiHub", "V1"]
|
70
|
+
parent_config = while namespace.any?
|
71
|
+
parent_name = namespace.join "::"
|
72
|
+
parent_const = const_get parent_name
|
73
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
74
|
+
namespace.pop
|
75
|
+
end
|
76
|
+
default_config = Client::Configuration.new parent_config
|
77
|
+
|
78
|
+
default_config
|
79
|
+
end
|
80
|
+
yield @configure if block_given?
|
81
|
+
@configure
|
82
|
+
end
|
83
|
+
|
84
|
+
##
|
85
|
+
# Configure the ApiHubCollect Client instance.
|
86
|
+
#
|
87
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
88
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
89
|
+
# should be made on {Client.configure}.
|
90
|
+
#
|
91
|
+
# See {::Google::Cloud::ApiHub::V1::ApiHubCollect::Rest::Client::Configuration}
|
92
|
+
# for a description of the configuration fields.
|
93
|
+
#
|
94
|
+
# @yield [config] Configure the Client client.
|
95
|
+
# @yieldparam config [Client::Configuration]
|
96
|
+
#
|
97
|
+
# @return [Client::Configuration]
|
98
|
+
#
|
99
|
+
def configure
|
100
|
+
yield @config if block_given?
|
101
|
+
@config
|
102
|
+
end
|
103
|
+
|
104
|
+
##
|
105
|
+
# The effective universe domain
|
106
|
+
#
|
107
|
+
# @return [String]
|
108
|
+
#
|
109
|
+
def universe_domain
|
110
|
+
@api_hub_collect_stub.universe_domain
|
111
|
+
end
|
112
|
+
|
113
|
+
##
|
114
|
+
# Create a new ApiHubCollect REST client object.
|
115
|
+
#
|
116
|
+
# @example
|
117
|
+
#
|
118
|
+
# # Create a client using the default configuration
|
119
|
+
# client = ::Google::Cloud::ApiHub::V1::ApiHubCollect::Rest::Client.new
|
120
|
+
#
|
121
|
+
# # Create a client using a custom configuration
|
122
|
+
# client = ::Google::Cloud::ApiHub::V1::ApiHubCollect::Rest::Client.new do |config|
|
123
|
+
# config.timeout = 10.0
|
124
|
+
# end
|
125
|
+
#
|
126
|
+
# @yield [config] Configure the ApiHubCollect client.
|
127
|
+
# @yieldparam config [Client::Configuration]
|
128
|
+
#
|
129
|
+
def initialize
|
130
|
+
# Create the configuration object
|
131
|
+
@config = Configuration.new Client.configure
|
132
|
+
|
133
|
+
# Yield the configuration if needed
|
134
|
+
yield @config if block_given?
|
135
|
+
|
136
|
+
# Create credentials
|
137
|
+
credentials = @config.credentials
|
138
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
139
|
+
# but only if the default endpoint does not have a region prefix.
|
140
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
141
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
142
|
+
!@config.endpoint.split(".").first.include?("-"))
|
143
|
+
credentials ||= Credentials.default scope: @config.scope,
|
144
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
145
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
146
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
147
|
+
end
|
148
|
+
|
149
|
+
@quota_project_id = @config.quota_project
|
150
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
151
|
+
|
152
|
+
@operations_client = ::Google::Cloud::ApiHub::V1::ApiHubCollect::Rest::Operations.new do |config|
|
153
|
+
config.credentials = credentials
|
154
|
+
config.quota_project = @quota_project_id
|
155
|
+
config.endpoint = @config.endpoint
|
156
|
+
config.universe_domain = @config.universe_domain
|
157
|
+
end
|
158
|
+
|
159
|
+
@api_hub_collect_stub = ::Google::Cloud::ApiHub::V1::ApiHubCollect::Rest::ServiceStub.new(
|
160
|
+
endpoint: @config.endpoint,
|
161
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
162
|
+
universe_domain: @config.universe_domain,
|
163
|
+
credentials: credentials,
|
164
|
+
logger: @config.logger
|
165
|
+
)
|
166
|
+
|
167
|
+
@api_hub_collect_stub.logger(stub: true)&.info do |entry|
|
168
|
+
entry.set_system_name
|
169
|
+
entry.set_service
|
170
|
+
entry.message = "Created client for #{entry.service}"
|
171
|
+
entry.set_credentials_fields credentials
|
172
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
173
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
174
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
175
|
+
end
|
176
|
+
|
177
|
+
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
178
|
+
config.credentials = credentials
|
179
|
+
config.quota_project = @quota_project_id
|
180
|
+
config.endpoint = @api_hub_collect_stub.endpoint
|
181
|
+
config.universe_domain = @api_hub_collect_stub.universe_domain
|
182
|
+
config.bindings_override = @config.bindings_override
|
183
|
+
config.logger = @api_hub_collect_stub.logger if config.respond_to? :logger=
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
##
|
188
|
+
# Get the associated client for long-running operations.
|
189
|
+
#
|
190
|
+
# @return [::Google::Cloud::ApiHub::V1::ApiHubCollect::Rest::Operations]
|
191
|
+
#
|
192
|
+
attr_reader :operations_client
|
193
|
+
|
194
|
+
##
|
195
|
+
# Get the associated client for mix-in of the Locations.
|
196
|
+
#
|
197
|
+
# @return [Google::Cloud::Location::Locations::Rest::Client]
|
198
|
+
#
|
199
|
+
attr_reader :location_client
|
200
|
+
|
201
|
+
##
|
202
|
+
# The logger used for request/response debug logging.
|
203
|
+
#
|
204
|
+
# @return [Logger]
|
205
|
+
#
|
206
|
+
def logger
|
207
|
+
@api_hub_collect_stub.logger
|
208
|
+
end
|
209
|
+
|
210
|
+
# Service calls
|
211
|
+
|
212
|
+
##
|
213
|
+
# Collect API data from a source and push it to Hub's collect layer.
|
214
|
+
#
|
215
|
+
# @overload collect_api_data(request, options = nil)
|
216
|
+
# Pass arguments to `collect_api_data` via a request object, either of type
|
217
|
+
# {::Google::Cloud::ApiHub::V1::CollectApiDataRequest} or an equivalent Hash.
|
218
|
+
#
|
219
|
+
# @param request [::Google::Cloud::ApiHub::V1::CollectApiDataRequest, ::Hash]
|
220
|
+
# A request object representing the call parameters. Required. To specify no
|
221
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
222
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
223
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
224
|
+
#
|
225
|
+
# @overload collect_api_data(location: nil, collection_type: nil, plugin_instance: nil, action_id: nil, api_data: nil)
|
226
|
+
# Pass arguments to `collect_api_data` via keyword arguments. Note that at
|
227
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
228
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
229
|
+
#
|
230
|
+
# @param location [::String]
|
231
|
+
# Required. The regional location of the API hub instance and its resources.
|
232
|
+
# Format: `projects/{project}/locations/{location}`
|
233
|
+
# @param collection_type [::Google::Cloud::ApiHub::V1::CollectionType]
|
234
|
+
# Required. The type of collection. Applies to all entries in
|
235
|
+
# {::Google::Cloud::ApiHub::V1::CollectApiDataRequest#api_data api_data}.
|
236
|
+
# @param plugin_instance [::String]
|
237
|
+
# Required. The plugin instance collecting the API data.
|
238
|
+
# Format:
|
239
|
+
# `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`.
|
240
|
+
# @param action_id [::String]
|
241
|
+
# Required. The action ID to be used for collecting the API data.
|
242
|
+
# This should map to one of the action IDs specified
|
243
|
+
# in action configs in the plugin.
|
244
|
+
# @param api_data [::Google::Cloud::ApiHub::V1::ApiData, ::Hash]
|
245
|
+
# Required. The API data to be collected.
|
246
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
247
|
+
# @yieldparam result [::Gapic::Operation]
|
248
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
249
|
+
#
|
250
|
+
# @return [::Gapic::Operation]
|
251
|
+
#
|
252
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
253
|
+
#
|
254
|
+
# @example Basic example
|
255
|
+
# require "google/cloud/api_hub/v1"
|
256
|
+
#
|
257
|
+
# # Create a client object. The client can be reused for multiple calls.
|
258
|
+
# client = Google::Cloud::ApiHub::V1::ApiHubCollect::Rest::Client.new
|
259
|
+
#
|
260
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
261
|
+
# request = Google::Cloud::ApiHub::V1::CollectApiDataRequest.new
|
262
|
+
#
|
263
|
+
# # Call the collect_api_data method.
|
264
|
+
# result = client.collect_api_data request
|
265
|
+
#
|
266
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
267
|
+
# # check the status of an operation, cancel it, or wait for results.
|
268
|
+
# # Here is how to wait for a response.
|
269
|
+
# result.wait_until_done! timeout: 60
|
270
|
+
# if result.response?
|
271
|
+
# p result.response
|
272
|
+
# else
|
273
|
+
# puts "No response received."
|
274
|
+
# end
|
275
|
+
#
|
276
|
+
def collect_api_data request, options = nil
|
277
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
278
|
+
|
279
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::CollectApiDataRequest
|
280
|
+
|
281
|
+
# Converts hash and nil to an options object
|
282
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
283
|
+
|
284
|
+
# Customize the options with defaults
|
285
|
+
call_metadata = @config.rpcs.collect_api_data.metadata.to_h
|
286
|
+
|
287
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
288
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
289
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
290
|
+
gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
|
291
|
+
transports_version_send: [:rest]
|
292
|
+
|
293
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
294
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
295
|
+
|
296
|
+
options.apply_defaults timeout: @config.rpcs.collect_api_data.timeout,
|
297
|
+
metadata: call_metadata,
|
298
|
+
retry_policy: @config.rpcs.collect_api_data.retry_policy
|
299
|
+
|
300
|
+
options.apply_defaults timeout: @config.timeout,
|
301
|
+
metadata: @config.metadata,
|
302
|
+
retry_policy: @config.retry_policy
|
303
|
+
|
304
|
+
@api_hub_collect_stub.collect_api_data request, options do |result, operation|
|
305
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
306
|
+
yield result, operation if block_given?
|
307
|
+
throw :response, result
|
308
|
+
end
|
309
|
+
rescue ::Gapic::Rest::Error => e
|
310
|
+
raise ::Google::Cloud::Error.from_error(e)
|
311
|
+
end
|
312
|
+
|
313
|
+
##
|
314
|
+
# Configuration class for the ApiHubCollect REST API.
|
315
|
+
#
|
316
|
+
# This class represents the configuration for ApiHubCollect REST,
|
317
|
+
# providing control over timeouts, retry behavior, logging, transport
|
318
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
319
|
+
# applied individually to specific RPCs. See
|
320
|
+
# {::Google::Cloud::ApiHub::V1::ApiHubCollect::Rest::Client::Configuration::Rpcs}
|
321
|
+
# for a list of RPCs that can be configured independently.
|
322
|
+
#
|
323
|
+
# Configuration can be applied globally to all clients, or to a single client
|
324
|
+
# on construction.
|
325
|
+
#
|
326
|
+
# @example
|
327
|
+
#
|
328
|
+
# # Modify the global config, setting the timeout for
|
329
|
+
# # collect_api_data to 20 seconds,
|
330
|
+
# # and all remaining timeouts to 10 seconds.
|
331
|
+
# ::Google::Cloud::ApiHub::V1::ApiHubCollect::Rest::Client.configure do |config|
|
332
|
+
# config.timeout = 10.0
|
333
|
+
# config.rpcs.collect_api_data.timeout = 20.0
|
334
|
+
# end
|
335
|
+
#
|
336
|
+
# # Apply the above configuration only to a new client.
|
337
|
+
# client = ::Google::Cloud::ApiHub::V1::ApiHubCollect::Rest::Client.new do |config|
|
338
|
+
# config.timeout = 10.0
|
339
|
+
# config.rpcs.collect_api_data.timeout = 20.0
|
340
|
+
# end
|
341
|
+
#
|
342
|
+
# @!attribute [rw] endpoint
|
343
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
344
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
345
|
+
# @return [::String,nil]
|
346
|
+
# @!attribute [rw] credentials
|
347
|
+
# Credentials to send with calls. You may provide any of the following types:
|
348
|
+
# * (`String`) The path to a service account key file in JSON format
|
349
|
+
# * (`Hash`) A service account key as a Hash
|
350
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
351
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
352
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
353
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
354
|
+
# * (`nil`) indicating no credentials
|
355
|
+
#
|
356
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
357
|
+
# external source for authentication to Google Cloud, you must validate it before
|
358
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
359
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
360
|
+
# For more information, refer to [Validate credential configurations from external
|
361
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
362
|
+
# @return [::Object]
|
363
|
+
# @!attribute [rw] scope
|
364
|
+
# The OAuth scopes
|
365
|
+
# @return [::Array<::String>]
|
366
|
+
# @!attribute [rw] lib_name
|
367
|
+
# The library name as recorded in instrumentation and logging
|
368
|
+
# @return [::String]
|
369
|
+
# @!attribute [rw] lib_version
|
370
|
+
# The library version as recorded in instrumentation and logging
|
371
|
+
# @return [::String]
|
372
|
+
# @!attribute [rw] timeout
|
373
|
+
# The call timeout in seconds.
|
374
|
+
# @return [::Numeric]
|
375
|
+
# @!attribute [rw] metadata
|
376
|
+
# Additional headers to be sent with the call.
|
377
|
+
# @return [::Hash{::Symbol=>::String}]
|
378
|
+
# @!attribute [rw] retry_policy
|
379
|
+
# The retry policy. The value is a hash with the following keys:
|
380
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
381
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
382
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
383
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
384
|
+
# trigger a retry.
|
385
|
+
# @return [::Hash]
|
386
|
+
# @!attribute [rw] quota_project
|
387
|
+
# A separate project against which to charge quota.
|
388
|
+
# @return [::String]
|
389
|
+
# @!attribute [rw] universe_domain
|
390
|
+
# The universe domain within which to make requests. This determines the
|
391
|
+
# default endpoint URL. The default value of nil uses the environment
|
392
|
+
# universe (usually the default "googleapis.com" universe).
|
393
|
+
# @return [::String,nil]
|
394
|
+
# @!attribute [rw] logger
|
395
|
+
# A custom logger to use for request/response debug logging, or the value
|
396
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
397
|
+
# explicitly disable logging.
|
398
|
+
# @return [::Logger,:default,nil]
|
399
|
+
#
|
400
|
+
class Configuration
|
401
|
+
extend ::Gapic::Config
|
402
|
+
|
403
|
+
# @private
|
404
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
405
|
+
DEFAULT_ENDPOINT = "apihub.googleapis.com"
|
406
|
+
|
407
|
+
config_attr :endpoint, nil, ::String, nil
|
408
|
+
config_attr :credentials, nil do |value|
|
409
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
|
410
|
+
allowed.any? { |klass| klass === value }
|
411
|
+
end
|
412
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
413
|
+
config_attr :lib_name, nil, ::String, nil
|
414
|
+
config_attr :lib_version, nil, ::String, nil
|
415
|
+
config_attr :timeout, nil, ::Numeric, nil
|
416
|
+
config_attr :metadata, nil, ::Hash, nil
|
417
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
418
|
+
config_attr :quota_project, nil, ::String, nil
|
419
|
+
config_attr :universe_domain, nil, ::String, nil
|
420
|
+
|
421
|
+
# @private
|
422
|
+
# Overrides for http bindings for the RPCs of this service
|
423
|
+
# are only used when this service is used as mixin, and only
|
424
|
+
# by the host service.
|
425
|
+
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
426
|
+
config_attr :bindings_override, {}, ::Hash, nil
|
427
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
428
|
+
|
429
|
+
# @private
|
430
|
+
def initialize parent_config = nil
|
431
|
+
@parent_config = parent_config unless parent_config.nil?
|
432
|
+
|
433
|
+
yield self if block_given?
|
434
|
+
end
|
435
|
+
|
436
|
+
##
|
437
|
+
# Configurations for individual RPCs
|
438
|
+
# @return [Rpcs]
|
439
|
+
#
|
440
|
+
def rpcs
|
441
|
+
@rpcs ||= begin
|
442
|
+
parent_rpcs = nil
|
443
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
444
|
+
Rpcs.new parent_rpcs
|
445
|
+
end
|
446
|
+
end
|
447
|
+
|
448
|
+
##
|
449
|
+
# Configuration RPC class for the ApiHubCollect API.
|
450
|
+
#
|
451
|
+
# Includes fields providing the configuration for each RPC in this service.
|
452
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
453
|
+
# the following configuration fields:
|
454
|
+
#
|
455
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
456
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
457
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
458
|
+
# include the following keys:
|
459
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
460
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
461
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
462
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
463
|
+
# trigger a retry.
|
464
|
+
#
|
465
|
+
class Rpcs
|
466
|
+
##
|
467
|
+
# RPC-specific configuration for `collect_api_data`
|
468
|
+
# @return [::Gapic::Config::Method]
|
469
|
+
#
|
470
|
+
attr_reader :collect_api_data
|
471
|
+
|
472
|
+
# @private
|
473
|
+
def initialize parent_rpcs = nil
|
474
|
+
collect_api_data_config = parent_rpcs.collect_api_data if parent_rpcs.respond_to? :collect_api_data
|
475
|
+
@collect_api_data = ::Gapic::Config::Method.new collect_api_data_config
|
476
|
+
|
477
|
+
yield self if block_given?
|
478
|
+
end
|
479
|
+
end
|
480
|
+
end
|
481
|
+
end
|
482
|
+
end
|
483
|
+
end
|
484
|
+
end
|
485
|
+
end
|
486
|
+
end
|
487
|
+
end
|