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/backend_services/rest/service_stub"
22
+ require "google/cloud/compute/v1/global_operations/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -153,9 +154,21 @@ module Google
153
154
  credentials = Credentials.new credentials, scope: @config.scope
154
155
  end
155
156
 
157
+ @global_operations = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client.new do |config|
158
+ config.credentials = credentials
159
+ config.endpoint = @config.endpoint
160
+ end
161
+
156
162
  @backend_services_stub = ::Google::Cloud::Compute::V1::BackendServices::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
157
163
  end
158
164
 
165
+ ##
166
+ # Get the associated client for long-running operations via GlobalOperations.
167
+ #
168
+ # @return [::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client]
169
+ #
170
+ attr_reader :global_operations
171
+
159
172
  # Service calls
160
173
 
161
174
  ##
@@ -187,10 +200,10 @@ module Google
187
200
  # @param signed_url_key_resource [::Google::Cloud::Compute::V1::SignedUrlKey, ::Hash]
188
201
  # The body resource for this request
189
202
  # @yield [result, response] Access the result along with the Faraday response object
190
- # @yieldparam result [::Gapic::Rest::BaseOperation]
203
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
191
204
  # @yieldparam response [::Faraday::Response]
192
205
  #
193
- # @return [::Gapic::Rest::BaseOperation]
206
+ # @return [::Gapic::GenericLRO::Operation]
194
207
  #
195
208
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
196
209
  def add_signed_url_key request, options = nil
@@ -217,7 +230,14 @@ module Google
217
230
  metadata: @config.metadata
218
231
 
219
232
  @backend_services_stub.add_signed_url_key request, options do |result, response|
220
- result = ::Gapic::Rest::BaseOperation.new result
233
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
234
+ operation: result,
235
+ client: global_operations,
236
+ request_values: {
237
+ "project" => request.project
238
+ },
239
+ options: options
240
+ )
221
241
  yield result, response if block_given?
222
242
  return result
223
243
  end
@@ -327,10 +347,10 @@ module Google
327
347
  # @param request_id [::String]
328
348
  # 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).
329
349
  # @yield [result, response] Access the result along with the Faraday response object
330
- # @yieldparam result [::Gapic::Rest::BaseOperation]
350
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
331
351
  # @yieldparam response [::Faraday::Response]
332
352
  #
333
- # @return [::Gapic::Rest::BaseOperation]
353
+ # @return [::Gapic::GenericLRO::Operation]
334
354
  #
335
355
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
336
356
  def delete request, options = nil
@@ -357,7 +377,14 @@ module Google
357
377
  metadata: @config.metadata
358
378
 
359
379
  @backend_services_stub.delete request, options do |result, response|
360
- result = ::Gapic::Rest::BaseOperation.new result
380
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
381
+ operation: result,
382
+ client: global_operations,
383
+ request_values: {
384
+ "project" => request.project
385
+ },
386
+ options: options
387
+ )
361
388
  yield result, response if block_given?
362
389
  return result
363
390
  end
@@ -395,10 +422,10 @@ module Google
395
422
  # @param request_id [::String]
396
423
  # 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).
397
424
  # @yield [result, response] Access the result along with the Faraday response object
398
- # @yieldparam result [::Gapic::Rest::BaseOperation]
425
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
399
426
  # @yieldparam response [::Faraday::Response]
400
427
  #
401
- # @return [::Gapic::Rest::BaseOperation]
428
+ # @return [::Gapic::GenericLRO::Operation]
402
429
  #
403
430
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
404
431
  def delete_signed_url_key request, options = nil
@@ -425,7 +452,14 @@ module Google
425
452
  metadata: @config.metadata
426
453
 
427
454
  @backend_services_stub.delete_signed_url_key request, options do |result, response|
428
- result = ::Gapic::Rest::BaseOperation.new result
455
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
456
+ operation: result,
457
+ client: global_operations,
458
+ request_values: {
459
+ "project" => request.project
460
+ },
461
+ options: options
462
+ )
429
463
  yield result, response if block_given?
430
464
  return result
431
465
  end
@@ -588,10 +622,10 @@ module Google
588
622
  # @param request_id [::String]
589
623
  # 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).
590
624
  # @yield [result, response] Access the result along with the Faraday response object
591
- # @yieldparam result [::Gapic::Rest::BaseOperation]
625
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
592
626
  # @yieldparam response [::Faraday::Response]
593
627
  #
