google-cloud-compute-v1 1.8.0 → 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (363) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +76 -50
  3. data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +9 -10
  4. data/lib/google/cloud/compute/v1/accelerator_types/rest.rb +20 -0
  5. data/lib/google/cloud/compute/v1/accelerator_types.rb +2 -2
  6. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +104 -83
  7. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +15 -16
  8. data/lib/google/cloud/compute/v1/addresses/rest.rb +18 -0
  9. data/lib/google/cloud/compute/v1/addresses.rb +2 -2
  10. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +113 -94
  11. data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +17 -18
  12. data/lib/google/cloud/compute/v1/autoscalers/rest.rb +18 -0
  13. data/lib/google/cloud/compute/v1/autoscalers.rb +2 -2
  14. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +131 -116
  15. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +21 -22
  16. data/lib/google/cloud/compute/v1/backend_buckets/rest.rb +18 -0
  17. data/lib/google/cloud/compute/v1/backend_buckets.rb +2 -2
  18. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +176 -171
  19. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +31 -32
  20. data/lib/google/cloud/compute/v1/backend_services/rest.rb +18 -0
  21. data/lib/google/cloud/compute/v1/backend_services.rb +2 -2
  22. data/lib/google/cloud/compute/v1/compute_pb.rb +206 -0
  23. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +76 -50
  24. data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +9 -10
  25. data/lib/google/cloud/compute/v1/disk_types/rest.rb +18 -0
  26. data/lib/google/cloud/compute/v1/disk_types.rb +2 -2
  27. data/lib/google/cloud/compute/v1/disks/rest/client.rb +167 -160
  28. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +29 -30
  29. data/lib/google/cloud/compute/v1/disks/rest.rb +18 -0
  30. data/lib/google/cloud/compute/v1/disks.rb +2 -2
  31. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +104 -83
  32. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +15 -16
  33. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest.rb +18 -0
  34. data/lib/google/cloud/compute/v1/external_vpn_gateways.rb +2 -2
  35. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +212 -215
  36. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +39 -40
  37. data/lib/google/cloud/compute/v1/firewall_policies/rest.rb +18 -0
  38. data/lib/google/cloud/compute/v1/firewall_policies.rb +2 -2
  39. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +104 -83
  40. data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +15 -16
  41. data/lib/google/cloud/compute/v1/firewalls/rest.rb +18 -0
  42. data/lib/google/cloud/compute/v1/firewalls.rb +2 -2
  43. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +122 -105
  44. data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +19 -20
  45. data/lib/google/cloud/compute/v1/forwarding_rules/rest.rb +18 -0
  46. data/lib/google/cloud/compute/v1/forwarding_rules.rb +2 -2
  47. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +95 -72
  48. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +13 -14
  49. data/lib/google/cloud/compute/v1/global_addresses/rest.rb +18 -0
  50. data/lib/google/cloud/compute/v1/global_addresses.rb +2 -2
  51. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +113 -94
  52. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +17 -18
  53. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest.rb +18 -0
  54. data/lib/google/cloud/compute/v1/global_forwarding_rules.rb +2 -2
  55. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +113 -94
  56. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +17 -18
  57. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest.rb +18 -0
  58. data/lib/google/cloud/compute/v1/global_network_endpoint_groups.rb +2 -2
  59. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +94 -72
  60. data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +13 -14
  61. data/lib/google/cloud/compute/v1/global_operations/rest.rb +18 -0
  62. data/lib/google/cloud/compute/v1/global_operations.rb +2 -2
  63. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +76 -50
  64. data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +9 -10
  65. data/lib/google/cloud/compute/v1/global_organization_operations/rest.rb +18 -0
  66. data/lib/google/cloud/compute/v1/global_organization_operations.rb +2 -2
  67. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +95 -72
  68. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +13 -14
  69. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest.rb +18 -0
  70. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes.rb +2 -2
  71. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +113 -94
  72. data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +17 -18
  73. data/lib/google/cloud/compute/v1/health_checks/rest.rb +18 -0
  74. data/lib/google/cloud/compute/v1/health_checks.rb +2 -2
  75. data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +58 -28
  76. data/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +5 -6
  77. data/lib/google/cloud/compute/v1/image_family_views/rest.rb +18 -0
  78. data/lib/google/cloud/compute/v1/image_family_views.rb +2 -2
  79. data/lib/google/cloud/compute/v1/images/rest/client.rb +149 -138
  80. data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +25 -26
  81. data/lib/google/cloud/compute/v1/images/rest.rb +18 -0
  82. data/lib/google/cloud/compute/v1/images.rb +2 -2
  83. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +230 -237
  84. data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +43 -44
  85. data/lib/google/cloud/compute/v1/instance_group_managers/rest.rb +18 -0
  86. data/lib/google/cloud/compute/v1/instance_group_managers.rb +2 -2
  87. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +131 -116
  88. data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +21 -22
  89. data/lib/google/cloud/compute/v1/instance_groups/rest.rb +18 -0
  90. data/lib/google/cloud/compute/v1/instance_groups.rb +2 -2
  91. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +113 -94
  92. data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +17 -18
  93. data/lib/google/cloud/compute/v1/instance_templates/rest.rb +18 -0
  94. data/lib/google/cloud/compute/v1/instance_templates.rb +2 -2
  95. data/lib/google/cloud/compute/v1/instances/rest/client.rb +461 -514
  96. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +93 -94
  97. data/lib/google/cloud/compute/v1/instances/rest.rb +18 -0
  98. data/lib/google/cloud/compute/v1/instances.rb +2 -2
  99. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +113 -94
  100. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +17 -18
  101. data/lib/google/cloud/compute/v1/interconnect_attachments/rest.rb +18 -0
  102. data/lib/google/cloud/compute/v1/interconnect_attachments.rb +2 -2
  103. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +67 -39
  104. data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +7 -8
  105. data/lib/google/cloud/compute/v1/interconnect_locations/rest.rb +18 -0
  106. data/lib/google/cloud/compute/v1/interconnect_locations.rb +2 -2
  107. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +119 -100
  108. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +17 -18
  109. data/lib/google/cloud/compute/v1/interconnects/rest.rb +18 -0
  110. data/lib/google/cloud/compute/v1/interconnects.rb +2 -2
  111. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +67 -39
  112. data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +7 -8
  113. data/lib/google/cloud/compute/v1/license_codes/rest.rb +18 -0
  114. data/lib/google/cloud/compute/v1/license_codes.rb +2 -2
  115. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +113 -94
  116. data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +17 -18
  117. data/lib/google/cloud/compute/v1/licenses/rest.rb +18 -0
  118. data/lib/google/cloud/compute/v1/licenses.rb +2 -2
  119. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +113 -94
  120. data/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +17 -18
  121. data/lib/google/cloud/compute/v1/machine_images/rest.rb +18 -0
  122. data/lib/google/cloud/compute/v1/machine_images.rb +2 -2
  123. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +76 -50
  124. data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +9 -10
  125. data/lib/google/cloud/compute/v1/machine_types/rest.rb +18 -0
  126. data/lib/google/cloud/compute/v1/machine_types.rb +2 -2
  127. data/lib/google/cloud/compute/v1/network_attachments/credentials.rb +52 -0
  128. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +945 -0
  129. data/lib/google/cloud/compute/v1/network_attachments/rest/service_stub.rb +527 -0
  130. data/lib/google/cloud/compute/v1/network_attachments/rest.rb +51 -0
  131. data/lib/google/cloud/compute/v1/network_attachments.rb +47 -0
  132. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +95 -72
  133. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +13 -14
  134. data/lib/google/cloud/compute/v1/network_edge_security_services/rest.rb +18 -0
  135. data/lib/google/cloud/compute/v1/network_edge_security_services.rb +2 -2
  136. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +131 -116
  137. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +21 -22
  138. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest.rb +18 -0
  139. data/lib/google/cloud/compute/v1/network_endpoint_groups.rb +2 -2
  140. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +194 -193
  141. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +35 -36
  142. data/lib/google/cloud/compute/v1/network_firewall_policies/rest.rb +18 -0
  143. data/lib/google/cloud/compute/v1/network_firewall_policies.rb +2 -2
  144. data/lib/google/cloud/compute/v1/networks/rest/client.rb +149 -138
  145. data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +25 -26
  146. data/lib/google/cloud/compute/v1/networks/rest.rb +18 -0
  147. data/lib/google/cloud/compute/v1/networks.rb +2 -2
  148. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +167 -160
  149. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +29 -30
  150. data/lib/google/cloud/compute/v1/node_groups/rest.rb +18 -0
  151. data/lib/google/cloud/compute/v1/node_groups.rb +2 -2
  152. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +122 -105
  153. data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +19 -20
  154. data/lib/google/cloud/compute/v1/node_templates/rest.rb +18 -0
  155. data/lib/google/cloud/compute/v1/node_templates.rb +2 -2
  156. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +76 -50
  157. data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +9 -10
  158. data/lib/google/cloud/compute/v1/node_types/rest.rb +18 -0
  159. data/lib/google/cloud/compute/v1/node_types.rb +2 -2
  160. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +113 -94
  161. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +17 -18
  162. data/lib/google/cloud/compute/v1/packet_mirrorings/rest.rb +18 -0
  163. data/lib/google/cloud/compute/v1/packet_mirrorings.rb +2 -2
  164. data/lib/google/cloud/compute/v1/projects/rest/client.rb +167 -160
  165. data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +29 -30
  166. data/lib/google/cloud/compute/v1/projects/rest.rb +18 -0
  167. data/lib/google/cloud/compute/v1/projects.rb +2 -2
  168. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +95 -72
  169. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +13 -14
  170. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest.rb +18 -0
  171. data/lib/google/cloud/compute/v1/public_advertised_prefixes.rb +2 -2
  172. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +104 -83
  173. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +15 -16
  174. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest.rb +18 -0
  175. data/lib/google/cloud/compute/v1/public_delegated_prefixes.rb +2 -2
  176. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +104 -83
  177. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +15 -16
  178. data/lib/google/cloud/compute/v1/region_autoscalers/rest.rb +18 -0
  179. data/lib/google/cloud/compute/v1/region_autoscalers.rb +2 -2
  180. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +131 -116
  181. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +21 -22
  182. data/lib/google/cloud/compute/v1/region_backend_services/rest.rb +18 -0
  183. data/lib/google/cloud/compute/v1/region_backend_services.rb +2 -2
  184. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +95 -72
  185. data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +13 -14
  186. data/lib/google/cloud/compute/v1/region_commitments/rest.rb +18 -0
  187. data/lib/google/cloud/compute/v1/region_commitments.rb +2 -2
  188. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +67 -39
  189. data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +7 -8
  190. data/lib/google/cloud/compute/v1/region_disk_types/rest.rb +18 -0
  191. data/lib/google/cloud/compute/v1/region_disk_types.rb +2 -2
  192. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +158 -149
  193. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +27 -28
  194. data/lib/google/cloud/compute/v1/region_disks/rest.rb +18 -0
  195. data/lib/google/cloud/compute/v1/region_disks.rb +2 -2
  196. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +95 -72
  197. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +13 -14
  198. data/lib/google/cloud/compute/v1/region_health_check_services/rest.rb +18 -0
  199. data/lib/google/cloud/compute/v1/region_health_check_services.rb +2 -2
  200. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +104 -83
  201. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +15 -16
  202. data/lib/google/cloud/compute/v1/region_health_checks/rest.rb +18 -0
  203. data/lib/google/cloud/compute/v1/region_health_checks.rb +2 -2
  204. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +221 -226
  205. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +41 -42
  206. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest.rb +18 -0
  207. data/lib/google/cloud/compute/v1/region_instance_group_managers.rb +2 -2
  208. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +86 -61
  209. data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +11 -12
  210. data/lib/google/cloud/compute/v1/region_instance_groups/rest.rb +18 -0
  211. data/lib/google/cloud/compute/v1/region_instance_groups.rb +2 -2
  212. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +59 -28
  213. data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +5 -6
  214. data/lib/google/cloud/compute/v1/region_instances/rest.rb +18 -0
  215. data/lib/google/cloud/compute/v1/region_instances.rb +2 -2
  216. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +86 -61
  217. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +11 -12
  218. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest.rb +18 -0
  219. data/lib/google/cloud/compute/v1/region_network_endpoint_groups.rb +2 -2
  220. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +203 -204
  221. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +37 -38
  222. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest.rb +18 -0
  223. data/lib/google/cloud/compute/v1/region_network_firewall_policies.rb +2 -2
  224. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +86 -61
  225. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +11 -12
  226. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest.rb +18 -0
  227. data/lib/google/cloud/compute/v1/region_notification_endpoints.rb +2 -2
  228. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +85 -61
  229. data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +11 -12
  230. data/lib/google/cloud/compute/v1/region_operations/rest.rb +18 -0
  231. data/lib/google/cloud/compute/v1/region_operations.rb +2 -2
  232. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +95 -72
  233. data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +13 -14
  234. data/lib/google/cloud/compute/v1/region_security_policies/rest.rb +18 -0
  235. data/lib/google/cloud/compute/v1/region_security_policies.rb +2 -2
  236. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +86 -61
  237. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +11 -12
  238. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest.rb +18 -0
  239. data/lib/google/cloud/compute/v1/region_ssl_certificates.rb +2 -2
  240. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +104 -83
  241. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb +15 -16
  242. data/lib/google/cloud/compute/v1/region_ssl_policies/rest.rb +18 -0
  243. data/lib/google/cloud/compute/v1/region_ssl_policies.rb +2 -2
  244. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +95 -72
  245. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +13 -14
  246. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest.rb +18 -0
  247. data/lib/google/cloud/compute/v1/region_target_http_proxies.rb +2 -2
  248. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +113 -94
  249. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +17 -18
  250. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest.rb +18 -0
  251. data/lib/google/cloud/compute/v1/region_target_https_proxies.rb +2 -2
  252. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +86 -61
  253. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb +11 -12
  254. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest.rb +18 -0
  255. data/lib/google/cloud/compute/v1/region_target_tcp_proxies.rb +2 -2
  256. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +113 -94
  257. data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +17 -18
  258. data/lib/google/cloud/compute/v1/region_url_maps/rest.rb +18 -0
  259. data/lib/google/cloud/compute/v1/region_url_maps.rb +2 -2
  260. data/lib/google/cloud/compute/v1/regions/rest/client.rb +67 -39
  261. data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +7 -8
  262. data/lib/google/cloud/compute/v1/regions/rest.rb +18 -0
  263. data/lib/google/cloud/compute/v1/regions.rb +2 -2
  264. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +140 -127
  265. data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +23 -24
  266. data/lib/google/cloud/compute/v1/reservations/rest.rb +18 -0
  267. data/lib/google/cloud/compute/v1/reservations.rb +2 -2
  268. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +122 -105
  269. data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +19 -20
  270. data/lib/google/cloud/compute/v1/resource_policies/rest.rb +18 -0
  271. data/lib/google/cloud/compute/v1/resource_policies.rb +2 -2
  272. data/lib/google/cloud/compute/v1/rest.rb +124 -0
  273. data/lib/google/cloud/compute/v1/routers/rest/client.rb +140 -127
  274. data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +23 -24
  275. data/lib/google/cloud/compute/v1/routers/rest.rb +18 -0
  276. data/lib/google/cloud/compute/v1/routers.rb +2 -2
  277. data/lib/google/cloud/compute/v1/routes/rest/client.rb +86 -61
  278. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +11 -12
  279. data/lib/google/cloud/compute/v1/routes/rest.rb +18 -0
  280. data/lib/google/cloud/compute/v1/routes.rb +2 -2
  281. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +158 -149
  282. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +27 -28
  283. data/lib/google/cloud/compute/v1/security_policies/rest.rb +18 -0
  284. data/lib/google/cloud/compute/v1/security_policies.rb +2 -2
  285. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +131 -116
  286. data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +21 -22
  287. data/lib/google/cloud/compute/v1/service_attachments/rest.rb +18 -0
  288. data/lib/google/cloud/compute/v1/service_attachments.rb +2 -2
  289. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +122 -105
  290. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +19 -20
  291. data/lib/google/cloud/compute/v1/snapshots/rest.rb +18 -0
  292. data/lib/google/cloud/compute/v1/snapshots.rb +2 -2
  293. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +95 -72
  294. data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +13 -14
  295. data/lib/google/cloud/compute/v1/ssl_certificates/rest.rb +18 -0
  296. data/lib/google/cloud/compute/v1/ssl_certificates.rb +2 -2
  297. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +113 -94
  298. data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +17 -18
  299. data/lib/google/cloud/compute/v1/ssl_policies/rest.rb +18 -0
  300. data/lib/google/cloud/compute/v1/ssl_policies.rb +2 -2
  301. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +158 -149
  302. data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +27 -28
  303. data/lib/google/cloud/compute/v1/subnetworks/rest.rb +18 -0
  304. data/lib/google/cloud/compute/v1/subnetworks.rb +2 -2
  305. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +95 -72
  306. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +13 -14
  307. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest.rb +18 -0
  308. data/lib/google/cloud/compute/v1/target_grpc_proxies.rb +2 -2
  309. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +113 -94
  310. data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +17 -18
  311. data/lib/google/cloud/compute/v1/target_http_proxies/rest.rb +18 -0
  312. data/lib/google/cloud/compute/v1/target_http_proxies.rb +2 -2
  313. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +149 -138
  314. data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +25 -26
  315. data/lib/google/cloud/compute/v1/target_https_proxies/rest.rb +18 -0
  316. data/lib/google/cloud/compute/v1/target_https_proxies.rb +2 -2
  317. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +95 -72
  318. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +13 -14
  319. data/lib/google/cloud/compute/v1/target_instances/rest.rb +18 -0
  320. data/lib/google/cloud/compute/v1/target_instances.rb +2 -2
  321. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +149 -138
  322. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +25 -26
  323. data/lib/google/cloud/compute/v1/target_pools/rest.rb +18 -0
  324. data/lib/google/cloud/compute/v1/target_pools.rb +2 -2
  325. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +131 -116
  326. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +21 -22
  327. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest.rb +18 -0
  328. data/lib/google/cloud/compute/v1/target_ssl_proxies.rb +2 -2
  329. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +191 -83
  330. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +72 -15
  331. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest.rb +18 -0
  332. data/lib/google/cloud/compute/v1/target_tcp_proxies.rb +2 -2
  333. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +104 -83
  334. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +15 -16
  335. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest.rb +18 -0
  336. data/lib/google/cloud/compute/v1/target_vpn_gateways.rb +2 -2
  337. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +131 -116
  338. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +21 -22
  339. data/lib/google/cloud/compute/v1/url_maps/rest.rb +18 -0
  340. data/lib/google/cloud/compute/v1/url_maps.rb +2 -2
  341. data/lib/google/cloud/compute/v1/version.rb +1 -1
  342. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +122 -105
  343. data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +19 -20
  344. data/lib/google/cloud/compute/v1/vpn_gateways/rest.rb +18 -0
  345. data/lib/google/cloud/compute/v1/vpn_gateways.rb +2 -2
  346. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +104 -83
  347. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +15 -16
  348. data/lib/google/cloud/compute/v1/vpn_tunnels/rest.rb +18 -0
  349. data/lib/google/cloud/compute/v1/vpn_tunnels.rb +2 -2
  350. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +85 -61
  351. data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +11 -12
  352. data/lib/google/cloud/compute/v1/zone_operations/rest.rb +18 -0
  353. data/lib/google/cloud/compute/v1/zone_operations.rb +2 -2
  354. data/lib/google/cloud/compute/v1/zones/rest/client.rb +67 -39
  355. data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +7 -8
  356. data/lib/google/cloud/compute/v1/zones/rest.rb +18 -0
  357. data/lib/google/cloud/compute/v1/zones.rb +2 -2
  358. data/lib/google/cloud/compute/v1.rb +3 -2
  359. data/proto_docs/google/api/client.rb +318 -0
  360. data/proto_docs/google/api/launch_stage.rb +71 -0
  361. data/proto_docs/google/cloud/compute/v1/compute.rb +564 -32
  362. data/proto_docs/google/protobuf/duration.rb +98 -0
  363. metadata +14 -5
