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
@@ -151,13 +151,22 @@ module Google
151
151
 
152
152
  # Create credentials
153
153
  credentials = @config.credentials
154
- credentials ||= Credentials.default scope: @config.scope
154
+ # Use self-signed JWT if the endpoint is unchanged from default,
155
+ # but only if the default endpoint does not have a region prefix.
156
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
157
+ !@config.endpoint.split(".").first.include?("-")
158
+ credentials ||= Credentials.default scope: @config.scope,
159
+ enable_self_signed_jwt: enable_self_signed_jwt
155
160
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
156
161
  credentials = Credentials.new credentials, scope: @config.scope
157
162
  end
158
163
 
164
+ @quota_project_id = @config.quota_project
165
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
166
+
159
167
  @region_operations = ::Google::Cloud::Compute::V1::RegionOperations::Rest::Client.new do |config|
160
168
  config.credentials = credentials
169
+ config.quota_project = @quota_project_id
161
170
  config.endpoint = @config.endpoint
162
171
  end
163
172
 
@@ -185,8 +194,6 @@ module Google
185
194
  # parameters, or to keep all the default parameter values, pass an empty Hash.
186
195
  # @param options [::Gapic::CallOptions, ::Hash]
187
196
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
188
- # Note: currently retry functionality is not implemented. While it is possible
189
- # to set it using ::Gapic::CallOptions, it will not be applied
190
197
  #
191
198
  # @overload aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
192
199
  # Pass arguments to `aggregated_list` via keyword arguments. Note that at
@@ -225,29 +232,29 @@ module Google
225
232
  # Customize the options with defaults
226
233
  call_metadata = @config.rpcs.aggregated_list.metadata.to_h
227
234
 
228
- # Set x-goog-api-client header
235
+ # Set x-goog-api-client and x-goog-user-project headers
229
236
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
230
237
  lib_name: @config.lib_name, lib_version: @config.lib_version,
231
238
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
232
239
  transports_version_send: [:rest]
233
240
 
241
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
242
+
234
243
  options.apply_defaults timeout: @config.rpcs.aggregated_list.timeout,
235
- metadata: call_metadata
244
+ metadata: call_metadata,
245
+ retry_policy: @config.rpcs.aggregated_list.retry_policy
236
246
 
237
247
  options.apply_defaults timeout: @config.timeout,
238
- metadata: @config.metadata
248
+ metadata: @config.metadata,
249
+ retry_policy: @config.retry_policy
239
250
 
240
251
  @routers_stub.aggregated_list request, options do |result, response|
241
252
  result = ::Gapic::Rest::PagedEnumerable.new @routers_stub, :aggregated_list, "items", request, result, options
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 delete(project: nil, region: nil, request_id: nil, router: nil)
269
274
  # Pass arguments to `delete` via keyword arguments. Note that at
@@ -296,17 +301,21 @@ module Google
296
301
  # Customize the options with defaults
297
302
  call_metadata = @config.rpcs.delete.metadata.to_h
298
303
 
299
- # Set x-goog-api-client header
304
+ # Set x-goog-api-client and x-goog-user-project headers
300
305
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
301
306
  lib_name: @config.lib_name, lib_version: @config.lib_version,
302
307
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
303
308
  transports_version_send: [:rest]
304
309
 
310
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
311
+
305
312
  options.apply_defaults timeout: @config.rpcs.delete.timeout,
306
- metadata: call_metadata
313
+ metadata: call_metadata,
314
+ retry_policy: @config.rpcs.delete.retry_policy
307
315
 
308
316
  options.apply_defaults timeout: @config.timeout,
309
- metadata: @config.metadata
317
+ metadata: @config.metadata,
318
+ retry_policy: @config.retry_policy
310
319
 
311
320
  @routers_stub.delete request, options do |result, response|
312
321
  result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
@@ -321,12 +330,8 @@ module Google
321
330
  yield result, response if block_given?
322
331
  return result
323
332
  end
