google-cloud-compute-v1 2.9.0 → 2.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) 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 +32 -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_managers/rest/client.rb +6 -6
  23. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +4 -4
  24. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +3 -3
  25. data/lib/google/cloud/compute/v1/instances/rest/client.rb +4 -4
  26. data/lib/google/cloud/compute/v1/instant_snapshots/credentials.rb +52 -0
  27. data/lib/google/cloud/compute/v1/instant_snapshots/rest/client.rb +1208 -0
  28. data/lib/google/cloud/compute/v1/instant_snapshots/rest/service_stub.rb +618 -0
  29. data/lib/google/cloud/compute/v1/instant_snapshots/rest.rb +51 -0
  30. data/lib/google/cloud/compute/v1/instant_snapshots.rb +47 -0
  31. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +3 -3
  32. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +1 -1
  33. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +1 -1
  34. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +1 -1
  35. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +1 -1
  36. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +1 -1
  37. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +3 -3
  38. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +3 -3
  39. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +2 -2
  40. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +4 -4
  41. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +1 -1
  42. data/lib/google/cloud/compute/v1/networks/rest/client.rb +2 -2
  43. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +4 -4
  44. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +3 -3
  45. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +3 -3
  46. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +3 -3
  47. data/lib/google/cloud/compute/v1/projects/rest/client.rb +101 -2
  48. data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +60 -0
  49. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +1 -1
  50. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +3 -3
  51. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +1 -1
  52. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +2 -2
  53. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +3 -3
  54. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +1 -1
  55. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +1 -1
  56. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +1 -1
  57. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +1 -1
  58. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +4 -4
  59. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +2 -2
  60. data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +1 -1
  61. data/lib/google/cloud/compute/v1/region_instant_snapshots/credentials.rb +52 -0
  62. data/lib/google/cloud/compute/v1/region_instant_snapshots/rest/client.rb +1103 -0
  63. data/lib/google/cloud/compute/v1/region_instant_snapshots/rest/service_stub.rb +559 -0
  64. data/lib/google/cloud/compute/v1/region_instant_snapshots/rest.rb +51 -0
  65. data/lib/google/cloud/compute/v1/region_instant_snapshots.rb +47 -0
  66. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +2 -2
  67. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +1 -1
  68. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +1 -1
  69. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +1 -1
  70. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +1 -1
  71. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +1 -1
  72. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +2 -2
  73. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +1 -1
  74. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +1 -1
  75. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +1 -1
  76. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +1 -1
  77. data/lib/google/cloud/compute/v1/region_zones/rest/client.rb +1 -1
  78. data/lib/google/cloud/compute/v1/regions/rest/client.rb +1 -1
  79. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +3 -3
  80. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +3 -3
  81. data/lib/google/cloud/compute/v1/rest.rb +2 -0
  82. data/lib/google/cloud/compute/v1/routers/rest/client.rb +4 -4
  83. data/lib/google/cloud/compute/v1/routes/rest/client.rb +1 -1
  84. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +4 -4
  85. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +3 -3
  86. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +1 -1
  87. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +3 -3
  88. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +4 -4
  89. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +4 -4
  90. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +1 -1
  91. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +3 -3
  92. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +3 -3
  93. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +3 -3
  94. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +3 -3
  95. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +1 -1
  96. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +3 -3
  97. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +3 -3
  98. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +3 -3
  99. data/lib/google/cloud/compute/v1/version.rb +1 -1
  100. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +3 -3
  101. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +3 -3
  102. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +1 -1
  103. data/lib/google/cloud/compute/v1/zones/rest/client.rb +1 -1
  104. data/lib/google/cloud/compute/v1.rb +2 -0
  105. data/proto_docs/google/cloud/compute/v1/compute.rb +806 -152
  106. metadata +12 -2
