google-cloud-compute-v1 1.8.0 → 1.9.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 +194 -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 +536 -28
  362. data/proto_docs/google/protobuf/duration.rb +98 -0
  363. metadata +14 -5
@@ -130,13 +130,22 @@ module Google
130
130
 
131
131
  # Create credentials
132
132
  credentials = @config.credentials
133
- credentials ||= Credentials.default scope: @config.scope
133
+ # Use self-signed JWT if the endpoint is unchanged from default,
134
+ # but only if the default endpoint does not have a region prefix.
135
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
136
+ !@config.endpoint.split(".").first.include?("-")
137
+ credentials ||= Credentials.default scope: @config.scope,
138
+ enable_self_signed_jwt: enable_self_signed_jwt
134
139
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
135
140
  credentials = Credentials.new credentials, scope: @config.scope
136
141
  end
137
142
 
143
+ @quota_project_id = @config.quota_project
144
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
145
+
138
146
  @region_operations = ::Google::Cloud::Compute::V1::RegionOperations::Rest::Client.new do |config|
139
147
  config.credentials = credentials
148
+ config.quota_project = @quota_project_id
140
149
  config.endpoint = @config.endpoint
141
150
  end
142
151
 
@@ -164,8 +173,6 @@ module Google
164
173
  # parameters, or to keep all the default parameter values, pass an empty Hash.
165
174
  # @param options [::Gapic::CallOptions, ::Hash]
166
175
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
167
- # Note: currently retry functionality is not implemented. While it is possible
168
- # to set it using ::Gapic::CallOptions, it will not be applied
169
176
  #
170
177
  # @overload get(instance_group: nil, project: nil, region: nil)
171
178
  # Pass arguments to `get` via keyword arguments. Note that at
@@ -196,28 +203,28 @@ module Google
196
203
  # Customize the options with defaults
197
204
  call_metadata = @config.rpcs.get.metadata.to_h
198
205
 
199
- # Set x-goog-api-client header
206
+ # Set x-goog-api-client and x-goog-user-project headers
200
207
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
201
208
  lib_name: @config.lib_name, lib_version: @config.lib_version,
202
209
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
203
210
  transports_version_send: [:rest]
204
211
 
212
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
213
+
205
214
  options.apply_defaults timeout: @config.rpcs.get.timeout,
206
- metadata: call_metadata
215
+ metadata: call_metadata,
216
+ retry_policy: @config.rpcs.get.retry_policy
207
217
 
208
218
  options.apply_defaults timeout: @config.timeout,
209
- metadata: @config.metadata
219
+ metadata: @config.metadata,
220
+ retry_policy: @config.retry_policy
210
221
 
211
222
  @region_instance_groups_stub.get request, options do |result, response|
212
223
  yield result, response if block_given?
213
224
  return result
214
225
  end
215
- rescue ::Faraday::Error => e
216
- begin
217
- raise ::Gapic::Rest::Error.wrap_faraday_error e
218
- rescue ::Gapic::Rest::Error => gapic_error
219
- raise ::Google::Cloud::Error.from_error gapic_error
220
- end
226
+ rescue ::Gapic::Rest::Error => e
227
+ raise ::Google::Cloud::Error.from_error(e)
221
228
  end
222
229
 
223
230
  ##
@@ -232,8 +239,6 @@ module Google
232
239
  # parameters, or to keep all the default parameter values, pass an empty Hash.
233
240
  # @param options [::Gapic::CallOptions, ::Hash]
234
241
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
235
- # Note: currently retry functionality is not implemented. While it is possible
236
- # to set it using ::Gapic::CallOptions, it will not be applied
237
242
  #
238
243
  # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil)
239
244
  # Pass arguments to `list` via keyword arguments. Note that at
@@ -272,29 +277,29 @@ module Google
272
277
  # Customize the options with defaults
273
278
  call_metadata = @config.rpcs.list.metadata.to_h
