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