594
- # @return [::Gapic::Rest::BaseOperation]
628
+ # @return [::Gapic::GenericLRO::Operation]
595
629
  #
596
630
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
597
631
  def insert request, options = nil
@@ -618,7 +652,14 @@ module Google
618
652
  metadata: @config.metadata
619
653
 
620
654
  @backend_services_stub.insert request, options do |result, response|
621
- result = ::Gapic::Rest::BaseOperation.new result
655
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
656
+ operation: result,
657
+ client: global_operations,
658
+ request_values: {
659
+ "project" => request.project
660
+ },
661
+ options: options
662
+ )
622
663
  yield result, response if block_given?
623
664
  return result
624
665
  end
@@ -728,10 +769,10 @@ module Google
728
769
  # @param request_id [::String]
729
770
  # 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).
730
771
  # @yield [result, response] Access the result along with the Faraday response object
731
- # @yieldparam result [::Gapic::Rest::BaseOperation]
772
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
732
773
  # @yieldparam response [::Faraday::Response]
733
774
  #
734
- # @return [::Gapic::Rest::BaseOperation]
775
+ # @return [::Gapic::GenericLRO::Operation]
735
776
  #
736
777
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
737
778
  def patch request, options = nil
@@ -758,7 +799,14 @@ module Google
758
799
  metadata: @config.metadata
759
800
 
760
801
  @backend_services_stub.patch request, options do |result, response|
761
- result = ::Gapic::Rest::BaseOperation.new result
802
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
803
+ operation: result,
804
+ client: global_operations,
805
+ request_values: {
806
+ "project" => request.project
807
+ },
808
+ options: options
809
+ )
762
810
  yield result, response if block_given?
763
811
  return result
764
812
  end
@@ -796,10 +844,10 @@ module Google
796
844
  # @param security_policy_reference_resource [::Google::Cloud::Compute::V1::SecurityPolicyReference, ::Hash]
797
845
  # The body resource for this request
798
846
  # @yield [result, response] Access the result along with the Faraday response object
799
- # @yieldparam result [::Gapic::Rest::BaseOperation]
847
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
800
848
  # @yieldparam response [::Faraday::Response]
801
849
  #
802
- # @return [::Gapic::Rest::BaseOperation]
850
+ # @return [::Gapic::GenericLRO::Operation]
803
851
  #
804
852
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
805
853
  def set_edge_security_policy request, options = nil
@@ -826,7 +874,14 @@ module Google
826
874
  metadata: @config.metadata
827
875
 
828
876
  @backend_services_stub.set_edge_security_policy request, options do |result, response|
829
- result = ::Gapic::Rest::BaseOperation.new result
877
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
878
+ operation: result,
879
+ client: global_operations,
880
+ request_values: {
881
+ "project" => request.project
882
+ },
883
+ options: options
884
+ )
830
885
  yield result, response if block_given?
831
886
  return result
832
887
  end
@@ -864,10 +919,10 @@ module Google
864
919
  # @param security_policy_reference_resource [::Google::Cloud::Compute::V1::SecurityPolicyReference, ::Hash]
865
920
  # The body resource for this request
866
921
  # @yield [result, response] Access the result along with the Faraday response object
867
- # @yieldparam result [::Gapic::Rest::BaseOperation]
922
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
868
923
  # @yieldparam response [::Faraday::Response]
869
924
  #
870
- # @return [::Gapic::Rest::BaseOperation]
925
+ # @return [::Gapic::GenericLRO::Operation]
871
926
  #
872
927
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
873
928
  def set_security_policy request, options = nil
@@ -894,7 +949,14 @@ module Google
894
949
  metadata: @config.metadata
895
950
 
896
951
  @backend_services_stub.set_security_policy request, options do |result, response|
897
- result = ::Gapic::Rest::BaseOperation.new result
952
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
953
+ operation: result,
954
+ client: global_operations,
955
+ request_values: {
956
+ "project" => request.project
957
+ },
958
+ options: options
959
+ )
898
960
  yield result, response if block_given?
899
961
  return result
900
962
  end
@@ -932,10 +994,10 @@ module Google
932
994
  # @param request_id [::String]
933
995
  # 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).
934
996
  # @yield [result, response] Access the result along with the Faraday response object
935
- # @yieldparam result [::Gapic::Rest::BaseOperation]
997
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
936
998
  # @yieldparam response [::Faraday::Response]
937
999
  #