@@ -147,13 +147,22 @@ module Google
147
147
 
148
148
  # Create credentials
149
149
  credentials = @config.credentials
150
- credentials ||= Credentials.default scope: @config.scope
150
+ # Use self-signed JWT if the endpoint is unchanged from default,
151
+ # but only if the default endpoint does not have a region prefix.
152
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
153
+ !@config.endpoint.split(".").first.include?("-")
154
+ credentials ||= Credentials.default scope: @config.scope,
155
+ enable_self_signed_jwt: enable_self_signed_jwt
151
156
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
152
157
  credentials = Credentials.new credentials, scope: @config.scope
153
158
  end
154
159
 
160
+ @quota_project_id = @config.quota_project
161
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
162
+
155
163
  @region_operations = ::Google::Cloud::Compute::V1::RegionOperations::Rest::Client.new do |config|
156
164
  config.credentials = credentials
165
+ config.quota_project = @quota_project_id
157
166
  config.endpoint = @config.endpoint
158
167
  end
159
168
 
@@ -181,8 +190,6 @@ module Google
181
190
  # parameters, or to keep all the default parameter values, pass an empty Hash.
182
191
  # @param options [::Gapic::CallOptions, ::Hash]
183
192
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
184
- # Note: currently retry functionality is not implemented. While it is possible
185
- # to set it using ::Gapic::CallOptions, it will not be applied
186
193
  #
