google-cloud-compute-v1 1.6.0 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +15 -6
  4. data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +1 -1
  5. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +115 -10
  6. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +62 -1
  7. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +35 -14
  8. data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +1 -1
  9. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +45 -18
  10. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +1 -1
  11. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +217 -24
  12. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +120 -1
  13. data/lib/google/cloud/compute/v1/compute_pb.rb +228 -0
  14. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +15 -6
  15. data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +1 -1
  16. data/lib/google/cloud/compute/v1/disks/rest/client.rb +65 -26
  17. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +1 -1
  18. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +30 -12
  19. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +1 -1
  20. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +90 -36
  21. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +1 -1
  22. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +30 -12
  23. data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +1 -1
  24. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +40 -16
  25. data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +1 -1
  26. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +105 -8
  27. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +61 -1
  28. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +35 -14
  29. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +1 -1
  30. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +35 -14
  31. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +1 -1
  32. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +25 -10
  33. data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +1 -1
  34. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +15 -6
  35. data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +1 -1
  36. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +25 -10
  37. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +1 -1
  38. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +35 -14
  39. data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +1 -1
  40. data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +5 -2
  41. data/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +1 -1
  42. data/lib/google/cloud/compute/v1/images/rest/client.rb +55 -22
  43. data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +1 -1
  44. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +100 -40
  45. data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +1 -1
  46. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +45 -18
  47. data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +1 -1
  48. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +35 -14
  49. data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +1 -1
  50. data/lib/google/cloud/compute/v1/instances/rest/client.rb +225 -90
  51. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +1 -1
  52. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +120 -12
  53. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +62 -1
  54. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +10 -4
  55. data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +1 -1
  56. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +115 -12
  57. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +61 -1
  58. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +10 -4
  59. data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +1 -1
  60. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +35 -14
  61. data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +1 -1
  62. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +35 -14
  63. data/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +1 -1
  64. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +15 -6
  65. data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +1 -1
  66. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +25 -10
  67. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +1 -1
  68. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +45 -18
  69. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +1 -1
  70. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +80 -32
  71. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +1 -1
  72. data/lib/google/cloud/compute/v1/networks/rest/client.rb +55 -22
  73. data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +1 -1
  74. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +65 -26
  75. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +1 -1
  76. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +40 -16
  77. data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +1 -1
  78. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +15 -6
  79. data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +1 -1
  80. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +35 -14
  81. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +1 -1
  82. data/lib/google/cloud/compute/v1/projects/rest/client.rb +65 -26
  83. data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +1 -1
  84. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +25 -10
  85. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +1 -1
  86. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +30 -12
  87. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +1 -1
  88. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +30 -12
  89. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +1 -1
  90. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +196 -14
  91. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +122 -1
  92. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +25 -10
  93. data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +1 -1
  94. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +10 -4
  95. data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +1 -1
  96. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +60 -24
  97. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +1 -1
  98. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +25 -10
  99. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +1 -1
  100. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +30 -12
  101. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +1 -1
  102. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +95 -38
  103. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +1 -1
  104. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +20 -8
  105. data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +1 -1
  106. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +5 -2
  107. data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +1 -1
  108. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +20 -8
  109. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +1 -1
  110. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +85 -34
  111. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +1 -1
  112. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +20 -8
  113. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +1 -1
  114. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +20 -8
  115. data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +1 -1
  116. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +25 -10
  117. data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +1 -1
  118. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +20 -8
  119. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +1 -1
  120. data/lib/google/cloud/compute/v1/region_ssl_policies/credentials.rb +52 -0
  121. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +777 -0
  122. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb +408 -0
  123. data/lib/google/cloud/compute/v1/region_ssl_policies/rest.rb +33 -0
  124. data/lib/google/cloud/compute/v1/region_ssl_policies.rb +47 -0
  125. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +25 -10
  126. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +1 -1
  127. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +35 -14
  128. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +1 -1
  129. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/credentials.rb +52 -0
  130. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +599 -0
  131. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb +288 -0
  132. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest.rb +33 -0
  133. data/lib/google/cloud/compute/v1/region_target_tcp_proxies.rb +47 -0
  134. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +35 -14
  135. data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +1 -1
  136. data/lib/google/cloud/compute/v1/regions/rest/client.rb +10 -4
  137. data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +1 -1
  138. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +50 -20
  139. data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +1 -1
  140. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +40 -16
  141. data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +1 -1
  142. data/lib/google/cloud/compute/v1/routers/rest/client.rb +50 -20
  143. data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +1 -1
  144. data/lib/google/cloud/compute/v1/routes/rest/client.rb +20 -8
  145. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +1 -1
  146. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +140 -22
  147. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +61 -1
  148. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +45 -18
  149. data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +1 -1
  150. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +40 -16
  151. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +1 -1
  152. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +25 -10
  153. data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +1 -1
  154. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +119 -12
  155. data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +59 -1
  156. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +60 -24
  157. data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +1 -1
  158. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +25 -10
  159. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +1 -1
  160. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +35 -14
  161. data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +1 -1
  162. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +55 -22
  163. data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +1 -1
  164. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +25 -10
  165. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +1 -1
  166. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +55 -22
  167. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +1 -1
  168. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +45 -18
  169. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +1 -1
  170. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +30 -12
  171. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +1 -1
  172. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +115 -10
  173. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +62 -1
  174. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +45 -18
  175. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +1 -1
  176. data/lib/google/cloud/compute/v1/version.rb +1 -1
  177. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +40 -16
  178. data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +1 -1
  179. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +115 -10
  180. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +62 -1
  181. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +20 -8
  182. data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +1 -1
  183. data/lib/google/cloud/compute/v1/zones/rest/client.rb +10 -4
  184. data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +1 -1
  185. data/lib/google/cloud/compute/v1.rb +2 -0
  186. data/proto_docs/google/cloud/compute/v1/compute.rb +637 -26
  187. metadata +14 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ea56f9dd35946267157d69bc6aad4d2011ef0d032c2692f0fc8585f20f9e77d
