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