google-cloud-compute-v1 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +35 -6
  3. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +57 -12
  4. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +83 -21
  5. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +93 -24
  6. data/lib/google/cloud/compute/v1/disks/rest/client.rb +90 -21
  7. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +43 -9
  8. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +97 -30
  9. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +53 -12
  10. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +68 -15
  11. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +33 -6
  12. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +63 -15
  13. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +53 -12
  14. data/lib/google/cloud/compute/v1/global_operations/rest/nonstandard_lro.rb +68 -0
  15. data/lib/google/cloud/compute/v1/global_operations.rb +1 -0
  16. data/lib/google/cloud/compute/v1/global_organization_operations/rest/nonstandard_lro.rb +68 -0
  17. data/lib/google/cloud/compute/v1/global_organization_operations.rb +1 -0
  18. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +43 -9
  19. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +53 -12
  20. data/lib/google/cloud/compute/v1/images/rest/client.rb +63 -15
  21. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +167 -42
  22. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +68 -15
  23. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +33 -6
  24. data/lib/google/cloud/compute/v1/instances/rest/client.rb +365 -96
  25. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +46 -9
  26. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +43 -9
  27. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +33 -6
  28. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +33 -6
  29. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +57 -12
  30. data/lib/google/cloud/compute/v1/networks/rest/client.rb +83 -21
  31. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +79 -18
  32. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +35 -6
  33. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +46 -9
  34. data/lib/google/cloud/compute/v1/projects/rest/client.rb +103 -27
  35. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +43 -9
  36. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +46 -9
  37. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +57 -12
  38. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +57 -12
  39. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +35 -6
  40. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +90 -21
  41. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +46 -9
  42. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +57 -12
  43. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +167 -42
  44. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +24 -3
  45. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +24 -3
  46. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +35 -6
  47. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +35 -6
  48. data/lib/google/cloud/compute/v1/region_operations/rest/nonstandard_lro.rb +68 -0
  49. data/lib/google/cloud/compute/v1/region_operations.rb +1 -0
  50. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +35 -6
  51. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +46 -9
  52. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +57 -12
  53. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +57 -12
  54. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +57 -12
  55. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +35 -6
  56. data/lib/google/cloud/compute/v1/routers/rest/client.rb +57 -12
  57. data/lib/google/cloud/compute/v1/routes/rest/client.rb +33 -6
  58. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +73 -18
  59. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +46 -9
  60. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +43 -9
  61. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +33 -6
  62. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +43 -9
  63. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +68 -15
  64. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +43 -9
  65. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +53 -12
  66. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +83 -21
  67. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +35 -6
  68. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +90 -21
  69. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +73 -18
  70. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +53 -12
  71. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +35 -6
  72. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +63 -15
  73. data/lib/google/cloud/compute/v1/version.rb +1 -1
  74. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +46 -9
  75. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +35 -6
  76. data/lib/google/cloud/compute/v1/zone_operations/rest/nonstandard_lro.rb +68 -0
  77. data/lib/google/cloud/compute/v1/zone_operations.rb +1 -0
  78. data/lib/google/cloud/compute/v1.rb +2 -0
  79. metadata +6 -2
@@ -19,6 +19,7 @@
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/compute/v1/compute_pb"
21
21
  require "google/cloud/compute/v1/global_addresses/rest/service_stub"
22
+ require "google/cloud/compute/v1/global_operations/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -134,9 +135,21 @@ module Google
134
135
  credentials = Credentials.new credentials, scope: @config.scope
135
136
  end
136
137
 
138
+ @global_operations = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client.new do |config|
139
+ config.credentials = credentials
140
+ config.endpoint = @config.endpoint
141
+ end
142
+
137
143
  @global_addresses_stub = ::Google::Cloud::Compute::V1::GlobalAddresses::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
138
144
  end
139
145
 
146
+ ##
147
+ # Get the associated client for long-running operations via GlobalOperations.
148
+ #
149
+ # @return [::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client]
150
+ #
151
+ attr_reader :global_operations
152
+
140
153
  # Service calls
141
154
 
142
155
  ##
@@ -166,10 +179,10 @@ module Google
166
179
  # @param request_id [::String]
167
180
  # 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).
168
181
  # @yield [result, response] Access the result along with the Faraday response object