4
- data.tar.gz: 24d4246582ba7d9f897457fe5a3a09a2295b7888205c48146c71223662d287c8
3
+ metadata.gz: d4df0057408d303fa690748467bbacd0083ee1c24b31067a5f81f49baf9011c9
4
+ data.tar.gz: 56050ef5ac59ec598dcb41771dc241c4cc1326a7871480b961ac752a94800e78
5
5
  SHA512:
6
- metadata.gz: 12780f1e3231db163be3bf498700a34939ce9fef3c4545c353e111f1ab33f8871792ca48c9d74a8e1fe783a7c2a30cbd4da2fd1d10c6a82b9d0e277be2cf607b
7
- data.tar.gz: e867f79215fd5932d6be2df27884a4570b1ff2595554124249b1b9c6cc93d4e8a9804b24c465535b7846c8dd01a451218abeeb3ceb2b0ea91859f45c8eafb2a6
6
+ metadata.gz: afeeb43e8641b86d012f3916e95bd80b7b5669b6a2627a8432823614de9f75f4a39bc54a14ec6b654642c52151c52c4ff9d5e8253060d5caba7ceb7d8e803967
7
+ data.tar.gz: 7eb1c2decd112c9d6409f44dc3f920ad948faf2fa781460a16366d8b032cdefb6dfb105c7392b054150c976d7b984c749a149cf9d29984320e05eef1bee91baa
data/AUTHENTICATION.md CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
114
114
  To configure your system for this, simply:
115
115
 
116
116
  1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
117
- 2. Authenticate using OAuth 2.0 `$ gcloud auth login`
117
+ 2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
118
118
  3. Write code as if already authenticated.
119
119
 
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
@@ -212,8 +212,11 @@ module Google
212
212
  return result
213
213
  end
214
214
  rescue ::Faraday::Error => e
215
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
216
- raise ::Google::Cloud::Error.from_error(gapic_error)
215
+ begin
216
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
217
+ rescue ::Gapic::Rest::Error => gapic_error
218
+ raise ::Google::Cloud::Error.from_error gapic_error
219
+ end
217
220
  end
218
221
 
219
222
  ##
@@ -277,8 +280,11 @@ module Google
277
280
  return result
278
281
  end
279
282
  rescue ::Faraday::Error => e
280
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
281
- raise ::Google::Cloud::Error.from_error(gapic_error)
283
+ begin
284
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
285
+ rescue ::Gapic::Rest::Error => gapic_error
286
+ raise ::Google::Cloud::Error.from_error gapic_error
287
+ end
282
288
  end
283
289
 
284
290
  ##
@@ -351,8 +357,11 @@ module Google
351
357
  return result
352
358
  end
353
359
  rescue ::Faraday::Error => e