274
279
 
275
- # Set x-goog-api-client header
280
+ # Set x-goog-api-client and x-goog-user-project headers
276
281
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
277
282
  lib_name: @config.lib_name, lib_version: @config.lib_version,
278
283
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
279
284
  transports_version_send: [:rest]
280
285
 
286
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
287
+
281
288
  options.apply_defaults timeout: @config.rpcs.list.timeout,
282
- metadata: call_metadata
289
+ metadata: call_metadata,
290
+ retry_policy: @config.rpcs.list.retry_policy
283
291
 
284
292
  options.apply_defaults timeout: @config.timeout,
285
- metadata: @config.metadata
293
+ metadata: @config.metadata,
294
+ retry_policy: @config.retry_policy
286
295
 
287
296
  @region_instance_groups_stub.list request, options do |result, response|
288
297
  result = ::Gapic::Rest::PagedEnumerable.new @region_instance_groups_stub, :list, "items", request, result, options
289
298
  yield result, response if block_given?
290
299
  return result
291
300
  end
292
- rescue ::Faraday::Error => e
293
- begin
294
- raise ::Gapic::Rest::Error.wrap_faraday_error e
295
- rescue ::Gapic::Rest::Error => gapic_error
296
- raise ::Google::Cloud::Error.from_error gapic_error
297
- end
301
+ rescue ::Gapic::Rest::Error => e
302
+ raise ::Google::Cloud::Error.from_error(e)
298
303
  end
299
304
 
300
305
  ##
@@ -309,8 +314,6 @@ module Google
309
314
  # parameters, or to keep all the default parameter values, pass an empty Hash.
310
315
  # @param options [::Gapic::CallOptions, ::Hash]
311
316
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
312
- # Note: currently retry functionality is not implemented. While it is possible
313
- # to set it using ::Gapic::CallOptions, it will not be applied
314
317
  #
315
318
  # @overload list_instances(filter: nil, instance_group: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, region_instance_groups_list_instances_request_resource: nil, return_partial_success: nil)
316
319
  # Pass arguments to `list_instances` via keyword arguments. Note that at
@@ -353,29 +356,29 @@ module Google
353
356
  # Customize the options with defaults
354
357
  call_metadata = @config.rpcs.list_instances.metadata.to_h
355
358
 
356
- # Set x-goog-api-client header
359
+ # Set x-goog-api-client and x-goog-user-project headers
357
360
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
358
361
  lib_name: @config.lib_name, lib_version: @config.lib_version,
359
362
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
360
363
  transports_version_send: [:rest]
361
364
 
365
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
366
+
362
367
  options.apply_defaults timeout: @config.rpcs.list_instances.timeout,
363
- metadata: call_metadata
368
+ metadata: call_metadata,
369
+ retry_policy: @config.rpcs.list_instances.retry_policy
364
370
 
365
371
  options.apply_defaults timeout: @config.timeout,
366
- metadata: @config.metadata
372
+ metadata: @config.metadata,
373
+ retry_policy: @config.retry_policy
367
374
 
368
375
  @region_instance_groups_stub.list_instances request, options do |result, response|
369
376
  result = ::Gapic::Rest::PagedEnumerable.new @region_instance_groups_stub, :list_instances, "items", request, result, options
370
377
  yield result, response if block_given?
371
378
  return result
372
379
  end
373
- rescue ::Faraday::Error => e
374
- begin
375
- raise ::Gapic::Rest::Error.wrap_faraday_error e
376
- rescue ::Gapic::Rest::Error => gapic_error
377
- raise ::Google::Cloud::Error.from_error gapic_error
378
- end
380
+ rescue ::Gapic::Rest::Error => e
381
+ raise ::Google::Cloud::Error.from_error(e)
379
382
  end
380
383
 
381
384
  ##
@@ -390,8 +393,6 @@ module Google
390
393
  # parameters, or to keep all the default parameter values, pass an empty Hash.