324
- rescue ::Faraday::Error => e
325
- begin
326
- raise ::Gapic::Rest::Error.wrap_faraday_error e
327
- rescue ::Gapic::Rest::Error => gapic_error
328
- raise ::Google::Cloud::Error.from_error gapic_error
329
- end
333
+ rescue ::Gapic::Rest::Error => e
334
+ raise ::Google::Cloud::Error.from_error(e)
330
335
  end
331
336
 
332
337
  ##
@@ -341,8 +346,6 @@ module Google
341
346
  # parameters, or to keep all the default parameter values, pass an empty Hash.
342
347
  # @param options [::Gapic::CallOptions, ::Hash]
343
348
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
344
- # Note: currently retry functionality is not implemented. While it is possible
345
- # to set it using ::Gapic::CallOptions, it will not be applied
346
349
  #
347
350
  # @overload get(project: nil, region: nil, router: nil)
348
351
  # Pass arguments to `get` via keyword arguments. Note that at
@@ -373,28 +376,28 @@ module Google
373
376
  # Customize the options with defaults
374
377
  call_metadata = @config.rpcs.get.metadata.to_h
375
378
 
376
- # Set x-goog-api-client header
379
+ # Set x-goog-api-client and x-goog-user-project headers
377
380
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
378
381
  lib_name: @config.lib_name, lib_version: @config.lib_version,
379
382
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
380
383
  transports_version_send: [:rest]
381
384
 
385
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
386
+
382
387
  options.apply_defaults timeout: @config.rpcs.get.timeout,
383
- metadata: call_metadata
388
+ metadata: call_metadata,
389
+ retry_policy: @config.rpcs.get.retry_policy
384
390
 
385
391
  options.apply_defaults timeout: @config.timeout,
386
- metadata: @config.metadata
392
+ metadata: @config.metadata,
393
+ retry_policy: @config.retry_policy
387
394
 
388
395
  @routers_stub.get request, options do |result, response|
389
396
  yield result, response if block_given?
390
397
  return result
391
398
  end
392
- rescue ::Faraday::Error => e
393
- begin
394
- raise ::Gapic::Rest::Error.wrap_faraday_error e
395
- rescue ::Gapic::Rest::Error => gapic_error
396
- raise ::Google::Cloud::Error.from_error gapic_error
397
- end
399
+ rescue ::Gapic::Rest::Error => e
400
+ raise ::Google::Cloud::Error.from_error(e)
398
401
  end
399
402
 
400
403
  ##
@@ -409,8 +412,6 @@ module Google
409
412
  # parameters, or to keep all the default parameter values, pass an empty Hash.
410
413
  # @param options [::Gapic::CallOptions, ::Hash]
411
414
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
412
- # Note: currently retry functionality is not implemented. While it is possible
413
- # to set it using ::Gapic::CallOptions, it will not be applied
414
415
  #
415
416
  # @overload get_nat_mapping_info(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil, router: nil)
416
417
  # Pass arguments to `get_nat_mapping_info` via keyword arguments. Note that at
@@ -451,29 +452,29 @@ module Google
451
452
  # Customize the options with defaults
452
453
  call_metadata = @config.rpcs.get_nat_mapping_info.metadata.to_h
453
454
 
454
- # Set x-goog-api-client header
455
+ # Set x-goog-api-client and x-goog-user-project headers
455
456
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
456
457
  lib_name: @config.lib_name, lib_version: @config.lib_version,
457
458
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
458
459
  transports_version_send: [:rest]
459
460
 
461
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
462
+
460
463
  options.apply_defaults timeout: @config.rpcs.get_nat_mapping_info.timeout,
461
- metadata: call_metadata
464
+ metadata: call_metadata,
465
+ retry_policy: @config.rpcs.get_nat_mapping_info.retry_policy
462
466
 
463
467
  options.apply_defaults timeout: @config.timeout,
464
- metadata: @config.metadata
468
+ metadata: @config.metadata,
469
+ retry_policy: @config.retry_policy
465
470
 
466
471
  @routers_stub.get_nat_mapping_info request, options do |result, response|