938
- # @return [::Gapic::Rest::BaseOperation]
1000
+ # @return [::Gapic::GenericLRO::Operation]
939
1001
  #
940
1002
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
941
1003
  def update request, options = nil
@@ -962,7 +1024,14 @@ module Google
962
1024
  metadata: @config.metadata
963
1025
 
964
1026
  @backend_services_stub.update request, options do |result, response|
965
- result = ::Gapic::Rest::BaseOperation.new result
1027
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
1028
+ operation: result,
1029
+ client: global_operations,
1030
+ request_values: {
1031
+ "project" => request.project
1032
+ },
1033
+ options: options
1034
+ )
966
1035
  yield result, response if block_given?
967
1036
  return result
968
1037
  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/disks/rest/service_stub"
22
+ require "google/cloud/compute/v1/zone_operations/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -158,9 +159,21 @@ module Google
158
159
  credentials = Credentials.new credentials, scope: @config.scope
159
160
  end
160
161
 
162
+ @zone_operations = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client.new do |config|
163
+ config.credentials = credentials
164
+ config.endpoint = @config.endpoint
165
+ end
166
+
161
167
  @disks_stub = ::Google::Cloud::Compute::V1::Disks::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
162
168
  end
163
169
 
170
+ ##
171
+ # Get the associated client for long-running operations via ZoneOperations.
172
+ #
173
+ # @return [::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client]
174
+ #
175
+ attr_reader :zone_operations
176
+
164
177
  # Service calls
165
178
 
166
179
  ##
@@ -194,10 +207,10 @@ module Google
194
207
  # @param zone [::String]
195
208
  # The name of the zone for this request.
196
209
  # @yield [result, response] Access the result along with the Faraday response object
197
- # @yieldparam result [::Gapic::Rest::BaseOperation]
210
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
198
211
  # @yieldparam response [::Faraday::Response]
199
212
  #
200
- # @return [::Gapic::Rest::BaseOperation]
213
+ # @return [::Gapic::GenericLRO::Operation]
201
214
  #
202
215
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
203
216
  def add_resource_policies request, options = nil
@@ -224,7 +237,15 @@ module Google
224
237
  metadata: @config.metadata
225
238
 
226
239
  @disks_stub.add_resource_policies request, options do |result, response|
227
- result = ::Gapic::Rest::BaseOperation.new result
240
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
241
+ operation: result,
242
+ client: zone_operations,
243
+ request_values: {
244
+ "project" => request.project,
245
+ "zone" => request.zone
246
+ },
247
+ options: options
248
+ )
228
249
  yield result, response if block_given?
229
250
  return result
230
251
  end
@@ -340,10 +361,10 @@ module Google
340
361
  # @param zone [::String]
341
362
  # The name of the zone for this request.
342
363
  # @yield [result, response] Access the result along with the Faraday response object
343
- # @yieldparam result [::Gapic::Rest::BaseOperation]
364
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
344
365
  # @yieldparam response [::Faraday::Response]
345
366
  #
346
- # @return [::Gapic::Rest::BaseOperation]
367
+ # @return [::Gapic::GenericLRO::Operation]
347
368
  #
348
369
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
349
370
  def create_snapshot request, options = nil
@@ -370,7 +391,15 @@ module Google
370
391
  metadata: @config.metadata
371
392
 
372
393
  @disks_stub.create_snapshot request, options do |result, response|
373
- result = ::Gapic::Rest::BaseOperation.new result
394
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
395
+ operation: result,
396
+ client: zone_operations,
397
+ request_values: {
398
+ "project" => request.project,
399
+ "zone" => request.zone
400
+ },
401
+ options: options
402
+ )
374
403
  yield result, response if block_given?
375
404
  return result
376
405
  end
@@ -408,10 +437,10 @@ module Google
408
437
  # @param zone [::String]
409
438
  # The name of the zone for this request.
410
439
  # @yield [result, response] Access the result along with the Faraday response object
411
- # @yieldparam result [::Gapic::Rest::BaseOperation]
440
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
412
441
  # @yieldparam response [::Faraday::Response]
413
442
  #
414
- # @return [::Gapic::Rest::BaseOperation]
443
+ # @return [::Gapic::GenericLRO::Operation]
415
444
  #
416
445
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
417
446
  def delete request, options = nil
@@ -438,7 +467,15 @@ module Google
438
467
  metadata: @config.metadata
439
468
 
440
469
  @disks_stub.delete request, options do |result, response|