169
- # @yieldparam result [::Gapic::Rest::BaseOperation]
182
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
170
183
  # @yieldparam response [::Faraday::Response]
171
184
  #
172
- # @return [::Gapic::Rest::BaseOperation]
185
+ # @return [::Gapic::GenericLRO::Operation]
173
186
  #
174
187
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
175
188
  def delete request, options = nil
@@ -196,7 +209,14 @@ module Google
196
209
  metadata: @config.metadata
197
210
 
198
211
  @global_addresses_stub.delete request, options do |result, response|
199
- result = ::Gapic::Rest::BaseOperation.new result
212
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
213
+ operation: result,
214
+ client: global_operations,
215
+ request_values: {
216
+ "project" => request.project
217
+ },
218
+ options: options
219
+ )
200
220
  yield result, response if block_given?
201
221
  return result
202
222
  end
@@ -295,10 +315,10 @@ module Google
295
315
  # @param request_id [::String]
296
316
  # 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).
297
317
  # @yield [result, response] Access the result along with the Faraday response object
298
- # @yieldparam result [::Gapic::Rest::BaseOperation]
318
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
299
319
  # @yieldparam response [::Faraday::Response]
300
320
  #
301
- # @return [::Gapic::Rest::BaseOperation]
321
+ # @return [::Gapic::GenericLRO::Operation]
302
322
  #
303
323
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
304
324
  def insert request, options = nil
@@ -325,7 +345,14 @@ module Google
325
345
  metadata: @config.metadata
326
346
 
327
347
  @global_addresses_stub.insert request, options do |result, response|
328
- result = ::Gapic::Rest::BaseOperation.new result
348
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
349
+ operation: result,
350
+ client: global_operations,
351
+ request_values: {
352
+ "project" => request.project
353
+ },
354
+ options: options
355
+ )
329
356
  yield result, response if block_given?
330
357
  return result
331
358
  end
@@ -19,6 +19,7 @@
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/compute/v1/compute_pb"
21
21
  require "google/cloud/compute/v1/global_forwarding_rules/rest/service_stub"
22
+ require "google/cloud/compute/v1/global_operations/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -140,9 +141,21 @@ module Google
140
141
  credentials = Credentials.new credentials, scope: @config.scope
141
142
  end
142
143
 
144
+ @global_operations = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client.new do |config|
145
+ config.credentials = credentials
146
+ config.endpoint = @config.endpoint
147
+ end
148
+
143
149
  @global_forwarding_rules_stub = ::Google::Cloud::Compute::V1::GlobalForwardingRules::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
144
150
  end
145
151
 
152
+ ##
153
+ # Get the associated client for long-running operations via GlobalOperations.
154
+ #
155
+ # @return [::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client]
156
+ #
157
+ attr_reader :global_operations
158
+
146
159
  # Service calls
147
160
 
148
161
  ##
@@ -172,10 +185,10 @@ module Google
172
185
  # @param request_id [::String]
173
186
  # 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).
174
187
  # @yield [result, response] Access the result along with the Faraday response object
175
- # @yieldparam result [::Gapic::Rest::BaseOperation]
188
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
176
189
  # @yieldparam response [::Faraday::Response]
177
190
  #
178
- # @return [::Gapic::Rest::BaseOperation]
191
+ # @return [::Gapic::GenericLRO::Operation]
179
192
  #
180
193
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
181
194
  def delete request, options = nil
@@ -202,7 +215,14 @@ module Google
202
215
  metadata: @config.metadata
203
216
 
204
217
  @global_forwarding_rules_stub.delete request, options do |result, response|
205
- result = ::Gapic::Rest::BaseOperation.new result
218
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
219
+ operation: result,
220
+ client: global_operations,
221
+ request_values: {
222
+ "project" => request.project
223
+ },
224
+ options: options
225
+ )
206
226
  yield result, response if block_given?
207
227
  return result
208
228
  end
@@ -301,10 +321,10 @@ module Google
301
321
  # @param request_id [::String]
302
322
  # 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).
303
323
  # @yield [result, response] Access the result along with the Faraday response object
304
- # @yieldparam result [::Gapic::Rest::BaseOperation]
324
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
305
325
  # @yieldparam response [::Faraday::Response]
306
326
  #
307
- # @return [::Gapic::Rest::BaseOperation]
327
+ # @return [::Gapic::GenericLRO::Operation]
308
328
  #