@@ -0,0 +1,559 @@
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/compute/v1/compute_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Compute
24
+ module V1
25
+ module RegionInstantSnapshots
26
+ module Rest
27
+ ##
28
+ # REST service stub for the RegionInstantSnapshots service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
+ # These require statements are intentionally placed here to initialize
35
+ # the REST modules only when it's required.
36
+ require "gapic/rest"
37
+
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
42
+ numeric_enums: false,
43
+ raise_faraday_errors: false
44
+ end
45
+
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
55
+ ##
56
+ # The effective endpoint
57
+ #
58
+ # @return [String]
59
+ #
60
+ def endpoint
61
+ @client_stub.endpoint
62
+ end
63
+
64
+ ##
65
+ # Baseline implementation for the delete REST call
66
+ #
67
+ # @param request_pb [::Google::Cloud::Compute::V1::DeleteRegionInstantSnapshotRequest]
68
+ # A request object representing the call parameters. Required.
69
+ # @param options [::Gapic::CallOptions]
70
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
71
+ #
72
+ # @yield [result, operation] Access the result along with the TransportOperation object
73
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
74
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
75
+ #
76
+ # @return [::Google::Cloud::Compute::V1::Operation]
77
+ # A result object deserialized from the server's reply
78
+ def delete request_pb, options = nil
79
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
80
+
81
+ verb, uri, query_string_params, body = ServiceStub.transcode_delete_request request_pb
82
+ query_string_params = if query_string_params.any?
83
+ query_string_params.to_h { |p| p.split "=", 2 }
84
+ else
85
+ {}
86
+ end
87
+
88
+ response = @client_stub.make_http_request(
89
+ verb,
90
+ uri: uri,
91
+ body: body || "",
92
+ params: query_string_params,
93
+ options: options
94
+ )
95
+ operation = ::Gapic::Rest::TransportOperation.new response
96
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
97
+
98
+ yield result, operation if block_given?
99
+ result
100
+ end
101
+
102
+ ##
103
+ # Baseline implementation for the get REST call
104
+ #
105
+ # @param request_pb [::Google::Cloud::Compute::V1::GetRegionInstantSnapshotRequest]
106
+ # A request object representing the call parameters. Required.
107
+ # @param options [::Gapic::CallOptions]
108
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
109
+ #
110
+ # @yield [result, operation] Access the result along with the TransportOperation object
111
+ # @yieldparam result [::Google::Cloud::Compute::V1::InstantSnapshot]
112
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
113
+ #
114
+ # @return [::Google::Cloud::Compute::V1::InstantSnapshot]
115
+ # A result object deserialized from the server's reply
116
+ def get request_pb, options = nil
117
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
118
+
119
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_request request_pb
120
+ query_string_params = if query_string_params.any?
121
+ query_string_params.to_h { |p| p.split "=", 2 }
122
+ else
123
+ {}
124
+ end
125
+
126
+ response = @client_stub.make_http_request(
127
+ verb,
128
+ uri: uri,
129
+ body: body || "",
130
+ params: query_string_params,
131
+ options: options
132
+ )
133
+ operation = ::Gapic::Rest::TransportOperation.new response
134
+ result = ::Google::Cloud::Compute::V1::InstantSnapshot.decode_json response.body, ignore_unknown_fields: true
135
+
136
+ yield result, operation if block_given?
137
+ result
138
+ end
139
+
140
+ ##
141
+ # Baseline implementation for the get_iam_policy REST call
142
+ #
143
+ # @param request_pb [::Google::Cloud::Compute::V1::GetIamPolicyRegionInstantSnapshotRequest]
144
+ # A request object representing the call parameters. Required.
145
+ # @param options [::Gapic::CallOptions]
146
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
147
+ #
148
+ # @yield [result, operation] Access the result along with the TransportOperation object
149
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
150
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
151
+ #
152
+ # @return [::Google::Cloud::Compute::V1::Policy]
153
+ # A result object deserialized from the server's reply
154
+ def get_iam_policy request_pb, options = nil
155
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
156
+
157
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb
158
+ query_string_params = if query_string_params.any?
159
+ query_string_params.to_h { |p| p.split "=", 2 }
160
+ else
161
+ {}
162
+ end
163
+
164
+ response = @client_stub.make_http_request(
165
+ verb,
166
+ uri: uri,
167
+ body: body || "",
168
+ params: query_string_params,
169
+ options: options
170
+ )
171
+ operation = ::Gapic::Rest::TransportOperation.new response
172
+ result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
173
+
174
+ yield result, operation if block_given?
175
+ result
176
+ end
177
+
178
+ ##
179
+ # Baseline implementation for the insert REST call
180
+ #
181
+ # @param request_pb [::Google::Cloud::Compute::V1::InsertRegionInstantSnapshotRequest]
182
+ # A request object representing the call parameters. Required.
183
+ # @param options [::Gapic::CallOptions]
184
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
185
+ #
186
+ # @yield [result, operation] Access the result along with the TransportOperation object
187
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
188
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
189
+ #
190
+ # @return [::Google::Cloud::Compute::V1::Operation]
191
+ # A result object deserialized from the server's reply
192
+ def insert request_pb, options = nil
193
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
194
+
195
+ verb, uri, query_string_params, body = ServiceStub.transcode_insert_request request_pb
196
+ query_string_params = if query_string_params.any?
197
+ query_string_params.to_h { |p| p.split "=", 2 }
198
+ else
199
+ {}
200
+ end
201
+
202
+ response = @client_stub.make_http_request(
203
+ verb,
204
+ uri: uri,
205
+ body: body || "",
206
+ params: query_string_params,
207
+ options: options
208
+ )
209
+ operation = ::Gapic::Rest::TransportOperation.new response
210
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
211
+
212
+ yield result, operation if block_given?
213
+ result
214
+ end
215
+
216
+ ##
217
+ # Baseline implementation for the list REST call
218
+ #
219
+ # @param request_pb [::Google::Cloud::Compute::V1::ListRegionInstantSnapshotsRequest]
220
+ # A request object representing the call parameters. Required.
221
+ # @param options [::Gapic::CallOptions]
222
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
223
+ #
224
+ # @yield [result, operation] Access the result along with the TransportOperation object
225
+ # @yieldparam result [::Google::Cloud::Compute::V1::InstantSnapshotList]
226
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
227
+ #
228
+ # @return [::Google::Cloud::Compute::V1::InstantSnapshotList]
229
+ # A result object deserialized from the server's reply
230
+ def list request_pb, options = nil
231
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
232
+
233
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_request request_pb
234
+ query_string_params = if query_string_params.any?
235
+ query_string_params.to_h { |p| p.split "=", 2 }
236
+ else
237
+ {}
238
+ end
239
+
240
+ response = @client_stub.make_http_request(
241
+ verb,
242
+ uri: uri,
243
+ body: body || "",
244
+ params: query_string_params,
245
+ options: options
246
+ )
247
+ operation = ::Gapic::Rest::TransportOperation.new response
248
+ result = ::Google::Cloud::Compute::V1::InstantSnapshotList.decode_json response.body, ignore_unknown_fields: true
249
+
250
+ yield result, operation if block_given?
251
+ result
252
+ end
253
+
254
+ ##
255
+ # Baseline implementation for the set_iam_policy REST call
256
+ #
257
+ # @param request_pb [::Google::Cloud::Compute::V1::SetIamPolicyRegionInstantSnapshotRequest]
258
+ # A request object representing the call parameters. Required.
259
+ # @param options [::Gapic::CallOptions]
260
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
261
+ #
262
+ # @yield [result, operation] Access the result along with the TransportOperation object
263
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
264
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
265
+ #
266
+ # @return [::Google::Cloud::Compute::V1::Policy]
267
+ # A result object deserialized from the server's reply
268
+ def set_iam_policy request_pb, options = nil
269
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
270
+
271
+ verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb
272
+ query_string_params = if query_string_params.any?
273
+ query_string_params.to_h { |p| p.split "=", 2 }
274
+ else
275
+ {}
276
+ end
277
+
278
+ response = @client_stub.make_http_request(
279
+ verb,
280
+ uri: uri,
281
+ body: body || "",
282
+ params: query_string_params,
283
+ options: options
284
+ )
285
+ operation = ::Gapic::Rest::TransportOperation.new response
286
+ result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
287
+
288
+ yield result, operation if block_given?
289
+ result
290
+ end
291
+
292
+ ##
293
+ # Baseline implementation for the set_labels REST call
294
+ #
295
+ # @param request_pb [::Google::Cloud::Compute::V1::SetLabelsRegionInstantSnapshotRequest]
296
+ # A request object representing the call parameters. Required.
297
+ # @param options [::Gapic::CallOptions]
298
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
299
+ #
300
+ # @yield [result, operation] Access the result along with the TransportOperation object
301
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
302
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
303
+ #
304
+ # @return [::Google::Cloud::Compute::V1::Operation]
305
+ # A result object deserialized from the server's reply
306
+ def set_labels request_pb, options = nil
307
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
308
+
309
+ verb, uri, query_string_params, body = ServiceStub.transcode_set_labels_request request_pb
310
+ query_string_params = if query_string_params.any?
311
+ query_string_params.to_h { |p| p.split "=", 2 }
312
+ else
313
+ {}
314
+ end
315
+
316
+ response = @client_stub.make_http_request(
317
+ verb,
318
+ uri: uri,
319
+ body: body || "",
320
+ params: query_string_params,
321
+ options: options
322
+ )
323
+ operation = ::Gapic::Rest::TransportOperation.new response
324
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
325
+
326
+ yield result, operation if block_given?
327
+ result
328
+ end
329
+
330
+ ##
331
+ # Baseline implementation for the test_iam_permissions REST call
332
+ #
333
+ # @param request_pb [::Google::Cloud::Compute::V1::TestIamPermissionsRegionInstantSnapshotRequest]
334
+ # A request object representing the call parameters. Required.
335
+ # @param options [::Gapic::CallOptions]
336
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
337
+ #
338
+ # @yield [result, operation] Access the result along with the TransportOperation object
339
+ # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
340
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
341
+ #
342
+ # @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
343
+ # A result object deserialized from the server's reply
344
+ def test_iam_permissions request_pb, options = nil
345
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
346
+
347
+ verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb
348
+ query_string_params = if query_string_params.any?
349
+ query_string_params.to_h { |p| p.split "=", 2 }
350
+ else
351
+ {}
352
+ end
353
+
354
+ response = @client_stub.make_http_request(
355
+ verb,
356
+ uri: uri,
357
+ body: body || "",
358
+ params: query_string_params,
359
+ options: options
360
+ )
361
+ operation = ::Gapic::Rest::TransportOperation.new response
362
+ result = ::Google::Cloud::Compute::V1::TestPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
363
+
364
+ yield result, operation if block_given?
365
+ result
366
+ end
367
+
368
+ ##
369
+ # @private
370
+ #
371
+ # GRPC transcoding helper method for the delete REST call
372
+ #
373
+ # @param request_pb [::Google::Cloud::Compute::V1::DeleteRegionInstantSnapshotRequest]
374
+ # A request object representing the call parameters. Required.
375
+ # @return [Array(String, [String, nil], Hash{String => String})]
376
+ # Uri, Body, Query string parameters
377
+ def self.transcode_delete_request request_pb
378
+ transcoder = Gapic::Rest::GrpcTranscoder.new
379
+ .with_bindings(
380
+ uri_method: :delete,
381
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/instantSnapshots/{instant_snapshot}",
382
+ matches: [
383
+ ["project", %r{^[^/]+/?$}, false],
384
+ ["region", %r{^[^/]+/?$}, false],
385
+ ["instant_snapshot", %r{^[^/]+/?$}, false]
386
+ ]
387
+ )
388
+ transcoder.transcode request_pb
389
+ end
390
+
391
+ ##
392
+ # @private
393
+ #
394
+ # GRPC transcoding helper method for the get REST call
395
+ #
396
+ # @param request_pb [::Google::Cloud::Compute::V1::GetRegionInstantSnapshotRequest]
397
+ # A request object representing the call parameters. Required.
398
+ # @return [Array(String, [String, nil], Hash{String => String})]
399
+ # Uri, Body, Query string parameters
400
+ def self.transcode_get_request request_pb
401
+ transcoder = Gapic::Rest::GrpcTranscoder.new
402
+ .with_bindings(
403
+ uri_method: :get,
404
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/instantSnapshots/{instant_snapshot}",
405
+ matches: [
406
+ ["project", %r{^[^/]+/?$}, false],
407
+ ["region", %r{^[^/]+/?$}, false],
408
+ ["instant_snapshot", %r{^[^/]+/?$}, false]
409
+ ]
410
+ )
411
+ transcoder.transcode request_pb
412
+ end
413
+
414
+ ##
415
+ # @private
416
+ #
417
+ # GRPC transcoding helper method for the get_iam_policy REST call
418
+ #
419
+ # @param request_pb [::Google::Cloud::Compute::V1::GetIamPolicyRegionInstantSnapshotRequest]
420
+ # A request object representing the call parameters. Required.
421
+ # @return [Array(String, [String, nil], Hash{String => String})]
422
+ # Uri, Body, Query string parameters
423
+ def self.transcode_get_iam_policy_request request_pb
424
+ transcoder = Gapic::Rest::GrpcTranscoder.new
425
+ .with_bindings(
426
+ uri_method: :get,
427
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/instantSnapshots/{resource}/getIamPolicy",
428
+ matches: [
429
+ ["project", %r{^[^/]+/?$}, false],
430
+ ["region", %r{^[^/]+/?$}, false],
431
+ ["resource", %r{^[^/]+/?$}, false]
432
+ ]
433
+ )
434
+ transcoder.transcode request_pb
435
+ end
436
+
437
+ ##
438
+ # @private
439
+ #
440
+ # GRPC transcoding helper method for the insert REST call
441
+ #
442
+ # @param request_pb [::Google::Cloud::Compute::V1::InsertRegionInstantSnapshotRequest]
443
+ # A request object representing the call parameters. Required.
444
+ # @return [Array(String, [String, nil], Hash{String => String})]
445
+ # Uri, Body, Query string parameters
446
+ def self.transcode_insert_request request_pb
447
+ transcoder = Gapic::Rest::GrpcTranscoder.new
448
+ .with_bindings(
449
+ uri_method: :post,
450
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/instantSnapshots",
451
+ body: "instant_snapshot_resource",
452
+ matches: [
453
+ ["project", %r{^[^/]+/?$}, false],
454
+ ["region", %r{^[^/]+/?$}, false]
455
+ ]
456
+ )
457
+ transcoder.transcode request_pb
458
+ end
459
+
460
+ ##
461
+ # @private
462
+ #
463
+ # GRPC transcoding helper method for the list REST call
464
+ #
465
+ # @param request_pb [::Google::Cloud::Compute::V1::ListRegionInstantSnapshotsRequest]
466
+ # A request object representing the call parameters. Required.
467
+ # @return [Array(String, [String, nil], Hash{String => String})]
468
+ # Uri, Body, Query string parameters
469
+ def self.transcode_list_request request_pb
470
+ transcoder = Gapic::Rest::GrpcTranscoder.new
471
+ .with_bindings(
472
+ uri_method: :get,
473
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/instantSnapshots",
474
+ matches: [
475
+ ["project", %r{^[^/]+/?$}, false],
476
+ ["region", %r{^[^/]+/?$}, false]
477
+ ]
478
+ )
479
+ transcoder.transcode request_pb
480
+ end
481
+
482
+ ##
483
+ # @private
484
+ #
485
+ # GRPC transcoding helper method for the set_iam_policy REST call
486
+ #
487
+ # @param request_pb [::Google::Cloud::Compute::V1::SetIamPolicyRegionInstantSnapshotRequest]
488
+ # A request object representing the call parameters. Required.
489
+ # @return [Array(String, [String, nil], Hash{String => String})]
490
+ # Uri, Body, Query string parameters
491
+ def self.transcode_set_iam_policy_request request_pb
492
+ transcoder = Gapic::Rest::GrpcTranscoder.new
493
+ .with_bindings(
494
+ uri_method: :post,
495
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/instantSnapshots/{resource}/setIamPolicy",
496
+ body: "region_set_policy_request_resource",
497
+ matches: [
498
+ ["project", %r{^[^/]+/?$}, false],
499
+ ["region", %r{^[^/]+/?$}, false],
500
+ ["resource", %r{^[^/]+/?$}, false]
501
+ ]
502
+ )
503
+ transcoder.transcode request_pb
504
+ end
505
+
506
+ ##
507
+ # @private
508
+ #
509
+ # GRPC transcoding helper method for the set_labels REST call
510
+ #
511
+ # @param request_pb [::Google::Cloud::Compute::V1::SetLabelsRegionInstantSnapshotRequest]
512
+ # A request object representing the call parameters. Required.
513
+ # @return [Array(String, [String, nil], Hash{String => String})]
514
+ # Uri, Body, Query string parameters
515
+ def self.transcode_set_labels_request request_pb
516
+ transcoder = Gapic::Rest::GrpcTranscoder.new
517
+ .with_bindings(
518
+ uri_method: :post,
519
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/instantSnapshots/{resource}/setLabels",
520
+ body: "region_set_labels_request_resource",
521
+ matches: [
522
+ ["project", %r{^[^/]+/?$}, false],
523
+ ["region", %r{^[^/]+/?$}, false],
524
+ ["resource", %r{^[^/]+/?$}, false]
525
+ ]
526
+ )
527
+ transcoder.transcode request_pb
528
+ end
529
+
530
+ ##
531
+ # @private
532
+ #
533
+ # GRPC transcoding helper method for the test_iam_permissions REST call
534
+ #
535
+ # @param request_pb [::Google::Cloud::Compute::V1::TestIamPermissionsRegionInstantSnapshotRequest]
536
+ # A request object representing the call parameters. Required.
537
+ # @return [Array(String, [String, nil], Hash{String => String})]
538
+ # Uri, Body, Query string parameters
539
+ def self.transcode_test_iam_permissions_request request_pb
540
+ transcoder = Gapic::Rest::GrpcTranscoder.new
541
+ .with_bindings(
542
+ uri_method: :post,
543
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/instantSnapshots/{resource}/testIamPermissions",
544
+ body: "test_permissions_request_resource",
545
+ matches: [
546
+ ["project", %r{^[^/]+/?$}, false],
547
+ ["region", %r{^[^/]+/?$}, false],
548
+ ["resource", %r{^[^/]+/?$}, false]
549
+ ]
550
+ )
551
+ transcoder.transcode request_pb
552
+ end
553
+ end
554
+ end
555
+ end
556
+ end
557
+ end
558
+ end
559
+ end
@@ -0,0 +1,51 @@
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 "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/compute/v1/version"
24
+
25
+ require "google/cloud/compute/v1/region_instant_snapshots/credentials"
26
+ require "google/cloud/compute/v1/region_instant_snapshots/rest/client"
27
+
28
+ module Google
29
+ module Cloud
30
+ module Compute
31
+ module V1
32
+ ##
33
+ # The RegionInstantSnapshots API.
34
+ #
35
+ # To load this service and instantiate a REST client:
36
+ #
37
+ # require "google/cloud/compute/v1/region_instant_snapshots/rest"
38
+ # client = ::Google::Cloud::Compute::V1::RegionInstantSnapshots::Rest::Client.new
39
+ #
40
+ module RegionInstantSnapshots
41
+ # Client for the REST transport
42
+ module Rest
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+
50
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
51
+ require "google/cloud/compute/v1/region_instant_snapshots/rest/helpers" if ::File.file? helper_path
@@ -0,0 +1,47 @@
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 "gapic/config"
20
+ require "gapic/config/method"
21
+
22
+ require "google/cloud/compute/v1/version"
23
+
24
+ require "google/cloud/compute/v1/region_instant_snapshots/credentials"
25
+ require "google/cloud/compute/v1/region_instant_snapshots/rest"
26
+
27
+ module Google
28
+ module Cloud
29
+ module Compute
30
+ module V1
31
+ ##
32
+ # The RegionInstantSnapshots API.
33
+ #
34
+ # @example Load this service and instantiate a REST client
35
+ #
36
+ # require "google/cloud/compute/v1/region_instant_snapshots/rest"
37
+ # client = ::Google::Cloud::Compute::V1::RegionInstantSnapshots::Rest::Client.new
38
+ #
39
+ module RegionInstantSnapshots
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+
46
+ helper_path = ::File.join __dir__, "region_instant_snapshots", "helpers.rb"
47
+ require "google/cloud/compute/v1/region_instant_snapshots/helpers" if ::File.file? helper_path
@@ -675,7 +675,7 @@ module Google
675
675
  # @param region [::String]
676
676
  # The name of the region where the network endpoint group is located. It should comply with RFC1035.
677
677
  # @param return_partial_success [::Boolean]
678
- # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
678
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.
679
679
  # @yield [result, operation] Access the result along with the TransportOperation object
680
680
  # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::NetworkEndpointGroup>]
681
681
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -768,7 +768,7 @@ module Google
768
768
  # @param region [::String]
769
769
  # The name of the region where the network endpoint group is located. It should comply with RFC1035.
770
770
  # @param return_partial_success [::Boolean]
771
- # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
771
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.
772
772
  # @yield [result, operation] Access the result along with the TransportOperation object
773
773
  # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::NetworkEndpointWithHealthStatus>]
774
774
  # @yieldparam operation [::Gapic::Rest::TransportOperation]