google-cloud-compute-v1 2.4.0 → 2.6.0

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