309
329
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
310
330
  def insert request, options = nil
@@ -331,7 +351,14 @@ module Google
331
351
  metadata: @config.metadata
332
352
 
333
353
  @global_forwarding_rules_stub.insert request, options do |result, response|
334
- result = ::Gapic::Rest::BaseOperation.new result
354
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
355
+ operation: result,
356
+ client: global_operations,
357
+ request_values: {
358
+ "project" => request.project
359
+ },
360
+ options: options
361
+ )
335
362
  yield result, response if block_given?
336
363
  return result
337
364
  end
@@ -441,10 +468,10 @@ module Google
441
468
  # @param request_id [::String]
442
469
  # 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).
443
470
  # @yield [result, response] Access the result along with the Faraday response object
444
- # @yieldparam result [::Gapic::Rest::BaseOperation]
471
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
445
472
  # @yieldparam response [::Faraday::Response]
446
473
  #
447
- # @return [::Gapic::Rest::BaseOperation]
474
+ # @return [::Gapic::GenericLRO::Operation]
448
475
  #
449
476
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
450
477
  def patch request, options = nil
@@ -471,7 +498,14 @@ module Google
471
498
  metadata: @config.metadata
472
499
 
473
500
  @global_forwarding_rules_stub.patch request, options do |result, response|
474
- result = ::Gapic::Rest::BaseOperation.new result
501
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
502
+ operation: result,
503
+ client: global_operations,
504
+ request_values: {
505
+ "project" => request.project
506
+ },
507
+ options: options
508
+ )
475
509
  yield result, response if block_given?
476
510
  return result
477
511
  end
@@ -507,10 +541,10 @@ module Google
507
541
  # @param resource [::String]
508
542
  # Name or id of the resource for this request.
509
543
  # @yield [result, response] Access the result along with the Faraday response object
510
- # @yieldparam result [::Gapic::Rest::BaseOperation]
544
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
511
545
  # @yieldparam response [::Faraday::Response]
512
546
  #
513
- # @return [::Gapic::Rest::BaseOperation]
547
+ # @return [::Gapic::GenericLRO::Operation]
514
548
  #
515
549
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
516
550
  def set_labels request, options = nil
@@ -537,7 +571,14 @@ module Google
537
571
  metadata: @config.metadata
538
572
 
539
573
  @global_forwarding_rules_stub.set_labels request, options do |result, response|
540
- result = ::Gapic::Rest::BaseOperation.new result
574
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
575
+ operation: result,
576
+ client: global_operations,
577
+ request_values: {
578
+ "project" => request.project
579
+ },
580
+ options: options
581
+ )
541
582
  yield result, response if block_given?
542
583
  return result
543
584
  end
@@ -575,10 +616,10 @@ module Google
575
616
  # @param target_reference_resource [::Google::Cloud::Compute::V1::TargetReference, ::Hash]
576
617
  # The body resource for this request
577
618
  # @yield [result, response] Access the result along with the Faraday response object
578
- # @yieldparam result [::Gapic::Rest::BaseOperation]
619
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
579
620
  # @yieldparam response [::Faraday::Response]
580
621
  #
581
- # @return [::Gapic::Rest::BaseOperation]
622
+ # @return [::Gapic::GenericLRO::Operation]
582
623
  #
583
624
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
584
625
  def set_target request, options = nil
@@ -605,7 +646,14 @@ module Google
605
646
  metadata: @config.metadata
606
647
 
607
648
  @global_forwarding_rules_stub.set_target request, options do |result, response|
608
- result = ::Gapic::Rest::BaseOperation.new result
649
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
650
+ operation: result,
651
+ client: global_operations,
652
+ request_values: {
653
+ "project" => request.project
654
+ },
655
+ options: options
656
+ )
609
657
  yield result, response if block_given?
610
658
  return result
611
659
  end
@@ -19,6 +19,7 @@
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/compute/v1/compute_pb"
21
21
  require "google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub"
22
+ require "google/cloud/compute/v1/global_operations/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -140,9 +141,21 @@ module Google
140
141
  credentials = Credentials.new credentials, scope: @config.scope
141
142
  end
142
143
 
