google-cloud-compute-v1 2.22.0 → 3.0.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 (34) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/compute_pb.rb +125 -2
  3. data/lib/google/cloud/compute/v1/disks/rest/client.rb +105 -0
  4. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +63 -0
  5. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +2 -2
  6. data/lib/google/cloud/compute/v1/interconnect_attachment_groups/credentials.rb +52 -0
  7. data/lib/google/cloud/compute/v1/interconnect_attachment_groups/rest/client.rb +1218 -0
  8. data/lib/google/cloud/compute/v1/interconnect_attachment_groups/rest/service_stub.rb +641 -0
  9. data/lib/google/cloud/compute/v1/interconnect_attachment_groups/rest.rb +51 -0
  10. data/lib/google/cloud/compute/v1/interconnect_attachment_groups.rb +47 -0
  11. data/lib/google/cloud/compute/v1/interconnect_groups/credentials.rb +52 -0
  12. data/lib/google/cloud/compute/v1/interconnect_groups/rest/client.rb +1318 -0
  13. data/lib/google/cloud/compute/v1/interconnect_groups/rest/service_stub.rb +704 -0
  14. data/lib/google/cloud/compute/v1/interconnect_groups/rest.rb +51 -0
  15. data/lib/google/cloud/compute/v1/interconnect_groups.rb +47 -0
  16. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +104 -0
  17. data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +63 -0
  18. data/lib/google/cloud/compute/v1/network_profiles/rest/client.rb +4 -2
  19. data/lib/google/cloud/compute/v1/networks/rest/client.rb +102 -0
  20. data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +63 -0
  21. data/lib/google/cloud/compute/v1/reservation_blocks/rest/client.rb +4 -1
  22. data/lib/google/cloud/compute/v1/reservation_sub_blocks/credentials.rb +52 -0
  23. data/lib/google/cloud/compute/v1/reservation_sub_blocks/rest/client.rb +659 -0
  24. data/lib/google/cloud/compute/v1/reservation_sub_blocks/rest/service_stub.rb +272 -0
  25. data/lib/google/cloud/compute/v1/reservation_sub_blocks/rest.rb +51 -0
  26. data/lib/google/cloud/compute/v1/reservation_sub_blocks.rb +47 -0
  27. data/lib/google/cloud/compute/v1/rest.rb +3 -0
  28. data/lib/google/cloud/compute/v1/routers/rest/client.rb +8 -4
  29. data/lib/google/cloud/compute/v1/storage_pools/rest/client.rb +8 -4
  30. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +3 -1
  31. data/lib/google/cloud/compute/v1/version.rb +1 -1
  32. data/lib/google/cloud/compute/v1.rb +3 -0
  33. data/proto_docs/google/cloud/compute/v1/compute.rb +2265 -64
  34. metadata +19 -4
