google-cloud-compute-v1 2.10.0 → 2.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/compute_pb.rb +51 -1
  3. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/credentials.rb +52 -0
  4. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest/client.rb +829 -0
  5. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest/service_stub.rb +378 -0
  6. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest.rb +51 -0
  7. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests.rb +47 -0
  8. data/lib/google/cloud/compute/v1/instance_settings_service/credentials.rb +52 -0
  9. data/lib/google/cloud/compute/v1/instance_settings_service/rest/client.rb +512 -0
  10. data/lib/google/cloud/compute/v1/instance_settings_service/rest/service_stub.rb +190 -0
  11. data/lib/google/cloud/compute/v1/instance_settings_service/rest.rb +51 -0
  12. data/lib/google/cloud/compute/v1/instance_settings_service.rb +47 -0
  13. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +104 -0
  14. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +62 -0
  15. data/lib/google/cloud/compute/v1/rest.rb +4 -0
  16. data/lib/google/cloud/compute/v1/storage_pool_types/credentials.rb +53 -0
  17. data/lib/google/cloud/compute/v1/storage_pool_types/rest/client.rb +603 -0
  18. data/lib/google/cloud/compute/v1/storage_pool_types/rest/service_stub.rb +249 -0
  19. data/lib/google/cloud/compute/v1/storage_pool_types/rest.rb +51 -0
  20. data/lib/google/cloud/compute/v1/storage_pool_types.rb +47 -0
  21. data/lib/google/cloud/compute/v1/storage_pools/credentials.rb +52 -0
  22. data/lib/google/cloud/compute/v1/storage_pools/rest/client.rb +1313 -0
  23. data/lib/google/cloud/compute/v1/storage_pools/rest/service_stub.rb +679 -0
  24. data/lib/google/cloud/compute/v1/storage_pools/rest.rb +51 -0
  25. data/lib/google/cloud/compute/v1/storage_pools.rb +47 -0
  26. data/lib/google/cloud/compute/v1/version.rb +1 -1
  27. data/lib/google/cloud/compute/v1.rb +4 -0
  28. data/proto_docs/google/api/client.rb +4 -0
  29. data/proto_docs/google/cloud/compute/v1/compute.rb +1410 -118
  30. metadata +22 -2