187
194
  # @overload add_health_check(project: nil, region: nil, request_id: nil, target_pool: nil, target_pools_add_health_check_request_resource: nil)
188
195
  # Pass arguments to `add_health_check` via keyword arguments. Note that at
@@ -217,17 +224,21 @@ module Google
217
224
  # Customize the options with defaults
218
225
  call_metadata = @config.rpcs.add_health_check.metadata.to_h
219
226
 
220
- # Set x-goog-api-client header
227
+ # Set x-goog-api-client and x-goog-user-project headers
221
228
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
222
229
  lib_name: @config.lib_name, lib_version: @config.lib_version,
223
230
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
224
231
  transports_version_send: [:rest]
225
232
 
233
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
234
+
226
235
  options.apply_defaults timeout: @config.rpcs.add_health_check.timeout,
227
- metadata: call_metadata
236
+ metadata: call_metadata,
237
+ retry_policy: @config.rpcs.add_health_check.retry_policy
228
238
 
229
239
  options.apply_defaults timeout: @config.timeout,
230
- metadata: @config.metadata
240
+ metadata: @config.metadata,
241
+ retry_policy: @config.retry_policy
231
242
 
232
243
  @target_pools_stub.add_health_check request, options do |result, response|
233
244
  result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
@@ -242,12 +253,8 @@ module Google
242
253
  yield result, response if block_given?