@@ -0,0 +1,1318 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/compute/v1/compute_pb"
21
+ require "google/cloud/compute/v1/interconnect_groups/rest/service_stub"
22
+ require "google/cloud/compute/v1/global_operations/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Compute
27
+ module V1
28
+ module InterconnectGroups
29
+ module Rest
30
+ ##
31
+ # REST client for the InterconnectGroups service.
32
+ #
33
+ # The InterconnectGroups API.
34
+ #
35
+ class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
39
+ # @private
40
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
41
+
42
+ # @private
43
+ attr_reader :interconnect_groups_stub
44
+
45
+ ##
46
+ # Configure the InterconnectGroups Client class.
47
+ #
48
+ # See {::Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all InterconnectGroups clients
54
+ # ::Google::Cloud::Compute::V1::InterconnectGroups::Rest::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", "Compute", "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_members.timeout = 600.0
75
+
76
+ default_config.rpcs.delete.timeout = 600.0
77
+
78
+ default_config.rpcs.get.timeout = 600.0
79
+ default_config.rpcs.get.retry_policy = {
80
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
81
+ }
82
+
83
+ default_config.rpcs.get_iam_policy.timeout = 600.0
84
+ default_config.rpcs.get_iam_policy.retry_policy = {
85
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
86
+ }
87
+
88
+ default_config.rpcs.get_operational_status.timeout = 600.0
89
+ default_config.rpcs.get_operational_status.retry_policy = {
90
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
91
+ }
92
+
93
+ default_config.rpcs.insert.timeout = 600.0
94
+
95
+ default_config.rpcs.list.timeout = 600.0
96
+ default_config.rpcs.list.retry_policy = {
97
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
98
+ }
99
+
100
+ default_config.rpcs.patch.timeout = 600.0
101
+
102
+ default_config.rpcs.set_iam_policy.timeout = 600.0
103
+
104
+ default_config.rpcs.test_iam_permissions.timeout = 600.0
105
+
106
+ default_config
107
+ end
108
+ yield @configure if block_given?
109
+ @configure
110
+ end
111
+
112
+ ##
113
+ # Configure the InterconnectGroups Client instance.
114
+ #
115
+ # The configuration is set to the derived mode, meaning that values can be changed,
116
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
117
+ # should be made on {Client.configure}.
118
+ #
119
+ # See {::Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client::Configuration}
120
+ # for a description of the configuration fields.
121
+ #
122
+ # @yield [config] Configure the Client client.
123
+ # @yieldparam config [Client::Configuration]
124
+ #
125
+ # @return [Client::Configuration]
126
+ #
127
+ def configure
128
+ yield @config if block_given?
129
+ @config
130
+ end
131
+
132
+ ##
133
+ # The effective universe domain
134
+ #
135
+ # @return [String]
136
+ #
137
+ def universe_domain
138
+ @interconnect_groups_stub.universe_domain
139
+ end
140
+
141
+ ##
142
+ # Create a new InterconnectGroups REST client object.
143
+ #
144
+ # @example
145
+ #
146
+ # # Create a client using the default configuration
147
+ # client = ::Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client.new
148
+ #
149
+ # # Create a client using a custom configuration
150
+ # client = ::Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client.new do |config|
151
+ # config.timeout = 10.0
152
+ # end
153
+ #
154
+ # @yield [config] Configure the InterconnectGroups client.
155
+ # @yieldparam config [Client::Configuration]
156
+ #
157
+ def initialize
158
+ # Create the configuration object
159
+ @config = Configuration.new Client.configure
160
+
161
+ # Yield the configuration if needed
162
+ yield @config if block_given?
163
+
164
+ # Create credentials
165
+ credentials = @config.credentials
166
+ # Use self-signed JWT if the endpoint is unchanged from default,
167
+ # but only if the default endpoint does not have a region prefix.
168
+ enable_self_signed_jwt = @config.endpoint.nil? ||
169
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
170
+ !@config.endpoint.split(".").first.include?("-"))
171
+ credentials ||= Credentials.default scope: @config.scope,
172
+ enable_self_signed_jwt: enable_self_signed_jwt
173
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
174
+ credentials = Credentials.new credentials, scope: @config.scope
175
+ end
176
+
177
+ @quota_project_id = @config.quota_project
178
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
179
+
180
+ @global_operations = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client.new do |config|
181
+ config.credentials = credentials
182
+ config.quota_project = @quota_project_id
183
+ config.endpoint = @config.endpoint
184
+ config.universe_domain = @config.universe_domain
185
+ end
186
+
187
+ @interconnect_groups_stub = ::Google::Cloud::Compute::V1::InterconnectGroups::Rest::ServiceStub.new(
188
+ endpoint: @config.endpoint,
189
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
190
+ universe_domain: @config.universe_domain,
191
+ credentials: credentials,
192
+ logger: @config.logger
193
+ )
194
+
195
+ @interconnect_groups_stub.logger(stub: true)&.info do |entry|
196
+ entry.set_system_name
197
+ entry.set_service
198
+ entry.message = "Created client for #{entry.service}"
199
+ entry.set_credentials_fields credentials
200
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
201
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
202
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
203
+ end
204
+ end
205
+
206
+ ##
207
+ # Get the associated client for long-running operations via GlobalOperations.
208
+ #
209
+ # @return [::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client]
210
+ #
211
+ attr_reader :global_operations
212
+
213
+ ##
214
+ # The logger used for request/response debug logging.
215
+ #
216
+ # @return [Logger]
217
+ #
218
+ def logger
219
+ @interconnect_groups_stub.logger
220
+ end
221
+
222
+ # Service calls
223
+
224
+ ##
225
+ # Create Interconnects with redundancy by creating them in a specified interconnect group.
226
+ #
227
+ # @overload create_members(request, options = nil)
228
+ # Pass arguments to `create_members` via a request object, either of type
229
+ # {::Google::Cloud::Compute::V1::CreateMembersInterconnectGroupRequest} or an equivalent Hash.
230
+ #
231
+ # @param request [::Google::Cloud::Compute::V1::CreateMembersInterconnectGroupRequest, ::Hash]
232
+ # A request object representing the call parameters. Required. To specify no
233
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
234
+ # @param options [::Gapic::CallOptions, ::Hash]
235
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
236
+ #
237
+ # @overload create_members(interconnect_group: nil, interconnect_groups_create_members_request_resource: nil, project: nil)
238
+ # Pass arguments to `create_members` via keyword arguments. Note that at
239
+ # least one keyword argument is required. To specify no parameters, or to keep all
240
+ # the default parameter values, pass an empty Hash as a request object (see above).
241
+ #
242
+ # @param interconnect_group [::String]
243
+ # Name of the group resource to create members for.
244
+ # @param interconnect_groups_create_members_request_resource [::Google::Cloud::Compute::V1::InterconnectGroupsCreateMembersRequest, ::Hash]
245
+ # The body resource for this request
246
+ # @param project [::String]
247
+ # Project ID for this request.
248
+ # @yield [result, operation] Access the result along with the TransportOperation object
249
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
250
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
251
+ #
252
+ # @return [::Gapic::GenericLRO::Operation]
253
+ #
254
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
255
+ #
256
+ # @example Basic example
257
+ # require "google/cloud/compute/v1"
258
+ #
259
+ # # Create a client object. The client can be reused for multiple calls.
260
+ # client = Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client.new
261
+ #
262
+ # # Create a request. To set request fields, pass in keyword arguments.
263
+ # request = Google::Cloud::Compute::V1::CreateMembersInterconnectGroupRequest.new
264
+ #
265
+ # # Call the create_members method.
266
+ # result = client.create_members request
267
+ #
268
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
269
+ # p result
270
+ #
271
+ def create_members request, options = nil
272
+ raise ::ArgumentError, "request must be provided" if request.nil?
273
+
274
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::CreateMembersInterconnectGroupRequest
275
+
276
+ # Converts hash and nil to an options object
277
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
278
+
279
+ # Customize the options with defaults
280
+ call_metadata = @config.rpcs.create_members.metadata.to_h
281
+
282
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
283
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
284
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
285
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
286
+ transports_version_send: [:rest]
287
+
288
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
289
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
290
+
291
+ options.apply_defaults timeout: @config.rpcs.create_members.timeout,
292
+ metadata: call_metadata,
293
+ retry_policy: @config.rpcs.create_members.retry_policy
294
+
295
+ options.apply_defaults timeout: @config.timeout,
296
+ metadata: @config.metadata,
297
+ retry_policy: @config.retry_policy
298
+
299
+ @interconnect_groups_stub.create_members request, options do |result, response|
300
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
301
+ operation: result,
302
+ client: global_operations,
303
+ request_values: {
304
+ "project" => request.project
305
+ },
306
+ options: options
307
+ )
308
+ yield result, response if block_given?
309
+ throw :response, result
310
+ end
311
+ rescue ::Gapic::Rest::Error => e
312
+ raise ::Google::Cloud::Error.from_error(e)
313
+ end
314
+
315
+ ##
316
+ # Deletes the specified InterconnectGroup in the given scope
317
+ #
318
+ # @overload delete(request, options = nil)
319
+ # Pass arguments to `delete` via a request object, either of type
320
+ # {::Google::Cloud::Compute::V1::DeleteInterconnectGroupRequest} or an equivalent Hash.
321
+ #
322
+ # @param request [::Google::Cloud::Compute::V1::DeleteInterconnectGroupRequest, ::Hash]
323
+ # A request object representing the call parameters. Required. To specify no
324
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
325
+ # @param options [::Gapic::CallOptions, ::Hash]
326
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
327
+ #
328
+ # @overload delete(interconnect_group: nil, project: nil, request_id: nil)
329
+ # Pass arguments to `delete` via keyword arguments. Note that at
330
+ # least one keyword argument is required. To specify no parameters, or to keep all
331
+ # the default parameter values, pass an empty Hash as a request object (see above).
332
+ #
333
+ # @param interconnect_group [::String]
334
+ # Name of the InterconnectGroup resource to delete.
335
+ # @param project [::String]
336
+ # Project ID for this request.
337
+ # @param request_id [::String]
338
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). end_interface: MixerMutationRequestBuilder
339
+ # @yield [result, operation] Access the result along with the TransportOperation object
340
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
341
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
342
+ #
343
+ # @return [::Gapic::GenericLRO::Operation]
344
+ #
345
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
346
+ #
347
+ # @example Basic example
348
+ # require "google/cloud/compute/v1"
349
+ #
350
+ # # Create a client object. The client can be reused for multiple calls.
351
+ # client = Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client.new
352
+ #
353
+ # # Create a request. To set request fields, pass in keyword arguments.
354
+ # request = Google::Cloud::Compute::V1::DeleteInterconnectGroupRequest.new
355
+ #
356
+ # # Call the delete method.
357
+ # result = client.delete request
358
+ #
359
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
360
+ # p result
361
+ #
362
+ def delete request, options = nil
363
+ raise ::ArgumentError, "request must be provided" if request.nil?
364
+
365
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteInterconnectGroupRequest
366
+
367
+ # Converts hash and nil to an options object
368
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
369
+
370
+ # Customize the options with defaults
371
+ call_metadata = @config.rpcs.delete.metadata.to_h
372
+
373
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
374
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
375
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
376
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
377
+ transports_version_send: [:rest]
378
+
379
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
380
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
381
+
382
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
383
+ metadata: call_metadata,
384
+ retry_policy: @config.rpcs.delete.retry_policy
385
+
386
+ options.apply_defaults timeout: @config.timeout,
387
+ metadata: @config.metadata,
388
+ retry_policy: @config.retry_policy
389
+
390
+ @interconnect_groups_stub.delete request, options do |result, response|
391
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
392
+ operation: result,
393
+ client: global_operations,
394
+ request_values: {
395
+ "project" => request.project
396
+ },
397
+ options: options
398
+ )
399
+ yield result, response if block_given?
400
+ throw :response, result
401
+ end
402
+ rescue ::Gapic::Rest::Error => e
403
+ raise ::Google::Cloud::Error.from_error(e)
404
+ end
405
+
406
+ ##
407
+ # Returns the specified InterconnectGroup resource in the given scope.
408
+ #
409
+ # @overload get(request, options = nil)
410
+ # Pass arguments to `get` via a request object, either of type
411
+ # {::Google::Cloud::Compute::V1::GetInterconnectGroupRequest} or an equivalent Hash.
412
+ #
413
+ # @param request [::Google::Cloud::Compute::V1::GetInterconnectGroupRequest, ::Hash]
414
+ # A request object representing the call parameters. Required. To specify no
415
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
416
+ # @param options [::Gapic::CallOptions, ::Hash]
417
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
418
+ #
419
+ # @overload get(interconnect_group: nil, project: nil)
420
+ # Pass arguments to `get` via keyword arguments. Note that at
421
+ # least one keyword argument is required. To specify no parameters, or to keep all
422
+ # the default parameter values, pass an empty Hash as a request object (see above).
423
+ #
424
+ # @param interconnect_group [::String]
425
+ # Name of the InterconnectGroup resource to return.
426
+ # @param project [::String]
427
+ # Project ID for this request.
428
+ # @yield [result, operation] Access the result along with the TransportOperation object
429
+ # @yieldparam result [::Google::Cloud::Compute::V1::InterconnectGroup]
430
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
431
+ #
432
+ # @return [::Google::Cloud::Compute::V1::InterconnectGroup]
433
+ #
434
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
435
+ #
436
+ # @example Basic example
437
+ # require "google/cloud/compute/v1"
438
+ #
439
+ # # Create a client object. The client can be reused for multiple calls.
440
+ # client = Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client.new
441
+ #
442
+ # # Create a request. To set request fields, pass in keyword arguments.
443
+ # request = Google::Cloud::Compute::V1::GetInterconnectGroupRequest.new
444
+ #
445
+ # # Call the get method.
446
+ # result = client.get request
447
+ #
448
+ # # The returned object is of type Google::Cloud::Compute::V1::InterconnectGroup.
449
+ # p result
450
+ #
451
+ def get request, options = nil
452
+ raise ::ArgumentError, "request must be provided" if request.nil?
453
+
454
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetInterconnectGroupRequest
455
+
456
+ # Converts hash and nil to an options object
457
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
458
+
459
+ # Customize the options with defaults
460
+ call_metadata = @config.rpcs.get.metadata.to_h
461
+
462
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
463
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
464
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
465
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
466
+ transports_version_send: [:rest]
467
+
468
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
469
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
470
+
471
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
472
+ metadata: call_metadata,
473
+ retry_policy: @config.rpcs.get.retry_policy
474
+
475
+ options.apply_defaults timeout: @config.timeout,
476
+ metadata: @config.metadata,
477
+ retry_policy: @config.retry_policy
478
+
479
+ @interconnect_groups_stub.get request, options do |result, operation|
480
+ yield result, operation if block_given?
481
+ end
482
+ rescue ::Gapic::Rest::Error => e
483
+ raise ::Google::Cloud::Error.from_error(e)
484
+ end
485
+
486
+ ##
487
+ # Gets the access control policy for a resource. May be empty if no such policy or resource exists.
488
+ #
489
+ # @overload get_iam_policy(request, options = nil)
490
+ # Pass arguments to `get_iam_policy` via a request object, either of type
491
+ # {::Google::Cloud::Compute::V1::GetIamPolicyInterconnectGroupRequest} or an equivalent Hash.
492
+ #
493
+ # @param request [::Google::Cloud::Compute::V1::GetIamPolicyInterconnectGroupRequest, ::Hash]
494
+ # A request object representing the call parameters. Required. To specify no
495
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
496
+ # @param options [::Gapic::CallOptions, ::Hash]
497
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
498
+ #
499
+ # @overload get_iam_policy(options_requested_policy_version: nil, project: nil, resource: nil)
500
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
501
+ # least one keyword argument is required. To specify no parameters, or to keep all
502
+ # the default parameter values, pass an empty Hash as a request object (see above).
503
+ #
504
+ # @param options_requested_policy_version [::Integer]
505
+ # Requested IAM Policy version.
506
+ # @param project [::String]
507
+ # Project ID for this request.
508
+ # @param resource [::String]
509
+ # Name or id of the resource for this request.
510
+ # @yield [result, operation] Access the result along with the TransportOperation object
511
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
512
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
513
+ #
514
+ # @return [::Google::Cloud::Compute::V1::Policy]
515
+ #
516
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
517
+ #
518
+ # @example Basic example
519
+ # require "google/cloud/compute/v1"
520
+ #
521
+ # # Create a client object. The client can be reused for multiple calls.
522
+ # client = Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client.new
523
+ #
524
+ # # Create a request. To set request fields, pass in keyword arguments.
525
+ # request = Google::Cloud::Compute::V1::GetIamPolicyInterconnectGroupRequest.new
526
+ #
527
+ # # Call the get_iam_policy method.
528
+ # result = client.get_iam_policy request
529
+ #
530
+ # # The returned object is of type Google::Cloud::Compute::V1::Policy.
531
+ # p result
532
+ #
533
+ def get_iam_policy request, options = nil
534
+ raise ::ArgumentError, "request must be provided" if request.nil?
535
+
536
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetIamPolicyInterconnectGroupRequest
537
+
538
+ # Converts hash and nil to an options object
539
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
540
+
541
+ # Customize the options with defaults
542
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
543
+
544
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
545
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
546
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
547
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
548
+ transports_version_send: [:rest]
549
+
550
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
551
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
552
+
553
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
554
+ metadata: call_metadata,
555
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
556
+
557
+ options.apply_defaults timeout: @config.timeout,
558
+ metadata: @config.metadata,
559
+ retry_policy: @config.retry_policy
560
+
561
+ @interconnect_groups_stub.get_iam_policy request, options do |result, operation|
562
+ yield result, operation if block_given?
563
+ end
564
+ rescue ::Gapic::Rest::Error => e
565
+ raise ::Google::Cloud::Error.from_error(e)
566
+ end
567
+
568
+ ##
569
+ # Returns the interconnectStatuses for the specified InterconnectGroup.
570
+ #
571
+ # @overload get_operational_status(request, options = nil)
572
+ # Pass arguments to `get_operational_status` via a request object, either of type
573
+ # {::Google::Cloud::Compute::V1::GetOperationalStatusInterconnectGroupRequest} or an equivalent Hash.
574
+ #
575
+ # @param request [::Google::Cloud::Compute::V1::GetOperationalStatusInterconnectGroupRequest, ::Hash]
576
+ # A request object representing the call parameters. Required. To specify no
577
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
578
+ # @param options [::Gapic::CallOptions, ::Hash]
579
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
580
+ #
581
+ # @overload get_operational_status(interconnect_group: nil, project: nil)
582
+ # Pass arguments to `get_operational_status` via keyword arguments. Note that at
583
+ # least one keyword argument is required. To specify no parameters, or to keep all
584
+ # the default parameter values, pass an empty Hash as a request object (see above).
585
+ #
586
+ # @param interconnect_group [::String]
587
+ # Name of the interconnectGroup resource to query.
588
+ # @param project [::String]
589
+ # Project ID for this request.
590
+ # @yield [result, operation] Access the result along with the TransportOperation object
591
+ # @yieldparam result [::Google::Cloud::Compute::V1::InterconnectGroupsGetOperationalStatusResponse]
592
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
593
+ #
594
+ # @return [::Google::Cloud::Compute::V1::InterconnectGroupsGetOperationalStatusResponse]
595
+ #
596
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
597
+ #
598
+ # @example Basic example
599
+ # require "google/cloud/compute/v1"
600
+ #
601
+ # # Create a client object. The client can be reused for multiple calls.
602
+ # client = Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client.new
603
+ #
604
+ # # Create a request. To set request fields, pass in keyword arguments.
605
+ # request = Google::Cloud::Compute::V1::GetOperationalStatusInterconnectGroupRequest.new
606
+ #
607
+ # # Call the get_operational_status method.
608
+ # result = client.get_operational_status request
609
+ #
610
+ # # The returned object is of type Google::Cloud::Compute::V1::InterconnectGroupsGetOperationalStatusResponse.
611
+ # p result
612
+ #
613
+ def get_operational_status request, options = nil
614
+ raise ::ArgumentError, "request must be provided" if request.nil?
615
+
616
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetOperationalStatusInterconnectGroupRequest
617
+
618
+ # Converts hash and nil to an options object
619
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
620
+
621
+ # Customize the options with defaults
622
+ call_metadata = @config.rpcs.get_operational_status.metadata.to_h
623
+
624
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
625
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
626
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
627
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
628
+ transports_version_send: [:rest]
629
+
630
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
631
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
632
+
633
+ options.apply_defaults timeout: @config.rpcs.get_operational_status.timeout,
634
+ metadata: call_metadata,
635
+ retry_policy: @config.rpcs.get_operational_status.retry_policy
636
+
637
+ options.apply_defaults timeout: @config.timeout,
638
+ metadata: @config.metadata,
639
+ retry_policy: @config.retry_policy
640
+
641
+ @interconnect_groups_stub.get_operational_status request, options do |result, operation|
642
+ yield result, operation if block_given?
643
+ end
644
+ rescue ::Gapic::Rest::Error => e
645
+ raise ::Google::Cloud::Error.from_error(e)
646
+ end
647
+
648
+ ##
649
+ # Creates a InterconnectGroup in the specified project in the given scope using the parameters that are included in the request.
650
+ #
651
+ # @overload insert(request, options = nil)
652
+ # Pass arguments to `insert` via a request object, either of type
653
+ # {::Google::Cloud::Compute::V1::InsertInterconnectGroupRequest} or an equivalent Hash.
654
+ #
655
+ # @param request [::Google::Cloud::Compute::V1::InsertInterconnectGroupRequest, ::Hash]
656
+ # A request object representing the call parameters. Required. To specify no
657
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
658
+ # @param options [::Gapic::CallOptions, ::Hash]
659
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
660
+ #
661
+ # @overload insert(interconnect_group_resource: nil, project: nil, request_id: nil)
662
+ # Pass arguments to `insert` via keyword arguments. Note that at
663
+ # least one keyword argument is required. To specify no parameters, or to keep all
664
+ # the default parameter values, pass an empty Hash as a request object (see above).
665
+ #
666
+ # @param interconnect_group_resource [::Google::Cloud::Compute::V1::InterconnectGroup, ::Hash]
667
+ # The body resource for this request
668
+ # @param project [::String]
669
+ # Project ID for this request.
670
+ # @param request_id [::String]
671
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). end_interface: MixerMutationRequestBuilder
672
+ # @yield [result, operation] Access the result along with the TransportOperation object
673
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
674
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
675
+ #
676
+ # @return [::Gapic::GenericLRO::Operation]
677
+ #
678
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
679
+ #
680
+ # @example Basic example
681
+ # require "google/cloud/compute/v1"
682
+ #
683
+ # # Create a client object. The client can be reused for multiple calls.
684
+ # client = Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client.new
685
+ #
686
+ # # Create a request. To set request fields, pass in keyword arguments.
687
+ # request = Google::Cloud::Compute::V1::InsertInterconnectGroupRequest.new
688
+ #
689
+ # # Call the insert method.
690
+ # result = client.insert request
691
+ #
692
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
693
+ # p result
694
+ #
695
+ def insert request, options = nil
696
+ raise ::ArgumentError, "request must be provided" if request.nil?
697
+
698
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::InsertInterconnectGroupRequest
699
+
700
+ # Converts hash and nil to an options object
701
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
702
+
703
+ # Customize the options with defaults
704
+ call_metadata = @config.rpcs.insert.metadata.to_h
705
+
706
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
707
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
708
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
709
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
710
+ transports_version_send: [:rest]
711
+
712
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
713
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
714
+
715
+ options.apply_defaults timeout: @config.rpcs.insert.timeout,
716
+ metadata: call_metadata,
717
+ retry_policy: @config.rpcs.insert.retry_policy
718
+
719
+ options.apply_defaults timeout: @config.timeout,
720
+ metadata: @config.metadata,
721
+ retry_policy: @config.retry_policy
722
+
723
+ @interconnect_groups_stub.insert request, options do |result, response|
724
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
725
+ operation: result,
726
+ client: global_operations,
727
+ request_values: {
728
+ "project" => request.project
729
+ },
730
+ options: options
731
+ )
732
+ yield result, response if block_given?
733
+ throw :response, result
734
+ end
735
+ rescue ::Gapic::Rest::Error => e
736
+ raise ::Google::Cloud::Error.from_error(e)
737
+ end
738
+
739
+ ##
740
+ # Lists the InterconnectGroups for a project in the given scope.
741
+ #
742
+ # @overload list(request, options = nil)
743
+ # Pass arguments to `list` via a request object, either of type
744
+ # {::Google::Cloud::Compute::V1::ListInterconnectGroupsRequest} or an equivalent Hash.
745
+ #
746
+ # @param request [::Google::Cloud::Compute::V1::ListInterconnectGroupsRequest, ::Hash]
747
+ # A request object representing the call parameters. Required. To specify no
748
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
749
+ # @param options [::Gapic::CallOptions, ::Hash]
750
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
751
+ #
752
+ # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
753
+ # Pass arguments to `list` via keyword arguments. Note that at
754
+ # least one keyword argument is required. To specify no parameters, or to keep all
755
+ # the default parameter values, pass an empty Hash as a request object (see above).
756
+ #
757
+ # @param filter [::String]
758
+ # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.
759
+ # @param max_results [::Integer]
760
+ # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
761
+ # @param order_by [::String]
762
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.
763
+ # @param page_token [::String]
764
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
765
+ # @param project [::String]
766
+ # Project ID for this request.
767
+ # @param return_partial_success [::Boolean]
768
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.
769
+ # @yield [result, operation] Access the result along with the TransportOperation object
770
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InterconnectGroup>]
771
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
772
+ #
773
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InterconnectGroup>]
774
+ #
775
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
776
+ #
777
+ # @example Basic example
778
+ # require "google/cloud/compute/v1"
779
+ #
780
+ # # Create a client object. The client can be reused for multiple calls.
781
+ # client = Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client.new
782
+ #
783
+ # # Create a request. To set request fields, pass in keyword arguments.
784
+ # request = Google::Cloud::Compute::V1::ListInterconnectGroupsRequest.new
785
+ #
786
+ # # Call the list method.
787
+ # result = client.list request
788
+ #
789
+ # # The returned object is of type Google::Cloud::Compute::V1::InterconnectGroupsListResponse.
790
+ # p result
791
+ #
792
+ def list request, options = nil
793
+ raise ::ArgumentError, "request must be provided" if request.nil?
794
+
795
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListInterconnectGroupsRequest
796
+
797
+ # Converts hash and nil to an options object
798
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
799
+
800
+ # Customize the options with defaults
801
+ call_metadata = @config.rpcs.list.metadata.to_h
802
+
803
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
804
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
805
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
806
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
807
+ transports_version_send: [:rest]
808
+
809
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
810
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
811
+
812
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
813
+ metadata: call_metadata,
814
+ retry_policy: @config.rpcs.list.retry_policy
815
+
816
+ options.apply_defaults timeout: @config.timeout,
817
+ metadata: @config.metadata,
818
+ retry_policy: @config.retry_policy
819
+
820
+ @interconnect_groups_stub.list request, options do |result, operation|
821
+ result = ::Gapic::Rest::PagedEnumerable.new @interconnect_groups_stub, :list, "items", request, result, options
822
+ yield result, operation if block_given?
823
+ throw :response, result
824
+ end
825
+ rescue ::Gapic::Rest::Error => e
826
+ raise ::Google::Cloud::Error.from_error(e)
827
+ end
828
+
829
+ ##
830
+ # Patches the specified InterconnectGroup resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.
831
+ #
832
+ # @overload patch(request, options = nil)
833
+ # Pass arguments to `patch` via a request object, either of type
834
+ # {::Google::Cloud::Compute::V1::PatchInterconnectGroupRequest} or an equivalent Hash.
835
+ #
836
+ # @param request [::Google::Cloud::Compute::V1::PatchInterconnectGroupRequest, ::Hash]
837
+ # A request object representing the call parameters. Required. To specify no
838
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
839
+ # @param options [::Gapic::CallOptions, ::Hash]
840
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
841
+ #
842
+ # @overload patch(interconnect_group: nil, interconnect_group_resource: nil, project: nil, request_id: nil, update_mask: nil)
843
+ # Pass arguments to `patch` via keyword arguments. Note that at
844
+ # least one keyword argument is required. To specify no parameters, or to keep all
845
+ # the default parameter values, pass an empty Hash as a request object (see above).
846
+ #
847
+ # @param interconnect_group [::String]
848
+ # Name of the InterconnectGroup resource to patch.
849
+ # @param interconnect_group_resource [::Google::Cloud::Compute::V1::InterconnectGroup, ::Hash]
850
+ # The body resource for this request
851
+ # @param project [::String]
852
+ # Project ID for this request.
853
+ # @param request_id [::String]
854
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). end_interface: MixerMutationRequestBuilder
855
+ # @param update_mask [::String]
856
+ # The list of fields to update.
857
+ # @yield [result, operation] Access the result along with the TransportOperation object
858
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
859
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
860
+ #
861
+ # @return [::Gapic::GenericLRO::Operation]
862
+ #
863
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
864
+ #
865
+ # @example Basic example
866
+ # require "google/cloud/compute/v1"
867
+ #
868
+ # # Create a client object. The client can be reused for multiple calls.
869
+ # client = Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client.new
870
+ #
871
+ # # Create a request. To set request fields, pass in keyword arguments.
872
+ # request = Google::Cloud::Compute::V1::PatchInterconnectGroupRequest.new
873
+ #
874
+ # # Call the patch method.
875
+ # result = client.patch request
876
+ #
877
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
878
+ # p result
879
+ #
880
+ def patch request, options = nil
881
+ raise ::ArgumentError, "request must be provided" if request.nil?
882
+
883
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchInterconnectGroupRequest
884
+
885
+ # Converts hash and nil to an options object
886
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
887
+
888
+ # Customize the options with defaults
889
+ call_metadata = @config.rpcs.patch.metadata.to_h
890
+
891
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
892
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
893
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
894
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
895
+ transports_version_send: [:rest]
896
+
897
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
898
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
899
+
900
+ options.apply_defaults timeout: @config.rpcs.patch.timeout,
901
+ metadata: call_metadata,
902
+ retry_policy: @config.rpcs.patch.retry_policy
903
+
904
+ options.apply_defaults timeout: @config.timeout,
905
+ metadata: @config.metadata,
906
+ retry_policy: @config.retry_policy
907
+
908
+ @interconnect_groups_stub.patch request, options do |result, response|
909
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
910
+ operation: result,
911
+ client: global_operations,
912
+ request_values: {
913
+ "project" => request.project
914
+ },
915
+ options: options
916
+ )
917
+ yield result, response if block_given?
918
+ throw :response, result
919
+ end
920
+ rescue ::Gapic::Rest::Error => e
921
+ raise ::Google::Cloud::Error.from_error(e)
922
+ end
923
+
924
+ ##
925
+ # Sets the access control policy on the specified resource. Replaces any existing policy.
926
+ #
927
+ # @overload set_iam_policy(request, options = nil)
928
+ # Pass arguments to `set_iam_policy` via a request object, either of type
929
+ # {::Google::Cloud::Compute::V1::SetIamPolicyInterconnectGroupRequest} or an equivalent Hash.
930
+ #
931
+ # @param request [::Google::Cloud::Compute::V1::SetIamPolicyInterconnectGroupRequest, ::Hash]
932
+ # A request object representing the call parameters. Required. To specify no
933
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
934
+ # @param options [::Gapic::CallOptions, ::Hash]
935
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
936
+ #
937
+ # @overload set_iam_policy(global_set_policy_request_resource: nil, project: nil, resource: nil)
938
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
939
+ # least one keyword argument is required. To specify no parameters, or to keep all
940
+ # the default parameter values, pass an empty Hash as a request object (see above).
941
+ #
942
+ # @param global_set_policy_request_resource [::Google::Cloud::Compute::V1::GlobalSetPolicyRequest, ::Hash]
943
+ # The body resource for this request
944
+ # @param project [::String]
945
+ # Project ID for this request.
946
+ # @param resource [::String]
947
+ # Name or id of the resource for this request.
948
+ # @yield [result, operation] Access the result along with the TransportOperation object
949
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
950
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
951
+ #
952
+ # @return [::Google::Cloud::Compute::V1::Policy]
953
+ #
954
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
955
+ #
956
+ # @example Basic example
957
+ # require "google/cloud/compute/v1"
958
+ #
959
+ # # Create a client object. The client can be reused for multiple calls.
960
+ # client = Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client.new
961
+ #
962
+ # # Create a request. To set request fields, pass in keyword arguments.
963
+ # request = Google::Cloud::Compute::V1::SetIamPolicyInterconnectGroupRequest.new
964
+ #
965
+ # # Call the set_iam_policy method.
966
+ # result = client.set_iam_policy request
967
+ #
968
+ # # The returned object is of type Google::Cloud::Compute::V1::Policy.
969
+ # p result
970
+ #
971
+ def set_iam_policy request, options = nil
972
+ raise ::ArgumentError, "request must be provided" if request.nil?
973
+
974
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetIamPolicyInterconnectGroupRequest
975
+
976
+ # Converts hash and nil to an options object
977
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
978
+
979
+ # Customize the options with defaults
980
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
981
+
982
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
983
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
984
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
985
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
986
+ transports_version_send: [:rest]
987
+
988
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
989
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
990
+
991
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
992
+ metadata: call_metadata,
993
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
994
+
995
+ options.apply_defaults timeout: @config.timeout,
996
+ metadata: @config.metadata,
997
+ retry_policy: @config.retry_policy
998
+
999
+ @interconnect_groups_stub.set_iam_policy request, options do |result, operation|
1000
+ yield result, operation if block_given?
1001
+ end
1002
+ rescue ::Gapic::Rest::Error => e
1003
+ raise ::Google::Cloud::Error.from_error(e)
1004
+ end
1005
+
1006
+ ##
1007
+ # Returns permissions that a caller has on the specified resource.
1008
+ #
1009
+ # @overload test_iam_permissions(request, options = nil)
1010
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
1011
+ # {::Google::Cloud::Compute::V1::TestIamPermissionsInterconnectGroupRequest} or an equivalent Hash.
1012
+ #
1013
+ # @param request [::Google::Cloud::Compute::V1::TestIamPermissionsInterconnectGroupRequest, ::Hash]
1014
+ # A request object representing the call parameters. Required. To specify no
1015
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1016
+ # @param options [::Gapic::CallOptions, ::Hash]
1017
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1018
+ #
1019
+ # @overload test_iam_permissions(project: nil, resource: nil, test_permissions_request_resource: nil)
1020
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
1021
+ # least one keyword argument is required. To specify no parameters, or to keep all
1022
+ # the default parameter values, pass an empty Hash as a request object (see above).
1023
+ #
1024
+ # @param project [::String]
1025
+ # Project ID for this request.
1026
+ # @param resource [::String]
1027
+ # Name or id of the resource for this request.
1028
+ # @param test_permissions_request_resource [::Google::Cloud::Compute::V1::TestPermissionsRequest, ::Hash]
1029
+ # The body resource for this request
1030
+ # @yield [result, operation] Access the result along with the TransportOperation object
1031
+ # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
1032
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1033
+ #
1034
+ # @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
1035
+ #
1036
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1037
+ #
1038
+ # @example Basic example
1039
+ # require "google/cloud/compute/v1"
1040
+ #
1041
+ # # Create a client object. The client can be reused for multiple calls.
1042
+ # client = Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client.new
1043
+ #
1044
+ # # Create a request. To set request fields, pass in keyword arguments.
1045
+ # request = Google::Cloud::Compute::V1::TestIamPermissionsInterconnectGroupRequest.new
1046
+ #
1047
+ # # Call the test_iam_permissions method.
1048
+ # result = client.test_iam_permissions request
1049
+ #
1050
+ # # The returned object is of type Google::Cloud::Compute::V1::TestPermissionsResponse.
1051
+ # p result
1052
+ #
1053
+ def test_iam_permissions request, options = nil
1054
+ raise ::ArgumentError, "request must be provided" if request.nil?
1055
+
1056
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::TestIamPermissionsInterconnectGroupRequest
1057
+
1058
+ # Converts hash and nil to an options object
1059
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1060
+
1061
+ # Customize the options with defaults
1062
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
1063
+
1064
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1065
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1066
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1067
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1068
+ transports_version_send: [:rest]
1069
+
1070
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1071
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1072
+
1073
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
1074
+ metadata: call_metadata,
1075
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
1076
+
1077
+ options.apply_defaults timeout: @config.timeout,
1078
+ metadata: @config.metadata,
1079
+ retry_policy: @config.retry_policy
1080
+
1081
+ @interconnect_groups_stub.test_iam_permissions request, options do |result, operation|
1082
+ yield result, operation if block_given?
1083
+ end
1084
+ rescue ::Gapic::Rest::Error => e
1085
+ raise ::Google::Cloud::Error.from_error(e)
1086
+ end
1087
+
1088
+ ##
1089
+ # Configuration class for the InterconnectGroups REST API.
1090
+ #
1091
+ # This class represents the configuration for InterconnectGroups REST,
1092
+ # providing control over timeouts, retry behavior, logging, transport
1093
+ # parameters, and other low-level controls. Certain parameters can also be
1094
+ # applied individually to specific RPCs. See
1095
+ # {::Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client::Configuration::Rpcs}
1096
+ # for a list of RPCs that can be configured independently.
1097
+ #
1098
+ # Configuration can be applied globally to all clients, or to a single client
1099
+ # on construction.
1100
+ #
1101
+ # @example
1102
+ #
1103
+ # # Modify the global config, setting the timeout for
1104
+ # # create_members to 20 seconds,
1105
+ # # and all remaining timeouts to 10 seconds.
1106
+ # ::Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client.configure do |config|
1107
+ # config.timeout = 10.0
1108
+ # config.rpcs.create_members.timeout = 20.0
1109
+ # end
1110
+ #
1111
+ # # Apply the above configuration only to a new client.
1112
+ # client = ::Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client.new do |config|
1113
+ # config.timeout = 10.0
1114
+ # config.rpcs.create_members.timeout = 20.0
1115
+ # end
1116
+ #
1117
+ # @!attribute [rw] endpoint
1118
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1119
+ # nil, indicating to use the default endpoint in the current universe domain.
1120
+ # @return [::String,nil]
1121
+ # @!attribute [rw] credentials
1122
+ # Credentials to send with calls. You may provide any of the following types:
1123
+ # * (`String`) The path to a service account key file in JSON format
1124
+ # * (`Hash`) A service account key as a Hash
1125
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1126
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1127
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1128
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1129
+ # * (`nil`) indicating no credentials
1130
+ #
1131
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1132
+ # external source for authentication to Google Cloud, you must validate it before
1133
+ # providing it to a Google API client library. Providing an unvalidated credential
1134
+ # configuration to Google APIs can compromise the security of your systems and data.
1135
+ # For more information, refer to [Validate credential configurations from external
1136
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1137
+ # @return [::Object]
1138
+ # @!attribute [rw] scope
1139
+ # The OAuth scopes
1140
+ # @return [::Array<::String>]
1141
+ # @!attribute [rw] lib_name
1142
+ # The library name as recorded in instrumentation and logging
1143
+ # @return [::String]
1144
+ # @!attribute [rw] lib_version
1145
+ # The library version as recorded in instrumentation and logging
1146
+ # @return [::String]
1147
+ # @!attribute [rw] timeout
1148
+ # The call timeout in seconds.
1149
+ # @return [::Numeric]
1150
+ # @!attribute [rw] metadata
1151
+ # Additional headers to be sent with the call.
1152
+ # @return [::Hash{::Symbol=>::String}]
1153
+ # @!attribute [rw] retry_policy
1154
+ # The retry policy. The value is a hash with the following keys:
1155
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1156
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1157
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1158
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1159
+ # trigger a retry.
1160
+ # @return [::Hash]
1161
+ # @!attribute [rw] quota_project
1162
+ # A separate project against which to charge quota.
1163
+ # @return [::String]
1164
+ # @!attribute [rw] universe_domain
1165
+ # The universe domain within which to make requests. This determines the
1166
+ # default endpoint URL. The default value of nil uses the environment
1167
+ # universe (usually the default "googleapis.com" universe).
1168
+ # @return [::String,nil]
1169
+ # @!attribute [rw] logger
1170
+ # A custom logger to use for request/response debug logging, or the value
1171
+ # `:default` (the default) to construct a default logger, or `nil` to
1172
+ # explicitly disable logging.
1173
+ # @return [::Logger,:default,nil]
1174
+ #
1175
+ class Configuration
1176
+ extend ::Gapic::Config
1177
+
1178
+ # @private
1179
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1180
+ DEFAULT_ENDPOINT = "compute.googleapis.com"
1181
+
1182
+ config_attr :endpoint, nil, ::String, nil
1183
+ config_attr :credentials, nil do |value|
1184
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
1185
+ allowed.any? { |klass| klass === value }
1186
+ end
1187
+ config_attr :scope, nil, ::String, ::Array, nil
1188
+ config_attr :lib_name, nil, ::String, nil
1189
+ config_attr :lib_version, nil, ::String, nil
1190
+ config_attr :timeout, nil, ::Numeric, nil
1191
+ config_attr :metadata, nil, ::Hash, nil
1192
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1193
+ config_attr :quota_project, nil, ::String, nil
1194
+ config_attr :universe_domain, nil, ::String, nil
1195
+ config_attr :logger, :default, ::Logger, nil, :default
1196
+
1197
+ # @private
1198
+ def initialize parent_config = nil
1199
+ @parent_config = parent_config unless parent_config.nil?
1200
+
1201
+ yield self if block_given?
1202
+ end
1203
+
1204
+ ##
1205
+ # Configurations for individual RPCs
1206
+ # @return [Rpcs]
1207
+ #
1208
+ def rpcs
1209
+ @rpcs ||= begin
1210
+ parent_rpcs = nil
1211
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1212
+ Rpcs.new parent_rpcs
1213
+ end
1214
+ end
1215
+
1216
+ ##
1217
+ # Configuration RPC class for the InterconnectGroups API.
1218
+ #
1219
+ # Includes fields providing the configuration for each RPC in this service.
1220
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1221
+ # the following configuration fields:
1222
+ #
1223
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1224
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1225
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1226
+ # include the following keys:
1227
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1228
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1229
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1230
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1231
+ # trigger a retry.
1232
+ #
1233
+ class Rpcs
1234
+ ##
1235
+ # RPC-specific configuration for `create_members`
1236
+ # @return [::Gapic::Config::Method]
1237
+ #
1238
+ attr_reader :create_members
1239
+ ##
1240
+ # RPC-specific configuration for `delete`
1241
+ # @return [::Gapic::Config::Method]
1242
+ #
1243
+ attr_reader :delete
1244
+ ##
1245
+ # RPC-specific configuration for `get`
1246
+ # @return [::Gapic::Config::Method]
1247
+ #
1248
+ attr_reader :get
1249
+ ##
1250
+ # RPC-specific configuration for `get_iam_policy`
1251
+ # @return [::Gapic::Config::Method]
1252
+ #
1253
+ attr_reader :get_iam_policy
1254
+ ##
1255
+ # RPC-specific configuration for `get_operational_status`
1256
+ # @return [::Gapic::Config::Method]
1257
+ #
1258
+ attr_reader :get_operational_status
1259
+ ##
1260
+ # RPC-specific configuration for `insert`
1261
+ # @return [::Gapic::Config::Method]
1262
+ #
1263
+ attr_reader :insert
1264
+ ##
1265
+ # RPC-specific configuration for `list`
1266
+ # @return [::Gapic::Config::Method]
1267
+ #
1268
+ attr_reader :list
1269
+ ##
1270
+ # RPC-specific configuration for `patch`
1271
+ # @return [::Gapic::Config::Method]
1272
+ #
1273
+ attr_reader :patch
1274
+ ##
1275
+ # RPC-specific configuration for `set_iam_policy`
1276
+ # @return [::Gapic::Config::Method]
1277
+ #
1278
+ attr_reader :set_iam_policy
1279
+ ##
1280
+ # RPC-specific configuration for `test_iam_permissions`
1281
+ # @return [::Gapic::Config::Method]
1282
+ #
1283
+ attr_reader :test_iam_permissions
1284
+
1285
+ # @private
1286
+ def initialize parent_rpcs = nil
1287
+ create_members_config = parent_rpcs.create_members if parent_rpcs.respond_to? :create_members
1288
+ @create_members = ::Gapic::Config::Method.new create_members_config
1289
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
1290
+ @delete = ::Gapic::Config::Method.new delete_config
1291
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
1292
+ @get = ::Gapic::Config::Method.new get_config
1293
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1294
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1295
+ get_operational_status_config = parent_rpcs.get_operational_status if parent_rpcs.respond_to? :get_operational_status
1296
+ @get_operational_status = ::Gapic::Config::Method.new get_operational_status_config
1297
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
1298
+ @insert = ::Gapic::Config::Method.new insert_config
1299
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
1300
+ @list = ::Gapic::Config::Method.new list_config
1301
+ patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
1302
+ @patch = ::Gapic::Config::Method.new patch_config
1303
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1304
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1305
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1306
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
1307
+
1308
+ yield self if block_given?
1309
+ end
1310
+ end
1311
+ end
1312
+ end
1313
+ end
1314
+ end
1315
+ end
1316
+ end
1317
+ end
1318
+ end