@@ -0,0 +1,829 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/compute/v1/compute_pb"
21
+ require "google/cloud/compute/v1/instance_group_manager_resize_requests/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 InstanceGroupManagerResizeRequests
29
+ module Rest
30
+ ##
31
+ # REST client for the InstanceGroupManagerResizeRequests service.
32
+ #
33
+ # The InstanceGroupManagerResizeRequests API.
34
+ #
35
+ class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
39
+ # @private
40
+ attr_reader :instance_group_manager_resize_requests_stub
41
+
42
+ ##
43
+ # Configure the InstanceGroupManagerResizeRequests Client class.
44
+ #
45
+ # See {::Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequests::Rest::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all InstanceGroupManagerResizeRequests clients
51
+ # ::Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequests::Rest::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
54
+ #
55
+ # @yield [config] Configure the Client client.
56
+ # @yieldparam config [Client::Configuration]
57
+ #
58
+ # @return [Client::Configuration]
59
+ #
60
+ def self.configure
61
+ @configure ||= begin
62
+ namespace = ["Google", "Cloud", "Compute", "V1"]
63
+ parent_config = while namespace.any?
64
+ parent_name = namespace.join "::"
65
+ parent_const = const_get parent_name
66
+ break parent_const.configure if parent_const.respond_to? :configure
67
+ namespace.pop
68
+ end
69
+ default_config = Client::Configuration.new parent_config
70
+
71
+ default_config.rpcs.cancel.timeout = 600.0
72
+
73
+ default_config.rpcs.delete.timeout = 600.0
74
+
75
+ default_config.rpcs.get.timeout = 600.0
76
+ default_config.rpcs.get.retry_policy = {
77
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
78
+ }
79
+
80
+ default_config.rpcs.insert.timeout = 600.0
81
+
82
+ default_config.rpcs.list.timeout = 600.0
83
+ default_config.rpcs.list.retry_policy = {
84
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
85
+ }
86
+
87
+ default_config
88
+ end
89
+ yield @configure if block_given?
90
+ @configure
91
+ end
92
+
93
+ ##
94
+ # Configure the InstanceGroupManagerResizeRequests Client instance.
95
+ #
96
+ # The configuration is set to the derived mode, meaning that values can be changed,
97
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
98
+ # should be made on {Client.configure}.
99
+ #
100
+ # See {::Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequests::Rest::Client::Configuration}
101
+ # for a description of the configuration fields.
102
+ #
103
+ # @yield [config] Configure the Client client.
104
+ # @yieldparam config [Client::Configuration]
105
+ #
106
+ # @return [Client::Configuration]
107
+ #
108
+ def configure
109
+ yield @config if block_given?
110
+ @config
111
+ end
112
+
113
+ ##
114
+ # The effective universe domain
115
+ #
116
+ # @return [String]
117
+ #
118
+ def universe_domain
119
+ @instance_group_manager_resize_requests_stub.universe_domain
120
+ end
121
+
122
+ ##
123
+ # Create a new InstanceGroupManagerResizeRequests REST client object.
124
+ #
125
+ # @example
126
+ #
127
+ # # Create a client using the default configuration
128
+ # client = ::Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequests::Rest::Client.new
129
+ #
130
+ # # Create a client using a custom configuration
131
+ # client = ::Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequests::Rest::Client.new do |config|
132
+ # config.timeout = 10.0
133
+ # end
134
+ #
135
+ # @yield [config] Configure the InstanceGroupManagerResizeRequests client.
136
+ # @yieldparam config [Client::Configuration]
137
+ #
138
+ def initialize
139
+ # Create the configuration object
140
+ @config = Configuration.new Client.configure
141
+
142
+ # Yield the configuration if needed
143
+ yield @config if block_given?
144
+
145
+ # Create credentials
146
+ credentials = @config.credentials
147
+ # Use self-signed JWT if the endpoint is unchanged from default,
148
+ # but only if the default endpoint does not have a region prefix.
149
+ enable_self_signed_jwt = @config.endpoint.nil? ||
150
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
151
+ !@config.endpoint.split(".").first.include?("-"))
152
+ credentials ||= Credentials.default scope: @config.scope,
153
+ enable_self_signed_jwt: enable_self_signed_jwt
154
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
155
+ credentials = Credentials.new credentials, scope: @config.scope
156
+ end
157
+
158
+ @quota_project_id = @config.quota_project
159
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
160
+
161
+ @zone_operations = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client.new do |config|
162
+ config.credentials = credentials
163
+ config.quota_project = @quota_project_id
164
+ config.endpoint = @config.endpoint
165
+ config.universe_domain = @config.universe_domain
166
+ end
167
+
168
+ @instance_group_manager_resize_requests_stub = ::Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequests::Rest::ServiceStub.new(
169
+ endpoint: @config.endpoint,
170
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
171
+ universe_domain: @config.universe_domain,
172
+ credentials: credentials
173
+ )
174
+ end
175
+
176
+ ##
177
+ # Get the associated client for long-running operations via ZoneOperations.
178
+ #
179
+ # @return [::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client]
180
+ #
181
+ attr_reader :zone_operations
182
+
183
+ # Service calls
184
+
185
+ ##
186
+ # Cancels the specified resize request and removes it from the queue. Cancelled resize request does no longer wait for the resources to be provisioned. Cancel is only possible for requests that are accepted in the queue.
187
+ #
188
+ # @overload cancel(request, options = nil)
189
+ # Pass arguments to `cancel` via a request object, either of type
190
+ # {::Google::Cloud::Compute::V1::CancelInstanceGroupManagerResizeRequestRequest} or an equivalent Hash.
191
+ #
192
+ # @param request [::Google::Cloud::Compute::V1::CancelInstanceGroupManagerResizeRequestRequest, ::Hash]
193
+ # A request object representing the call parameters. Required. To specify no
194
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
195
+ # @param options [::Gapic::CallOptions, ::Hash]
196
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
197
+ #
198
+ # @overload cancel(instance_group_manager: nil, project: nil, request_id: nil, resize_request: nil, zone: nil)
199
+ # Pass arguments to `cancel` via keyword arguments. Note that at
200
+ # least one keyword argument is required. To specify no parameters, or to keep all
201
+ # the default parameter values, pass an empty Hash as a request object (see above).
202
+ #
203
+ # @param instance_group_manager [::String]
204
+ # The name of the managed instance group. The name should conform to RFC1035 or be a resource ID.
205
+ # @param project [::String]
206
+ # Project ID for this request.
207
+ # @param request_id [::String]
208
+ # 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).
209
+ # @param resize_request [::String]
210
+ # The name of the resize request to cancel. The name should conform to RFC1035 or be a resource ID.
211
+ # @param zone [::String]
212
+ # The name of the zone where the managed instance group is located. The name should conform to RFC1035.
213
+ # @yield [result, operation] Access the result along with the TransportOperation object
214
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
215
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
216
+ #
217
+ # @return [::Gapic::GenericLRO::Operation]
218
+ #
219
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
220
+ #
221
+ # @example Basic example
222
+ # require "google/cloud/compute/v1"
223
+ #
224
+ # # Create a client object. The client can be reused for multiple calls.
225
+ # client = Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequests::Rest::Client.new
226
+ #
227
+ # # Create a request. To set request fields, pass in keyword arguments.
228
+ # request = Google::Cloud::Compute::V1::CancelInstanceGroupManagerResizeRequestRequest.new
229
+ #
230
+ # # Call the cancel method.
231
+ # result = client.cancel request
232
+ #
233
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
234
+ # p result
235
+ #
236
+ def cancel request, options = nil
237
+ raise ::ArgumentError, "request must be provided" if request.nil?
238
+
239
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::CancelInstanceGroupManagerResizeRequestRequest
240
+
241
+ # Converts hash and nil to an options object
242
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
243
+
244
+ # Customize the options with defaults
245
+ call_metadata = @config.rpcs.cancel.metadata.to_h
246
+
247
+ # Set x-goog-api-client and x-goog-user-project headers
248
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
249
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
250
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
251
+ transports_version_send: [:rest]
252
+
253
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
254
+
255
+ options.apply_defaults timeout: @config.rpcs.cancel.timeout,
256
+ metadata: call_metadata,
257
+ retry_policy: @config.rpcs.cancel.retry_policy
258
+
259
+ options.apply_defaults timeout: @config.timeout,
260
+ metadata: @config.metadata,
261
+ retry_policy: @config.retry_policy
262
+
263
+ @instance_group_manager_resize_requests_stub.cancel request, options do |result, response|
264
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
265
+ operation: result,
266
+ client: zone_operations,
267
+ request_values: {
268
+ "project" => request.project,
269
+ "zone" => request.zone
270
+ },
271
+ options: options
272
+ )
273
+ yield result, response if block_given?
274
+ return result
275
+ end
276
+ rescue ::Gapic::Rest::Error => e
277
+ raise ::Google::Cloud::Error.from_error(e)
278
+ end
279
+
280
+ ##
281
+ # Deletes the specified, inactive resize request. Requests that are still active cannot be deleted. Deleting request does not delete instances that were provisioned previously.
282
+ #
283
+ # @overload delete(request, options = nil)
284
+ # Pass arguments to `delete` via a request object, either of type
285
+ # {::Google::Cloud::Compute::V1::DeleteInstanceGroupManagerResizeRequestRequest} or an equivalent Hash.
286
+ #
287
+ # @param request [::Google::Cloud::Compute::V1::DeleteInstanceGroupManagerResizeRequestRequest, ::Hash]
288
+ # A request object representing the call parameters. Required. To specify no
289
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
290
+ # @param options [::Gapic::CallOptions, ::Hash]
291
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
292
+ #
293
+ # @overload delete(instance_group_manager: nil, project: nil, request_id: nil, resize_request: nil, zone: nil)
294
+ # Pass arguments to `delete` via keyword arguments. Note that at
295
+ # least one keyword argument is required. To specify no parameters, or to keep all
296
+ # the default parameter values, pass an empty Hash as a request object (see above).
297
+ #
298
+ # @param instance_group_manager [::String]
299
+ # The name of the managed instance group. The name should conform to RFC1035 or be a resource ID.
300
+ # @param project [::String]
301
+ # Project ID for this request.
302
+ # @param request_id [::String]
303
+ # 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).
304
+ # @param resize_request [::String]
305
+ # The name of the resize request to delete. The name should conform to RFC1035 or be a resource ID.
306
+ # @param zone [::String]
307
+ # The name of the zone where the managed instance group is located. The name should conform to RFC1035.
308
+ # @yield [result, operation] Access the result along with the TransportOperation object
309
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
310
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
311
+ #
312
+ # @return [::Gapic::GenericLRO::Operation]
313
+ #
314
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
315
+ #
316
+ # @example Basic example
317
+ # require "google/cloud/compute/v1"
318
+ #
319
+ # # Create a client object. The client can be reused for multiple calls.
320
+ # client = Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequests::Rest::Client.new
321
+ #
322
+ # # Create a request. To set request fields, pass in keyword arguments.
323
+ # request = Google::Cloud::Compute::V1::DeleteInstanceGroupManagerResizeRequestRequest.new
324
+ #
325
+ # # Call the delete method.
326
+ # result = client.delete request
327
+ #
328
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
329
+ # p result
330
+ #
331
+ def delete request, options = nil
332
+ raise ::ArgumentError, "request must be provided" if request.nil?
333
+
334
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteInstanceGroupManagerResizeRequestRequest
335
+
336
+ # Converts hash and nil to an options object
337
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
338
+
339
+ # Customize the options with defaults
340
+ call_metadata = @config.rpcs.delete.metadata.to_h
341
+
342
+ # Set x-goog-api-client and x-goog-user-project headers
343
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
344
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
345
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
346
+ transports_version_send: [:rest]
347
+
348
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
349
+
350
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
351
+ metadata: call_metadata,
352
+ retry_policy: @config.rpcs.delete.retry_policy
353
+
354
+ options.apply_defaults timeout: @config.timeout,
355
+ metadata: @config.metadata,
356
+ retry_policy: @config.retry_policy
357
+
358
+ @instance_group_manager_resize_requests_stub.delete request, options do |result, response|
359
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
360
+ operation: result,
361
+ client: zone_operations,
362
+ request_values: {
363
+ "project" => request.project,
364
+ "zone" => request.zone
365
+ },
366
+ options: options
367
+ )
368
+ yield result, response if block_given?
369
+ return result
370
+ end
371
+ rescue ::Gapic::Rest::Error => e
372
+ raise ::Google::Cloud::Error.from_error(e)
373
+ end
374
+
375
+ ##
376
+ # Returns all of the details about the specified resize request.
377
+ #
378
+ # @overload get(request, options = nil)
379
+ # Pass arguments to `get` via a request object, either of type
380
+ # {::Google::Cloud::Compute::V1::GetInstanceGroupManagerResizeRequestRequest} or an equivalent Hash.
381
+ #
382
+ # @param request [::Google::Cloud::Compute::V1::GetInstanceGroupManagerResizeRequestRequest, ::Hash]
383
+ # A request object representing the call parameters. Required. To specify no
384
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
385
+ # @param options [::Gapic::CallOptions, ::Hash]
386
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
387
+ #
388
+ # @overload get(instance_group_manager: nil, project: nil, resize_request: nil, zone: nil)
389
+ # Pass arguments to `get` via keyword arguments. Note that at
390
+ # least one keyword argument is required. To specify no parameters, or to keep all
391
+ # the default parameter values, pass an empty Hash as a request object (see above).
392
+ #
393
+ # @param instance_group_manager [::String]
394
+ # The name of the managed instance group. Name should conform to RFC1035 or be a resource ID.
395
+ # @param project [::String]
396
+ # Project ID for this request.
397
+ # @param resize_request [::String]
398
+ # The name of the resize request. Name should conform to RFC1035 or be a resource ID.
399
+ # @param zone [::String]
400
+ # Name of the href="/compute/docs/regions-zones/#available">zone scoping this request. Name should conform to RFC1035.
401
+ # @yield [result, operation] Access the result along with the TransportOperation object
402
+ # @yieldparam result [::Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequest]
403
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
404
+ #
405
+ # @return [::Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequest]
406
+ #
407
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
408
+ #
409
+ # @example Basic example
410
+ # require "google/cloud/compute/v1"
411
+ #
412
+ # # Create a client object. The client can be reused for multiple calls.
413
+ # client = Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequests::Rest::Client.new
414
+ #
415
+ # # Create a request. To set request fields, pass in keyword arguments.
416
+ # request = Google::Cloud::Compute::V1::GetInstanceGroupManagerResizeRequestRequest.new
417
+ #
418
+ # # Call the get method.
419
+ # result = client.get request
420
+ #
421
+ # # The returned object is of type Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequest.
422
+ # p result
423
+ #
424
+ def get request, options = nil
425
+ raise ::ArgumentError, "request must be provided" if request.nil?
426
+
427
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetInstanceGroupManagerResizeRequestRequest
428
+
429
+ # Converts hash and nil to an options object
430
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
431
+
432
+ # Customize the options with defaults
433
+ call_metadata = @config.rpcs.get.metadata.to_h
434
+
435
+ # Set x-goog-api-client and x-goog-user-project headers
436
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
437
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
438
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
439
+ transports_version_send: [:rest]
440
+
441
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
442
+
443
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
444
+ metadata: call_metadata,
445
+ retry_policy: @config.rpcs.get.retry_policy
446
+
447
+ options.apply_defaults timeout: @config.timeout,
448
+ metadata: @config.metadata,
449
+ retry_policy: @config.retry_policy
450
+
451
+ @instance_group_manager_resize_requests_stub.get request, options do |result, operation|
452
+ yield result, operation if block_given?
453
+ return result
454
+ end
455
+ rescue ::Gapic::Rest::Error => e
456
+ raise ::Google::Cloud::Error.from_error(e)
457
+ end
458
+
459
+ ##
460
+ # Creates a new resize request that starts provisioning VMs immediately or queues VM creation.
461
+ #
462
+ # @overload insert(request, options = nil)
463
+ # Pass arguments to `insert` via a request object, either of type
464
+ # {::Google::Cloud::Compute::V1::InsertInstanceGroupManagerResizeRequestRequest} or an equivalent Hash.
465
+ #
466
+ # @param request [::Google::Cloud::Compute::V1::InsertInstanceGroupManagerResizeRequestRequest, ::Hash]
467
+ # A request object representing the call parameters. Required. To specify no
468
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
469
+ # @param options [::Gapic::CallOptions, ::Hash]
470
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
471
+ #
472
+ # @overload insert(instance_group_manager: nil, instance_group_manager_resize_request_resource: nil, project: nil, request_id: nil, zone: nil)
473
+ # Pass arguments to `insert` via keyword arguments. Note that at
474
+ # least one keyword argument is required. To specify no parameters, or to keep all
475
+ # the default parameter values, pass an empty Hash as a request object (see above).
476
+ #
477
+ # @param instance_group_manager [::String]
478
+ # The name of the managed instance group to which the resize request will be added. Name should conform to RFC1035 or be a resource ID.
479
+ # @param instance_group_manager_resize_request_resource [::Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequest, ::Hash]
480
+ # The body resource for this request
481
+ # @param project [::String]
482
+ # Project ID for this request.
483
+ # @param request_id [::String]
484
+ # 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).
485
+ # @param zone [::String]
486
+ # The name of the zone where the managed instance group is located and where the resize request will be created. Name should conform to RFC1035.
487
+ # @yield [result, operation] Access the result along with the TransportOperation object
488
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
489
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
490
+ #
491
+ # @return [::Gapic::GenericLRO::Operation]
492
+ #
493
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
494
+ #
495
+ # @example Basic example
496
+ # require "google/cloud/compute/v1"
497
+ #
498
+ # # Create a client object. The client can be reused for multiple calls.
499
+ # client = Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequests::Rest::Client.new
500
+ #
501
+ # # Create a request. To set request fields, pass in keyword arguments.
502
+ # request = Google::Cloud::Compute::V1::InsertInstanceGroupManagerResizeRequestRequest.new
503
+ #
504
+ # # Call the insert method.
505
+ # result = client.insert request
506
+ #
507
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
508
+ # p result
509
+ #
510
+ def insert request, options = nil
511
+ raise ::ArgumentError, "request must be provided" if request.nil?
512
+
513
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::InsertInstanceGroupManagerResizeRequestRequest
514
+
515
+ # Converts hash and nil to an options object
516
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
517
+
518
+ # Customize the options with defaults
519
+ call_metadata = @config.rpcs.insert.metadata.to_h
520
+
521
+ # Set x-goog-api-client and x-goog-user-project headers
522
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
523
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
524
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
525
+ transports_version_send: [:rest]
526
+
527
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
528
+
529
+ options.apply_defaults timeout: @config.rpcs.insert.timeout,
530
+ metadata: call_metadata,
531
+ retry_policy: @config.rpcs.insert.retry_policy
532
+
533
+ options.apply_defaults timeout: @config.timeout,
534
+ metadata: @config.metadata,
535
+ retry_policy: @config.retry_policy
536
+
537
+ @instance_group_manager_resize_requests_stub.insert request, options do |result, response|
538
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
539
+ operation: result,
540
+ client: zone_operations,
541
+ request_values: {
542
+ "project" => request.project,
543
+ "zone" => request.zone
544
+ },
545
+ options: options
546
+ )
547
+ yield result, response if block_given?
548
+ return result
549
+ end
550
+ rescue ::Gapic::Rest::Error => e
551
+ raise ::Google::Cloud::Error.from_error(e)
552
+ end
553
+
554
+ ##
555
+ # Retrieves a list of resize requests that are contained in the managed instance group.
556
+ #
557
+ # @overload list(request, options = nil)
558
+ # Pass arguments to `list` via a request object, either of type
559
+ # {::Google::Cloud::Compute::V1::ListInstanceGroupManagerResizeRequestsRequest} or an equivalent Hash.
560
+ #
561
+ # @param request [::Google::Cloud::Compute::V1::ListInstanceGroupManagerResizeRequestsRequest, ::Hash]
562
+ # A request object representing the call parameters. Required. To specify no
563
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
564
+ # @param options [::Gapic::CallOptions, ::Hash]
565
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
566
+ #
567
+ # @overload list(filter: nil, instance_group_manager: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil, zone: nil)
568
+ # Pass arguments to `list` via keyword arguments. Note that at
569
+ # least one keyword argument is required. To specify no parameters, or to keep all
570
+ # the default parameter values, pass an empty Hash as a request object (see above).
571
+ #
572
+ # @param filter [::String]
573
+ # 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.
574
+ # @param instance_group_manager [::String]
575
+ # The name of the managed instance group. The name should conform to RFC1035.
576
+ # @param max_results [::Integer]
577
+ # 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`)
578
+ # @param order_by [::String]
579
+ # 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.
580
+ # @param page_token [::String]
581
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
582
+ # @param project [::String]
583
+ # Project ID for this request.
584
+ # @param return_partial_success [::Boolean]
585
+ # 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.
586
+ # @param zone [::String]
587
+ # The name of the zone where the managed instance group is located. The name should conform to RFC1035.
588
+ # @yield [result, operation] Access the result along with the TransportOperation object
589
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequest>]
590
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
591
+ #
592
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequest>]
593
+ #
594
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
595
+ #
596
+ # @example Basic example
597
+ # require "google/cloud/compute/v1"
598
+ #
599
+ # # Create a client object. The client can be reused for multiple calls.
600
+ # client = Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequests::Rest::Client.new
601
+ #
602
+ # # Create a request. To set request fields, pass in keyword arguments.
603
+ # request = Google::Cloud::Compute::V1::ListInstanceGroupManagerResizeRequestsRequest.new
604
+ #
605
+ # # Call the list method.
606
+ # result = client.list request
607
+ #
608
+ # # The returned object is of type Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequestsListResponse.
609
+ # p result
610
+ #
611
+ def list request, options = nil
612
+ raise ::ArgumentError, "request must be provided" if request.nil?
613
+
614
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListInstanceGroupManagerResizeRequestsRequest
615
+
616
+ # Converts hash and nil to an options object
617
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
618
+
619
+ # Customize the options with defaults
620
+ call_metadata = @config.rpcs.list.metadata.to_h
621
+
622
+ # Set x-goog-api-client and x-goog-user-project headers
623
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
624
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
625
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
626
+ transports_version_send: [:rest]
627
+
628
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
629
+
630
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
631
+ metadata: call_metadata,
632
+ retry_policy: @config.rpcs.list.retry_policy
633
+
634
+ options.apply_defaults timeout: @config.timeout,
635
+ metadata: @config.metadata,
636
+ retry_policy: @config.retry_policy
637
+
638
+ @instance_group_manager_resize_requests_stub.list request, options do |result, operation|
639
+ result = ::Gapic::Rest::PagedEnumerable.new @instance_group_manager_resize_requests_stub, :list, "items", request, result, options
640
+ yield result, operation if block_given?
641
+ return result
642
+ end
643
+ rescue ::Gapic::Rest::Error => e
644
+ raise ::Google::Cloud::Error.from_error(e)
645
+ end
646
+
647
+ ##
648
+ # Configuration class for the InstanceGroupManagerResizeRequests REST API.
649
+ #
650
+ # This class represents the configuration for InstanceGroupManagerResizeRequests REST,
651
+ # providing control over timeouts, retry behavior, logging, transport
652
+ # parameters, and other low-level controls. Certain parameters can also be
653
+ # applied individually to specific RPCs. See
654
+ # {::Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequests::Rest::Client::Configuration::Rpcs}
655
+ # for a list of RPCs that can be configured independently.
656
+ #
657
+ # Configuration can be applied globally to all clients, or to a single client
658
+ # on construction.
659
+ #
660
+ # @example
661
+ #
662
+ # # Modify the global config, setting the timeout for
663
+ # # cancel to 20 seconds,
664
+ # # and all remaining timeouts to 10 seconds.
665
+ # ::Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequests::Rest::Client.configure do |config|
666
+ # config.timeout = 10.0
667
+ # config.rpcs.cancel.timeout = 20.0
668
+ # end
669
+ #
670
+ # # Apply the above configuration only to a new client.
671
+ # client = ::Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequests::Rest::Client.new do |config|
672
+ # config.timeout = 10.0
673
+ # config.rpcs.cancel.timeout = 20.0
674
+ # end
675
+ #
676
+ # @!attribute [rw] endpoint
677
+ # A custom service endpoint, as a hostname or hostname:port. The default is
678
+ # nil, indicating to use the default endpoint in the current universe domain.
679
+ # @return [::String,nil]
680
+ # @!attribute [rw] credentials
681
+ # Credentials to send with calls. You may provide any of the following types:
682
+ # * (`String`) The path to a service account key file in JSON format
683
+ # * (`Hash`) A service account key as a Hash
684
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
685
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
686
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
687
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
688
+ # * (`nil`) indicating no credentials
689
+ # @return [::Object]
690
+ # @!attribute [rw] scope
691
+ # The OAuth scopes
692
+ # @return [::Array<::String>]
693
+ # @!attribute [rw] lib_name
694
+ # The library name as recorded in instrumentation and logging
695
+ # @return [::String]
696
+ # @!attribute [rw] lib_version
697
+ # The library version as recorded in instrumentation and logging
698
+ # @return [::String]
699
+ # @!attribute [rw] timeout
700
+ # The call timeout in seconds.
701
+ # @return [::Numeric]
702
+ # @!attribute [rw] metadata
703
+ # Additional headers to be sent with the call.
704
+ # @return [::Hash{::Symbol=>::String}]
705
+ # @!attribute [rw] retry_policy
706
+ # The retry policy. The value is a hash with the following keys:
707
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
708
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
709
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
710
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
711
+ # trigger a retry.
712
+ # @return [::Hash]
713
+ # @!attribute [rw] quota_project
714
+ # A separate project against which to charge quota.
715
+ # @return [::String]
716
+ # @!attribute [rw] universe_domain
717
+ # The universe domain within which to make requests. This determines the
718
+ # default endpoint URL. The default value of nil uses the environment
719
+ # universe (usually the default "googleapis.com" universe).
720
+ # @return [::String,nil]
721
+ #
722
+ class Configuration
723
+ extend ::Gapic::Config
724
+
725
+ # @private
726
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
727
+ DEFAULT_ENDPOINT = "compute.googleapis.com"
728
+
729
+ config_attr :endpoint, nil, ::String, nil
730
+ config_attr :credentials, nil do |value|
731
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
732
+ allowed.any? { |klass| klass === value }
733
+ end
734
+ config_attr :scope, nil, ::String, ::Array, nil
735
+ config_attr :lib_name, nil, ::String, nil
736
+ config_attr :lib_version, nil, ::String, nil
737
+ config_attr :timeout, nil, ::Numeric, nil
738
+ config_attr :metadata, nil, ::Hash, nil
739
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
740
+ config_attr :quota_project, nil, ::String, nil
741
+ config_attr :universe_domain, nil, ::String, nil
742
+
743
+ # @private
744
+ def initialize parent_config = nil
745
+ @parent_config = parent_config unless parent_config.nil?
746
+
747
+ yield self if block_given?
748
+ end
749
+
750
+ ##
751
+ # Configurations for individual RPCs
752
+ # @return [Rpcs]
753
+ #
754
+ def rpcs
755
+ @rpcs ||= begin
756
+ parent_rpcs = nil
757
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
758
+ Rpcs.new parent_rpcs
759
+ end
760
+ end
761
+
762
+ ##
763
+ # Configuration RPC class for the InstanceGroupManagerResizeRequests API.
764
+ #
765
+ # Includes fields providing the configuration for each RPC in this service.
766
+ # Each configuration object is of type `Gapic::Config::Method` and includes
767
+ # the following configuration fields:
768
+ #
769
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
770
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
771
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
772
+ # include the following keys:
773
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
774
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
775
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
776
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
777
+ # trigger a retry.
778
+ #
779
+ class Rpcs
780
+ ##
781
+ # RPC-specific configuration for `cancel`
782
+ # @return [::Gapic::Config::Method]
783
+ #
784
+ attr_reader :cancel
785
+ ##
786
+ # RPC-specific configuration for `delete`
787
+ # @return [::Gapic::Config::Method]
788
+ #
789
+ attr_reader :delete
790
+ ##
791
+ # RPC-specific configuration for `get`
792
+ # @return [::Gapic::Config::Method]
793
+ #
794
+ attr_reader :get
795
+ ##
796
+ # RPC-specific configuration for `insert`
797
+ # @return [::Gapic::Config::Method]
798
+ #
799
+ attr_reader :insert
800
+ ##
801
+ # RPC-specific configuration for `list`
802
+ # @return [::Gapic::Config::Method]
803
+ #
804
+ attr_reader :list
805
+
806
+ # @private
807
+ def initialize parent_rpcs = nil
808
+ cancel_config = parent_rpcs.cancel if parent_rpcs.respond_to? :cancel
809
+ @cancel = ::Gapic::Config::Method.new cancel_config
810
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
811
+ @delete = ::Gapic::Config::Method.new delete_config
812
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
813
+ @get = ::Gapic::Config::Method.new get_config
814
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
815
+ @insert = ::Gapic::Config::Method.new insert_config
816
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
817
+ @list = ::Gapic::Config::Method.new list_config
818
+
819
+ yield self if block_given?
820
+ end
821
+ end
822
+ end
823
+ end
824
+ end
825
+ end
826
+ end
827
+ end
828
+ end
829
+ end