467
472
  result = ::Gapic::Rest::PagedEnumerable.new @routers_stub, :get_nat_mapping_info, "result", request, result, options
468
473
  yield result, response if block_given?
469
474
  return result
470
475
  end
471
- rescue ::Faraday::Error => e
472
- begin
473
- raise ::Gapic::Rest::Error.wrap_faraday_error e
474
- rescue ::Gapic::Rest::Error => gapic_error
475
- raise ::Google::Cloud::Error.from_error gapic_error
476
- end
476
+ rescue ::Gapic::Rest::Error => e
477
+ raise ::Google::Cloud::Error.from_error(e)
477
478
  end
478
479
 
479
480
  ##
@@ -488,8 +489,6 @@ module Google
488
489
  # parameters, or to keep all the default parameter values, pass an empty Hash.
489
490
  # @param options [::Gapic::CallOptions, ::Hash]
490
491
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
491
- # Note: currently retry functionality is not implemented. While it is possible
492
- # to set it using ::Gapic::CallOptions, it will not be applied
493
492
  #
494
493
  # @overload get_router_status(project: nil, region: nil, router: nil)
495
494
  # Pass arguments to `get_router_status` via keyword arguments. Note that at
@@ -520,28 +519,28 @@ module Google
520
519
  # Customize the options with defaults
521
520
  call_metadata = @config.rpcs.get_router_status.metadata.to_h
522
521
 
523
- # Set x-goog-api-client header
522
+ # Set x-goog-api-client and x-goog-user-project headers
524
523
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
525
524
  lib_name: @config.lib_name, lib_version: @config.lib_version,
526
525
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
527
526
  transports_version_send: [:rest]
528
527
 
528
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
529
+
529
530
  options.apply_defaults timeout: @config.rpcs.get_router_status.timeout,
530
- metadata: call_metadata
531
+ metadata: call_metadata,
532
+ retry_policy: @config.rpcs.get_router_status.retry_policy
531
533
 
532
534
  options.apply_defaults timeout: @config.timeout,
533
- metadata: @config.metadata
535
+ metadata: @config.metadata,
536
+ retry_policy: @config.retry_policy
534
537
 
535
538
  @routers_stub.get_router_status request, options do |result, response|
536
539
  yield result, response if block_given?
537
540
  return result
538
541
  end
539
- rescue ::Faraday::Error => e
540
- begin
541
- raise ::Gapic::Rest::Error.wrap_faraday_error e
542
- rescue ::Gapic::Rest::Error => gapic_error
543
- raise ::Google::Cloud::Error.from_error gapic_error
544
- end
542
+ rescue ::Gapic::Rest::Error => e
543
+ raise ::Google::Cloud::Error.from_error(e)
545
544
  end
546
545
 
547
546
  ##
@@ -556,8 +555,6 @@ module Google
556
555
  # parameters, or to keep all the default parameter values, pass an empty Hash.
557
556
  # @param options [::Gapic::CallOptions, ::Hash]
558
557
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
559
- # Note: currently retry functionality is not implemented. While it is possible
560
- # to set it using ::Gapic::CallOptions, it will not be applied
561
558
  #
562
559
  # @overload insert(project: nil, region: nil, request_id: nil, router_resource: nil)
563
560
  # Pass arguments to `insert` via keyword arguments. Note that at
@@ -590,17 +587,21 @@ module Google
590
587
  # Customize the options with defaults
591
588
  call_metadata = @config.rpcs.insert.metadata.to_h
592
589
 
593
- # Set x-goog-api-client header
590
+ # Set x-goog-api-client and x-goog-user-project headers
594
591
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
595
592
  lib_name: @config.lib_name, lib_version: @config.lib_version,
596
593
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
597
594
  transports_version_send: [:rest]
598
595
 
596
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
597
+
599
598
  options.apply_defaults timeout: @config.rpcs.insert.timeout,
600
- metadata: call_metadata
599
+ metadata: call_metadata,
600
+ retry_policy: @config.rpcs.insert.retry_policy
601
601
 
