google-cloud-api_hub-v1 0.1.1 → 0.2.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 (27) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +4 -4
  3. data/README.md +1 -27
  4. data/lib/google/cloud/api_hub/v1/api_hub.rb +0 -7
  5. data/lib/google/cloud/api_hub/v1/api_hub_dependencies.rb +0 -7
  6. data/lib/google/cloud/api_hub/v1/api_hub_plugin.rb +0 -7
  7. data/lib/google/cloud/api_hub/v1/host_project_registration_service.rb +0 -7
  8. data/lib/google/cloud/api_hub/v1/linting_service.rb +0 -7
  9. data/lib/google/cloud/api_hub/v1/provisioning.rb +0 -8
  10. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service.rb +0 -7
  11. data/lib/google/cloud/api_hub/v1/version.rb +1 -1
  12. data/lib/google/cloud/api_hub/v1.rb +0 -5
  13. data/proto_docs/google/cloud/apihub/v1/apihub_service.rb +47 -47
  14. data/proto_docs/google/cloud/apihub/v1/common_fields.rb +1 -1
  15. data/proto_docs/google/cloud/apihub/v1/host_project_registration_service.rb +4 -4
  16. data/proto_docs/google/cloud/apihub/v1/plugin_service.rb +3 -3
  17. data/proto_docs/google/cloud/apihub/v1/provisioning_service.rb +4 -4
  18. data/proto_docs/google/cloud/apihub/v1/runtime_project_attachment_service.rb +7 -7
  19. metadata +2 -10
  20. data/lib/google/cloud/api_hub/v1/api_hub/client.rb +0 -4514
  21. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/client.rb +0 -906
  22. data/lib/google/cloud/api_hub/v1/api_hub_plugin/client.rb +0 -640
  23. data/lib/google/cloud/api_hub/v1/host_project_registration_service/client.rb +0 -689
  24. data/lib/google/cloud/api_hub/v1/linting_service/client.rb +0 -744
  25. data/lib/google/cloud/api_hub/v1/provisioning/client.rb +0 -676
  26. data/lib/google/cloud/api_hub/v1/provisioning/operations.rb +0 -809
  27. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/client.rb +0 -885