243
254
  return result
244
255
  end
245
- rescue ::Faraday::Error => e
246
- begin
247
- raise ::Gapic::Rest::Error.wrap_faraday_error e
248
- rescue ::Gapic::Rest::Error => gapic_error
249
- raise ::Google::Cloud::Error.from_error gapic_error
250
- end
256
+ rescue ::Gapic::Rest::Error => e
257
+ raise ::Google::Cloud::Error.from_error(e)
251
258
  end
252
259
 
253
260
  ##
@@ -262,8 +269,6 @@ module Google
262
269
  # parameters, or to keep all the default parameter values, pass an empty Hash.
263
270
  # @param options [::Gapic::CallOptions, ::Hash]
264
271
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
265
- # Note: currently retry functionality is not implemented. While it is possible
266
- # to set it using ::Gapic::CallOptions, it will not be applied
267
272
  #
268
273
  # @overload add_instance(project: nil, region: nil, request_id: nil, target_pool: nil, target_pools_add_instance_request_resource: nil)
269
274
  # Pass arguments to `add_instance` via keyword arguments. Note that at
@@ -298,17 +303,21 @@ module Google
298
303
  # Customize the options with defaults
299
304
  call_metadata = @config.rpcs.add_instance.metadata.to_h
300
305
 
301
- # Set x-goog-api-client header
306
+ # Set x-goog-api-client and x-goog-user-project headers
302
307
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
303
308
  lib_name: @config.lib_name, lib_version: @config.lib_version,