354
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
355
- raise ::Google::Cloud::Error.from_error(gapic_error)
360
+ begin
361
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
362
+ rescue ::Gapic::Rest::Error => gapic_error
363
+ raise ::Google::Cloud::Error.from_error gapic_error
364
+ end
356
365
  end
357
366
 
358
367
  ##
@@ -35,7 +35,7 @@ module Google
35
35
  # the REST modules only when it's required.
36
36
  require "gapic/rest"
37
37
 
38
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials, numeric_enums: false
39
39
  end
40
40
 
41
41
  ##
@@ -84,6 +84,8 @@ module Google
84
84
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
85
85
  }
86
86
 
87
+ default_config.rpcs.set_labels.timeout = 600.0
88
+
87
89
  default_config
88
90
  end
89
91
  yield @configure if block_given?
@@ -227,8 +229,11 @@ module Google
227
229
  return result
228
230
  end
229
231
  rescue ::Faraday::Error => e
230
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
231
- raise ::Google::Cloud::Error.from_error(gapic_error)
232
+ begin
233
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
234
+ rescue ::Gapic::Rest::Error => gapic_error
235
+ raise ::Google::Cloud::Error.from_error gapic_error
236
+ end
232
237
  end
233
238
 
234
239
  ##
@@ -303,8 +308,11 @@ module Google
303
308
  return result
304
309
  end
305
310
  rescue ::Faraday::Error => e
306
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
307
- raise ::Google::Cloud::Error.from_error(gapic_error)
311
+ begin
312
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
313
+ rescue ::Gapic::Rest::Error => gapic_error
314
+ raise ::Google::Cloud::Error.from_error gapic_error
315
+ end
308
316
  end
309
317
 
310
318
  ##
@@ -368,8 +376,11 @@ module Google
368
376
  return result
369
377
  end
370
378
  rescue ::Faraday::Error => e
371
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
372
- raise ::Google::Cloud::Error.from_error(gapic_error)
379
+ begin
380
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
381
+ rescue ::Gapic::Rest::Error => gapic_error
382
+ raise ::Google::Cloud::Error.from_error gapic_error
383
+ end
373
384
  end
374
385
 
375
386
  ##
@@ -444,8 +455,11 @@ module Google
444
455
  return result
445
456
  end
446
457
  rescue ::Faraday::Error => e
447
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
448
- raise ::Google::Cloud::Error.from_error(gapic_error)
458
+ begin
459
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
460
+ rescue ::Gapic::Rest::Error => gapic_error
461
+ raise ::Google::Cloud::Error.from_error gapic_error
462
+ end
449
463
  end
450
464
 
451
465
  ##
@@ -518,8 +532,92 @@ module Google
518
532
  return result
519
533
  end
520
534
  rescue ::Faraday::Error => e