@@ -1,885 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright 2024 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/runtime_project_attachment_service_pb"
21
- require "google/cloud/location"
22
-
23
- module Google
24
- module Cloud
25
- module ApiHub
26
- module V1
27
- module RuntimeProjectAttachmentService
28
- ##
29
- # Client for the RuntimeProjectAttachmentService service.
30
- #
31
- # This service is used for managing the runtime project attachments.
32
- #
33
- class Client
34
- # @private
35
- API_VERSION = ""
36
-
37
- # @private
38
- DEFAULT_ENDPOINT_TEMPLATE = "apihub.$UNIVERSE_DOMAIN$"
39
-
40
- include Paths
41
-
42
- # @private
43
- attr_reader :runtime_project_attachment_service_stub
44
-
45
- ##
46
- # Configure the RuntimeProjectAttachmentService Client class.
47
- #
48
- # See {::Google::Cloud::ApiHub::V1::RuntimeProjectAttachmentService::Client::Configuration}
49
- # for a description of the configuration fields.
50
- #
51
- # @example
52
- #
53
- # # Modify the configuration for all RuntimeProjectAttachmentService clients
54
- # ::Google::Cloud::ApiHub::V1::RuntimeProjectAttachmentService::Client.configure do |config|
55
- # config.timeout = 10.0
56
- # end
57
- #
58
- # @yield [config] Configure the Client client.
59
- # @yieldparam config [Client::Configuration]
60
- #
61
- # @return [Client::Configuration]
62
- #
63
- def self.configure
64
- @configure ||= begin
65
- namespace = ["Google", "Cloud", "ApiHub", "V1"]
66
- parent_config = while namespace.any?
67
- parent_name = namespace.join "::"
68
- parent_const = const_get parent_name
69
- break parent_const.configure if parent_const.respond_to? :configure
70
- namespace.pop
71
- end
72
- default_config = Client::Configuration.new parent_config
73
-
74
- default_config.rpcs.create_runtime_project_attachment.timeout = 60.0
75
-
76
- default_config.rpcs.get_runtime_project_attachment.timeout = 60.0
77
- default_config.rpcs.get_runtime_project_attachment.retry_policy = {
78
- initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
79
- }
80
-
81
- default_config.rpcs.list_runtime_project_attachments.timeout = 60.0
82
- default_config.rpcs.list_runtime_project_attachments.retry_policy = {
83
- initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
84
- }
85
-
86
- default_config.rpcs.delete_runtime_project_attachment.timeout = 60.0
87
-
88
- default_config.rpcs.lookup_runtime_project_attachment.timeout = 60.0
89
- default_config.rpcs.lookup_runtime_project_attachment.retry_policy = {
90
- initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
91
- }
92
-
93
- default_config
94
- end
95
- yield @configure if block_given?
96
- @configure
97
- end
98
-
99
- ##
100
- # Configure the RuntimeProjectAttachmentService Client instance.
101
- #
102
- # The configuration is set to the derived mode, meaning that values can be changed,
103
- # but structural changes (adding new fields, etc.) are not allowed. Structural changes
104
- # should be made on {Client.configure}.
105
- #
106
- # See {::Google::Cloud::ApiHub::V1::RuntimeProjectAttachmentService::Client::Configuration}
107
- # for a description of the configuration fields.
108
- #
109
- # @yield [config] Configure the Client client.
110
- # @yieldparam config [Client::Configuration]
111
- #
112
- # @return [Client::Configuration]
113
- #
114
- def configure
115
- yield @config if block_given?
116
- @config
117
- end
118
-
119
- ##
120
- # The effective universe domain
121
- #
122
- # @return [String]
123
- #
124
- def universe_domain
125
- @runtime_project_attachment_service_stub.universe_domain
126
- end
127
-
128
- ##
129
- # Create a new RuntimeProjectAttachmentService client object.
130
- #
131
- # @example
132
- #
133
- # # Create a client using the default configuration
134
- # client = ::Google::Cloud::ApiHub::V1::RuntimeProjectAttachmentService::Client.new
135
- #
136
- # # Create a client using a custom configuration
137
- # client = ::Google::Cloud::ApiHub::V1::RuntimeProjectAttachmentService::Client.new do |config|
138
- # config.timeout = 10.0
139
- # end
140
- #
141
- # @yield [config] Configure the RuntimeProjectAttachmentService client.
142
- # @yieldparam config [Client::Configuration]
143
- #
144
- def initialize
145
- # These require statements are intentionally placed here to initialize
146
- # the gRPC module only when it's required.
147
- # See https://github.com/googleapis/toolkit/issues/446
148
- require "gapic/grpc"
149
- require "google/cloud/apihub/v1/runtime_project_attachment_service_services_pb"
150
-
151
- # Create the configuration object
152
- @config = Configuration.new Client.configure
153
-
154
- # Yield the configuration if needed
155
- yield @config if block_given?
156
-
157
- # Create credentials
158
- credentials = @config.credentials
159
- # Use self-signed JWT if the endpoint is unchanged from default,
160
- # but only if the default endpoint does not have a region prefix.
161
- enable_self_signed_jwt = @config.endpoint.nil? ||
162
- (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
163
- !@config.endpoint.split(".").first.include?("-"))
164
- credentials ||= Credentials.default scope: @config.scope,
165
- enable_self_signed_jwt: enable_self_signed_jwt
166
- if credentials.is_a?(::String) || credentials.is_a?(::Hash)
167
- credentials = Credentials.new credentials, scope: @config.scope
168
- end
169
- @quota_project_id = @config.quota_project
170
- @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
171
-
172
- @runtime_project_attachment_service_stub = ::Gapic::ServiceStub.new(
173
- ::Google::Cloud::ApiHub::V1::RuntimeProjectAttachmentService::Stub,
174
- credentials: credentials,
175
- endpoint: @config.endpoint,
176
- endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
177
- universe_domain: @config.universe_domain,
178
- channel_args: @config.channel_args,
179
- interceptors: @config.interceptors,
180
- channel_pool_config: @config.channel_pool
181
- )
182
-
183
- @location_client = Google::Cloud::Location::Locations::Client.new do |config|
184
- config.credentials = credentials
185
- config.quota_project = @quota_project_id
186
- config.endpoint = @runtime_project_attachment_service_stub.endpoint
187
- config.universe_domain = @runtime_project_attachment_service_stub.universe_domain
188
- end
189
- end
190
-
191
- ##
192
- # Get the associated client for mix-in of the Locations.
193
- #
194
- # @return [Google::Cloud::Location::Locations::Client]
195
- #
196
- attr_reader :location_client
197
-
198
- # Service calls
199
-
200
- ##
201
- # Attaches a runtime project to the host project.
202
- #
203
- # @overload create_runtime_project_attachment(request, options = nil)
204
- # Pass arguments to `create_runtime_project_attachment` via a request object, either of type
205
- # {::Google::Cloud::ApiHub::V1::CreateRuntimeProjectAttachmentRequest} or an equivalent Hash.
206
- #
207
- # @param request [::Google::Cloud::ApiHub::V1::CreateRuntimeProjectAttachmentRequest, ::Hash]
208
- # A request object representing the call parameters. Required. To specify no
209
- # parameters, or to keep all the default parameter values, pass an empty Hash.
210
- # @param options [::Gapic::CallOptions, ::Hash]
211
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
212
- #
213
- # @overload create_runtime_project_attachment(parent: nil, runtime_project_attachment_id: nil, runtime_project_attachment: nil)
214
- # Pass arguments to `create_runtime_project_attachment` via keyword arguments. Note that at
215
- # least one keyword argument is required. To specify no parameters, or to keep all
216
- # the default parameter values, pass an empty Hash as a request object (see above).
217
- #
218
- # @param parent [::String]
219
- # Required. The parent resource for the Runtime Project Attachment.
220
- # Format: `projects/{project}/locations/{location}`
221
- # @param runtime_project_attachment_id [::String]
222
- # Required. The ID to use for the Runtime Project Attachment, which will
223
- # become the final component of the Runtime Project Attachment's name. The ID
224
- # must be the same as the project ID of the Google cloud project specified in
225
- # the runtime_project_attachment.runtime_project field.
226
- # @param runtime_project_attachment [::Google::Cloud::ApiHub::V1::RuntimeProjectAttachment, ::Hash]
227
- # Required. The Runtime Project Attachment to create.
228
- #
229
- # @yield [response, operation] Access the result along with the RPC operation
230
- # @yieldparam response [::Google::Cloud::ApiHub::V1::RuntimeProjectAttachment]
231
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
232
- #
233
- # @return [::Google::Cloud::ApiHub::V1::RuntimeProjectAttachment]
234
- #
235
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
236
- #
237
- # @example Basic example
238
- # require "google/cloud/api_hub/v1"
239
- #
240
- # # Create a client object. The client can be reused for multiple calls.
241
- # client = Google::Cloud::ApiHub::V1::RuntimeProjectAttachmentService::Client.new
242
- #
243
- # # Create a request. To set request fields, pass in keyword arguments.
244
- # request = Google::Cloud::ApiHub::V1::CreateRuntimeProjectAttachmentRequest.new
245
- #
246
- # # Call the create_runtime_project_attachment method.
247
- # result = client.create_runtime_project_attachment request
248
- #
249
- # # The returned object is of type Google::Cloud::ApiHub::V1::RuntimeProjectAttachment.
250
- # p result
251
- #
252
- def create_runtime_project_attachment request, options = nil
253
- raise ::ArgumentError, "request must be provided" if request.nil?
254
-
255
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::CreateRuntimeProjectAttachmentRequest
256
-
257
- # Converts hash and nil to an options object
258
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
259
-
260
- # Customize the options with defaults
261
- metadata = @config.rpcs.create_runtime_project_attachment.metadata.to_h
262
-
263
- # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
264
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
265
- lib_name: @config.lib_name, lib_version: @config.lib_version,
266
- gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
267
- metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
268
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
269
-
270
- header_params = {}
271
- if request.parent
272
- header_params["parent"] = request.parent
273
- end
274
-
275
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
276
- metadata[:"x-goog-request-params"] ||= request_params_header
277
-
278
- options.apply_defaults timeout: @config.rpcs.create_runtime_project_attachment.timeout,
279
- metadata: metadata,
280
- retry_policy: @config.rpcs.create_runtime_project_attachment.retry_policy
281
-
282
- options.apply_defaults timeout: @config.timeout,
283
- metadata: @config.metadata,
284
- retry_policy: @config.retry_policy
285
-
286
- @runtime_project_attachment_service_stub.call_rpc :create_runtime_project_attachment, request, options: options do |response, operation|
287
- yield response, operation if block_given?
288
- return response
289
- end
290
- rescue ::GRPC::BadStatus => e
291
- raise ::Google::Cloud::Error.from_error(e)
292
- end
293
-
294
- ##
295
- # Gets a runtime project attachment.
296
- #
297
- # @overload get_runtime_project_attachment(request, options = nil)
298
- # Pass arguments to `get_runtime_project_attachment` via a request object, either of type
299
- # {::Google::Cloud::ApiHub::V1::GetRuntimeProjectAttachmentRequest} or an equivalent Hash.
300
- #
301
- # @param request [::Google::Cloud::ApiHub::V1::GetRuntimeProjectAttachmentRequest, ::Hash]
302
- # A request object representing the call parameters. Required. To specify no
303
- # parameters, or to keep all the default parameter values, pass an empty Hash.
304
- # @param options [::Gapic::CallOptions, ::Hash]
305
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
306
- #
307
- # @overload get_runtime_project_attachment(name: nil)
308
- # Pass arguments to `get_runtime_project_attachment` via keyword arguments. Note that at
309
- # least one keyword argument is required. To specify no parameters, or to keep all
310
- # the default parameter values, pass an empty Hash as a request object (see above).
311
- #
312
- # @param name [::String]
313
- # Required. The name of the API resource to retrieve.
314
- # Format:
315
- # `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
316
- #
317
- # @yield [response, operation] Access the result along with the RPC operation
318
- # @yieldparam response [::Google::Cloud::ApiHub::V1::RuntimeProjectAttachment]
319
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
320
- #
321
- # @return [::Google::Cloud::ApiHub::V1::RuntimeProjectAttachment]
322
- #
323
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
324
- #
325
- # @example Basic example
326
- # require "google/cloud/api_hub/v1"
327
- #
328
- # # Create a client object. The client can be reused for multiple calls.
329
- # client = Google::Cloud::ApiHub::V1::RuntimeProjectAttachmentService::Client.new
330
- #
331
- # # Create a request. To set request fields, pass in keyword arguments.
332
- # request = Google::Cloud::ApiHub::V1::GetRuntimeProjectAttachmentRequest.new
333
- #
334
- # # Call the get_runtime_project_attachment method.
335
- # result = client.get_runtime_project_attachment request
336
- #
337
- # # The returned object is of type Google::Cloud::ApiHub::V1::RuntimeProjectAttachment.
338
- # p result
339
- #
340
- def get_runtime_project_attachment request, options = nil
341
- raise ::ArgumentError, "request must be provided" if request.nil?
342
-
343
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetRuntimeProjectAttachmentRequest
344
-
345
- # Converts hash and nil to an options object
346
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
347
-
348
- # Customize the options with defaults
349
- metadata = @config.rpcs.get_runtime_project_attachment.metadata.to_h
350
-
351
- # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
352
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
353
- lib_name: @config.lib_name, lib_version: @config.lib_version,
354
- gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
355
- metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
356
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
357
-
358
- header_params = {}
359
- if request.name
360
- header_params["name"] = request.name
361
- end
362
-
363
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
364
- metadata[:"x-goog-request-params"] ||= request_params_header
365
-
366
- options.apply_defaults timeout: @config.rpcs.get_runtime_project_attachment.timeout,
367
- metadata: metadata,
368
- retry_policy: @config.rpcs.get_runtime_project_attachment.retry_policy
369
-
370
- options.apply_defaults timeout: @config.timeout,
371
- metadata: @config.metadata,
372
- retry_policy: @config.retry_policy
373
-
374
- @runtime_project_attachment_service_stub.call_rpc :get_runtime_project_attachment, request, options: options do |response, operation|
375
- yield response, operation if block_given?
376
- return response
377
- end
378
- rescue ::GRPC::BadStatus => e
379
- raise ::Google::Cloud::Error.from_error(e)
380
- end
381
-
382
- ##
383
- # List runtime projects attached to the host project.
384
- #
385
- # @overload list_runtime_project_attachments(request, options = nil)
386
- # Pass arguments to `list_runtime_project_attachments` via a request object, either of type
387
- # {::Google::Cloud::ApiHub::V1::ListRuntimeProjectAttachmentsRequest} or an equivalent Hash.
388
- #
389
- # @param request [::Google::Cloud::ApiHub::V1::ListRuntimeProjectAttachmentsRequest, ::Hash]
390
- # A request object representing the call parameters. Required. To specify no
391
- # parameters, or to keep all the default parameter values, pass an empty Hash.
392
- # @param options [::Gapic::CallOptions, ::Hash]
393
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
394
- #
395
- # @overload list_runtime_project_attachments(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
396
- # Pass arguments to `list_runtime_project_attachments` via keyword arguments. Note that at
397
- # least one keyword argument is required. To specify no parameters, or to keep all
398
- # the default parameter values, pass an empty Hash as a request object (see above).
399
- #
400
- # @param parent [::String]
401
- # Required. The parent, which owns this collection of runtime project
402
- # attachments. Format: `projects/{project}/locations/{location}`
403
- # @param page_size [::Integer]
404
- # Optional. The maximum number of runtime project attachments to return. The
405
- # service may return fewer than this value. If unspecified, at most 50
406
- # runtime project attachments will be returned. The maximum value is 1000;
407
- # values above 1000 will be coerced to 1000.
408
- # @param page_token [::String]
409
- # Optional. A page token, received from a previous
410
- # `ListRuntimeProjectAttachments` call. Provide this to retrieve the
411
- # subsequent page.
412
- #
413
- # When paginating, all other parameters (except page_size) provided to
414
- # `ListRuntimeProjectAttachments` must match the call that provided the page
415
- # token.
416
- # @param filter [::String]
417
- # Optional. An expression that filters the list of RuntimeProjectAttachments.
418
- #
419
- # A filter expression consists of a field name, a comparison
420
- # operator, and a value for filtering. The value must be a string. All
421
- # standard operators as documented at https://google.aip.dev/160 are
422
- # supported.
423
- #
424
- # The following fields in the `RuntimeProjectAttachment` are eligible for
425
- # filtering:
426
- #
427
- # * `name` - The name of the RuntimeProjectAttachment.
428
- # * `create_time` - The time at which the RuntimeProjectAttachment was
429
- # created. The value should be in the
430
- # (RFC3339)[https://tools.ietf.org/html/rfc3339] format.
431
- # * `runtime_project` - The Google cloud project associated with the
432
- # RuntimeProjectAttachment.
433
- # @param order_by [::String]
434
- # Optional. Hint for how to order the results.
435
- #
436
- # @yield [response, operation] Access the result along with the RPC operation
437
- # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::RuntimeProjectAttachment>]
438
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
439
- #
440
- # @return [::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::RuntimeProjectAttachment>]
441
- #
442
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
443
- #
444
- # @example Basic example
445
- # require "google/cloud/api_hub/v1"
446
- #
447
- # # Create a client object. The client can be reused for multiple calls.
448
- # client = Google::Cloud::ApiHub::V1::RuntimeProjectAttachmentService::Client.new
449
- #
450
- # # Create a request. To set request fields, pass in keyword arguments.
451
- # request = Google::Cloud::ApiHub::V1::ListRuntimeProjectAttachmentsRequest.new
452
- #
453
- # # Call the list_runtime_project_attachments method.
454
- # result = client.list_runtime_project_attachments request
455
- #
456
- # # The returned object is of type Gapic::PagedEnumerable. You can iterate
457
- # # over elements, and API calls will be issued to fetch pages as needed.
458
- # result.each do |item|
459
- # # Each element is of type ::Google::Cloud::ApiHub::V1::RuntimeProjectAttachment.
460
- # p item
461
- # end
462
- #
463
- def list_runtime_project_attachments request, options = nil
464
- raise ::ArgumentError, "request must be provided" if request.nil?
465
-
466
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::ListRuntimeProjectAttachmentsRequest
467
-
468
- # Converts hash and nil to an options object
469
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
470
-
471
- # Customize the options with defaults
472
- metadata = @config.rpcs.list_runtime_project_attachments.metadata.to_h
473
-
474
- # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
475
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
476
- lib_name: @config.lib_name, lib_version: @config.lib_version,
477
- gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
478
- metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
479
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
480
-
481
- header_params = {}
482
- if request.parent
483
- header_params["parent"] = request.parent
484
- end
485
-
486
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
487
- metadata[:"x-goog-request-params"] ||= request_params_header
488
-
489
- options.apply_defaults timeout: @config.rpcs.list_runtime_project_attachments.timeout,
490
- metadata: metadata,
491
- retry_policy: @config.rpcs.list_runtime_project_attachments.retry_policy
492
-
493
- options.apply_defaults timeout: @config.timeout,
494
- metadata: @config.metadata,
495
- retry_policy: @config.retry_policy
496
-
497
- @runtime_project_attachment_service_stub.call_rpc :list_runtime_project_attachments, request, options: options do |response, operation|
498
- response = ::Gapic::PagedEnumerable.new @runtime_project_attachment_service_stub, :list_runtime_project_attachments, request, response, operation, options
499
- yield response, operation if block_given?
500
- return response
501
- end
502
- rescue ::GRPC::BadStatus => e
503
- raise ::Google::Cloud::Error.from_error(e)
504
- end
505
-
506
- ##
507
- # Delete a runtime project attachment in the API Hub. This call will detach
508
- # the runtime project from the host project.
509
- #
510
- # @overload delete_runtime_project_attachment(request, options = nil)
511
- # Pass arguments to `delete_runtime_project_attachment` via a request object, either of type
512
- # {::Google::Cloud::ApiHub::V1::DeleteRuntimeProjectAttachmentRequest} or an equivalent Hash.
513
- #
514
- # @param request [::Google::Cloud::ApiHub::V1::DeleteRuntimeProjectAttachmentRequest, ::Hash]
515
- # A request object representing the call parameters. Required. To specify no
516
- # parameters, or to keep all the default parameter values, pass an empty Hash.
517
- # @param options [::Gapic::CallOptions, ::Hash]
518
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
519
- #
520
- # @overload delete_runtime_project_attachment(name: nil)
521
- # Pass arguments to `delete_runtime_project_attachment` via keyword arguments. Note that at
522
- # least one keyword argument is required. To specify no parameters, or to keep all
523
- # the default parameter values, pass an empty Hash as a request object (see above).
524
- #
525
- # @param name [::String]
526
- # Required. The name of the Runtime Project Attachment to delete.
527
- # Format:
528
- # `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
529
- #
530
- # @yield [response, operation] Access the result along with the RPC operation
531
- # @yieldparam response [::Google::Protobuf::Empty]
532
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
533
- #
534
- # @return [::Google::Protobuf::Empty]
535
- #
536
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
537
- #
538
- # @example Basic example
539
- # require "google/cloud/api_hub/v1"
540
- #
541
- # # Create a client object. The client can be reused for multiple calls.
542
- # client = Google::Cloud::ApiHub::V1::RuntimeProjectAttachmentService::Client.new
543
- #
544
- # # Create a request. To set request fields, pass in keyword arguments.
545
- # request = Google::Cloud::ApiHub::V1::DeleteRuntimeProjectAttachmentRequest.new
546
- #
547
- # # Call the delete_runtime_project_attachment method.
548
- # result = client.delete_runtime_project_attachment request
549
- #
550
- # # The returned object is of type Google::Protobuf::Empty.
551
- # p result
552
- #
553
- def delete_runtime_project_attachment request, options = nil
554
- raise ::ArgumentError, "request must be provided" if request.nil?
555
-
556
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::DeleteRuntimeProjectAttachmentRequest
557
-
558
- # Converts hash and nil to an options object
559
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
560
-
561
- # Customize the options with defaults
562
- metadata = @config.rpcs.delete_runtime_project_attachment.metadata.to_h
563
-
564
- # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
565
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
566
- lib_name: @config.lib_name, lib_version: @config.lib_version,
567
- gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
568
- metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
569
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
570
-
571
- header_params = {}
572
- if request.name
573
- header_params["name"] = request.name
574
- end
575
-
576
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
577
- metadata[:"x-goog-request-params"] ||= request_params_header
578
-
579
- options.apply_defaults timeout: @config.rpcs.delete_runtime_project_attachment.timeout,
580
- metadata: metadata,
581
- retry_policy: @config.rpcs.delete_runtime_project_attachment.retry_policy
582
-
583
- options.apply_defaults timeout: @config.timeout,
584
- metadata: @config.metadata,
585
- retry_policy: @config.retry_policy
586
-
587
- @runtime_project_attachment_service_stub.call_rpc :delete_runtime_project_attachment, request, options: options do |response, operation|
588
- yield response, operation if block_given?
589
- return response
590
- end
591
- rescue ::GRPC::BadStatus => e
592
- raise ::Google::Cloud::Error.from_error(e)
593
- end
594
-
595
- ##
596
- # Look up a runtime project attachment. This API can be called in the context
597
- # of any project.
598
- #
599
- # @overload lookup_runtime_project_attachment(request, options = nil)
600
- # Pass arguments to `lookup_runtime_project_attachment` via a request object, either of type
601
- # {::Google::Cloud::ApiHub::V1::LookupRuntimeProjectAttachmentRequest} or an equivalent Hash.
602
- #
603
- # @param request [::Google::Cloud::ApiHub::V1::LookupRuntimeProjectAttachmentRequest, ::Hash]
604
- # A request object representing the call parameters. Required. To specify no
605
- # parameters, or to keep all the default parameter values, pass an empty Hash.
606
- # @param options [::Gapic::CallOptions, ::Hash]
607
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
608
- #
609
- # @overload lookup_runtime_project_attachment(name: nil)
610
- # Pass arguments to `lookup_runtime_project_attachment` via keyword arguments. Note that at
611
- # least one keyword argument is required. To specify no parameters, or to keep all
612
- # the default parameter values, pass an empty Hash as a request object (see above).
613
- #
614
- # @param name [::String]
615
- # Required. Runtime project ID to look up runtime project attachment for.
616
- # Lookup happens across all regions. Expected format:
617
- # `projects/{project}/locations/{location}`.
618
- #
619
- # @yield [response, operation] Access the result along with the RPC operation
620
- # @yieldparam response [::Google::Cloud::ApiHub::V1::LookupRuntimeProjectAttachmentResponse]
621
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
622
- #
623
- # @return [::Google::Cloud::ApiHub::V1::LookupRuntimeProjectAttachmentResponse]
624
- #
625
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
626
- #
627
- # @example Basic example
628
- # require "google/cloud/api_hub/v1"
629
- #
630
- # # Create a client object. The client can be reused for multiple calls.
631
- # client = Google::Cloud::ApiHub::V1::RuntimeProjectAttachmentService::Client.new
632
- #
633
- # # Create a request. To set request fields, pass in keyword arguments.
634
- # request = Google::Cloud::ApiHub::V1::LookupRuntimeProjectAttachmentRequest.new
635
- #
636
- # # Call the lookup_runtime_project_attachment method.
637
- # result = client.lookup_runtime_project_attachment request
638
- #
639
- # # The returned object is of type Google::Cloud::ApiHub::V1::LookupRuntimeProjectAttachmentResponse.
640
- # p result
641
- #
642
- def lookup_runtime_project_attachment request, options = nil
643
- raise ::ArgumentError, "request must be provided" if request.nil?
644
-
645
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::LookupRuntimeProjectAttachmentRequest
646
-
647
- # Converts hash and nil to an options object
648
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
649
-
650
- # Customize the options with defaults
651
- metadata = @config.rpcs.lookup_runtime_project_attachment.metadata.to_h
652
-
653
- # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
654
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
655
- lib_name: @config.lib_name, lib_version: @config.lib_version,
656
- gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
657
- metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
658
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
659
-
660
- header_params = {}
661
- if request.name
662
- header_params["name"] = request.name
663
- end
664
-
665
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
666
- metadata[:"x-goog-request-params"] ||= request_params_header
667
-
668
- options.apply_defaults timeout: @config.rpcs.lookup_runtime_project_attachment.timeout,
669
- metadata: metadata,
670
- retry_policy: @config.rpcs.lookup_runtime_project_attachment.retry_policy
671
-
672
- options.apply_defaults timeout: @config.timeout,
673
- metadata: @config.metadata,
674
- retry_policy: @config.retry_policy
675
-
676
- @runtime_project_attachment_service_stub.call_rpc :lookup_runtime_project_attachment, request, options: options do |response, operation|
677
- yield response, operation if block_given?
678
- return response
679
- end
680
- rescue ::GRPC::BadStatus => e
681
- raise ::Google::Cloud::Error.from_error(e)
682
- end
683
-
684
- ##
685
- # Configuration class for the RuntimeProjectAttachmentService API.
686
- #
687
- # This class represents the configuration for RuntimeProjectAttachmentService,
688
- # providing control over timeouts, retry behavior, logging, transport
689
- # parameters, and other low-level controls. Certain parameters can also be
690
- # applied individually to specific RPCs. See
691
- # {::Google::Cloud::ApiHub::V1::RuntimeProjectAttachmentService::Client::Configuration::Rpcs}
692
- # for a list of RPCs that can be configured independently.
693
- #
694
- # Configuration can be applied globally to all clients, or to a single client
695
- # on construction.
696
- #
697
- # @example
698
- #
699
- # # Modify the global config, setting the timeout for
700
- # # create_runtime_project_attachment to 20 seconds,
701
- # # and all remaining timeouts to 10 seconds.
702
- # ::Google::Cloud::ApiHub::V1::RuntimeProjectAttachmentService::Client.configure do |config|
703
- # config.timeout = 10.0
704
- # config.rpcs.create_runtime_project_attachment.timeout = 20.0
705
- # end
706
- #
707
- # # Apply the above configuration only to a new client.
708
- # client = ::Google::Cloud::ApiHub::V1::RuntimeProjectAttachmentService::Client.new do |config|
709
- # config.timeout = 10.0
710
- # config.rpcs.create_runtime_project_attachment.timeout = 20.0
711
- # end
712
- #
713
- # @!attribute [rw] endpoint
714
- # A custom service endpoint, as a hostname or hostname:port. The default is
715
- # nil, indicating to use the default endpoint in the current universe domain.
716
- # @return [::String,nil]
717
- # @!attribute [rw] credentials
718
- # Credentials to send with calls. You may provide any of the following types:
719
- # * (`String`) The path to a service account key file in JSON format
720
- # * (`Hash`) A service account key as a Hash
721
- # * (`Google::Auth::Credentials`) A googleauth credentials object
722
- # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
723
- # * (`Signet::OAuth2::Client`) A signet oauth2 client object
724
- # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
725
- # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
726
- # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
727
- # * (`nil`) indicating no credentials
728
- # @return [::Object]
729
- # @!attribute [rw] scope
730
- # The OAuth scopes
731
- # @return [::Array<::String>]
732
- # @!attribute [rw] lib_name
733
- # The library name as recorded in instrumentation and logging
734
- # @return [::String]
735
- # @!attribute [rw] lib_version
736
- # The library version as recorded in instrumentation and logging
737
- # @return [::String]
738
- # @!attribute [rw] channel_args
739
- # Extra parameters passed to the gRPC channel. Note: this is ignored if a
740
- # `GRPC::Core::Channel` object is provided as the credential.
741
- # @return [::Hash]
742
- # @!attribute [rw] interceptors
743
- # An array of interceptors that are run before calls are executed.
744
- # @return [::Array<::GRPC::ClientInterceptor>]
745
- # @!attribute [rw] timeout
746
- # The call timeout in seconds.
747
- # @return [::Numeric]
748
- # @!attribute [rw] metadata
749
- # Additional gRPC headers to be sent with the call.
750
- # @return [::Hash{::Symbol=>::String}]
751
- # @!attribute [rw] retry_policy
752
- # The retry policy. The value is a hash with the following keys:
753
- # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
754
- # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
755
- # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
756
- # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
757
- # trigger a retry.
758
- # @return [::Hash]
759
- # @!attribute [rw] quota_project
760
- # A separate project against which to charge quota.
761
- # @return [::String]
762
- # @!attribute [rw] universe_domain
763
- # The universe domain within which to make requests. This determines the
764
- # default endpoint URL. The default value of nil uses the environment
765
- # universe (usually the default "googleapis.com" universe).
766
- # @return [::String,nil]
767
- #
768
- class Configuration
769
- extend ::Gapic::Config
770
-
771
- # @private
772
- # The endpoint specific to the default "googleapis.com" universe. Deprecated.
773
- DEFAULT_ENDPOINT = "apihub.googleapis.com"
774
-
775
- config_attr :endpoint, nil, ::String, nil
776
- config_attr :credentials, nil do |value|
777
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
778
- allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
779
- allowed.any? { |klass| klass === value }
780
- end
781
- config_attr :scope, nil, ::String, ::Array, nil
782
- config_attr :lib_name, nil, ::String, nil
783
- config_attr :lib_version, nil, ::String, nil
784
- config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
785
- config_attr :interceptors, nil, ::Array, nil
786
- config_attr :timeout, nil, ::Numeric, nil
787
- config_attr :metadata, nil, ::Hash, nil
788
- config_attr :retry_policy, nil, ::Hash, ::Proc, nil
789
- config_attr :quota_project, nil, ::String, nil
790
- config_attr :universe_domain, nil, ::String, nil
791
-
792
- # @private
793
- def initialize parent_config = nil
794
- @parent_config = parent_config unless parent_config.nil?
795
-
796
- yield self if block_given?
797
- end
798
-
799
- ##
800
- # Configurations for individual RPCs
801
- # @return [Rpcs]
802
- #
803
- def rpcs
804
- @rpcs ||= begin
805
- parent_rpcs = nil
806
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
807
- Rpcs.new parent_rpcs
808
- end
809
- end
810
-
811
- ##
812
- # Configuration for the channel pool
813
- # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
814
- #
815
- def channel_pool
816
- @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
817
- end
818
-
819
- ##
820
- # Configuration RPC class for the RuntimeProjectAttachmentService API.
821
- #
822
- # Includes fields providing the configuration for each RPC in this service.
823
- # Each configuration object is of type `Gapic::Config::Method` and includes
824
- # the following configuration fields:
825
- #
826
- # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
827
- # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
828
- # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
829
- # include the following keys:
830
- # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
831
- # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
832
- # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
833
- # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
834
- # trigger a retry.
835
- #
836
- class Rpcs
837
- ##
838
- # RPC-specific configuration for `create_runtime_project_attachment`
839
- # @return [::Gapic::Config::Method]
840
- #
841
- attr_reader :create_runtime_project_attachment
842
- ##
843
- # RPC-specific configuration for `get_runtime_project_attachment`
844
- # @return [::Gapic::Config::Method]
845
- #
846
- attr_reader :get_runtime_project_attachment
847
- ##
848
- # RPC-specific configuration for `list_runtime_project_attachments`
849
- # @return [::Gapic::Config::Method]
850
- #
851
- attr_reader :list_runtime_project_attachments
852
- ##
853
- # RPC-specific configuration for `delete_runtime_project_attachment`
854
- # @return [::Gapic::Config::Method]
855
- #
856
- attr_reader :delete_runtime_project_attachment
857
- ##
858
- # RPC-specific configuration for `lookup_runtime_project_attachment`
859
- # @return [::Gapic::Config::Method]
860
- #
861
- attr_reader :lookup_runtime_project_attachment
862
-
863
- # @private
864
- def initialize parent_rpcs = nil
865
- create_runtime_project_attachment_config = parent_rpcs.create_runtime_project_attachment if parent_rpcs.respond_to? :create_runtime_project_attachment
866
- @create_runtime_project_attachment = ::Gapic::Config::Method.new create_runtime_project_attachment_config
867
- get_runtime_project_attachment_config = parent_rpcs.get_runtime_project_attachment if parent_rpcs.respond_to? :get_runtime_project_attachment
868
- @get_runtime_project_attachment = ::Gapic::Config::Method.new get_runtime_project_attachment_config
869
- list_runtime_project_attachments_config = parent_rpcs.list_runtime_project_attachments if parent_rpcs.respond_to? :list_runtime_project_attachments
870
- @list_runtime_project_attachments = ::Gapic::Config::Method.new list_runtime_project_attachments_config
871
- delete_runtime_project_attachment_config = parent_rpcs.delete_runtime_project_attachment if parent_rpcs.respond_to? :delete_runtime_project_attachment
872
- @delete_runtime_project_attachment = ::Gapic::Config::Method.new delete_runtime_project_attachment_config
873
- lookup_runtime_project_attachment_config = parent_rpcs.lookup_runtime_project_attachment if parent_rpcs.respond_to? :lookup_runtime_project_attachment
874
- @lookup_runtime_project_attachment = ::Gapic::Config::Method.new lookup_runtime_project_attachment_config
875
-
876
- yield self if block_given?
877
- end
878
- end
879
- end
880
- end
881
- end
882
- end
883
- end
884
- end
885
- end