304
309
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
305
310
  transports_version_send: [:rest]
306
311
 
312
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
313
+
307
314
  options.apply_defaults timeout: @config.rpcs.add_instance.timeout,
308
- metadata: call_metadata
315
+ metadata: call_metadata,
316
+ retry_policy: @config.rpcs.add_instance.retry_policy
309
317
 
310
318
  options.apply_defaults timeout: @config.timeout,
311
- metadata: @config.metadata
319
+ metadata: @config.metadata,
320
+ retry_policy: @config.retry_policy
312
321
 
313
322
  @target_pools_stub.add_instance request, options do |result, response|
314
323
  result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
@@ -323,12 +332,8 @@ module Google
323
332
  yield result, response if block_given?
324
333
  return result
325
334
  end
326
- rescue ::Faraday::Error => e
327
- begin
328
- raise ::Gapic::Rest::Error.wrap_faraday_error e
329
- rescue ::Gapic::Rest::Error => gapic_error
330
- raise ::Google::Cloud::Error.from_error gapic_error
331
- end
335
+ rescue ::Gapic::Rest::Error => e
336
+ raise ::Google::Cloud::Error.from_error(e)
332
337
  end
333
338
 
334
339
  ##
@@ -343,8 +348,6 @@ module Google
343
348
  # parameters, or to keep all the default parameter values, pass an empty Hash.
344
349
  # @param options [::Gapic::CallOptions, ::Hash]
345
350
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
346
- # Note: currently retry functionality is not implemented. While it is possible
347
- # to set it using ::Gapic::CallOptions, it will not be applied
348
351
  #
349
352
  # @overload aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
350
353
  # Pass arguments to `aggregated_list` via keyword arguments. Note that at
@@ -383,29 +386,29 @@ module Google
383
386
  # Customize the options with defaults
384
387
  call_metadata = @config.rpcs.aggregated_list.metadata.to_h
385
388
 
386
- # Set x-goog-api-client header
389
+ # Set x-goog-api-client and x-goog-user-project headers
387
390
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
388
391
  lib_name: @config.lib_name, lib_version: @config.lib_version,
389
392
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
390
393
  transports_version_send: [:rest]
391
394
 
395
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
396
+
392
397
  options.apply_defaults timeout: @config.rpcs.aggregated_list.timeout,
393
- metadata: call_metadata
398
+ metadata: call_metadata,
399
+ retry_policy: @config.rpcs.aggregated_list.retry_policy
394
400
 
395
401
  options.apply_defaults timeout: @config.timeout,
396
- metadata: @config.metadata
402
+ metadata: @config.metadata,
403
+ retry_policy: @config.retry_policy
397
404
 
398
405
  @target_pools_stub.aggregated_list request, options do |result, response|
399
406
  result = ::Gapic::Rest::PagedEnumerable.new @target_pools_stub, :aggregated_list, "items", request, result, options
400
407
  yield result, response if block_given?
401
408
  return result
402
409
  end
403
- rescue ::Faraday::Error => e
404
- begin
405
- raise ::Gapic::Rest::Error.wrap_faraday_error e
406
- rescue ::Gapic::Rest::Error => gapic_error
407
- raise ::Google::Cloud::Error.from_error gapic_error
408
- end
410
+ rescue ::Gapic::Rest::Error => e
411
+ raise ::Google::Cloud::Error.from_error(e)
409
412
  end
410
413
 
411
414
  ##
@@ -420,8 +423,6 @@ module Google
420
423
  # parameters, or to keep all the default parameter values, pass an empty Hash.
421
424
  # @param options [::Gapic::CallOptions, ::Hash]
422
425
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
423
- # Note: currently retry functionality is not implemented. While it is possible
424
- # to set it using ::Gapic::CallOptions, it will not be applied
425
426
  #
426
427
  # @overload delete(project: nil, region: nil, request_id: nil, target_pool: nil)
427
428
  # Pass arguments to `delete` via keyword arguments. Note that at
@@ -454,17 +455,21 @@ module Google
454
455
  # Customize the options with defaults
455
456
  call_metadata = @config.rpcs.delete.metadata.to_h
456
457
 
457
- # Set x-goog-api-client header
458
+ # Set x-goog-api-client and x-goog-user-project headers
458
459
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
459
460
  lib_name: @config.lib_name, lib_version: @config.lib_version,
460
461
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
461
462
  transports_version_send: [:rest]
462
463
 
464
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
465
+
463
466
  options.apply_defaults timeout: @config.rpcs.delete.timeout,
464
- metadata: call_metadata
467
+ metadata: call_metadata,
468
+ retry_policy: @config.rpcs.delete.retry_policy
465
469
 
466
470
  options.apply_defaults timeout: @config.timeout,
467
- metadata: @config.metadata
471
+ metadata: @config.metadata,
472
+ retry_policy: @config.retry_policy
468
473
 
469
474
  @target_pools_stub.delete request, options do |result, response|
470
475
  result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
@@ -479,12 +484,8 @@ module Google
479
484
  yield result, response if block_given?
480
485
  return result
481
486
  end
482
- rescue ::Faraday::Error => e
483
- begin
484
- raise ::Gapic::Rest::Error.wrap_faraday_error e
485
- rescue ::Gapic::Rest::Error => gapic_error
486
- raise ::Google::Cloud::Error.from_error gapic_error
487
- end
487
+ rescue ::Gapic::Rest::Error => e
488
+ raise ::Google::Cloud::Error.from_error(e)
488
489
  end
489
490
 
490
491
  ##
@@ -499,8 +500,6 @@ module Google
499
500
  # parameters, or to keep all the default parameter values, pass an empty Hash.
500
501
  # @param options [::Gapic::CallOptions, ::Hash]
501
502
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
502
- # Note: currently retry functionality is not implemented. While it is possible
503
- # to set it using ::Gapic::CallOptions, it will not be applied
504
503
  #
505
504
  # @overload get(project: nil, region: nil, target_pool: nil)