441
- result = ::Gapic::Rest::BaseOperation.new result
470
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
471
+ operation: result,
472
+ client: zone_operations,
473
+ request_values: {
474
+ "project" => request.project,
475
+ "zone" => request.zone
476
+ },
477
+ options: options
478
+ )
442
479
  yield result, response if block_given?
443
480
  return result
444
481
  end
@@ -610,10 +647,10 @@ module Google
610
647
  # @param zone [::String]
611
648
  # The name of the zone for this request.
612
649
  # @yield [result, response] Access the result along with the Faraday response object
613
- # @yieldparam result [::Gapic::Rest::BaseOperation]
650
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
614
651
  # @yieldparam response [::Faraday::Response]
615
652
  #
616
- # @return [::Gapic::Rest::BaseOperation]
653
+ # @return [::Gapic::GenericLRO::Operation]
617
654
  #
618
655
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
619
656
  def insert request, options = nil
@@ -640,7 +677,15 @@ module Google
640
677
  metadata: @config.metadata
641
678
 
642
679
  @disks_stub.insert request, options do |result, response|
643
- result = ::Gapic::Rest::BaseOperation.new result
680
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
681
+ operation: result,
682
+ client: zone_operations,
683
+ request_values: {
684
+ "project" => request.project,
685
+ "zone" => request.zone
686
+ },
687
+ options: options
688
+ )
644
689
  yield result, response if block_given?
645
690
  return result
646
691
  end
@@ -754,10 +799,10 @@ module Google
754
799
  # @param zone [::String]
755
800
  # The name of the zone for this request.
756
801
  # @yield [result, response] Access the result along with the Faraday response object
757
- # @yieldparam result [::Gapic::Rest::BaseOperation]
802
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
758
803
  # @yieldparam response [::Faraday::Response]
759
804
  #
760
- # @return [::Gapic::Rest::BaseOperation]
805
+ # @return [::Gapic::GenericLRO::Operation]
761
806
  #
762
807
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
763
808
  def remove_resource_policies request, options = nil
@@ -784,7 +829,15 @@ module Google
784
829
  metadata: @config.metadata
785
830
 
786
831
  @disks_stub.remove_resource_policies request, options do |result, response|
787
- result = ::Gapic::Rest::BaseOperation.new result
832
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
833
+ operation: result,
834
+ client: zone_operations,
835
+ request_values: {
836
+ "project" => request.project,
837
+ "zone" => request.zone
838
+ },
839
+ options: options
840
+ )
788
841
  yield result, response if block_given?
789
842
  return result
790
843
  end
@@ -824,10 +877,10 @@ module Google
824
877
  # @param zone [::String]
825
878
  # The name of the zone for this request.
826
879
  # @yield [result, response] Access the result along with the Faraday response object
827
- # @yieldparam result [::Gapic::Rest::BaseOperation]
880
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
828
881
  # @yieldparam response [::Faraday::Response]
829
882
  #
830
- # @return [::Gapic::Rest::BaseOperation]
883
+ # @return [::Gapic::GenericLRO::Operation]
831
884
  #
832
885
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
833
886
  def resize request, options = nil
@@ -854,7 +907,15 @@ module Google
854
907
  metadata: @config.metadata
855
908
 
856
909
  @disks_stub.resize request, options do |result, response|
857
- result = ::Gapic::Rest::BaseOperation.new result
910
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
911
+ operation: result,
912
+ client: zone_operations,
913
+ request_values: {
914
+ "project" => request.project,
915
+ "zone" => request.zone
916
+ },
917
+ options: options
918
+ )
858
919
  yield result, response if block_given?
859
920
  return result
860
921
  end
@@ -961,10 +1022,10 @@ module Google
961
1022
  # @param zone_set_labels_request_resource [::Google::Cloud::Compute::V1::ZoneSetLabelsRequest, ::Hash]
962
1023
  # The body resource for this request
963
1024
  # @yield [result, response] Access the result along with the Faraday response object
964
- # @yieldparam result [::Gapic::Rest::BaseOperation]
1025
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
965
1026
  # @yieldparam response [::Faraday::Response]
966
1027
  #
967
- # @return [::Gapic::Rest::BaseOperation]
1028
+ # @return [::Gapic::GenericLRO::Operation]
968
1029
  #
969
1030
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
970
1031
  def set_labels request, options = nil
@@ -991,7 +1052,15 @@ module Google
991
1052
  metadata: @config.metadata
992
1053
 
