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,1218 @@
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_attachment_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 InterconnectAttachmentGroups
29
+ module Rest
30
+ ##
31
+ # REST client for the InterconnectAttachmentGroups service.
32
+ #
33
+ # The InterconnectAttachmentGroups 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_attachment_groups_stub
44
+
45
+ ##
46
+ # Configure the InterconnectAttachmentGroups Client class.
47
+ #
48
+ # See {::Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all InterconnectAttachmentGroups clients
54
+ # ::Google::Cloud::Compute::V1::InterconnectAttachmentGroups::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.delete.timeout = 600.0
75
+
76
+ default_config.rpcs.get.timeout = 600.0
77
+ default_config.rpcs.get.retry_policy = {
78
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
79
+ }
80
+
81
+ default_config.rpcs.get_iam_policy.timeout = 600.0
82
+ default_config.rpcs.get_iam_policy.retry_policy = {
83
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
84
+ }
85
+
86
+ default_config.rpcs.get_operational_status.timeout = 600.0
87
+ default_config.rpcs.get_operational_status.retry_policy = {
88
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
89
+ }
90
+
91
+ default_config.rpcs.insert.timeout = 600.0
92
+
93
+ default_config.rpcs.list.timeout = 600.0
94
+ default_config.rpcs.list.retry_policy = {
95
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
96
+ }
97
+
98
+ default_config.rpcs.patch.timeout = 600.0
99
+
100
+ default_config.rpcs.set_iam_policy.timeout = 600.0
101
+
102
+ default_config.rpcs.test_iam_permissions.timeout = 600.0
103
+
104
+ default_config
105
+ end
106
+ yield @configure if block_given?
107
+ @configure
108
+ end
109
+
110
+ ##
111
+ # Configure the InterconnectAttachmentGroups Client instance.
112
+ #
113
+ # The configuration is set to the derived mode, meaning that values can be changed,
114
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
115
+ # should be made on {Client.configure}.
116
+ #
117
+ # See {::Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client::Configuration}
118
+ # for a description of the configuration fields.
119
+ #
120
+ # @yield [config] Configure the Client client.
121
+ # @yieldparam config [Client::Configuration]
122
+ #
123
+ # @return [Client::Configuration]
124
+ #
125
+ def configure
126
+ yield @config if block_given?
127
+ @config
128
+ end
129
+
130
+ ##
131
+ # The effective universe domain
132
+ #
133
+ # @return [String]
134
+ #
135
+ def universe_domain
136
+ @interconnect_attachment_groups_stub.universe_domain
137
+ end
138
+
139
+ ##
140
+ # Create a new InterconnectAttachmentGroups REST client object.
141
+ #
142
+ # @example
143
+ #
144
+ # # Create a client using the default configuration
145
+ # client = ::Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client.new
146
+ #
147
+ # # Create a client using a custom configuration
148
+ # client = ::Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client.new do |config|
149
+ # config.timeout = 10.0
150
+ # end
151
+ #
152
+ # @yield [config] Configure the InterconnectAttachmentGroups client.
153
+ # @yieldparam config [Client::Configuration]
154
+ #
155
+ def initialize
156
+ # Create the configuration object
157
+ @config = Configuration.new Client.configure
158
+
159
+ # Yield the configuration if needed
160
+ yield @config if block_given?
161
+
162
+ # Create credentials
163
+ credentials = @config.credentials
164
+ # Use self-signed JWT if the endpoint is unchanged from default,
165
+ # but only if the default endpoint does not have a region prefix.
166
+ enable_self_signed_jwt = @config.endpoint.nil? ||
167
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
168
+ !@config.endpoint.split(".").first.include?("-"))
169
+ credentials ||= Credentials.default scope: @config.scope,
170
+ enable_self_signed_jwt: enable_self_signed_jwt
171
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
172
+ credentials = Credentials.new credentials, scope: @config.scope
173
+ end
174
+
175
+ @quota_project_id = @config.quota_project
176
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
177
+
178
+ @global_operations = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client.new do |config|
179
+ config.credentials = credentials
180
+ config.quota_project = @quota_project_id
181
+ config.endpoint = @config.endpoint
182
+ config.universe_domain = @config.universe_domain
183
+ end
184
+
185
+ @interconnect_attachment_groups_stub = ::Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::ServiceStub.new(
186
+ endpoint: @config.endpoint,
187
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
188
+ universe_domain: @config.universe_domain,
189
+ credentials: credentials,
190
+ logger: @config.logger
191
+ )
192
+
193
+ @interconnect_attachment_groups_stub.logger(stub: true)&.info do |entry|
194
+ entry.set_system_name
195
+ entry.set_service
196
+ entry.message = "Created client for #{entry.service}"
197
+ entry.set_credentials_fields credentials
198
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
199
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
200
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
201
+ end
202
+ end
203
+
204
+ ##
205
+ # Get the associated client for long-running operations via GlobalOperations.
206
+ #
207
+ # @return [::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client]
208
+ #
209
+ attr_reader :global_operations
210
+
211
+ ##
212
+ # The logger used for request/response debug logging.
213
+ #
214
+ # @return [Logger]
215
+ #
216
+ def logger
217
+ @interconnect_attachment_groups_stub.logger
218
+ end
219
+
220
+ # Service calls
221
+
222
+ ##
223
+ # Deletes the specified InterconnectAttachmentGroup in the given scope
224
+ #
225
+ # @overload delete(request, options = nil)
226
+ # Pass arguments to `delete` via a request object, either of type
227
+ # {::Google::Cloud::Compute::V1::DeleteInterconnectAttachmentGroupRequest} or an equivalent Hash.
228
+ #
229
+ # @param request [::Google::Cloud::Compute::V1::DeleteInterconnectAttachmentGroupRequest, ::Hash]
230
+ # A request object representing the call parameters. Required. To specify no
231
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
232
+ # @param options [::Gapic::CallOptions, ::Hash]
233
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
234
+ #
235
+ # @overload delete(interconnect_attachment_group: nil, project: nil, request_id: nil)
236
+ # Pass arguments to `delete` via keyword arguments. Note that at
237
+ # least one keyword argument is required. To specify no parameters, or to keep all
238
+ # the default parameter values, pass an empty Hash as a request object (see above).
239
+ #
240
+ # @param interconnect_attachment_group [::String]
241
+ # Name of the InterconnectAttachmentGroup resource to delete.
242
+ # @param project [::String]
243
+ # Project ID for this request.
244
+ # @param request_id [::String]
245
+ # 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
246
+ # @yield [result, operation] Access the result along with the TransportOperation object
247
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
248
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
249
+ #
250
+ # @return [::Gapic::GenericLRO::Operation]
251
+ #
252
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
253
+ #
254
+ # @example Basic example
255
+ # require "google/cloud/compute/v1"
256
+ #
257
+ # # Create a client object. The client can be reused for multiple calls.
258
+ # client = Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client.new
259
+ #
260
+ # # Create a request. To set request fields, pass in keyword arguments.
261
+ # request = Google::Cloud::Compute::V1::DeleteInterconnectAttachmentGroupRequest.new
262
+ #
263
+ # # Call the delete method.
264
+ # result = client.delete request
265
+ #
266
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
267
+ # p result
268
+ #
269
+ def delete request, options = nil
270
+ raise ::ArgumentError, "request must be provided" if request.nil?
271
+
272
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteInterconnectAttachmentGroupRequest
273
+
274
+ # Converts hash and nil to an options object
275
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
276
+
277
+ # Customize the options with defaults
278
+ call_metadata = @config.rpcs.delete.metadata.to_h
279
+
280
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
281
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
282
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
283
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
284
+ transports_version_send: [:rest]
285
+
286
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
287
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
288
+
289
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
290
+ metadata: call_metadata,
291
+ retry_policy: @config.rpcs.delete.retry_policy
292
+
293
+ options.apply_defaults timeout: @config.timeout,
294
+ metadata: @config.metadata,
295
+ retry_policy: @config.retry_policy
296
+
297
+ @interconnect_attachment_groups_stub.delete request, options do |result, response|
298
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
299
+ operation: result,
300
+ client: global_operations,
301
+ request_values: {
302
+ "project" => request.project
303
+ },
304
+ options: options
305
+ )
306
+ yield result, response if block_given?
307
+ throw :response, result
308
+ end
309
+ rescue ::Gapic::Rest::Error => e
310
+ raise ::Google::Cloud::Error.from_error(e)
311
+ end
312
+
313
+ ##
314
+ # Returns the specified InterconnectAttachmentGroup resource in the given scope.
315
+ #
316
+ # @overload get(request, options = nil)
317
+ # Pass arguments to `get` via a request object, either of type
318
+ # {::Google::Cloud::Compute::V1::GetInterconnectAttachmentGroupRequest} or an equivalent Hash.
319
+ #
320
+ # @param request [::Google::Cloud::Compute::V1::GetInterconnectAttachmentGroupRequest, ::Hash]
321
+ # A request object representing the call parameters. Required. To specify no
322
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
323
+ # @param options [::Gapic::CallOptions, ::Hash]
324
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
325
+ #
326
+ # @overload get(interconnect_attachment_group: nil, project: nil)
327
+ # Pass arguments to `get` via keyword arguments. Note that at
328
+ # least one keyword argument is required. To specify no parameters, or to keep all
329
+ # the default parameter values, pass an empty Hash as a request object (see above).
330
+ #
331
+ # @param interconnect_attachment_group [::String]
332
+ # Name of the InterconnectAttachmentGroup resource to return.
333
+ # @param project [::String]
334
+ # Project ID for this request.
335
+ # @yield [result, operation] Access the result along with the TransportOperation object
336
+ # @yieldparam result [::Google::Cloud::Compute::V1::InterconnectAttachmentGroup]
337
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
338
+ #
339
+ # @return [::Google::Cloud::Compute::V1::InterconnectAttachmentGroup]
340
+ #
341
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
342
+ #
343
+ # @example Basic example
344
+ # require "google/cloud/compute/v1"
345
+ #
346
+ # # Create a client object. The client can be reused for multiple calls.
347
+ # client = Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client.new
348
+ #
349
+ # # Create a request. To set request fields, pass in keyword arguments.
350
+ # request = Google::Cloud::Compute::V1::GetInterconnectAttachmentGroupRequest.new
351
+ #
352
+ # # Call the get method.
353
+ # result = client.get request
354
+ #
355
+ # # The returned object is of type Google::Cloud::Compute::V1::InterconnectAttachmentGroup.
356
+ # p result
357
+ #
358
+ def get request, options = nil
359
+ raise ::ArgumentError, "request must be provided" if request.nil?
360
+
361
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetInterconnectAttachmentGroupRequest
362
+
363
+ # Converts hash and nil to an options object
364
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
365
+
366
+ # Customize the options with defaults
367
+ call_metadata = @config.rpcs.get.metadata.to_h
368
+
369
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
370
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
371
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
372
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
373
+ transports_version_send: [:rest]
374
+
375
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
376
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
377
+
378
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
379
+ metadata: call_metadata,
380
+ retry_policy: @config.rpcs.get.retry_policy
381
+
382
+ options.apply_defaults timeout: @config.timeout,
383
+ metadata: @config.metadata,
384
+ retry_policy: @config.retry_policy
385
+
386
+ @interconnect_attachment_groups_stub.get request, options do |result, operation|
387
+ yield result, operation if block_given?
388
+ end
389
+ rescue ::Gapic::Rest::Error => e
390
+ raise ::Google::Cloud::Error.from_error(e)
391
+ end
392
+
393
+ ##
394
+ # Gets the access control policy for a resource. May be empty if no such policy or resource exists.
395
+ #
396
+ # @overload get_iam_policy(request, options = nil)
397
+ # Pass arguments to `get_iam_policy` via a request object, either of type
398
+ # {::Google::Cloud::Compute::V1::GetIamPolicyInterconnectAttachmentGroupRequest} or an equivalent Hash.
399
+ #
400
+ # @param request [::Google::Cloud::Compute::V1::GetIamPolicyInterconnectAttachmentGroupRequest, ::Hash]
401
+ # A request object representing the call parameters. Required. To specify no
402
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
403
+ # @param options [::Gapic::CallOptions, ::Hash]
404
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
405
+ #
406
+ # @overload get_iam_policy(options_requested_policy_version: nil, project: nil, resource: nil)
407
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
408
+ # least one keyword argument is required. To specify no parameters, or to keep all
409
+ # the default parameter values, pass an empty Hash as a request object (see above).
410
+ #
411
+ # @param options_requested_policy_version [::Integer]
412
+ # Requested IAM Policy version.
413
+ # @param project [::String]
414
+ # Project ID for this request.
415
+ # @param resource [::String]
416
+ # Name or id of the resource for this request.
417
+ # @yield [result, operation] Access the result along with the TransportOperation object
418
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
419
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
420
+ #
421
+ # @return [::Google::Cloud::Compute::V1::Policy]
422
+ #
423
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
424
+ #
425
+ # @example Basic example
426
+ # require "google/cloud/compute/v1"
427
+ #
428
+ # # Create a client object. The client can be reused for multiple calls.
429
+ # client = Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client.new
430
+ #
431
+ # # Create a request. To set request fields, pass in keyword arguments.
432
+ # request = Google::Cloud::Compute::V1::GetIamPolicyInterconnectAttachmentGroupRequest.new
433
+ #
434
+ # # Call the get_iam_policy method.
435
+ # result = client.get_iam_policy request
436
+ #
437
+ # # The returned object is of type Google::Cloud::Compute::V1::Policy.
438
+ # p result
439
+ #
440
+ def get_iam_policy request, options = nil
441
+ raise ::ArgumentError, "request must be provided" if request.nil?
442
+
443
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetIamPolicyInterconnectAttachmentGroupRequest
444
+
445
+ # Converts hash and nil to an options object
446
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
447
+
448
+ # Customize the options with defaults
449
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
450
+
451
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
452
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
453
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
454
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
455
+ transports_version_send: [:rest]
456
+
457
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
458
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
459
+
460
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
461
+ metadata: call_metadata,
462
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
463
+
464
+ options.apply_defaults timeout: @config.timeout,
465
+ metadata: @config.metadata,
466
+ retry_policy: @config.retry_policy
467
+
468
+ @interconnect_attachment_groups_stub.get_iam_policy request, options do |result, operation|
469
+ yield result, operation if block_given?
470
+ end
471
+ rescue ::Gapic::Rest::Error => e
472
+ raise ::Google::Cloud::Error.from_error(e)
473
+ end
474
+
475
+ ##
476
+ # Returns the InterconnectAttachmentStatuses for the specified InterconnectAttachmentGroup resource.
477
+ #
478
+ # @overload get_operational_status(request, options = nil)
479
+ # Pass arguments to `get_operational_status` via a request object, either of type
480
+ # {::Google::Cloud::Compute::V1::GetOperationalStatusInterconnectAttachmentGroupRequest} or an equivalent Hash.
481
+ #
482
+ # @param request [::Google::Cloud::Compute::V1::GetOperationalStatusInterconnectAttachmentGroupRequest, ::Hash]
483
+ # A request object representing the call parameters. Required. To specify no
484
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
485
+ # @param options [::Gapic::CallOptions, ::Hash]
486
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
487
+ #
488
+ # @overload get_operational_status(interconnect_attachment_group: nil, project: nil)
489
+ # Pass arguments to `get_operational_status` via keyword arguments. Note that at
490
+ # least one keyword argument is required. To specify no parameters, or to keep all
491
+ # the default parameter values, pass an empty Hash as a request object (see above).
492
+ #
493
+ # @param interconnect_attachment_group [::String]
494
+ # Name of the interconnectAttachmentGroup resource to query.
495
+ # @param project [::String]
496
+ # Project ID for this request.
497
+ # @yield [result, operation] Access the result along with the TransportOperation object
498
+ # @yieldparam result [::Google::Cloud::Compute::V1::InterconnectAttachmentGroupsGetOperationalStatusResponse]
499
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
500
+ #
501
+ # @return [::Google::Cloud::Compute::V1::InterconnectAttachmentGroupsGetOperationalStatusResponse]
502
+ #
503
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
504
+ #
505
+ # @example Basic example
506
+ # require "google/cloud/compute/v1"
507
+ #
508
+ # # Create a client object. The client can be reused for multiple calls.
509
+ # client = Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client.new
510
+ #
511
+ # # Create a request. To set request fields, pass in keyword arguments.
512
+ # request = Google::Cloud::Compute::V1::GetOperationalStatusInterconnectAttachmentGroupRequest.new
513
+ #
514
+ # # Call the get_operational_status method.
515
+ # result = client.get_operational_status request
516
+ #
517
+ # # The returned object is of type Google::Cloud::Compute::V1::InterconnectAttachmentGroupsGetOperationalStatusResponse.
518
+ # p result
519
+ #
520
+ def get_operational_status request, options = nil
521
+ raise ::ArgumentError, "request must be provided" if request.nil?
522
+
523
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetOperationalStatusInterconnectAttachmentGroupRequest
524
+
525
+ # Converts hash and nil to an options object
526
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
527
+
528
+ # Customize the options with defaults
529
+ call_metadata = @config.rpcs.get_operational_status.metadata.to_h
530
+
531
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
532
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
533
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
534
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
535
+ transports_version_send: [:rest]
536
+
537
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
538
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
539
+
540
+ options.apply_defaults timeout: @config.rpcs.get_operational_status.timeout,
541
+ metadata: call_metadata,
542
+ retry_policy: @config.rpcs.get_operational_status.retry_policy
543
+
544
+ options.apply_defaults timeout: @config.timeout,
545
+ metadata: @config.metadata,
546
+ retry_policy: @config.retry_policy
547
+
548
+ @interconnect_attachment_groups_stub.get_operational_status request, options do |result, operation|
549
+ yield result, operation if block_given?
550
+ end
551
+ rescue ::Gapic::Rest::Error => e
552
+ raise ::Google::Cloud::Error.from_error(e)
553
+ end
554
+
555
+ ##
556
+ # Creates a InterconnectAttachmentGroup in the specified project in the given scope using the parameters that are included in the request.
557
+ #
558
+ # @overload insert(request, options = nil)
559
+ # Pass arguments to `insert` via a request object, either of type
560
+ # {::Google::Cloud::Compute::V1::InsertInterconnectAttachmentGroupRequest} or an equivalent Hash.
561
+ #
562
+ # @param request [::Google::Cloud::Compute::V1::InsertInterconnectAttachmentGroupRequest, ::Hash]
563
+ # A request object representing the call parameters. Required. To specify no
564
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
565
+ # @param options [::Gapic::CallOptions, ::Hash]
566
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
567
+ #
568
+ # @overload insert(interconnect_attachment_group_resource: nil, project: nil, request_id: nil)
569
+ # Pass arguments to `insert` via keyword arguments. Note that at
570
+ # least one keyword argument is required. To specify no parameters, or to keep all
571
+ # the default parameter values, pass an empty Hash as a request object (see above).
572
+ #
573
+ # @param interconnect_attachment_group_resource [::Google::Cloud::Compute::V1::InterconnectAttachmentGroup, ::Hash]
574
+ # The body resource for this request
575
+ # @param project [::String]
576
+ # Project ID for this request.
577
+ # @param request_id [::String]
578
+ # 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
579
+ # @yield [result, operation] Access the result along with the TransportOperation object
580
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
581
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
582
+ #
583
+ # @return [::Gapic::GenericLRO::Operation]
584
+ #
585
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
586
+ #
587
+ # @example Basic example
588
+ # require "google/cloud/compute/v1"
589
+ #
590
+ # # Create a client object. The client can be reused for multiple calls.
591
+ # client = Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client.new
592
+ #
593
+ # # Create a request. To set request fields, pass in keyword arguments.
594
+ # request = Google::Cloud::Compute::V1::InsertInterconnectAttachmentGroupRequest.new
595
+ #
596
+ # # Call the insert method.
597
+ # result = client.insert request
598
+ #
599
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
600
+ # p result
601
+ #
602
+ def insert request, options = nil
603
+ raise ::ArgumentError, "request must be provided" if request.nil?
604
+
605
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::InsertInterconnectAttachmentGroupRequest
606
+
607
+ # Converts hash and nil to an options object
608
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
609
+
610
+ # Customize the options with defaults
611
+ call_metadata = @config.rpcs.insert.metadata.to_h
612
+
613
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
614
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
615
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
616
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
617
+ transports_version_send: [:rest]
618
+
619
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
620
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
621
+
622
+ options.apply_defaults timeout: @config.rpcs.insert.timeout,
623
+ metadata: call_metadata,
624
+ retry_policy: @config.rpcs.insert.retry_policy
625
+
626
+ options.apply_defaults timeout: @config.timeout,
627
+ metadata: @config.metadata,
628
+ retry_policy: @config.retry_policy
629
+
630
+ @interconnect_attachment_groups_stub.insert request, options do |result, response|
631
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
632
+ operation: result,
633
+ client: global_operations,
634
+ request_values: {
635
+ "project" => request.project
636
+ },
637
+ options: options
638
+ )
639
+ yield result, response if block_given?
640
+ throw :response, result
641
+ end
642
+ rescue ::Gapic::Rest::Error => e
643
+ raise ::Google::Cloud::Error.from_error(e)
644
+ end
645
+
646
+ ##
647
+ # Lists the InterconnectAttachmentGroups for a project in the given scope.
648
+ #
649
+ # @overload list(request, options = nil)
650
+ # Pass arguments to `list` via a request object, either of type
651
+ # {::Google::Cloud::Compute::V1::ListInterconnectAttachmentGroupsRequest} or an equivalent Hash.
652
+ #
653
+ # @param request [::Google::Cloud::Compute::V1::ListInterconnectAttachmentGroupsRequest, ::Hash]
654
+ # A request object representing the call parameters. Required. To specify no
655
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
656
+ # @param options [::Gapic::CallOptions, ::Hash]
657
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
658
+ #
659
+ # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
660
+ # Pass arguments to `list` via keyword arguments. Note that at
661
+ # least one keyword argument is required. To specify no parameters, or to keep all
662
+ # the default parameter values, pass an empty Hash as a request object (see above).
663
+ #
664
+ # @param filter [::String]
665
+ # 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.
666
+ # @param max_results [::Integer]
667
+ # 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`)
668
+ # @param order_by [::String]
669
+ # 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.
670
+ # @param page_token [::String]
671
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
672
+ # @param project [::String]
673
+ # Project ID for this request.
674
+ # @param return_partial_success [::Boolean]
675
+ # 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.
676
+ # @yield [result, operation] Access the result along with the TransportOperation object
677
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InterconnectAttachmentGroup>]
678
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
679
+ #
680
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InterconnectAttachmentGroup>]
681
+ #
682
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
683
+ #
684
+ # @example Basic example
685
+ # require "google/cloud/compute/v1"
686
+ #
687
+ # # Create a client object. The client can be reused for multiple calls.
688
+ # client = Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client.new
689
+ #
690
+ # # Create a request. To set request fields, pass in keyword arguments.
691
+ # request = Google::Cloud::Compute::V1::ListInterconnectAttachmentGroupsRequest.new
692
+ #
693
+ # # Call the list method.
694
+ # result = client.list request
695
+ #
696
+ # # The returned object is of type Google::Cloud::Compute::V1::InterconnectAttachmentGroupsListResponse.
697
+ # p result
698
+ #
699
+ def list request, options = nil
700
+ raise ::ArgumentError, "request must be provided" if request.nil?
701
+
702
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListInterconnectAttachmentGroupsRequest
703
+
704
+ # Converts hash and nil to an options object
705
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
706
+
707
+ # Customize the options with defaults
708
+ call_metadata = @config.rpcs.list.metadata.to_h
709
+
710
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
711
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
712
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
713
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
714
+ transports_version_send: [:rest]
715
+
716
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
717
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
718
+
719
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
720
+ metadata: call_metadata,
721
+ retry_policy: @config.rpcs.list.retry_policy
722
+
723
+ options.apply_defaults timeout: @config.timeout,
724
+ metadata: @config.metadata,
725
+ retry_policy: @config.retry_policy
726
+
727
+ @interconnect_attachment_groups_stub.list request, options do |result, operation|
728
+ result = ::Gapic::Rest::PagedEnumerable.new @interconnect_attachment_groups_stub, :list, "items", request, result, options
729
+ yield result, operation if block_given?
730
+ throw :response, result
731
+ end
732
+ rescue ::Gapic::Rest::Error => e
733
+ raise ::Google::Cloud::Error.from_error(e)
734
+ end
735
+
736
+ ##
737
+ # Patches the specified InterconnectAttachmentGroup resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.
738
+ #
739
+ # @overload patch(request, options = nil)
740
+ # Pass arguments to `patch` via a request object, either of type
741
+ # {::Google::Cloud::Compute::V1::PatchInterconnectAttachmentGroupRequest} or an equivalent Hash.
742
+ #
743
+ # @param request [::Google::Cloud::Compute::V1::PatchInterconnectAttachmentGroupRequest, ::Hash]
744
+ # A request object representing the call parameters. Required. To specify no
745
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
746
+ # @param options [::Gapic::CallOptions, ::Hash]
747
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
748
+ #
749
+ # @overload patch(interconnect_attachment_group: nil, interconnect_attachment_group_resource: nil, project: nil, request_id: nil, update_mask: nil)
750
+ # Pass arguments to `patch` via keyword arguments. Note that at
751
+ # least one keyword argument is required. To specify no parameters, or to keep all
752
+ # the default parameter values, pass an empty Hash as a request object (see above).
753
+ #
754
+ # @param interconnect_attachment_group [::String]
755
+ # Name of the InterconnectAttachmentGroup resource to patch.
756
+ # @param interconnect_attachment_group_resource [::Google::Cloud::Compute::V1::InterconnectAttachmentGroup, ::Hash]
757
+ # The body resource for this request
758
+ # @param project [::String]
759
+ # Project ID for this request.
760
+ # @param request_id [::String]
761
+ # 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
762
+ # @param update_mask [::String]
763
+ # The list of fields to update.
764
+ # @yield [result, operation] Access the result along with the TransportOperation object
765
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
766
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
767
+ #
768
+ # @return [::Gapic::GenericLRO::Operation]
769
+ #
770
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
771
+ #
772
+ # @example Basic example
773
+ # require "google/cloud/compute/v1"
774
+ #
775
+ # # Create a client object. The client can be reused for multiple calls.
776
+ # client = Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client.new
777
+ #
778
+ # # Create a request. To set request fields, pass in keyword arguments.
779
+ # request = Google::Cloud::Compute::V1::PatchInterconnectAttachmentGroupRequest.new
780
+ #
781
+ # # Call the patch method.
782
+ # result = client.patch request
783
+ #
784
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
785
+ # p result
786
+ #
787
+ def patch request, options = nil
788
+ raise ::ArgumentError, "request must be provided" if request.nil?
789
+
790
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchInterconnectAttachmentGroupRequest
791
+
792
+ # Converts hash and nil to an options object
793
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
794
+
795
+ # Customize the options with defaults
796
+ call_metadata = @config.rpcs.patch.metadata.to_h
797
+
798
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
799
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
800
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
801
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
802
+ transports_version_send: [:rest]
803
+
804
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
805
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
806
+
807
+ options.apply_defaults timeout: @config.rpcs.patch.timeout,
808
+ metadata: call_metadata,
809
+ retry_policy: @config.rpcs.patch.retry_policy
810
+
811
+ options.apply_defaults timeout: @config.timeout,
812
+ metadata: @config.metadata,
813
+ retry_policy: @config.retry_policy
814
+
815
+ @interconnect_attachment_groups_stub.patch request, options do |result, response|
816
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
817
+ operation: result,
818
+ client: global_operations,
819
+ request_values: {
820
+ "project" => request.project
821
+ },
822
+ options: options
823
+ )
824
+ yield result, response if block_given?
825
+ throw :response, result
826
+ end
827
+ rescue ::Gapic::Rest::Error => e
828
+ raise ::Google::Cloud::Error.from_error(e)
829
+ end
830
+
831
+ ##
832
+ # Sets the access control policy on the specified resource. Replaces any existing policy.
833
+ #
834
+ # @overload set_iam_policy(request, options = nil)
835
+ # Pass arguments to `set_iam_policy` via a request object, either of type
836
+ # {::Google::Cloud::Compute::V1::SetIamPolicyInterconnectAttachmentGroupRequest} or an equivalent Hash.
837
+ #
838
+ # @param request [::Google::Cloud::Compute::V1::SetIamPolicyInterconnectAttachmentGroupRequest, ::Hash]
839
+ # A request object representing the call parameters. Required. To specify no
840
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
841
+ # @param options [::Gapic::CallOptions, ::Hash]
842
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
843
+ #
844
+ # @overload set_iam_policy(global_set_policy_request_resource: nil, project: nil, resource: nil)
845
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
846
+ # least one keyword argument is required. To specify no parameters, or to keep all
847
+ # the default parameter values, pass an empty Hash as a request object (see above).
848
+ #
849
+ # @param global_set_policy_request_resource [::Google::Cloud::Compute::V1::GlobalSetPolicyRequest, ::Hash]
850
+ # The body resource for this request
851
+ # @param project [::String]
852
+ # Project ID for this request.
853
+ # @param resource [::String]
854
+ # Name or id of the resource for this request.
855
+ # @yield [result, operation] Access the result along with the TransportOperation object
856
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
857
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
858
+ #
859
+ # @return [::Google::Cloud::Compute::V1::Policy]
860
+ #
861
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
862
+ #
863
+ # @example Basic example
864
+ # require "google/cloud/compute/v1"
865
+ #
866
+ # # Create a client object. The client can be reused for multiple calls.
867
+ # client = Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client.new
868
+ #
869
+ # # Create a request. To set request fields, pass in keyword arguments.
870
+ # request = Google::Cloud::Compute::V1::SetIamPolicyInterconnectAttachmentGroupRequest.new
871
+ #
872
+ # # Call the set_iam_policy method.
873
+ # result = client.set_iam_policy request
874
+ #
875
+ # # The returned object is of type Google::Cloud::Compute::V1::Policy.
876
+ # p result
877
+ #
878
+ def set_iam_policy request, options = nil
879
+ raise ::ArgumentError, "request must be provided" if request.nil?
880
+
881
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetIamPolicyInterconnectAttachmentGroupRequest
882
+
883
+ # Converts hash and nil to an options object
884
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
885
+
886
+ # Customize the options with defaults
887
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
888
+
889
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
890
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
891
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
892
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
893
+ transports_version_send: [:rest]
894
+
895
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
896
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
897
+
898
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
899
+ metadata: call_metadata,
900
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
901
+
902
+ options.apply_defaults timeout: @config.timeout,
903
+ metadata: @config.metadata,
904
+ retry_policy: @config.retry_policy
905
+
906
+ @interconnect_attachment_groups_stub.set_iam_policy request, options do |result, operation|
907
+ yield result, operation if block_given?
908
+ end
909
+ rescue ::Gapic::Rest::Error => e
910
+ raise ::Google::Cloud::Error.from_error(e)
911
+ end
912
+
913
+ ##
914
+ # Returns permissions that a caller has on the specified resource.
915
+ #
916
+ # @overload test_iam_permissions(request, options = nil)
917
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
918
+ # {::Google::Cloud::Compute::V1::TestIamPermissionsInterconnectAttachmentGroupRequest} or an equivalent Hash.
919
+ #
920
+ # @param request [::Google::Cloud::Compute::V1::TestIamPermissionsInterconnectAttachmentGroupRequest, ::Hash]
921
+ # A request object representing the call parameters. Required. To specify no
922
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
923
+ # @param options [::Gapic::CallOptions, ::Hash]
924
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
925
+ #
926
+ # @overload test_iam_permissions(project: nil, resource: nil, test_permissions_request_resource: nil)
927
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
928
+ # least one keyword argument is required. To specify no parameters, or to keep all
929
+ # the default parameter values, pass an empty Hash as a request object (see above).
930
+ #
931
+ # @param project [::String]
932
+ # Project ID for this request.
933
+ # @param resource [::String]
934
+ # Name or id of the resource for this request.
935
+ # @param test_permissions_request_resource [::Google::Cloud::Compute::V1::TestPermissionsRequest, ::Hash]
936
+ # The body resource for this request
937
+ # @yield [result, operation] Access the result along with the TransportOperation object
938
+ # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
939
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
940
+ #
941
+ # @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
942
+ #
943
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
944
+ #
945
+ # @example Basic example
946
+ # require "google/cloud/compute/v1"
947
+ #
948
+ # # Create a client object. The client can be reused for multiple calls.
949
+ # client = Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client.new
950
+ #
951
+ # # Create a request. To set request fields, pass in keyword arguments.
952
+ # request = Google::Cloud::Compute::V1::TestIamPermissionsInterconnectAttachmentGroupRequest.new
953
+ #
954
+ # # Call the test_iam_permissions method.
955
+ # result = client.test_iam_permissions request
956
+ #
957
+ # # The returned object is of type Google::Cloud::Compute::V1::TestPermissionsResponse.
958
+ # p result
959
+ #
960
+ def test_iam_permissions request, options = nil
961
+ raise ::ArgumentError, "request must be provided" if request.nil?
962
+
963
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::TestIamPermissionsInterconnectAttachmentGroupRequest
964
+
965
+ # Converts hash and nil to an options object
966
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
967
+
968
+ # Customize the options with defaults
969
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
970
+
971
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
972
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
973
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
974
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
975
+ transports_version_send: [:rest]
976
+
977
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
978
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
979
+
980
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
981
+ metadata: call_metadata,
982
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
983
+
984
+ options.apply_defaults timeout: @config.timeout,
985
+ metadata: @config.metadata,
986
+ retry_policy: @config.retry_policy
987
+
988
+ @interconnect_attachment_groups_stub.test_iam_permissions request, options do |result, operation|
989
+ yield result, operation if block_given?
990
+ end
991
+ rescue ::Gapic::Rest::Error => e
992
+ raise ::Google::Cloud::Error.from_error(e)
993
+ end
994
+
995
+ ##
996
+ # Configuration class for the InterconnectAttachmentGroups REST API.
997
+ #
998
+ # This class represents the configuration for InterconnectAttachmentGroups REST,
999
+ # providing control over timeouts, retry behavior, logging, transport
1000
+ # parameters, and other low-level controls. Certain parameters can also be
1001
+ # applied individually to specific RPCs. See
1002
+ # {::Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client::Configuration::Rpcs}
1003
+ # for a list of RPCs that can be configured independently.
1004
+ #
1005
+ # Configuration can be applied globally to all clients, or to a single client
1006
+ # on construction.
1007
+ #
1008
+ # @example
1009
+ #
1010
+ # # Modify the global config, setting the timeout for
1011
+ # # delete to 20 seconds,
1012
+ # # and all remaining timeouts to 10 seconds.
1013
+ # ::Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client.configure do |config|
1014
+ # config.timeout = 10.0
1015
+ # config.rpcs.delete.timeout = 20.0
1016
+ # end
1017
+ #
1018
+ # # Apply the above configuration only to a new client.
1019
+ # client = ::Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client.new do |config|
1020
+ # config.timeout = 10.0
1021
+ # config.rpcs.delete.timeout = 20.0
1022
+ # end
1023
+ #
1024
+ # @!attribute [rw] endpoint
1025
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1026
+ # nil, indicating to use the default endpoint in the current universe domain.
1027
+ # @return [::String,nil]
1028
+ # @!attribute [rw] credentials
1029
+ # Credentials to send with calls. You may provide any of the following types:
1030
+ # * (`String`) The path to a service account key file in JSON format
1031
+ # * (`Hash`) A service account key as a Hash
1032
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1033
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1034
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1035
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1036
+ # * (`nil`) indicating no credentials
1037
+ #
1038
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1039
+ # external source for authentication to Google Cloud, you must validate it before
1040
+ # providing it to a Google API client library. Providing an unvalidated credential
1041
+ # configuration to Google APIs can compromise the security of your systems and data.
1042
+ # For more information, refer to [Validate credential configurations from external
1043
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1044
+ # @return [::Object]
1045
+ # @!attribute [rw] scope
1046
+ # The OAuth scopes
1047
+ # @return [::Array<::String>]
1048
+ # @!attribute [rw] lib_name
1049
+ # The library name as recorded in instrumentation and logging
1050
+ # @return [::String]
1051
+ # @!attribute [rw] lib_version
1052
+ # The library version as recorded in instrumentation and logging
1053
+ # @return [::String]
1054
+ # @!attribute [rw] timeout
1055
+ # The call timeout in seconds.
1056
+ # @return [::Numeric]
1057
+ # @!attribute [rw] metadata
1058
+ # Additional headers to be sent with the call.
1059
+ # @return [::Hash{::Symbol=>::String}]
1060
+ # @!attribute [rw] retry_policy
1061
+ # The retry policy. The value is a hash with the following keys:
1062
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1063
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1064
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1065
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1066
+ # trigger a retry.
1067
+ # @return [::Hash]
1068
+ # @!attribute [rw] quota_project
1069
+ # A separate project against which to charge quota.
1070
+ # @return [::String]
1071
+ # @!attribute [rw] universe_domain
1072
+ # The universe domain within which to make requests. This determines the
1073
+ # default endpoint URL. The default value of nil uses the environment
1074
+ # universe (usually the default "googleapis.com" universe).
1075
+ # @return [::String,nil]
1076
+ # @!attribute [rw] logger
1077
+ # A custom logger to use for request/response debug logging, or the value
1078
+ # `:default` (the default) to construct a default logger, or `nil` to
1079
+ # explicitly disable logging.
1080
+ # @return [::Logger,:default,nil]
1081
+ #
1082
+ class Configuration
1083
+ extend ::Gapic::Config
1084
+
1085
+ # @private
1086
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1087
+ DEFAULT_ENDPOINT = "compute.googleapis.com"
1088
+
1089
+ config_attr :endpoint, nil, ::String, nil
1090
+ config_attr :credentials, nil do |value|
1091
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
1092
+ allowed.any? { |klass| klass === value }
1093
+ end
1094
+ config_attr :scope, nil, ::String, ::Array, nil
1095
+ config_attr :lib_name, nil, ::String, nil
1096
+ config_attr :lib_version, nil, ::String, nil
1097
+ config_attr :timeout, nil, ::Numeric, nil
1098
+ config_attr :metadata, nil, ::Hash, nil
1099
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1100
+ config_attr :quota_project, nil, ::String, nil
1101
+ config_attr :universe_domain, nil, ::String, nil
1102
+ config_attr :logger, :default, ::Logger, nil, :default
1103
+
1104
+ # @private
1105
+ def initialize parent_config = nil
1106
+ @parent_config = parent_config unless parent_config.nil?
1107
+
1108
+ yield self if block_given?
1109
+ end
1110
+
1111
+ ##
1112
+ # Configurations for individual RPCs
1113
+ # @return [Rpcs]
1114
+ #
1115
+ def rpcs
1116
+ @rpcs ||= begin
1117
+ parent_rpcs = nil
1118
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1119
+ Rpcs.new parent_rpcs
1120
+ end
1121
+ end
1122
+
1123
+ ##
1124
+ # Configuration RPC class for the InterconnectAttachmentGroups API.
1125
+ #
1126
+ # Includes fields providing the configuration for each RPC in this service.
1127
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1128
+ # the following configuration fields:
1129
+ #
1130
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1131
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1132
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1133
+ # include the following keys:
1134
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1135
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1136
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1137
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1138
+ # trigger a retry.
1139
+ #
1140
+ class Rpcs
1141
+ ##
1142
+ # RPC-specific configuration for `delete`
1143
+ # @return [::Gapic::Config::Method]
1144
+ #
1145
+ attr_reader :delete
1146
+ ##
1147
+ # RPC-specific configuration for `get`
1148
+ # @return [::Gapic::Config::Method]
1149
+ #
1150
+ attr_reader :get
1151
+ ##
1152
+ # RPC-specific configuration for `get_iam_policy`
1153
+ # @return [::Gapic::Config::Method]
1154
+ #
1155
+ attr_reader :get_iam_policy
1156
+ ##
1157
+ # RPC-specific configuration for `get_operational_status`
1158
+ # @return [::Gapic::Config::Method]
1159
+ #
1160
+ attr_reader :get_operational_status
1161
+ ##
1162
+ # RPC-specific configuration for `insert`
1163
+ # @return [::Gapic::Config::Method]
1164
+ #
1165
+ attr_reader :insert
1166
+ ##
1167
+ # RPC-specific configuration for `list`
1168
+ # @return [::Gapic::Config::Method]
1169
+ #
1170
+ attr_reader :list
1171
+ ##
1172
+ # RPC-specific configuration for `patch`
1173
+ # @return [::Gapic::Config::Method]
1174
+ #
1175
+ attr_reader :patch
1176
+ ##
1177
+ # RPC-specific configuration for `set_iam_policy`
1178
+ # @return [::Gapic::Config::Method]
1179
+ #
1180
+ attr_reader :set_iam_policy
1181
+ ##
1182
+ # RPC-specific configuration for `test_iam_permissions`
1183
+ # @return [::Gapic::Config::Method]
1184
+ #
1185
+ attr_reader :test_iam_permissions
1186
+
1187
+ # @private
1188
+ def initialize parent_rpcs = nil
1189
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
1190
+ @delete = ::Gapic::Config::Method.new delete_config
1191
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
1192
+ @get = ::Gapic::Config::Method.new get_config
1193
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1194
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1195
+ get_operational_status_config = parent_rpcs.get_operational_status if parent_rpcs.respond_to? :get_operational_status
1196
+ @get_operational_status = ::Gapic::Config::Method.new get_operational_status_config
1197
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
1198
+ @insert = ::Gapic::Config::Method.new insert_config
1199
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
1200
+ @list = ::Gapic::Config::Method.new list_config
1201
+ patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
1202
+ @patch = ::Gapic::Config::Method.new patch_config
1203
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1204
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1205
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1206
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
1207
+
1208
+ yield self if block_given?
1209
+ end
1210
+ end
1211
+ end
1212
+ end
1213
+ end
1214
+ end
1215
+ end
1216
+ end
1217
+ end
1218
+ end