506
505
  # Pass arguments to `get` via keyword arguments. Note that at
@@ -531,28 +530,28 @@ module Google
531
530
  # Customize the options with defaults
532
531
  call_metadata = @config.rpcs.get.metadata.to_h
533
532
 
534
- # Set x-goog-api-client header
533
+ # Set x-goog-api-client and x-goog-user-project headers
535
534
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
536
535
  lib_name: @config.lib_name, lib_version: @config.lib_version,
537
536
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
538
537
  transports_version_send: [:rest]
539
538
 
539
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
540
+
540
541
  options.apply_defaults timeout: @config.rpcs.get.timeout,
541
- metadata: call_metadata
542
+ metadata: call_metadata,
543
+ retry_policy: @config.rpcs.get.retry_policy
542
544
 
543
545
  options.apply_defaults timeout: @config.timeout,
544
- metadata: @config.metadata
546
+ metadata: @config.metadata,
547
+ retry_policy: @config.retry_policy
545
548
 
546
549
  @target_pools_stub.get request, options do |result, response|
547
550
  yield result, response if block_given?
548
551
  return result
549
552
  end
550
- rescue ::Faraday::Error => e
551
- begin
552
- raise ::Gapic::Rest::Error.wrap_faraday_error e
553
- rescue ::Gapic::Rest::Error => gapic_error
554
- raise ::Google::Cloud::Error.from_error gapic_error
555
- end
553
+ rescue ::Gapic::Rest::Error => e
554
+ raise ::Google::Cloud::Error.from_error(e)
556
555
  end
557
556
 
558
557
  ##
@@ -567,8 +566,6 @@ module Google
567
566
  # parameters, or to keep all the default parameter values, pass an empty Hash.
568
567
  # @param options [::Gapic::CallOptions, ::Hash]
569
568
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
570
- # Note: currently retry functionality is not implemented. While it is possible
571
- # to set it using ::Gapic::CallOptions, it will not be applied
572
569
  #
573
570
  # @overload get_health(instance_reference_resource: nil, project: nil, region: nil, target_pool: nil)
574
571
  # Pass arguments to `get_health` via keyword arguments. Note that at
@@ -601,28 +598,28 @@ module Google
601
598
  # Customize the options with defaults
602
599
  call_metadata = @config.rpcs.get_health.metadata.to_h
603
600
 
604
- # Set x-goog-api-client header
601
+ # Set x-goog-api-client and x-goog-user-project headers
605
602
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
606
603
  lib_name: @config.lib_name, lib_version: @config.lib_version,
607
604
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
608
605
  transports_version_send: [:rest]
609
606
 
607
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
608
+
610
609
  options.apply_defaults timeout: @config.rpcs.get_health.timeout,
611
- metadata: call_metadata
610
+ metadata: call_metadata,
611
+ retry_policy: @config.rpcs.get_health.retry_policy
612
612
 
613
613
  options.apply_defaults timeout: @config.timeout,
614
- metadata: @config.metadata
614
+ metadata: @config.metadata,
615
+ retry_policy: @config.retry_policy
615
616
 
616
617
  @target_pools_stub.get_health request, options do |result, response|
617
618
  yield result, response if block_given?
618
619
  return result
619
620
  end
620
- rescue ::Faraday::Error => e
621
- begin
622
- raise ::Gapic::Rest::Error.wrap_faraday_error e
623
- rescue ::Gapic::Rest::Error => gapic_error
624
- raise ::Google::Cloud::Error.from_error gapic_error
625
- end
621
+ rescue ::Gapic::Rest::Error => e
622
+ raise ::Google::Cloud::Error.from_error(e)
626
623
  end
627
624
 
628
625
  ##
@@ -637,8 +634,6 @@ module Google
637
634
  # parameters, or to keep all the default parameter values, pass an empty Hash.
638
635
  # @param options [::Gapic::CallOptions, ::Hash]
639
636
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
640
- # Note: currently retry functionality is not implemented. While it is possible
641
- # to set it using ::Gapic::CallOptions, it will not be applied
642
637
  #
643
638
  # @overload insert(project: nil, region: nil, request_id: nil, target_pool_resource: nil)
644
639
  # Pass arguments to `insert` via keyword arguments. Note that at
@@ -671,17 +666,21 @@ module Google
671
666
  # Customize the options with defaults
672
667
  call_metadata = @config.rpcs.insert.metadata.to_h
673
668
 
674
- # Set x-goog-api-client header
669
+ # Set x-goog-api-client and x-goog-user-project headers
675
670
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
676
671
  lib_name: @config.lib_name, lib_version: @config.lib_version,
677
672
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
678
673
  transports_version_send: [:rest]
679
674
 
675
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
676
+
680
677
  options.apply_defaults timeout: @config.rpcs.insert.timeout,
681
- metadata: call_metadata
678
+ metadata: call_metadata,
679
+ retry_policy: @config.rpcs.insert.retry_policy
682
680
 
683
681
  options.apply_defaults timeout: @config.timeout,
684
- metadata: @config.metadata
682
+ metadata: @config.metadata,
683
+ retry_policy: @config.retry_policy
685
684
 
686
685
  @target_pools_stub.insert request, options do |result, response|
687
686
  result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
@@ -696,12 +695,8 @@ module Google
696
695
  yield result, response if block_given?
697
696
  return result
698
697
  end
699
- rescue ::Faraday::Error => e
700
- begin
701
- raise ::Gapic::Rest::Error.wrap_faraday_error e
702
- rescue ::Gapic::Rest::Error => gapic_error
703
- raise ::Google::Cloud::Error.from_error gapic_error
704
- end
698
+ rescue ::Gapic::Rest::Error => e
699
+ raise ::Google::Cloud::Error.from_error(e)
705
700
  end
706
701
 
707
702
  ##
@@ -716,8 +711,6 @@ module Google
716
711
  # parameters, or to keep all the default parameter values, pass an empty Hash.
717
712
  # @param options [::Gapic::CallOptions, ::Hash]
718
713
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
719
- # Note: currently retry functionality is not implemented. While it is possible
720
- # to set it using ::Gapic::CallOptions, it will not be applied
721
714
  #
722
715
  # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil)
