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