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