723
716
  # Pass arguments to `list` via keyword arguments. Note that at
@@ -756,29 +749,29 @@ module Google
756
749
  # Customize the options with defaults
757
750
  call_metadata = @config.rpcs.list.metadata.to_h
758
751
 
759
- # Set x-goog-api-client header
752
+ # Set x-goog-api-client and x-goog-user-project headers
760
753
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
761
754
  lib_name: @config.lib_name, lib_version: @config.lib_version,
762
755
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
763
756
  transports_version_send: [:rest]
764
757
 
758
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
759
+
765
760
  options.apply_defaults timeout: @config.rpcs.list.timeout,
766
- metadata: call_metadata
761
+ metadata: call_metadata,
762
+ retry_policy: @config.rpcs.list.retry_policy
767
763
 
768
764
  options.apply_defaults timeout: @config.timeout,
769
- metadata: @config.metadata
765
+ metadata: @config.metadata,
766
+ retry_policy: @config.retry_policy
770
767
 
771
768
  @target_pools_stub.list request, options do |result, response|
772
769
  result = ::Gapic::Rest::PagedEnumerable.new @target_pools_stub, :list, "items", request, result, options
773
770
  yield result, response if block_given?
774
771
  return result
775
772
  end
776
- rescue ::Faraday::Error => e
777
- begin
778
- raise ::Gapic::Rest::Error.wrap_faraday_error e
779
- rescue ::Gapic::Rest::Error => gapic_error
780
- raise ::Google::Cloud::Error.from_error gapic_error
781
- end
773
+ rescue ::Gapic::Rest::Error => e
774
+ raise ::Google::Cloud::Error.from_error(e)
782
775
  end
783
776
 
784
777
  ##
@@ -793,8 +786,6 @@ module Google
793
786
  # parameters, or to keep all the default parameter values, pass an empty Hash.
794
787
  # @param options [::Gapic::CallOptions, ::Hash]
795
788
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
796
- # Note: currently retry functionality is not implemented. While it is possible
797
- # to set it using ::Gapic::CallOptions, it will not be applied
798
789
  #
799
790
  # @overload remove_health_check(project: nil, region: nil, request_id: nil, target_pool: nil, target_pools_remove_health_check_request_resource: nil)
800
791
  # Pass arguments to `remove_health_check` via keyword arguments. Note that at
@@ -829,17 +820,21 @@ module Google
829
820
  # Customize the options with defaults
830
821
  call_metadata = @config.rpcs.remove_health_check.metadata.to_h
831
822
 
832
- # Set x-goog-api-client header
823
+ # Set x-goog-api-client and x-goog-user-project headers
833
824
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
834
825
  lib_name: @config.lib_name, lib_version: @config.lib_version,
835
826
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
836
827
  transports_version_send: [:rest]
837
828
 
829
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
830
+
838
831
  options.apply_defaults timeout: @config.rpcs.remove_health_check.timeout,
839
- metadata: call_metadata
832
+ metadata: call_metadata,
833
+ retry_policy: @config.rpcs.remove_health_check.retry_policy
840
834
 
841
835
  options.apply_defaults timeout: @config.timeout,
842
- metadata: @config.metadata
836
+ metadata: @config.metadata,
837
+ retry_policy: @config.retry_policy
843
838
 
844
839
  @target_pools_stub.remove_health_check request, options do |result, response|
845
840
  result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
@@ -854,12 +849,8 @@ module Google
854
849
  yield result, response if block_given?
855
850
  return result
856
851
  end
857
- rescue ::Faraday::Error => e
858
- begin
859
- raise ::Gapic::Rest::Error.wrap_faraday_error e
860
- rescue ::Gapic::Rest::Error => gapic_error
861
- raise ::Google::Cloud::Error.from_error gapic_error
862
- end
852
+ rescue ::Gapic::Rest::Error => e
853
+ raise ::Google::Cloud::Error.from_error(e)
863
854
  end
864
855
 
865
856
  ##
@@ -874,8 +865,6 @@ module Google
874
865
  # parameters, or to keep all the default parameter values, pass an empty Hash.
875
866
  # @param options [::Gapic::CallOptions, ::Hash]
876
867
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
877
- # Note: currently retry functionality is not implemented. While it is possible
878
- # to set it using ::Gapic::CallOptions, it will not be applied
879
868
  #
880
869
  # @overload remove_instance(project: nil, region: nil, request_id: nil, target_pool: nil, target_pools_remove_instance_request_resource: nil)
881
870
  # Pass arguments to `remove_instance` via keyword arguments. Note that at
@@ -910,17 +899,21 @@ module Google
910
899
  # Customize the options with defaults
911
900
  call_metadata = @config.rpcs.remove_instance.metadata.to_h
912
901
 
913
- # Set x-goog-api-client header
902
+ # Set x-goog-api-client and x-goog-user-project headers
914
903
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
915
904
  lib_name: @config.lib_name, lib_version: @config.lib_version,
916
905
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
917
906
  transports_version_send: [:rest]
918
907
 
908
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
909
+
919
910
  options.apply_defaults timeout: @config.rpcs.remove_instance.timeout,
920
- metadata: call_metadata
911
+ metadata: call_metadata,
912
+ retry_policy: @config.rpcs.remove_instance.retry_policy
921
913
 
922
914
  options.apply_defaults timeout: @config.timeout,
923
- metadata: @config.metadata
915
+ metadata: @config.metadata,
916
+ retry_policy: @config.retry_policy
924
917
 
925
918
  @target_pools_stub.remove_instance request, options do |result, response|
926
919
  result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
@@ -935,12 +928,8 @@ module Google
935
928
  yield result, response if block_given?
936
929
  return result
937
930
  end
938
- rescue ::Faraday::Error => e
939
- begin
940
- raise ::Gapic::Rest::Error.wrap_faraday_error e
941
- rescue ::Gapic::Rest::Error => gapic_error
942
- raise ::Google::Cloud::Error.from_error gapic_error
943
- end
931
+ rescue ::Gapic::Rest::Error => e
932
+ raise ::Google::Cloud::Error.from_error(e)
944
933
  end
945
934
 
946
935
  ##