602
602
  options.apply_defaults timeout: @config.timeout,
603
- metadata: @config.metadata
603
+ metadata: @config.metadata,
604
+ retry_policy: @config.retry_policy
604
605
 
605
606
  @routers_stub.insert request, options do |result, response|
606
607
  result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
@@ -615,12 +616,8 @@ module Google
615
616
  yield result, response if block_given?
616
617
  return result
617
618
  end
618
- rescue ::Faraday::Error => e
619
- begin
620
- raise ::Gapic::Rest::Error.wrap_faraday_error e
621
- rescue ::Gapic::Rest::Error => gapic_error
622
- raise ::Google::Cloud::Error.from_error gapic_error
623
- end
619
+ rescue ::Gapic::Rest::Error => e
620
+ raise ::Google::Cloud::Error.from_error(e)
624
621
  end
625
622
 
626
623
  ##
@@ -635,8 +632,6 @@ module Google
635
632
  # parameters, or to keep all the default parameter values, pass an empty Hash.
636
633
  # @param options [::Gapic::CallOptions, ::Hash]
637
634
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
638
- # Note: currently retry functionality is not implemented. While it is possible
639
- # to set it using ::Gapic::CallOptions, it will not be applied
640
635
  #
641
636
  # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil)
642
637
  # Pass arguments to `list` via keyword arguments. Note that at
@@ -675,29 +670,29 @@ module Google
675
670
  # Customize the options with defaults
676
671
  call_metadata = @config.rpcs.list.metadata.to_h
677
672
 
678
- # Set x-goog-api-client header
673
+ # Set x-goog-api-client and x-goog-user-project headers
679
674
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
680
675
  lib_name: @config.lib_name, lib_version: @config.lib_version,
681
676
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
682
677
  transports_version_send: [:rest]
683
678
 
679
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
680
+
684
681
  options.apply_defaults timeout: @config.rpcs.list.timeout,
685
- metadata: call_metadata
682
+ metadata: call_metadata,
683
+ retry_policy: @config.rpcs.list.retry_policy
686
684
 
687
685
  options.apply_defaults timeout: @config.timeout,
688
- metadata: @config.metadata
686
+ metadata: @config.metadata,
687
+ retry_policy: @config.retry_policy
689
688
 
690
689
  @routers_stub.list request, options do |result, response|
691
690
  result = ::Gapic::Rest::PagedEnumerable.new @routers_stub, :list, "items", request, result, options
692
691
  yield result, response if block_given?
693
692
  return result
694
693
  end
695
- rescue ::Faraday::Error => e
696
- begin
697
- raise ::Gapic::Rest::Error.wrap_faraday_error e
698
- rescue ::Gapic::Rest::Error => gapic_error
699
- raise ::Google::Cloud::Error.from_error gapic_error
700
- end
694
+ rescue ::Gapic::Rest::Error => e
695
+ raise ::Google::Cloud::Error.from_error(e)
701
696
  end
702
697
 
703
698
  ##
@@ -712,8 +707,6 @@ module Google
712
707
  # parameters, or to keep all the default parameter values, pass an empty Hash.
713
708
  # @param options [::Gapic::CallOptions, ::Hash]
714
709
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
715
- # Note: currently retry functionality is not implemented. While it is possible
716
- # to set it using ::Gapic::CallOptions, it will not be applied
717
710
  #
718
711
  # @overload patch(project: nil, region: nil, request_id: nil, router: nil, router_resource: nil)
719
712
  # Pass arguments to `patch` via keyword arguments. Note that at
@@ -748,17 +741,21 @@ module Google
748
741
  # Customize the options with defaults
749
742
  call_metadata = @config.rpcs.patch.metadata.to_h
750
743
 
751
- # Set x-goog-api-client header
744
+ # Set x-goog-api-client and x-goog-user-project headers
752
745
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
753
746
  lib_name: @config.lib_name, lib_version: @config.lib_version,
754
747
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
755
748
  transports_version_send: [:rest]
756
749
 
