google-cloud-compute-v1 2.9.0 → 2.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +3 -3
  3. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +3 -3
  4. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +3 -3
  5. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +1 -1
  6. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +4 -4
  7. data/lib/google/cloud/compute/v1/compute_pb.rb +82 -1
  8. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +3 -3
  9. data/lib/google/cloud/compute/v1/disks/rest/client.rb +3 -3
  10. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +1 -1
  11. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +1 -1
  12. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +1 -1
  13. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +3 -3
  14. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +1 -1
  15. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +1 -1
  16. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +2 -2
  17. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +3 -3
  18. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +1 -1
  19. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +1 -1
  20. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +3 -3
  21. data/lib/google/cloud/compute/v1/images/rest/client.rb +1 -1
  22. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/credentials.rb +52 -0
  23. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest/client.rb +829 -0
  24. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest/service_stub.rb +378 -0
  25. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest.rb +51 -0
  26. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests.rb +47 -0
  27. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +6 -6
  28. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +4 -4
  29. data/lib/google/cloud/compute/v1/instance_settings_service/credentials.rb +52 -0
  30. data/lib/google/cloud/compute/v1/instance_settings_service/rest/client.rb +512 -0
  31. data/lib/google/cloud/compute/v1/instance_settings_service/rest/service_stub.rb +190 -0
  32. data/lib/google/cloud/compute/v1/instance_settings_service/rest.rb +51 -0
  33. data/lib/google/cloud/compute/v1/instance_settings_service.rb +47 -0
  34. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +3 -3
  35. data/lib/google/cloud/compute/v1/instances/rest/client.rb +4 -4
  36. data/lib/google/cloud/compute/v1/instant_snapshots/credentials.rb +52 -0
  37. data/lib/google/cloud/compute/v1/instant_snapshots/rest/client.rb +1208 -0
  38. data/lib/google/cloud/compute/v1/instant_snapshots/rest/service_stub.rb +618 -0
  39. data/lib/google/cloud/compute/v1/instant_snapshots/rest.rb +51 -0
  40. data/lib/google/cloud/compute/v1/instant_snapshots.rb +47 -0
  41. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +3 -3
  42. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +1 -1
  43. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +1 -1
  44. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +1 -1
  45. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +1 -1
  46. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +1 -1
  47. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +3 -3
  48. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +3 -3
  49. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +2 -2
  50. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +4 -4
  51. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +1 -1
  52. data/lib/google/cloud/compute/v1/networks/rest/client.rb +2 -2
  53. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +108 -4
  54. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +62 -0
  55. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +3 -3
  56. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +3 -3
  57. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +3 -3
  58. data/lib/google/cloud/compute/v1/projects/rest/client.rb +101 -2
  59. data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +60 -0
  60. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +1 -1
  61. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +3 -3
  62. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +1 -1
  63. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +2 -2
  64. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +3 -3
  65. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +1 -1
  66. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +1 -1
  67. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +1 -1
  68. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +1 -1
  69. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +4 -4
  70. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +2 -2
  71. data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +1 -1
  72. data/lib/google/cloud/compute/v1/region_instant_snapshots/credentials.rb +52 -0
  73. data/lib/google/cloud/compute/v1/region_instant_snapshots/rest/client.rb +1103 -0
  74. data/lib/google/cloud/compute/v1/region_instant_snapshots/rest/service_stub.rb +559 -0
  75. data/lib/google/cloud/compute/v1/region_instant_snapshots/rest.rb +51 -0
  76. data/lib/google/cloud/compute/v1/region_instant_snapshots.rb +47 -0
  77. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +2 -2
  78. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +1 -1
  79. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +1 -1
  80. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +1 -1
  81. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +1 -1
  82. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +1 -1
  83. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +2 -2
  84. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +1 -1
  85. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +1 -1
  86. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +1 -1
  87. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +1 -1
  88. data/lib/google/cloud/compute/v1/region_zones/rest/client.rb +1 -1
  89. data/lib/google/cloud/compute/v1/regions/rest/client.rb +1 -1
  90. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +3 -3
  91. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +3 -3
  92. data/lib/google/cloud/compute/v1/rest.rb +6 -0
  93. data/lib/google/cloud/compute/v1/routers/rest/client.rb +4 -4
  94. data/lib/google/cloud/compute/v1/routes/rest/client.rb +1 -1
  95. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +4 -4
  96. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +3 -3
  97. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +1 -1
  98. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +3 -3
  99. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +4 -4
  100. data/lib/google/cloud/compute/v1/storage_pool_types/credentials.rb +53 -0
  101. data/lib/google/cloud/compute/v1/storage_pool_types/rest/client.rb +603 -0
  102. data/lib/google/cloud/compute/v1/storage_pool_types/rest/service_stub.rb +249 -0
  103. data/lib/google/cloud/compute/v1/storage_pool_types/rest.rb +51 -0
  104. data/lib/google/cloud/compute/v1/storage_pool_types.rb +47 -0
  105. data/lib/google/cloud/compute/v1/storage_pools/credentials.rb +52 -0
  106. data/lib/google/cloud/compute/v1/storage_pools/rest/client.rb +1313 -0
  107. data/lib/google/cloud/compute/v1/storage_pools/rest/service_stub.rb +679 -0
  108. data/lib/google/cloud/compute/v1/storage_pools/rest.rb +51 -0
  109. data/lib/google/cloud/compute/v1/storage_pools.rb +47 -0
  110. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +4 -4
  111. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +1 -1
  112. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +3 -3
  113. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +3 -3
  114. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +3 -3
  115. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +3 -3
  116. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +1 -1
  117. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +3 -3
  118. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +3 -3
  119. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +3 -3
  120. data/lib/google/cloud/compute/v1/version.rb +1 -1
  121. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +3 -3
  122. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +3 -3
  123. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +1 -1
  124. data/lib/google/cloud/compute/v1/zones/rest/client.rb +1 -1
  125. data/lib/google/cloud/compute/v1.rb +6 -0
  126. data/proto_docs/google/api/client.rb +4 -0
  127. data/proto_docs/google/cloud/compute/v1/compute.rb +2128 -182
  128. metadata +32 -2