993
1054
  @disks_stub.set_labels request, options do |result, response|
994
- result = ::Gapic::Rest::BaseOperation.new result
1055
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
1056
+ operation: result,
1057
+ client: zone_operations,
1058
+ request_values: {
1059
+ "project" => request.project,
1060
+ "zone" => request.zone
1061
+ },
1062
+ options: options
1063
+ )
995
1064
  yield result, response if block_given?
996
1065
  return result
997
1066
  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/external_vpn_gateways/rest/service_stub"
22
+ require "google/cloud/compute/v1/global_operations/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -138,9 +139,21 @@ module Google
138
139
  credentials = Credentials.new credentials, scope: @config.scope
139
140
  end
140
141
 
142
+ @global_operations = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client.new do |config|
143
+ config.credentials = credentials
144
+ config.endpoint = @config.endpoint
145
+ end
146
+
141
147
  @external_vpn_gateways_stub = ::Google::Cloud::Compute::V1::ExternalVpnGateways::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
142
148
  end
143
149
 
150
+ ##
151
+ # Get the associated client for long-running operations via GlobalOperations.
152
+ #
153
+ # @return [::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client]
154
+ #
155
+ attr_reader :global_operations
156
+
144
157
  # Service calls
145
158
 
146
159
  ##
@@ -170,10 +183,10 @@ module Google
170
183
  # @param request_id [::String]
171
184
  # 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).
172
185
  # @yield [result, response] Access the result along with the Faraday response object
173
- # @yieldparam result [::Gapic::Rest::BaseOperation]
186
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
174
187
  # @yieldparam response [::Faraday::Response]
175
188
  #
176
- # @return [::Gapic::Rest::BaseOperation]
189
+ # @return [::Gapic::GenericLRO::Operation]
177
190
  #
178
191
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
179
192
  def delete request, options = nil
@@ -200,7 +213,14 @@ module Google
200
213
  metadata: @config.metadata
201
214
 
202
215
  @external_vpn_gateways_stub.delete request, options do |result, response|
203
- result = ::Gapic::Rest::BaseOperation.new result
216
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
217
+ operation: result,
218
+ client: global_operations,
219
+ request_values: {
220
+ "project" => request.project
221
+ },
222
+ options: options
223
+ )
204
224
  yield result, response if block_given?
205
225
  return result
206
226
  end
@@ -299,10 +319,10 @@ module Google
299
319
  # @param request_id [::String]
300
320
  # 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).
301
321
  # @yield [result, response] Access the result along with the Faraday response object
302
- # @yieldparam result [::Gapic::Rest::BaseOperation]
322
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
303
323
  # @yieldparam response [::Faraday::Response]
304
324
  #
305
- # @return [::Gapic::Rest::BaseOperation]
325
+ # @return [::Gapic::GenericLRO::Operation]
306
326
  #
307
327
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
308
328
  def insert request, options = nil
@@ -329,7 +349,14 @@ module Google
329
349
  metadata: @config.metadata
330
350
 
331
351
  @external_vpn_gateways_stub.insert request, options do |result, response|
332
- result = ::Gapic::Rest::BaseOperation.new result
352
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
353
+ operation: result,
354
+ client: global_operations,
355
+ request_values: {
356
+ "project" => request.project
357
+ },
358
+ options: options
359
+ )
333
360
  yield result, response if block_given?
334
361
  return result
335
362
  end
@@ -437,10 +464,10 @@ module Google
437
464
  # @param resource [::String]
438
465
  # Name or id of the resource for this request.
439
466
  # @yield [result, response] Access the result along with the Faraday response object
440
- # @yieldparam result [::Gapic::Rest::BaseOperation]
467
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
441
468
  # @yieldparam response [::Faraday::Response]
442
469
  #
443
- # @return [::Gapic::Rest::BaseOperation]
470
+ # @return [::Gapic::GenericLRO::Operation]
444
471
  #
445
472
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
446
473
  def set_labels request, options = nil
@@ -467,7 +494,14 @@ module Google
467
494
  metadata: @config.metadata
468
495
 
469
496
  @external_vpn_gateways_stub.set_labels request, options do |result, response|
470
- result = ::Gapic::Rest::BaseOperation.new result
497
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
498
+ operation: result,
499
+ client: global_operations,
500
+ request_values: {
501
+ "project" => request.project
502
+ },
503
+ options: options
504
+ )
471
505
  yield result, response if block_given?
472
506
  return result
473
507
  end