@@ -955,8 +944,6 @@ module Google
955
944
  # parameters, or to keep all the default parameter values, pass an empty Hash.
956
945
  # @param options [::Gapic::CallOptions, ::Hash]
957
946
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
958
- # Note: currently retry functionality is not implemented. While it is possible
959
- # to set it using ::Gapic::CallOptions, it will not be applied
960
947
  #
961
948
  # @overload set_backup(failover_ratio: nil, project: nil, region: nil, request_id: nil, target_pool: nil, target_reference_resource: nil)
962
949
  # Pass arguments to `set_backup` via keyword arguments. Note that at
@@ -993,17 +980,21 @@ module Google
993
980
  # Customize the options with defaults
994
981
  call_metadata = @config.rpcs.set_backup.metadata.to_h
995
982
 
996
- # Set x-goog-api-client header
983
+ # Set x-goog-api-client and x-goog-user-project headers
997
984
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
998
985
  lib_name: @config.lib_name, lib_version: @config.lib_version,
999
986
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1000
987
  transports_version_send: [:rest]
1001
988
 
989
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
990
+
1002
991
  options.apply_defaults timeout: @config.rpcs.set_backup.timeout,
1003
- metadata: call_metadata
992
+ metadata: call_metadata,
993
+ retry_policy: @config.rpcs.set_backup.retry_policy
1004
994
 
1005
995
  options.apply_defaults timeout: @config.timeout,
1006
- metadata: @config.metadata
996
+ metadata: @config.metadata,
997
+ retry_policy: @config.retry_policy
1007
998
 
1008
999
  @target_pools_stub.set_backup request, options do |result, response|
1009
1000
  result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
@@ -1018,36 +1009,38 @@ module Google
1018
1009
  yield result, response if block_given?
1019
1010
  return result
1020
1011
  end
1021
- rescue ::Faraday::Error => e
1022
- begin
1023
- raise ::Gapic::Rest::Error.wrap_faraday_error e
1024
- rescue ::Gapic::Rest::Error => gapic_error
1025
- raise ::Google::Cloud::Error.from_error gapic_error
1026
- end
1012
+ rescue ::Gapic::Rest::Error => e
1013
+ raise ::Google::Cloud::Error.from_error(e)
1027
1014
  end
1028
1015
 
1029
1016
  ##
1030
1017
  # Configuration class for the TargetPools REST API.
1031
1018
  #
1032
1019
  # This class represents the configuration for TargetPools REST,
1033
- # providing control over credentials, timeouts, retry behavior, logging.
1020
+ # providing control over timeouts, retry behavior, logging, transport
1021
+ # parameters, and other low-level controls. Certain parameters can also be
1022
+ # applied individually to specific RPCs. See
1023
+ # {::Google::Cloud::Compute::V1::TargetPools::Rest::Client::Configuration::Rpcs}
1024
+ # for a list of RPCs that can be configured independently.
1034
1025
  #
1035
1026
  # Configuration can be applied globally to all clients, or to a single client
1036
1027
  # on construction.
1037
1028
  #
1038
- # # Examples
1039
- #
1040
- # To modify the global config, setting the timeout for all calls to 10 seconds:
1041
- #
1042
- # ::Google::Cloud::Compute::V1::TargetPools::Client.configure do |config|
1043
- # config.timeout = 10.0
1044
- # end
1029
+ # @example
1045
1030
  #
1046
- # To apply the above configuration only to a new client:
1031
+ # # Modify the global config, setting the timeout for
1032
+ # # add_health_check to 20 seconds,
1033
+ # # and all remaining timeouts to 10 seconds.
1034
+ # ::Google::Cloud::Compute::V1::TargetPools::Rest::Client.configure do |config|
1035
+ # config.timeout = 10.0
1036
+ # config.rpcs.add_health_check.timeout = 20.0
1037
+ # end
1047
1038
  #
1048
- # client = ::Google::Cloud::Compute::V1::TargetPools::Client.new do |config|
1049
- # config.timeout = 10.0
1050
- # end
1039
+ # # Apply the above configuration only to a new client.
1040
+ # client = ::Google::Cloud::Compute::V1::TargetPools::Rest::Client.new do |config|
1041
+ # config.timeout = 10.0
1042
+ # config.rpcs.add_health_check.timeout = 20.0
1043
+ # end
1051
1044
  #
1052
1045
  # @!attribute [rw] endpoint
1053
1046
  # The hostname or hostname:port of the service endpoint.
@@ -1076,8 +1069,19 @@ module Google
1076
1069
  # The call timeout in seconds.
1077
1070
  # @return [::Numeric]
1078
1071
  # @!attribute [rw] metadata
1079
- # Additional REST headers to be sent with the call.
1072
+ # Additional headers to be sent with the call.
1080
1073
  # @return [::Hash{::Symbol=>::String}]
1074
+ # @!attribute [rw] retry_policy
1075
+ # The retry policy. The value is a hash with the following keys:
1076
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1077
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1078
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1079
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1080
+ # trigger a retry.
1081
+ # @return [::Hash]
1082
+ # @!attribute [rw] quota_project
1083
+ # A separate project against which to charge quota.
1084
+ # @return [::String]
1081
1085
  #
1082
1086
  class Configuration
1083
1087
  extend ::Gapic::Config
@@ -1092,6 +1096,8 @@ module Google
1092
1096
  config_attr :lib_version, nil, ::String, nil
1093
1097
  config_attr :timeout, nil, ::Numeric, nil
1094
1098
  config_attr :metadata, nil, ::Hash, nil
1099
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1100
+ config_attr :quota_project, nil, ::String, nil
1095
1101
 
1096
1102
  # @private
1097
1103
  def initialize parent_config = nil
@@ -1120,9 +1126,14 @@ module Google
1120
1126
  # the following configuration fields:
1121
1127
  #
1122
1128
  # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1123
- #
1124
- # there is one other field (`retry_policy`) that can be set
1125
- # but is currently not supported for REST Gapic libraries.
1129
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1130
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1131
+ # include the following keys:
1132
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1133
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1134
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1135
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1136
+ # trigger a retry.
1126
1137
  #
1127
1138
  class Rpcs
1128
1139
  ##