@@ -0,0 +1,512 @@
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_settings_service/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 InstanceSettingsService
29
+ module Rest
30
+ ##
31
+ # REST client for the InstanceSettingsService service.
32
+ #
33
+ # The InstanceSettings API.
34
+ #
35
+ class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
39
+ # @private
40
+ attr_reader :instance_settings_service_stub
41
+
42
+ ##
43
+ # Configure the InstanceSettingsService Client class.
44
+ #
45
+ # See {::Google::Cloud::Compute::V1::InstanceSettingsService::Rest::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all InstanceSettingsService clients
51
+ # ::Google::Cloud::Compute::V1::InstanceSettingsService::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.get.timeout = 600.0
72
+ default_config.rpcs.get.retry_policy = {
73
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
74
+ }
75
+
76
+ default_config.rpcs.patch.timeout = 600.0
77
+
78
+ default_config
79
+ end
80
+ yield @configure if block_given?
81
+ @configure
82
+ end
83
+
84
+ ##
85
+ # Configure the InstanceSettingsService Client instance.
86
+ #
87
+ # The configuration is set to the derived mode, meaning that values can be changed,
88
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
89
+ # should be made on {Client.configure}.
90
+ #
91
+ # See {::Google::Cloud::Compute::V1::InstanceSettingsService::Rest::Client::Configuration}
92
+ # for a description of the configuration fields.
93
+ #
94
+ # @yield [config] Configure the Client client.
95
+ # @yieldparam config [Client::Configuration]
96
+ #
97
+ # @return [Client::Configuration]
98
+ #
99
+ def configure
100
+ yield @config if block_given?
101
+ @config
102
+ end
103
+
104
+ ##
105
+ # The effective universe domain
106
+ #
107
+ # @return [String]
108
+ #
109
+ def universe_domain
110
+ @instance_settings_service_stub.universe_domain
111
+ end
112
+
113
+ ##
114
+ # Create a new InstanceSettingsService REST client object.
115
+ #
116
+ # @example
117
+ #
118
+ # # Create a client using the default configuration
119
+ # client = ::Google::Cloud::Compute::V1::InstanceSettingsService::Rest::Client.new
120
+ #
121
+ # # Create a client using a custom configuration
122
+ # client = ::Google::Cloud::Compute::V1::InstanceSettingsService::Rest::Client.new do |config|
123
+ # config.timeout = 10.0
124
+ # end
125
+ #
126
+ # @yield [config] Configure the InstanceSettingsService client.
127
+ # @yieldparam config [Client::Configuration]
128
+ #
129
+ def initialize
130
+ # Create the configuration object
131
+ @config = Configuration.new Client.configure
132
+
133
+ # Yield the configuration if needed
134
+ yield @config if block_given?
135
+
136
+ # Create credentials
137
+ credentials = @config.credentials
138
+ # Use self-signed JWT if the endpoint is unchanged from default,
139
+ # but only if the default endpoint does not have a region prefix.
140
+ enable_self_signed_jwt = @config.endpoint.nil? ||
141
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
142
+ !@config.endpoint.split(".").first.include?("-"))
143
+ credentials ||= Credentials.default scope: @config.scope,
144
+ enable_self_signed_jwt: enable_self_signed_jwt
145
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
146
+ credentials = Credentials.new credentials, scope: @config.scope
147
+ end
148
+
149
+ @quota_project_id = @config.quota_project
150
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
151
+
152
+ @zone_operations = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client.new do |config|
153
+ config.credentials = credentials
154
+ config.quota_project = @quota_project_id
155
+ config.endpoint = @config.endpoint
156
+ config.universe_domain = @config.universe_domain
157
+ end
158
+
159
+ @instance_settings_service_stub = ::Google::Cloud::Compute::V1::InstanceSettingsService::Rest::ServiceStub.new(
160
+ endpoint: @config.endpoint,
161
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
162
+ universe_domain: @config.universe_domain,
163
+ credentials: credentials
164
+ )
165
+ end
166
+
167
+ ##
168
+ # Get the associated client for long-running operations via ZoneOperations.
169
+ #
170
+ # @return [::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client]
171
+ #
172
+ attr_reader :zone_operations
173
+
174
+ # Service calls
175
+
176
+ ##
177
+ # Get Instance settings.
178
+ #
179
+ # @overload get(request, options = nil)
180
+ # Pass arguments to `get` via a request object, either of type
181
+ # {::Google::Cloud::Compute::V1::GetInstanceSettingRequest} or an equivalent Hash.
182
+ #
183
+ # @param request [::Google::Cloud::Compute::V1::GetInstanceSettingRequest, ::Hash]
184
+ # A request object representing the call parameters. Required. To specify no
185
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
186
+ # @param options [::Gapic::CallOptions, ::Hash]
187
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
188
+ #
189
+ # @overload get(project: nil, zone: nil)
190
+ # Pass arguments to `get` via keyword arguments. Note that at
191
+ # least one keyword argument is required. To specify no parameters, or to keep all
192
+ # the default parameter values, pass an empty Hash as a request object (see above).
193
+ #
194
+ # @param project [::String]
195
+ # Project ID for this request.
196
+ # @param zone [::String]
197
+ # Name of the zone for this request.
198
+ # @yield [result, operation] Access the result along with the TransportOperation object
199
+ # @yieldparam result [::Google::Cloud::Compute::V1::InstanceSettings]
200
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
201
+ #
202
+ # @return [::Google::Cloud::Compute::V1::InstanceSettings]
203
+ #
204
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
205
+ #
206
+ # @example Basic example
207
+ # require "google/cloud/compute/v1"
208
+ #
209
+ # # Create a client object. The client can be reused for multiple calls.
210
+ # client = Google::Cloud::Compute::V1::InstanceSettingsService::Rest::Client.new
211
+ #
212
+ # # Create a request. To set request fields, pass in keyword arguments.
213
+ # request = Google::Cloud::Compute::V1::GetInstanceSettingRequest.new
214
+ #
215
+ # # Call the get method.
216
+ # result = client.get request
217
+ #
218
+ # # The returned object is of type Google::Cloud::Compute::V1::InstanceSettings.
219
+ # p result
220
+ #
221
+ def get request, options = nil
222
+ raise ::ArgumentError, "request must be provided" if request.nil?
223
+
224
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetInstanceSettingRequest
225
+
226
+ # Converts hash and nil to an options object
227
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
228
+
229
+ # Customize the options with defaults
230
+ call_metadata = @config.rpcs.get.metadata.to_h
231
+
232
+ # Set x-goog-api-client and x-goog-user-project headers
233
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
234
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
235
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
236
+ transports_version_send: [:rest]
237
+
238
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
239
+
240
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
241
+ metadata: call_metadata,
242
+ retry_policy: @config.rpcs.get.retry_policy
243
+
244
+ options.apply_defaults timeout: @config.timeout,
245
+ metadata: @config.metadata,
246
+ retry_policy: @config.retry_policy
247
+
248
+ @instance_settings_service_stub.get request, options do |result, operation|
249
+ yield result, operation if block_given?
250
+ return result
251
+ end
252
+ rescue ::Gapic::Rest::Error => e
253
+ raise ::Google::Cloud::Error.from_error(e)
254
+ end
255
+
256
+ ##
257
+ # Patch Instance settings
258
+ #
259
+ # @overload patch(request, options = nil)
260
+ # Pass arguments to `patch` via a request object, either of type
261
+ # {::Google::Cloud::Compute::V1::PatchInstanceSettingRequest} or an equivalent Hash.
262
+ #
263
+ # @param request [::Google::Cloud::Compute::V1::PatchInstanceSettingRequest, ::Hash]
264
+ # A request object representing the call parameters. Required. To specify no
265
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
266
+ # @param options [::Gapic::CallOptions, ::Hash]
267
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
268
+ #
269
+ # @overload patch(instance_settings_resource: nil, project: nil, request_id: nil, update_mask: nil, zone: nil)
270
+ # Pass arguments to `patch` via keyword arguments. Note that at
271
+ # least one keyword argument is required. To specify no parameters, or to keep all
272
+ # the default parameter values, pass an empty Hash as a request object (see above).
273
+ #
274
+ # @param instance_settings_resource [::Google::Cloud::Compute::V1::InstanceSettings, ::Hash]
275
+ # The body resource for this request
276
+ # @param project [::String]
277
+ # Project ID for this request.
278
+ # @param request_id [::String]
279
+ # 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).
280
+ # @param update_mask [::String]
281
+ # update_mask indicates fields to be updated as part of this request.
282
+ # @param zone [::String]
283
+ # The zone scoping this request. It should conform to RFC1035.
284
+ # @yield [result, operation] Access the result along with the TransportOperation object
285
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
286
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
287
+ #
288
+ # @return [::Gapic::GenericLRO::Operation]
289
+ #
290
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
291
+ #
292
+ # @example Basic example
293
+ # require "google/cloud/compute/v1"
294
+ #
295
+ # # Create a client object. The client can be reused for multiple calls.
296
+ # client = Google::Cloud::Compute::V1::InstanceSettingsService::Rest::Client.new
297
+ #
298
+ # # Create a request. To set request fields, pass in keyword arguments.
299
+ # request = Google::Cloud::Compute::V1::PatchInstanceSettingRequest.new
300
+ #
301
+ # # Call the patch method.
302
+ # result = client.patch request
303
+ #
304
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
305
+ # p result
306
+ #
307
+ def patch request, options = nil
308
+ raise ::ArgumentError, "request must be provided" if request.nil?
309
+
310
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchInstanceSettingRequest
311
+
312
+ # Converts hash and nil to an options object
313
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
314
+
315
+ # Customize the options with defaults
316
+ call_metadata = @config.rpcs.patch.metadata.to_h
317
+
318
+ # Set x-goog-api-client and x-goog-user-project headers
319
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
320
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
321
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
322
+ transports_version_send: [:rest]
323
+
324
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
325
+
326
+ options.apply_defaults timeout: @config.rpcs.patch.timeout,
327
+ metadata: call_metadata,
328
+ retry_policy: @config.rpcs.patch.retry_policy
329
+
330
+ options.apply_defaults timeout: @config.timeout,
331
+ metadata: @config.metadata,
332
+ retry_policy: @config.retry_policy
333
+
334
+ @instance_settings_service_stub.patch request, options do |result, response|
335
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
336
+ operation: result,
337
+ client: zone_operations,
338
+ request_values: {
339
+ "project" => request.project,
340
+ "zone" => request.zone
341
+ },
342
+ options: options
343
+ )
344
+ yield result, response if block_given?
345
+ return result
346
+ end
347
+ rescue ::Gapic::Rest::Error => e
348
+ raise ::Google::Cloud::Error.from_error(e)
349
+ end
350
+
351
+ ##
352
+ # Configuration class for the InstanceSettingsService REST API.
353
+ #
354
+ # This class represents the configuration for InstanceSettingsService REST,
355
+ # providing control over timeouts, retry behavior, logging, transport
356
+ # parameters, and other low-level controls. Certain parameters can also be
357
+ # applied individually to specific RPCs. See
358
+ # {::Google::Cloud::Compute::V1::InstanceSettingsService::Rest::Client::Configuration::Rpcs}
359
+ # for a list of RPCs that can be configured independently.
360
+ #
361
+ # Configuration can be applied globally to all clients, or to a single client
362
+ # on construction.
363
+ #
364
+ # @example
365
+ #
366
+ # # Modify the global config, setting the timeout for
367
+ # # get to 20 seconds,
368
+ # # and all remaining timeouts to 10 seconds.
369
+ # ::Google::Cloud::Compute::V1::InstanceSettingsService::Rest::Client.configure do |config|
370
+ # config.timeout = 10.0
371
+ # config.rpcs.get.timeout = 20.0
372
+ # end
373
+ #
374
+ # # Apply the above configuration only to a new client.
375
+ # client = ::Google::Cloud::Compute::V1::InstanceSettingsService::Rest::Client.new do |config|
376
+ # config.timeout = 10.0
377
+ # config.rpcs.get.timeout = 20.0
378
+ # end
379
+ #
380
+ # @!attribute [rw] endpoint
381
+ # A custom service endpoint, as a hostname or hostname:port. The default is
382
+ # nil, indicating to use the default endpoint in the current universe domain.
383
+ # @return [::String,nil]
384
+ # @!attribute [rw] credentials
385
+ # Credentials to send with calls. You may provide any of the following types:
386
+ # * (`String`) The path to a service account key file in JSON format
387
+ # * (`Hash`) A service account key as a Hash
388
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
389
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
390
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
391
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
392
+ # * (`nil`) indicating no credentials
393
+ # @return [::Object]
394
+ # @!attribute [rw] scope
395
+ # The OAuth scopes
396
+ # @return [::Array<::String>]
397
+ # @!attribute [rw] lib_name
398
+ # The library name as recorded in instrumentation and logging
399
+ # @return [::String]
400
+ # @!attribute [rw] lib_version
401
+ # The library version as recorded in instrumentation and logging
402
+ # @return [::String]
403
+ # @!attribute [rw] timeout
404
+ # The call timeout in seconds.
405
+ # @return [::Numeric]
406
+ # @!attribute [rw] metadata
407
+ # Additional headers to be sent with the call.
408
+ # @return [::Hash{::Symbol=>::String}]
409
+ # @!attribute [rw] retry_policy
410
+ # The retry policy. The value is a hash with the following keys:
411
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
412
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
413
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
414
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
415
+ # trigger a retry.
416
+ # @return [::Hash]
417
+ # @!attribute [rw] quota_project
418
+ # A separate project against which to charge quota.
419
+ # @return [::String]
420
+ # @!attribute [rw] universe_domain
421
+ # The universe domain within which to make requests. This determines the
422
+ # default endpoint URL. The default value of nil uses the environment
423
+ # universe (usually the default "googleapis.com" universe).
424
+ # @return [::String,nil]
425
+ #
426
+ class Configuration
427
+ extend ::Gapic::Config
428
+
429
+ # @private
430
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
431
+ DEFAULT_ENDPOINT = "compute.googleapis.com"
432
+
433
+ config_attr :endpoint, nil, ::String, nil
434
+ config_attr :credentials, nil do |value|
435
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
436
+ allowed.any? { |klass| klass === value }
437
+ end
438
+ config_attr :scope, nil, ::String, ::Array, nil
439
+ config_attr :lib_name, nil, ::String, nil
440
+ config_attr :lib_version, nil, ::String, nil
441
+ config_attr :timeout, nil, ::Numeric, nil
442
+ config_attr :metadata, nil, ::Hash, nil
443
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
444
+ config_attr :quota_project, nil, ::String, nil
445
+ config_attr :universe_domain, nil, ::String, nil
446
+
447
+ # @private
448
+ def initialize parent_config = nil
449
+ @parent_config = parent_config unless parent_config.nil?
450
+
451
+ yield self if block_given?
452
+ end
453
+
454
+ ##
455
+ # Configurations for individual RPCs
456
+ # @return [Rpcs]
457
+ #
458
+ def rpcs
459
+ @rpcs ||= begin
460
+ parent_rpcs = nil
461
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
462
+ Rpcs.new parent_rpcs
463
+ end
464
+ end
465
+
466
+ ##
467
+ # Configuration RPC class for the InstanceSettingsService API.
468
+ #
469
+ # Includes fields providing the configuration for each RPC in this service.
470
+ # Each configuration object is of type `Gapic::Config::Method` and includes
471
+ # the following configuration fields:
472
+ #
473
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
474
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
475
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
476
+ # include the following keys:
477
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
478
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
479
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
480
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
481
+ # trigger a retry.
482
+ #
483
+ class Rpcs
484
+ ##
485
+ # RPC-specific configuration for `get`
486
+ # @return [::Gapic::Config::Method]
487
+ #
488
+ attr_reader :get
489
+ ##
490
+ # RPC-specific configuration for `patch`
491
+ # @return [::Gapic::Config::Method]
492
+ #
493
+ attr_reader :patch
494
+
495
+ # @private
496
+ def initialize parent_rpcs = nil
497
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
498
+ @get = ::Gapic::Config::Method.new get_config
499
+ patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
500
+ @patch = ::Gapic::Config::Method.new patch_config
501
+
502
+ yield self if block_given?
503
+ end
504
+ end
505
+ end
506
+ end
507
+ end
508
+ end
509
+ end
510
+ end
511
+ end
512
+ end