521
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
522
- raise ::Google::Cloud::Error.from_error(gapic_error)
535
+ begin
536
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
537
+ rescue ::Gapic::Rest::Error => gapic_error
538
+ raise ::Google::Cloud::Error.from_error gapic_error
539
+ end
540
+ end
541
+
542
+ ##
543
+ # Sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation.
544
+ #
545
+ # @overload set_labels(request, options = nil)
546
+ # Pass arguments to `set_labels` via a request object, either of type
547
+ # {::Google::Cloud::Compute::V1::SetLabelsAddressRequest} or an equivalent Hash.
548
+ #
549
+ # @param request [::Google::Cloud::Compute::V1::SetLabelsAddressRequest, ::Hash]
550
+ # A request object representing the call parameters. Required. To specify no
551
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
552
+ # @param options [::Gapic::CallOptions, ::Hash]
553
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
554
+ # Note: currently retry functionality is not implemented. While it is possible
555
+ # to set it using ::Gapic::CallOptions, it will not be applied
556
+ #
557
+ # @overload set_labels(project: nil, region: nil, region_set_labels_request_resource: nil, request_id: nil, resource: nil)
558
+ # Pass arguments to `set_labels` via keyword arguments. Note that at
559
+ # least one keyword argument is required. To specify no parameters, or to keep all
560
+ # the default parameter values, pass an empty Hash as a request object (see above).
561
+ #
562
+ # @param project [::String]
563
+ # Project ID for this request.
564
+ # @param region [::String]
565
+ # The region for this request.
566
+ # @param region_set_labels_request_resource [::Google::Cloud::Compute::V1::RegionSetLabelsRequest, ::Hash]
567
+ # The body resource for this request
568
+ # @param request_id [::String]
569
+ # 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).
570
+ # @param resource [::String]
571
+ # Name or id of the resource for this request.
572
+ # @yield [result, response] Access the result along with the Faraday response object
573
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
574
+ # @yieldparam response [::Faraday::Response]
575
+ #
576
+ # @return [::Gapic::GenericLRO::Operation]
577
+ #
578
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
579
+ def set_labels request, options = nil
580
+ raise ::ArgumentError, "request must be provided" if request.nil?
581
+
582
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetLabelsAddressRequest
583
+
584
+ # Converts hash and nil to an options object
585
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
586
+
587
+ # Customize the options with defaults
588
+ call_metadata = @config.rpcs.set_labels.metadata.to_h
589
+
590
+ # Set x-goog-api-client header
591
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
592
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
593
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
594
+ transports_version_send: [:rest]
595
+
596
+ options.apply_defaults timeout: @config.rpcs.set_labels.timeout,
597
+ metadata: call_metadata
598
+
599
+ options.apply_defaults timeout: @config.timeout,
600
+ metadata: @config.metadata
601
+
602
+ @addresses_stub.set_labels request, options do |result, response|
603
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
604
+ operation: result,
605
+ client: region_operations,
606
+ request_values: {
607
+ "project" => request.project,
608
+ "region" => request.region
609
+ },
610
+ options: options
611
+ )
612
+ yield result, response if block_given?
613
+ return result
614
+ end
615
+ rescue ::Faraday::Error => e
616
+ begin
617
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
618
+ rescue ::Gapic::Rest::Error => gapic_error
619
+ raise ::Google::Cloud::Error.from_error gapic_error
620
+ end
523
621
  end
524
622
 
525
623
  ##
@@ -646,6 +744,11 @@ module Google
646
744
  # @return [::Gapic::Config::Method]
647
745
  #
648
746
  attr_reader :list
747
+ ##
748
+ # RPC-specific configuration for `set_labels`
749
+ # @return [::Gapic::Config::Method]
750
+ #
751
+ attr_reader :set_labels
649
752
 
650
753
  # @private
651
754
  def initialize parent_rpcs = nil
@@ -659,6 +762,8 @@ module Google
659
762
  @insert = ::Gapic::Config::Method.new insert_config
660
763
  list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
661
764
  @list = ::Gapic::Config::Method.new list_config
765
+ set_labels_config = parent_rpcs.set_labels if parent_rpcs.respond_to? :set_labels
766
+ @set_labels = ::Gapic::Config::Method.new set_labels_config
662
767
 
663
768
  yield self if block_given?
664
769
  end
@@ -35,7 +35,7 @@ module Google
35
35
  # the REST modules only when it's required.
36
36
  require "gapic/rest"
37
37
 
38
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials, numeric_enums: false
39
39
  end
40
40
 
41
41
  ##
@@ -223,6 +223,43 @@ module Google
223
223
  result
224
224
  end
225
225
 
226
+ ##
227
+ # Baseline implementation for the set_labels REST call
228
+ #
229
+ # @param request_pb [::Google::Cloud::Compute::V1::SetLabelsAddressRequest]
230
+ # A request object representing the call parameters. Required.
231
+ # @param options [::Gapic::CallOptions]
232
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
233
+ #
234
+ # @yield [result, response] Access the result along with the Faraday response object
235
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
236
+ # @yieldparam response [::Faraday::Response]
237
+ #
238
+ # @return [::Google::Cloud::Compute::V1::Operation]
239
+ # A result object deserialized from the server's reply
240
+ def set_labels request_pb, options = nil
241
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
242
+
243
+ verb, uri, query_string_params, body = transcode_set_labels_request request_pb
244
+ query_string_params = if query_string_params.any?
245
+ query_string_params.to_h { |p| p.split("=", 2) }
246
+ else
247
+ {}
248
+ end
249
+
250
+ response = @client_stub.make_http_request(
251
+ verb,
252
+ uri: uri,
253
+ body: body || "",
254
+ params: query_string_params,
255
+ options: options
256
+ )
257
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
258
+
259
+ yield result, response if block_given?
260
+ result
261
+ end
262
+
226
263
 
227
264
  private
228
265
 
@@ -337,6 +374,30 @@ module Google
337
374
  )
338
375
  transcoder.transcode request_pb
339
376
  end