391
394
  # @param options [::Gapic::CallOptions, ::Hash]
392
395
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
393
- # Note: currently retry functionality is not implemented. While it is possible
394
- # to set it using ::Gapic::CallOptions, it will not be applied
395
396
  #
396
397
  # @overload set_named_ports(instance_group: nil, project: nil, region: nil, region_instance_groups_set_named_ports_request_resource: nil, request_id: nil)
397
398
  # Pass arguments to `set_named_ports` via keyword arguments. Note that at
@@ -426,17 +427,21 @@ module Google
426
427
  # Customize the options with defaults
427
428
  call_metadata = @config.rpcs.set_named_ports.metadata.to_h
428
429
 
429
- # Set x-goog-api-client header
430
+ # Set x-goog-api-client and x-goog-user-project headers
430
431
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
431
432
  lib_name: @config.lib_name, lib_version: @config.lib_version,
432
433
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
433
434
  transports_version_send: [:rest]
434
435
 
436
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
437
+
435
438
  options.apply_defaults timeout: @config.rpcs.set_named_ports.timeout,
436
- metadata: call_metadata
439
+ metadata: call_metadata,
440
+ retry_policy: @config.rpcs.set_named_ports.retry_policy
437
441
 
438
442
  options.apply_defaults timeout: @config.timeout,
439
- metadata: @config.metadata
443
+ metadata: @config.metadata,
444
+ retry_policy: @config.retry_policy
440
445
 
441
446
  @region_instance_groups_stub.set_named_ports request, options do |result, response|
442
447
  result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
@@ -451,36 +456,38 @@ module Google
451
456
  yield result, response if block_given?
452
457
  return result
453
458
  end
454
- rescue ::Faraday::Error => e
455
- begin
456
- raise ::Gapic::Rest::Error.wrap_faraday_error e
457
- rescue ::Gapic::Rest::Error => gapic_error
458
- raise ::Google::Cloud::Error.from_error gapic_error
459
- end
459
+ rescue ::Gapic::Rest::Error => e
460
+ raise ::Google::Cloud::Error.from_error(e)
460
461
  end
461
462
 
462
463
  ##
463
464
  # Configuration class for the RegionInstanceGroups REST API.
464
465
  #
465
466
  # This class represents the configuration for RegionInstanceGroups REST,
466
- # providing control over credentials, timeouts, retry behavior, logging.
467
+ # providing control over timeouts, retry behavior, logging, transport
468
+ # parameters, and other low-level controls. Certain parameters can also be
469
+ # applied individually to specific RPCs. See
470
+ # {::Google::Cloud::Compute::V1::RegionInstanceGroups::Rest::Client::Configuration::Rpcs}
471
+ # for a list of RPCs that can be configured independently.
467
472
  #
468
473
  # Configuration can be applied globally to all clients, or to a single client
469
474
  # on construction.
470
475
  #
471
- # # Examples
472
- #
473
- # To modify the global config, setting the timeout for all calls to 10 seconds:
474
- #
475
- # ::Google::Cloud::Compute::V1::RegionInstanceGroups::Client.configure do |config|
476
- # config.timeout = 10.0
477
- # end
476
+ # @example
478
477
  #
479
- # To apply the above configuration only to a new client:
478
+ # # Modify the global config, setting the timeout for
479
+ # # get to 20 seconds,
480
+ # # and all remaining timeouts to 10 seconds.
481
+ # ::Google::Cloud::Compute::V1::RegionInstanceGroups::Rest::Client.configure do |config|
482
+ # config.timeout = 10.0
483
+ # config.rpcs.get.timeout = 20.0
484
+ # end
480
485
  #
481
- # client = ::Google::Cloud::Compute::V1::RegionInstanceGroups::Client.new do |config|
482
- # config.timeout = 10.0
483
- # end
486
+ # # Apply the above configuration only to a new client.
487
+ # client = ::Google::Cloud::Compute::V1::RegionInstanceGroups::Rest::Client.new do |config|
488
+ # config.timeout = 10.0
489
+ # config.rpcs.get.timeout = 20.0
490
+ # end
484
491
  #