750
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
751
+
757
752
  options.apply_defaults timeout: @config.rpcs.patch.timeout,
758
- metadata: call_metadata
753
+ metadata: call_metadata,
754
+ retry_policy: @config.rpcs.patch.retry_policy
759
755
 
760
756
  options.apply_defaults timeout: @config.timeout,
761
- metadata: @config.metadata
757
+ metadata: @config.metadata,
758
+ retry_policy: @config.retry_policy
762
759
 
763
760
  @routers_stub.patch request, options do |result, response|
764
761
  result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
@@ -773,12 +770,8 @@ module Google
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 preview(project: nil, region: nil, router: nil, router_resource: nil)
800
791
  # Pass arguments to `preview` via keyword arguments. Note that at
@@ -827,28 +818,28 @@ module Google
827
818
  # Customize the options with defaults
828
819
  call_metadata = @config.rpcs.preview.metadata.to_h
829
820
 
830
- # Set x-goog-api-client header
821
+ # Set x-goog-api-client and x-goog-user-project headers
831
822
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
832
823
  lib_name: @config.lib_name, lib_version: @config.lib_version,
833
824
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
834
825
  transports_version_send: [:rest]
835
826
 
827
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
828
+
836
829
  options.apply_defaults timeout: @config.rpcs.preview.timeout,
837
- metadata: call_metadata
830
+ metadata: call_metadata,
831
+ retry_policy: @config.rpcs.preview.retry_policy
838
832
 
839
833
  options.apply_defaults timeout: @config.timeout,
840
- metadata: @config.metadata
834
+ metadata: @config.metadata,
835
+ retry_policy: @config.retry_policy
841
836
 
842
837
  @routers_stub.preview request, options do |result, response|
843
838
  yield result, response if block_given?
844
839
  return result
845
840
  end
846
- rescue ::Faraday::Error => e
847
- begin
848
- raise ::Gapic::Rest::Error.wrap_faraday_error e
849
- rescue ::Gapic::Rest::Error => gapic_error
850
- raise ::Google::Cloud::Error.from_error gapic_error
851
- end
841
+ rescue ::Gapic::Rest::Error => e
842
+ raise ::Google::Cloud::Error.from_error(e)
852
843
  end
853
844
 
854
845
  ##
@@ -863,8 +854,6 @@ module Google
863
854
  # parameters, or to keep all the default parameter values, pass an empty Hash.
864
855
  # @param options [::Gapic::CallOptions, ::Hash]
865
856
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
866
- # Note: currently retry functionality is not implemented. While it is possible
867
- # to set it using ::Gapic::CallOptions, it will not be applied
868
857
  #
869
858
  # @overload update(project: nil, region: nil, request_id: nil, router: nil, router_resource: nil)
870
859
  # Pass arguments to `update` via keyword arguments. Note that at
@@ -899,17 +888,21 @@ module Google
899
888
  # Customize the options with defaults
900
889
  call_metadata = @config.rpcs.update.metadata.to_h
901
890
 
902
- # Set x-goog-api-client header
891
+ # Set x-goog-api-client and x-goog-user-project headers
903
892
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
904
893
  lib_name: @config.lib_name, lib_version: @config.lib_version,
905
894
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
906
895
  transports_version_send: [:rest]
907
896
 
897
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
898
+
908
899
  options.apply_defaults timeout: @config.rpcs.update.timeout,
909
- metadata: call_metadata
900
+ metadata: call_metadata,
901
+ retry_policy: @config.rpcs.update.retry_policy
910
902
 
911
903
  options.apply_defaults timeout: @config.timeout,
912
- metadata: @config.metadata
904
+ metadata: @config.metadata,
905
+ retry_policy: @config.retry_policy
913
906
 
914
907
  @routers_stub.update request, options do |result, response|
915
908
  result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
@@ -924,36 +917,38 @@ module Google
924
917
  yield result, response if block_given?
925
918
  return result
926
919
  end