144
+ @global_operations = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client.new do |config|
145
+ config.credentials = credentials
146
+ config.endpoint = @config.endpoint
147
+ end
148
+
143
149
  @global_network_endpoint_groups_stub = ::Google::Cloud::Compute::V1::GlobalNetworkEndpointGroups::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
144
150
  end
145
151
 
152
+ ##
153
+ # Get the associated client for long-running operations via GlobalOperations.
154
+ #
155
+ # @return [::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client]
156
+ #
157
+ attr_reader :global_operations
158
+
146
159
  # Service calls
147
160
 
148
161
  ##
@@ -174,10 +187,10 @@ module Google
174
187
  # @param request_id [::String]
175
188
  # 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).
176
189
  # @yield [result, response] Access the result along with the Faraday response object
177
- # @yieldparam result [::Gapic::Rest::BaseOperation]
190
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
178
191
  # @yieldparam response [::Faraday::Response]
179
192
  #
180
- # @return [::Gapic::Rest::BaseOperation]
193
+ # @return [::Gapic::GenericLRO::Operation]
181
194
  #
182
195
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
183
196
  def attach_network_endpoints request, options = nil
@@ -204,7 +217,14 @@ module Google
204
217
  metadata: @config.metadata
205
218
 
206
219
  @global_network_endpoint_groups_stub.attach_network_endpoints request, options do |result, response|
207
- result = ::Gapic::Rest::BaseOperation.new result
220
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
221
+ operation: result,
222
+ client: global_operations,
223
+ request_values: {
224
+ "project" => request.project
225
+ },
226
+ options: options
227
+ )
208
228
  yield result, response if block_given?
209
229
  return result
210
230
  end
@@ -240,10 +260,10 @@ module Google
240
260
  # @param request_id [::String]
241
261
  # 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).
242
262
  # @yield [result, response] Access the result along with the Faraday response object
243
- # @yieldparam result [::Gapic::Rest::BaseOperation]
263
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
244
264
  # @yieldparam response [::Faraday::Response]
245
265
  #
246
- # @return [::Gapic::Rest::BaseOperation]
266
+ # @return [::Gapic::GenericLRO::Operation]
247
267
  #
248
268
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
249
269
  def delete request, options = nil
@@ -270,7 +290,14 @@ module Google
270
290
  metadata: @config.metadata
271
291
 
272
292
  @global_network_endpoint_groups_stub.delete request, options do |result, response|
273
- result = ::Gapic::Rest::BaseOperation.new result
293
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
294
+ operation: result,
295
+ client: global_operations,
296
+ request_values: {
297
+ "project" => request.project
298
+ },
299
+ options: options
300
+ )
274
301
  yield result, response if block_given?
275
302
  return result
276
303
  end
@@ -308,10 +335,10 @@ module Google
308
335
  # @param request_id [::String]
309
336
  # 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).
310
337
  # @yield [result, response] Access the result along with the Faraday response object
311
- # @yieldparam result [::Gapic::Rest::BaseOperation]
338
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
312
339
  # @yieldparam response [::Faraday::Response]
313
340
  #
314
- # @return [::Gapic::Rest::BaseOperation]
341
+ # @return [::Gapic::GenericLRO::Operation]
315
342
  #
316
343
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
317
344
  def detach_network_endpoints request, options = nil
@@ -338,7 +365,14 @@ module Google
338
365
  metadata: @config.metadata
339
366
 
340
367
  @global_network_endpoint_groups_stub.detach_network_endpoints request, options do |result, response|
341
- result = ::Gapic::Rest::BaseOperation.new result
368
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
369
+ operation: result,
370
+ client: global_operations,
371
+ request_values: {
372
+ "project" => request.project
373
+ },
374
+ options: options
375
+ )
342
376
  yield result, response if block_given?
343
377
  return result
344
378
  end
@@ -437,10 +471,10 @@ module Google
437
471
  # @param request_id [::String]
438
472
  # 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).
439
473
  # @yield [result, response] Access the result along with the Faraday response object
440
- # @yieldparam result [::Gapic::Rest::BaseOperation]
474
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
441
475
  # @yieldparam response [::Faraday::Response]
442
476
  #
443
- # @return [::Gapic::Rest::BaseOperation]
477
+ # @return [::Gapic::GenericLRO::Operation]
444
478
  #
445
479
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
446
480
  def insert request, options = nil
@@ -467,7 +501,14 @@ module Google
467
501
  metadata: @config.metadata