485
492
  # @!attribute [rw] endpoint
486
493
  # The hostname or hostname:port of the service endpoint.
@@ -509,8 +516,19 @@ module Google
509
516
  # The call timeout in seconds.
510
517
  # @return [::Numeric]
511
518
  # @!attribute [rw] metadata
512
- # Additional REST headers to be sent with the call.
519
+ # Additional headers to be sent with the call.
513
520
  # @return [::Hash{::Symbol=>::String}]
521
+ # @!attribute [rw] retry_policy
522
+ # The retry policy. The value is a hash with the following keys:
523
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
524
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
525
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
526
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
527
+ # trigger a retry.
528
+ # @return [::Hash]
529
+ # @!attribute [rw] quota_project
530
+ # A separate project against which to charge quota.
531
+ # @return [::String]
514
532
  #
515
533
  class Configuration
516
534
  extend ::Gapic::Config
@@ -525,6 +543,8 @@ module Google
525
543
  config_attr :lib_version, nil, ::String, nil
526
544
  config_attr :timeout, nil, ::Numeric, nil
527
545
  config_attr :metadata, nil, ::Hash, nil
546
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
547
+ config_attr :quota_project, nil, ::String, nil
528
548
 
529
549
  # @private
530
550
  def initialize parent_config = nil
@@ -553,9 +573,14 @@ module Google
553
573
  # the following configuration fields:
554
574
  #
555
575
  # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
556
- #
557
- # there is one other field (`retry_policy`) that can be set
558
- # but is currently not supported for REST Gapic libraries.
576
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
577
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
578
+ # include the following keys:
579
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
580
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
581
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
582
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
583
+ # trigger a retry.
559
584
  #
560
585
  class Rpcs
561
586
  ##
@@ -35,7 +35,9 @@ 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, numeric_enums: false
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
39
+ numeric_enums: false,
40
+ raise_faraday_errors: false
39
41
  end
40
42
 
41
43
  ##
@@ -55,7 +57,7 @@ module Google
55
57
  def get request_pb, options = nil
56
58
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
57
59
 
58
- verb, uri, query_string_params, body = transcode_get_request request_pb
60
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_request request_pb
59
61
  query_string_params = if query_string_params.any?
60
62
  query_string_params.to_h { |p| p.split("=", 2) }
61
63
  else
@@ -92,7 +94,7 @@ module Google
92
94
  def list request_pb, options = nil
93
95
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
94
96
 
95
- verb, uri, query_string_params, body = transcode_list_request request_pb
97
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_request request_pb
96
98
  query_string_params = if query_string_params.any?
97
99
  query_string_params.to_h { |p| p.split("=", 2) }
98
100
  else
@@ -129,7 +131,7 @@ module Google
129
131
  def list_instances request_pb, options = nil
130
132
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
131
133
 
132
- verb, uri, query_string_params, body = transcode_list_instances_request request_pb
134
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_instances_request request_pb
133
135
  query_string_params = if query_string_params.any?
134
136
  query_string_params.to_h { |p| p.split("=", 2) }
135
137
  else
@@ -166,7 +168,7 @@ module Google
166
168
  def set_named_ports request_pb, options = nil
167
169
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
168
170
 
169
- verb, uri, query_string_params, body = transcode_set_named_ports_request request_pb
171
+ verb, uri, query_string_params, body = ServiceStub.transcode_set_named_ports_request request_pb
170
172
  query_string_params = if query_string_params.any?
171
173
  query_string_params.to_h { |p| p.split("=", 2) }
172
174
  else
@@ -186,9 +188,6 @@ module Google
186
188
  result
187
189
  end
188
190
 
189
-
190
- private
191
-
192
191
  ##