927
- rescue ::Faraday::Error => e
928
- begin
929
- raise ::Gapic::Rest::Error.wrap_faraday_error e
930
- rescue ::Gapic::Rest::Error => gapic_error
931
- raise ::Google::Cloud::Error.from_error gapic_error
932
- end
920
+ rescue ::Gapic::Rest::Error => e
921
+ raise ::Google::Cloud::Error.from_error(e)
933
922
  end
934
923
 
935
924
  ##
936
925
  # Configuration class for the Routers REST API.
937
926
  #
938
927
  # This class represents the configuration for Routers REST,
939
- # providing control over credentials, timeouts, retry behavior, logging.
928
+ # providing control over timeouts, retry behavior, logging, transport
929
+ # parameters, and other low-level controls. Certain parameters can also be
930
+ # applied individually to specific RPCs. See
931
+ # {::Google::Cloud::Compute::V1::Routers::Rest::Client::Configuration::Rpcs}
932
+ # for a list of RPCs that can be configured independently.
940
933
  #
941
934
  # Configuration can be applied globally to all clients, or to a single client
942
935
  # on construction.
943
936
  #
944
- # # Examples
945
- #
946
- # To modify the global config, setting the timeout for all calls to 10 seconds:
947
- #
948
- # ::Google::Cloud::Compute::V1::Routers::Client.configure do |config|
949
- # config.timeout = 10.0
950
- # end
937
+ # @example
951
938
  #
952
- # To apply the above configuration only to a new client:
939
+ # # Modify the global config, setting the timeout for
940
+ # # aggregated_list to 20 seconds,
941
+ # # and all remaining timeouts to 10 seconds.
942
+ # ::Google::Cloud::Compute::V1::Routers::Rest::Client.configure do |config|
943
+ # config.timeout = 10.0
944
+ # config.rpcs.aggregated_list.timeout = 20.0
945
+ # end
953
946
  #
954
- # client = ::Google::Cloud::Compute::V1::Routers::Client.new do |config|
955
- # config.timeout = 10.0
956
- # end
947
+ # # Apply the above configuration only to a new client.
948
+ # client = ::Google::Cloud::Compute::V1::Routers::Rest::Client.new do |config|
949
+ # config.timeout = 10.0
950
+ # config.rpcs.aggregated_list.timeout = 20.0
951
+ # end
957
952
  #
958
953
  # @!attribute [rw] endpoint
959
954
  # The hostname or hostname:port of the service endpoint.
@@ -982,8 +977,19 @@ module Google
982
977
  # The call timeout in seconds.
983
978
  # @return [::Numeric]
984
979
  # @!attribute [rw] metadata
985
- # Additional REST headers to be sent with the call.
980
+ # Additional headers to be sent with the call.
986
981
  # @return [::Hash{::Symbol=>::String}]
982
+ # @!attribute [rw] retry_policy
983
+ # The retry policy. The value is a hash with the following keys:
984
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
985
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
986
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
987
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
988
+ # trigger a retry.
989
+ # @return [::Hash]
990
+ # @!attribute [rw] quota_project
991
+ # A separate project against which to charge quota.
992
+ # @return [::String]
987
993
  #
988
994
  class Configuration
989
995
  extend ::Gapic::Config
@@ -998,6 +1004,8 @@ module Google
998
1004
  config_attr :lib_version, nil, ::String, nil
999
1005
  config_attr :timeout, nil, ::Numeric, nil
1000
1006
  config_attr :metadata, nil, ::Hash, nil
1007
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1008
+ config_attr :quota_project, nil, ::String, nil
1001
1009
 
1002
1010
  # @private
1003
1011
  def initialize parent_config = nil
@@ -1026,9 +1034,14 @@ module Google
1026
1034
  # the following configuration fields:
1027
1035
  #
1028
1036
  # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1029
- #
1030
- # there is one other field (`retry_policy`) that can be set
1031
- # but is currently not supported for REST Gapic libraries.
1037
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1038
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1039
+ # include the following keys:
1040
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1041
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1042
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1043
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1044
+ # trigger a retry.
1032
1045
  #
1033
1046
  class Rpcs
1034
1047
  ##