377
+
378
+ ##
379
+ # @private
380
+ #
381
+ # GRPC transcoding helper method for the set_labels REST call
382
+ #
383
+ # @param request_pb [::Google::Cloud::Compute::V1::SetLabelsAddressRequest]
384
+ # A request object representing the call parameters. Required.
385
+ # @return [Array(String, [String, nil], Hash{String => String})]
386
+ # Uri, Body, Query string parameters
387
+ def transcode_set_labels_request request_pb
388
+ transcoder = Gapic::Rest::GrpcTranscoder.new
389
+ .with_bindings(
390
+ uri_method: :post,
391
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/addresses/{resource}/setLabels",
392
+ body: "region_set_labels_request_resource",
393
+ matches: [
394
+ ["project", %r{^[^/]+/?$}, false],
395
+ ["region", %r{^[^/]+/?$}, false],
396
+ ["resource", %r{^[^/]+/?$}, false]
397
+ ]
398
+ )
399
+ transcoder.transcode request_pb
400
+ end
340
401
  end
341
402
  end
342
403
  end
@@ -231,8 +231,11 @@ module Google
231
231
  return result
232
232
  end
233
233
  rescue ::Faraday::Error => e
234
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
235
- raise ::Google::Cloud::Error.from_error(gapic_error)
234
+ begin
235
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
236
+ rescue ::Gapic::Rest::Error => gapic_error
237
+ raise ::Google::Cloud::Error.from_error gapic_error
238
+ end
236
239
  end
237
240
 
238
241
  ##
@@ -307,8 +310,11 @@ module Google
307
310
  return result
308
311
  end
309
312
  rescue ::Faraday::Error => e
310
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
311
- raise ::Google::Cloud::Error.from_error(gapic_error)
313
+ begin
314
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
315
+ rescue ::Gapic::Rest::Error => gapic_error
316
+ raise ::Google::Cloud::Error.from_error gapic_error
317
+ end
312
318
  end
313
319
 
314
320
  ##
@@ -372,8 +378,11 @@ module Google
372
378
  return result
373
379
  end
374
380
  rescue ::Faraday::Error => e
375
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
376
- raise ::Google::Cloud::Error.from_error(gapic_error)
381
+ begin
382
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
383
+ rescue ::Gapic::Rest::Error => gapic_error
384
+ raise ::Google::Cloud::Error.from_error gapic_error
385
+ end
377
386
  end
378
387
 
379
388
  ##
@@ -448,8 +457,11 @@ module Google
448
457
  return result
449
458
  end
450
459
  rescue ::Faraday::Error => e
451
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
452
- raise ::Google::Cloud::Error.from_error(gapic_error)
460
+ begin
461
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
462
+ rescue ::Gapic::Rest::Error => gapic_error
463
+ raise ::Google::Cloud::Error.from_error gapic_error
464
+ end
453
465
  end
454
466
 
455
467
  ##
@@ -522,8 +534,11 @@ module Google
522
534
  return result
523
535
  end
524
536
  rescue ::Faraday::Error => e
525
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
526
- raise ::Google::Cloud::Error.from_error(gapic_error)
537
+ begin
538
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
539
+ rescue ::Gapic::Rest::Error => gapic_error
540
+ raise ::Google::Cloud::Error.from_error gapic_error
541
+ end
527
542
  end
528
543
 
529
544
  ##
@@ -600,8 +615,11 @@ module Google
600
615
  return result
601
616
  end
602
617
  rescue ::Faraday::Error => e
603
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
604
- raise ::Google::Cloud::Error.from_error(gapic_error)
618
+ begin
619
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
620
+ rescue ::Gapic::Rest::Error => gapic_error
621
+ raise ::Google::Cloud::Error.from_error gapic_error
622
+ end
605
623
  end
606
624
 
607
625
  ##
@@ -678,8 +696,11 @@ module Google
678
696
  return result
679
697
  end
680
698
  rescue ::Faraday::Error => e
681
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
682
- raise ::Google::Cloud::Error.from_error(gapic_error)
699
+ begin
700
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
701
+ rescue ::Gapic::Rest::Error => gapic_error
702
+ raise ::Google::Cloud::Error.from_error gapic_error
703
+ end
683
704
  end
684
705
 
685
706
  ##
@@ -35,7 +35,7 @@ module Google
35
35
  # the REST modules only when it's required.
36
36
  require "gapic/rest"
37
37
 