193
192
  # @private
194
193
  #
@@ -198,7 +197,7 @@ module Google
198
197
  # A request object representing the call parameters. Required.
199
198
  # @return [Array(String, [String, nil], Hash{String => String})]
200
199
  # Uri, Body, Query string parameters
201
- def transcode_get_request request_pb
200
+ def self.transcode_get_request request_pb
202
201
  transcoder = Gapic::Rest::GrpcTranscoder.new
203
202
  .with_bindings(
204
203
  uri_method: :get,
@@ -221,7 +220,7 @@ module Google
221
220
  # A request object representing the call parameters. Required.
222
221
  # @return [Array(String, [String, nil], Hash{String => String})]
223
222
  # Uri, Body, Query string parameters
224
- def transcode_list_request request_pb
223
+ def self.transcode_list_request request_pb
225
224
  transcoder = Gapic::Rest::GrpcTranscoder.new
226
225
  .with_bindings(
227
226
  uri_method: :get,
@@ -243,7 +242,7 @@ module Google
243
242
  # A request object representing the call parameters. Required.
244
243
  # @return [Array(String, [String, nil], Hash{String => String})]
245
244
  # Uri, Body, Query string parameters
246
- def transcode_list_instances_request request_pb
245
+ def self.transcode_list_instances_request request_pb
247
246
  transcoder = Gapic::Rest::GrpcTranscoder.new
248
247
  .with_bindings(
249
248
  uri_method: :post,
@@ -267,7 +266,7 @@ module Google
267
266
  # A request object representing the call parameters. Required.
268
267
  # @return [Array(String, [String, nil], Hash{String => String})]
269
268
  # Uri, Body, Query string parameters
270
- def transcode_set_named_ports_request request_pb
269
+ def self.transcode_set_named_ports_request request_pb
271
270
  transcoder = Gapic::Rest::GrpcTranscoder.new
272
271
  .with_bindings(
273
272
  uri_method: :post,
@@ -16,12 +16,27 @@
16
16
 
17
17
  # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
18
 
19
+ require "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/compute/v1/version"
24
+
25
+ require "google/cloud/compute/v1/region_instance_groups/credentials"
19
26
  require "google/cloud/compute/v1/region_instance_groups/rest/client"
20
27
 
21
28
  module Google
22
29
  module Cloud
23
30
  module Compute
24
31
  module V1
32
+ ##
33
+ # The RegionInstanceGroups API.
34
+ #
35
+ # To load this service and instantiate a REST client:
36
+ #
37
+ # require "google/cloud/compute/v1/region_instance_groups/rest"
38
+ # client = ::Google::Cloud::Compute::V1::RegionInstanceGroups::Rest::Client.new
39
+ #
25
40
  module RegionInstanceGroups
26
41
  # Client for the REST transport
27
42
  module Rest
@@ -31,3 +46,6 @@ module Google
31
46
  end
32
47
  end
33
48
  end
49
+
50
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
51
+ require "google/cloud/compute/v1/region_instance_groups/rest/helpers" if ::File.file? helper_path
@@ -31,9 +31,9 @@ module Google
31
31
  ##
32
32
  # The RegionInstanceGroups API.
33
33
  #
34
- # To load this service and instantiate a REST client:
34
+ # @example Load this service and instantiate a REST client
35
35
  #
36
- # require "google/cloud/compute/v1/region_instance_groups"
36
+ # require "google/cloud/compute/v1/region_instance_groups/rest"
37
37
  # client = ::Google::Cloud::Compute::V1::RegionInstanceGroups::Rest::Client.new
38
38
  #
39
39
  module RegionInstanceGroups
@@ -118,13 +118,22 @@ module Google
118
118
 
119
119
  # Create credentials
120
120
  credentials = @config.credentials
121
- credentials ||= Credentials.default scope: @config.scope
121
+ # Use self-signed JWT if the endpoint is unchanged from default,
122
+ # but only if the default endpoint does not have a region prefix.
123
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
124
+ !@config.endpoint.split(".").first.include?("-")
125
+ credentials ||= Credentials.default scope: @config.scope,
126
+ enable_self_signed_jwt: enable_self_signed_jwt
122
127
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
123
128
  credentials = Credentials.new credentials, scope: @config.scope
124
129
  end
125
130
 
131
+ @quota_project_id = @config.quota_project
132
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
133
+
126
134
  @region_operations = ::Google::Cloud::Compute::V1::RegionOperations::Rest::Client.new do |config|
127
135
  config.credentials = credentials
136
+ config.quota_project = @quota_project_id
128
137
  config.endpoint = @config.endpoint
129
138
  end
130
139
 
@@ -152,8 +161,6 @@ module Google
152
161
  # parameters, or to keep all the default parameter values, pass an empty Hash.
153
162
  # @param options [::Gapic::CallOptions, ::Hash]
154
163
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
155
- # Note: currently retry functionality is not implemented. While it is possible
156
- # to set it using ::Gapic::CallOptions, it will not be applied
157
164
  #
158
165
  # @overload bulk_insert(bulk_insert_instance_resource_resource: nil, project: nil, region: nil, request_id: nil)
159
166
  # Pass arguments to `bulk_insert` via keyword arguments. Note that at
@@ -186,17 +193,21 @@ module Google
186
193
  # Customize the options with defaults
187
194
  call_metadata = @config.rpcs.bulk_insert.metadata.to_h
188
195
 
189
- # Set x-goog-api-client header
196
+ # Set x-goog-api-client and x-goog-user-project headers
190
197
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
191
198
  lib_name: @config.lib_name, lib_version: @config.lib_version,
192
199
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
193
200
  transports_version_send: [:rest]
194
201
 
202
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
203
+
195
204
  options.apply_defaults timeout: @config.rpcs.bulk_insert.timeout,
196
- metadata: call_metadata
205
+ metadata: call_metadata,
206
+ retry_policy: @config.rpcs.bulk_insert.retry_policy
197
207
 
198
208
  options.apply_defaults timeout: @config.timeout,
199
- metadata: @config.metadata
209
+ metadata: @config.metadata,
210
+ retry_policy: @config.retry_policy
200
211
 
201
212
  @region_instances_stub.bulk_insert request, options do |result, response|
202
213
  result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
@@ -211,36 +222,38 @@ module Google
211
222
  yield result, response if block_given?
212
223
  return result
213
224
  end
214
- rescue ::Faraday::Error => e
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
225
+ rescue ::Gapic::Rest::Error => e
226
+ raise ::Google::Cloud::Error.from_error(e)
220
227
  end
221
228
 
222
229
  ##
223
230
  # Configuration class for the RegionInstances REST API.
224
231
  #
225
232
  # This class represents the configuration for RegionInstances REST,
226
- # providing control over credentials, timeouts, retry behavior, logging.
233
+ # providing control over timeouts, retry behavior, logging, transport
234
+ # parameters, and other low-level controls. Certain parameters can also be
235
+ # applied individually to specific RPCs. See
236
+ # {::Google::Cloud::Compute::V1::RegionInstances::Rest::Client::Configuration::Rpcs}
237
+ # for a list of RPCs that can be configured independently.
227
238
  #
228
239
  # Configuration can be applied globally to all clients, or to a single client
229
240
  # on construction.
230
241
  #
231
- # # Examples
232
- #
233
- # To modify the global config, setting the timeout for all calls to 10 seconds:
234
- #
235
- # ::Google::Cloud::Compute::V1::RegionInstances::Client.configure do |config|
236
- # config.timeout = 10.0
237
- # end
242
+ # @example
238
243
  #
239
- # To apply the above configuration only to a new client:
244
+ # # Modify the global config, setting the timeout for
245
+ # # bulk_insert to 20 seconds,
246
+ # # and all remaining timeouts to 10 seconds.
247
+ # ::Google::Cloud::Compute::V1::RegionInstances::Rest::Client.configure do |config|
248
+ # config.timeout = 10.0
249
+ # config.rpcs.bulk_insert.timeout = 20.0
250
+ # end
240
251
  #
241
- # client = ::Google::Cloud::Compute::V1::RegionInstances::Client.new do |config|
242
- # config.timeout = 10.0
243
- # end
252
+ # # Apply the above configuration only to a new client.
253
+ # client = ::Google::Cloud::Compute::V1::RegionInstances::Rest::Client.new do |config|
254
+ # config.timeout = 10.0
255
+ # config.rpcs.bulk_insert.timeout = 20.0
256
+ # end
244
257
  #
245
258
  # @!attribute [rw] endpoint
246
259
  # The hostname or hostname:port of the service endpoint.
@@ -269,8 +282,19 @@ module Google
269
282
  # The call timeout in seconds.
270
283
  # @return [::Numeric]
271
284
  # @!attribute [rw] metadata
272
- # Additional REST headers to be sent with the call.
285
+ # Additional headers to be sent with the call.
273
286
  # @return [::Hash{::Symbol=>::String}]
287
+ # @!attribute [rw] retry_policy
288
+ # The retry policy. The value is a hash with the following keys:
289
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
290
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
291
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
292
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
293
+ # trigger a retry.
294
+ # @return [::Hash]
295
+ # @!attribute [rw] quota_project
296
+ # A separate project against which to charge quota.
297
+ # @return [::String]
274
298
  #
275
299
  class Configuration
276
300
  extend ::Gapic::Config
@@ -285,6 +309,8 @@ module Google
285
309
  config_attr :lib_version, nil, ::String, nil
286
310
  config_attr :timeout, nil, ::Numeric, nil
287
311
  config_attr :metadata, nil, ::Hash, nil
312
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
313
+ config_attr :quota_project, nil, ::String, nil
288
314
 
289
315
  # @private
290
316
  def initialize parent_config = nil
@@ -313,9 +339,14 @@ module Google
313
339
  # the following configuration fields:
314
340
  #
315
341
  # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
316
- #
317
- # there is one other field (`retry_policy`) that can be set
318
- # but is currently not supported for REST Gapic libraries.
342
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
343
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
344
+ # include the following keys:
345
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
346
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
347
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
348
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
349
+ # trigger a retry.
319
350
  #
320
351
  class Rpcs
321
352
  ##
@@ -35,7 +35,9 @@ 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, numeric_enums: false
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
39
+ numeric_enums: false,
40
+ raise_faraday_errors: false
39
41
  end
40
42
 
41
43
  ##
@@ -55,7 +57,7 @@ module Google
55
57
  def bulk_insert request_pb, options = nil
56
58
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
57
59
 
58
- verb, uri, query_string_params, body = transcode_bulk_insert_request request_pb
60
+ verb, uri, query_string_params, body = ServiceStub.transcode_bulk_insert_request request_pb
59
61
  query_string_params = if query_string_params.any?
60
62
  query_string_params.to_h { |p| p.split("=", 2) }
61
63
  else
@@ -75,9 +77,6 @@ module Google
75
77
  result
76
78
  end
77
79
 
78
-
79
- private
80
-
81
80
  ##
82
81
  # @private
83
82
  #
@@ -87,7 +86,7 @@ module Google
87
86
  # A request object representing the call parameters. Required.
88
87
  # @return [Array(String, [String, nil], Hash{String => String})]
89
88
  # Uri, Body, Query string parameters
90
- def transcode_bulk_insert_request request_pb
89
+ def self.transcode_bulk_insert_request request_pb
91
90
  transcoder = Gapic::Rest::GrpcTranscoder.new
92
91
  .with_bindings(
93
92
  uri_method: :post,