468
502
 
469
503
  @global_network_endpoint_groups_stub.insert request, options do |result, response|
470
- result = ::Gapic::Rest::BaseOperation.new result
504
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
505
+ operation: result,
506
+ client: global_operations,
507
+ request_values: {
508
+ "project" => request.project
509
+ },
510
+ options: options
511
+ )
471
512
  yield result, response if block_given?
472
513
  return result
473
514
  end
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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/operation/retry_policy"
20
+ require "gapic/generic_lro/operation"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Compute
25
+ module V1
26
+ module GlobalOperations
27
+ module Rest
28
+ # A module containing nonstandard lro helpers
29
+ module NonstandardLro
30
+ class << self
31
+ ##
32
+ # Creates a Generic LRO operation object that wraps the nonstandard
33
+ # long-running operation specific to this service.
34
+ #
35
+ # @param operation [Object] The long-running operation object that is returned by the initial method call.
36
+ #
37
+ # @param client [::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client] The client that handles the polling for the longrunning operation.
38
+ #
39
+ # @param request_values [Map<String, String>] The values that are to be copied from the request that
40
+ # triggered the longrunning operation, into the request that polls for the longrunning operation.
41
+ # The format is `name of the request field -> value`
42
+ #
43
+ # @param options [Gapic::CallOptions] call options for this operation
44
+ #
45
+ # @return [Gapic::GenericLRO::Operation]
46
+ #
47
+ def create_operation operation:, client:, request_values:, options:
48
+ Gapic::GenericLRO::Operation.new(operation,
49
+ client: client,
50
+ polling_method_name: "get",
51
+ request_values: request_values,
52
+ operation_status_field: "status",
53
+ operation_name_field: "name",
54
+ operation_err_code_field: "http_error_status_code",
55
+ operation_err_msg_field: "http_error_message",
56
+ operation_copy_fields: {
57
+ "name" => "operation"
58
+ },
59
+ options: options)
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
@@ -22,6 +22,7 @@ require "gapic/config/method"
22
22
  require "google/cloud/compute/v1/version"
23
23
 
24
24
  require "google/cloud/compute/v1/global_operations/credentials"
25
+ require "google/cloud/compute/v1/global_operations/rest/nonstandard_lro"
25
26
  require "google/cloud/compute/v1/global_operations/rest"
26
27
 
27
28
  module Google
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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/operation/retry_policy"
20
+ require "gapic/generic_lro/operation"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Compute
25
+ module V1
26
+ module GlobalOrganizationOperations
27
+ module Rest
28
+ # A module containing nonstandard lro helpers
29
+ module NonstandardLro
30
+ class << self
31
+ ##
32
+ # Creates a Generic LRO operation object that wraps the nonstandard
33
+ # long-running operation specific to this service.
34
+ #
35
+ # @param operation [Object] The long-running operation object that is returned by the initial method call.
36
+ #
37
+ # @param client [::Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::Client] The client that handles the polling for the longrunning operation.
38
+ #
39
+ # @param request_values [Map<String, String>] The values that are to be copied from the request that
40
+ # triggered the longrunning operation, into the request that polls for the longrunning operation.
41
+ # The format is `name of the request field -> value`
42
+ #
43
+ # @param options [Gapic::CallOptions] call options for this operation
44
+ #
45
+ # @return [Gapic::GenericLRO::Operation]
46
+ #
47
+ def create_operation operation:, client:, request_values:, options:
48
+ Gapic::GenericLRO::Operation.new(operation,
49
+ client: client,
50
+ polling_method_name: "get",
51
+ request_values: request_values,
52
+ operation_status_field: "status",
53
+ operation_name_field: "name",
54
+ operation_err_code_field: "http_error_status_code",
55
+ operation_err_msg_field: "http_error_message",
56
+ operation_copy_fields: {
57
+ "name" => "operation"
58
+ },
59
+ options: options)
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
@@ -22,6 +22,7 @@ require "gapic/config/method"
22
22
  require "google/cloud/compute/v1/version"
23
23
 
24
24
  require "google/cloud/compute/v1/global_organization_operations/credentials"
25
+ require "google/cloud/compute/v1/global_organization_operations/rest/nonstandard_lro"
25
26
  require "google/cloud/compute/v1/global_organization_operations/rest"
26
27
 
27
28
  module Google