38
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials, numeric_enums: false
39
39
  end
40
40
 
41
41
  ##
@@ -233,8 +233,11 @@ module Google
233
233
  return result
234
234
  end
235
235
  rescue ::Faraday::Error => e
236
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
237
- raise ::Google::Cloud::Error.from_error(gapic_error)
236
+ begin
237
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
238
+ rescue ::Gapic::Rest::Error => gapic_error
239
+ raise ::Google::Cloud::Error.from_error gapic_error
240
+ end
238
241
  end
239
242
 
240
243
  ##
@@ -306,8 +309,11 @@ module Google
306
309
  return result
307
310
  end
308
311
  rescue ::Faraday::Error => e
309
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
310
- raise ::Google::Cloud::Error.from_error(gapic_error)
312
+ begin
313
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
314
+ rescue ::Gapic::Rest::Error => gapic_error
315
+ raise ::Google::Cloud::Error.from_error gapic_error
316
+ end
311
317
  end
312
318
 
313
319
  ##
@@ -381,8 +387,11 @@ module Google
381
387
  return result
382
388
  end
383
389
  rescue ::Faraday::Error => e
384
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
385
- raise ::Google::Cloud::Error.from_error(gapic_error)
390
+ begin
391
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
392
+ rescue ::Gapic::Rest::Error => gapic_error
393
+ raise ::Google::Cloud::Error.from_error gapic_error
394
+ end
386
395
  end
387
396
 
388
397
  ##
@@ -444,8 +453,11 @@ module Google
444
453
  return result
445
454
  end
446
455
  rescue ::Faraday::Error => e
447
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
448
- raise ::Google::Cloud::Error.from_error(gapic_error)
456
+ begin
457
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
458
+ rescue ::Gapic::Rest::Error => gapic_error
459
+ raise ::Google::Cloud::Error.from_error gapic_error
460
+ end
449
461
  end
450
462
 
451
463
  ##
@@ -517,8 +529,11 @@ module Google
517
529
  return result
518
530
  end
519
531
  rescue ::Faraday::Error => e
520
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
521
- raise ::Google::Cloud::Error.from_error(gapic_error)
532
+ begin
533
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
534
+ rescue ::Gapic::Rest::Error => gapic_error
535
+ raise ::Google::Cloud::Error.from_error gapic_error
536
+ end
522
537
  end
523
538
 
524
539
  ##
@@ -589,8 +604,11 @@ module Google
589
604
  return result
590
605
  end
591
606
  rescue ::Faraday::Error => e
592
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
593
- raise ::Google::Cloud::Error.from_error(gapic_error)
607
+ begin
608
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
609
+ rescue ::Gapic::Rest::Error => gapic_error
610
+ raise ::Google::Cloud::Error.from_error gapic_error
611
+ end
594
612
  end
595
613
 
596
614
  ##
@@ -664,8 +682,11 @@ module Google
664
682
  return result
665
683
  end
666
684
  rescue ::Faraday::Error => e
667
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
668
- raise ::Google::Cloud::Error.from_error(gapic_error)
685
+ begin
686
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
687
+ rescue ::Gapic::Rest::Error => gapic_error
688
+ raise ::Google::Cloud::Error.from_error gapic_error
689
+ end
669
690
  end
670
691
 
671
692
  ##
@@ -739,8 +760,11 @@ module Google
739
760
  return result
740
761
  end
741
762
  rescue ::Faraday::Error => e
742
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
743
- raise ::Google::Cloud::Error.from_error(gapic_error)
763
+ begin
764
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
765
+ rescue ::Gapic::Rest::Error => gapic_error
766
+ raise ::Google::Cloud::Error.from_error gapic_error
767
+ end
744
768
  end
745
769
 
746
770
  ##
@@ -814,8 +838,11 @@ module Google
814
838
  return result
815
839
  end
816
840
  rescue ::Faraday::Error => e
817
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
818
- raise ::Google::Cloud::Error.from_error(gapic_error)
841
+ begin
842
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
843
+ rescue ::Gapic::Rest::Error => gapic_error
844
+ raise ::Google::Cloud::Error.from_error gapic_error
845
+ end
819
846
  end
820
847
 
821
848
  ##
@@ -35,7 +35,7 @@ module Google
35
35
  # the REST modules only when it's required.
36
36
  require "gapic/rest"
37
37
 
38
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials, numeric_enums: false
39
39
  end
40
40
 
41
41
  ##