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
  @global_operations = ::Google::Cloud::Compute::V1::GlobalOperations::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 disable_xpn_host(project: nil, request_id: nil)
192
199
  # Pass arguments to `disable_xpn_host` via keyword arguments. Note that at
@@ -215,17 +222,21 @@ module Google
215
222
  # Customize the options with defaults
216
223
  call_metadata = @config.rpcs.disable_xpn_host.metadata.to_h
217
224
 
218
- # Set x-goog-api-client header
225
+ # Set x-goog-api-client and x-goog-user-project headers
219
226
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
220
227
  lib_name: @config.lib_name, lib_version: @config.lib_version,
221
228
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
222
229
  transports_version_send: [:rest]
223
230
 
231
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
232
+
224
233
  options.apply_defaults timeout: @config.rpcs.disable_xpn_host.timeout,
225
- metadata: call_metadata
234
+ metadata: call_metadata,
235
+ retry_policy: @config.rpcs.disable_xpn_host.retry_policy
226
236
 
227
237
  options.apply_defaults timeout: @config.timeout,
228
- metadata: @config.metadata
238
+ metadata: @config.metadata,
239
+ retry_policy: @config.retry_policy
229
240
 
230
241
  @projects_stub.disable_xpn_host request, options do |result, response|
231
242
  result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
@@ -239,12 +250,8 @@ module Google
239
250
  yield result, response if block_given?
240
251
  return result
241
252
  end
242
- rescue ::Faraday::Error => e
243
- begin
244
- raise ::Gapic::Rest::Error.wrap_faraday_error e
245
- rescue ::Gapic::Rest::Error => gapic_error
246
- raise ::Google::Cloud::Error.from_error gapic_error
247
- end
253
+ rescue ::Gapic::Rest::Error => e
254
+ raise ::Google::Cloud::Error.from_error(e)
248
255
  end
249
256
 
250
257
  ##
@@ -259,8 +266,6 @@ module Google
259
266
  # parameters, or to keep all the default parameter values, pass an empty Hash.
260
267
  # @param options [::Gapic::CallOptions, ::Hash]
261
268
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
262
- # Note: currently retry functionality is not implemented. While it is possible
263
- # to set it using ::Gapic::CallOptions, it will not be applied
264
269
  #
265
270
  # @overload disable_xpn_resource(project: nil, projects_disable_xpn_resource_request_resource: nil, request_id: nil)
266
271
  # Pass arguments to `disable_xpn_resource` via keyword arguments. Note that at
@@ -291,17 +296,21 @@ module Google
291
296
  # Customize the options with defaults
292
297
  call_metadata = @config.rpcs.disable_xpn_resource.metadata.to_h
293
298
 
294
- # Set x-goog-api-client header
299
+ # Set x-goog-api-client and x-goog-user-project headers
295
300
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
296
301
  lib_name: @config.lib_name, lib_version: @config.lib_version,
297
302
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
298
303
  transports_version_send: [:rest]
299
304
 
305
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
306
+
300
307
  options.apply_defaults timeout: @config.rpcs.disable_xpn_resource.timeout,
301
- metadata: call_metadata
308
+ metadata: call_metadata,
309
+ retry_policy: @config.rpcs.disable_xpn_resource.retry_policy
302
310
 
303
311
  options.apply_defaults timeout: @config.timeout,
304
- metadata: @config.metadata
312
+ metadata: @config.metadata,
313
+ retry_policy: @config.retry_policy
305
314
 
306
315
  @projects_stub.disable_xpn_resource request, options do |result, response|
307
316
  result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
@@ -315,12 +324,8 @@ module Google
315
324
  yield result, response if block_given?
316
325
  return result
317
326
  end
318
- rescue ::Faraday::Error => e
319
- begin
320
- raise ::Gapic::Rest::Error.wrap_faraday_error e
321
- rescue ::Gapic::Rest::Error => gapic_error
322
- raise ::Google::Cloud::Error.from_error gapic_error
323
- end
327
+ rescue ::Gapic::Rest::Error => e
328
+ raise ::Google::Cloud::Error.from_error(e)
324
329
  end
325
330
 
326
331
  ##
@@ -335,8 +340,6 @@ module Google
335
340
  # parameters, or to keep all the default parameter values, pass an empty Hash.
336
341
  # @param options [::Gapic::CallOptions, ::Hash]
337
342
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
338
- # Note: currently retry functionality is not implemented. While it is possible
339
- # to set it using ::Gapic::CallOptions, it will not be applied
340
343
  #
341
344
  # @overload enable_xpn_host(project: nil, request_id: nil)
342
345
  # Pass arguments to `enable_xpn_host` via keyword arguments. Note that at
@@ -365,17 +368,21 @@ module Google
365
368
  # Customize the options with defaults
366
369
  call_metadata = @config.rpcs.enable_xpn_host.metadata.to_h
367
370
 
368
- # Set x-goog-api-client header
371
+ # Set x-goog-api-client and x-goog-user-project headers
369
372
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
370
373
  lib_name: @config.lib_name, lib_version: @config.lib_version,
371
374
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
372
375
  transports_version_send: [:rest]
373
376
 
377
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
378
+
374
379
  options.apply_defaults timeout: @config.rpcs.enable_xpn_host.timeout,
375
- metadata: call_metadata
380
+ metadata: call_metadata,
381
+ retry_policy: @config.rpcs.enable_xpn_host.retry_policy
376
382
 
377
383
  options.apply_defaults timeout: @config.timeout,
378
- metadata: @config.metadata
384
+ metadata: @config.metadata,
385
+ retry_policy: @config.retry_policy
379
386
 
380
387
  @projects_stub.enable_xpn_host request, options do |result, response|
381
388
  result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
@@ -389,12 +396,8 @@ module Google
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 enable_xpn_resource(project: nil, projects_enable_xpn_resource_request_resource: nil, request_id: nil)
416
417
  # Pass arguments to `enable_xpn_resource` via keyword arguments. Note that at
@@ -441,17 +442,21 @@ module Google
441
442
  # Customize the options with defaults
442
443
  call_metadata = @config.rpcs.enable_xpn_resource.metadata.to_h
443
444
 
444
- # Set x-goog-api-client header
445
+ # Set x-goog-api-client and x-goog-user-project headers
445
446
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
446
447
  lib_name: @config.lib_name, lib_version: @config.lib_version,
447
448
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
448
449
  transports_version_send: [:rest]
449
450
 
451
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
452
+
450
453
  options.apply_defaults timeout: @config.rpcs.enable_xpn_resource.timeout,
451
- metadata: call_metadata
454
+ metadata: call_metadata,
455
+ retry_policy: @config.rpcs.enable_xpn_resource.retry_policy
452
456
 
453
457
  options.apply_defaults timeout: @config.timeout,
454
- metadata: @config.metadata
458
+ metadata: @config.metadata,
459
+ retry_policy: @config.retry_policy
455
460
 
456
461
  @projects_stub.enable_xpn_resource request, options do |result, response|
457
462
  result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
@@ -465,12 +470,8 @@ module Google
465
470
  yield result, response if block_given?
466
471
  return result
467
472
  end
468
- rescue ::Faraday::Error => e
469
- begin
470
- raise ::Gapic::Rest::Error.wrap_faraday_error e
471
- rescue ::Gapic::Rest::Error => gapic_error
472
- raise ::Google::Cloud::Error.from_error gapic_error
473
- end
473
+ rescue ::Gapic::Rest::Error => e
474
+ raise ::Google::Cloud::Error.from_error(e)
474
475
  end
475
476
 
476
477
  ##
@@ -485,8 +486,6 @@ module Google
485
486
  # parameters, or to keep all the default parameter values, pass an empty Hash.
486
487
  # @param options [::Gapic::CallOptions, ::Hash]
487
488
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
488
- # Note: currently retry functionality is not implemented. While it is possible
489
- # to set it using ::Gapic::CallOptions, it will not be applied
490
489
  #
491
490
  # @overload get(project: nil)
492
491
  # Pass arguments to `get` via keyword arguments. Note that at
@@ -513,28 +512,28 @@ module Google
513
512
  # Customize the options with defaults
514
513
  call_metadata = @config.rpcs.get.metadata.to_h
515
514
 
516
- # Set x-goog-api-client header
515
+ # Set x-goog-api-client and x-goog-user-project headers
517
516
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
518
517
  lib_name: @config.lib_name, lib_version: @config.lib_version,
519
518
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
520
519
  transports_version_send: [:rest]
521
520
 
521
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
522
+
522
523
  options.apply_defaults timeout: @config.rpcs.get.timeout,
523
- metadata: call_metadata
524
+ metadata: call_metadata,
525
+ retry_policy: @config.rpcs.get.retry_policy
524
526
 
525
527
  options.apply_defaults timeout: @config.timeout,
526
- metadata: @config.metadata
528
+ metadata: @config.metadata,
529
+ retry_policy: @config.retry_policy
527
530
 
528
531
  @projects_stub.get request, options do |result, response|
529
532
  yield result, response if block_given?
530
533
  return result
531
534
  end
532
- rescue ::Faraday::Error => e
533
- begin
534
- raise ::Gapic::Rest::Error.wrap_faraday_error e
535
- rescue ::Gapic::Rest::Error => gapic_error
536
- raise ::Google::Cloud::Error.from_error gapic_error
537
- end
535
+ rescue ::Gapic::Rest::Error => e
536
+ raise ::Google::Cloud::Error.from_error(e)
538
537
  end
539
538
 
540
539
  ##
@@ -549,8 +548,6 @@ module Google
549
548
  # parameters, or to keep all the default parameter values, pass an empty Hash.
550
549
  # @param options [::Gapic::CallOptions, ::Hash]
551
550
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
552
- # Note: currently retry functionality is not implemented. While it is possible
553
- # to set it using ::Gapic::CallOptions, it will not be applied
554
551
  #
555
552
  # @overload get_xpn_host(project: nil)
556
553
  # Pass arguments to `get_xpn_host` via keyword arguments. Note that at
@@ -577,28 +574,28 @@ module Google
577
574
  # Customize the options with defaults
578
575
  call_metadata = @config.rpcs.get_xpn_host.metadata.to_h
579
576
 
580
- # Set x-goog-api-client header
577
+ # Set x-goog-api-client and x-goog-user-project headers
581
578
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
582
579
  lib_name: @config.lib_name, lib_version: @config.lib_version,
583
580
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
584
581
  transports_version_send: [:rest]
585
582
 
583
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
584
+
586
585
  options.apply_defaults timeout: @config.rpcs.get_xpn_host.timeout,
587
- metadata: call_metadata
586
+ metadata: call_metadata,
587
+ retry_policy: @config.rpcs.get_xpn_host.retry_policy
588
588
 
589
589
  options.apply_defaults timeout: @config.timeout,
590
- metadata: @config.metadata
590
+ metadata: @config.metadata,
591
+ retry_policy: @config.retry_policy
591
592
 
592
593
  @projects_stub.get_xpn_host request, options do |result, response|
593
594
  yield result, response if block_given?
594
595
  return result
595
596
  end
596
- rescue ::Faraday::Error => e
597
- begin
598
- raise ::Gapic::Rest::Error.wrap_faraday_error e
599
- rescue ::Gapic::Rest::Error => gapic_error
600
- raise ::Google::Cloud::Error.from_error gapic_error
601
- end
597
+ rescue ::Gapic::Rest::Error => e
598
+ raise ::Google::Cloud::Error.from_error(e)
602
599
  end
603
600
 
604
601
  ##
@@ -613,8 +610,6 @@ module Google
613
610
  # parameters, or to keep all the default parameter values, pass an empty Hash.
614
611
  # @param options [::Gapic::CallOptions, ::Hash]
615
612
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
616
- # Note: currently retry functionality is not implemented. While it is possible
617
- # to set it using ::Gapic::CallOptions, it will not be applied
618
613
  #
619
614
  # @overload get_xpn_resources(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
620
615
  # Pass arguments to `get_xpn_resources` via keyword arguments. Note that at
@@ -651,29 +646,29 @@ module Google
651
646
  # Customize the options with defaults
652
647
  call_metadata = @config.rpcs.get_xpn_resources.metadata.to_h
653
648
 
654
- # Set x-goog-api-client header
649
+ # Set x-goog-api-client and x-goog-user-project headers
655
650
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
656
651
  lib_name: @config.lib_name, lib_version: @config.lib_version,
657
652
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
658
653
  transports_version_send: [:rest]
659
654
 
655
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
656
+
660
657
  options.apply_defaults timeout: @config.rpcs.get_xpn_resources.timeout,
661
- metadata: call_metadata
658
+ metadata: call_metadata,
659
+ retry_policy: @config.rpcs.get_xpn_resources.retry_policy
662
660
 
663
661
  options.apply_defaults timeout: @config.timeout,
664
- metadata: @config.metadata
662
+ metadata: @config.metadata,
663
+ retry_policy: @config.retry_policy
665
664
 
666
665
  @projects_stub.get_xpn_resources request, options do |result, response|
667
666
  result = ::Gapic::Rest::PagedEnumerable.new @projects_stub, :get_xpn_resources, "resources", request, result, options
668
667
  yield result, response if block_given?
669
668
  return result
670
669
  end
671
- rescue ::Faraday::Error => e
672
- begin
673
- raise ::Gapic::Rest::Error.wrap_faraday_error e
674
- rescue ::Gapic::Rest::Error => gapic_error
675
- raise ::Google::Cloud::Error.from_error gapic_error
676
- end
670
+ rescue ::Gapic::Rest::Error => e
671
+ raise ::Google::Cloud::Error.from_error(e)
677
672
  end
678
673
 
679
674
  ##
@@ -688,8 +683,6 @@ module Google
688
683
  # parameters, or to keep all the default parameter values, pass an empty Hash.
689
684
  # @param options [::Gapic::CallOptions, ::Hash]
690
685
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
691
- # Note: currently retry functionality is not implemented. While it is possible
692
- # to set it using ::Gapic::CallOptions, it will not be applied
693
686
  #
694
687
  # @overload list_xpn_hosts(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, projects_list_xpn_hosts_request_resource: nil, return_partial_success: nil)
695
688
  # Pass arguments to `list_xpn_hosts` via keyword arguments. Note that at
@@ -728,29 +721,29 @@ module Google
728
721
  # Customize the options with defaults
729
722
  call_metadata = @config.rpcs.list_xpn_hosts.metadata.to_h
730
723
 
731
- # Set x-goog-api-client header
724
+ # Set x-goog-api-client and x-goog-user-project headers
732
725
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
733
726
  lib_name: @config.lib_name, lib_version: @config.lib_version,
734
727
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
735
728
  transports_version_send: [:rest]
736
729
 
730
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
731
+
737
732
  options.apply_defaults timeout: @config.rpcs.list_xpn_hosts.timeout,
738
- metadata: call_metadata
733
+ metadata: call_metadata,
734
+ retry_policy: @config.rpcs.list_xpn_hosts.retry_policy
739
735
 
740
736
  options.apply_defaults timeout: @config.timeout,
741
- metadata: @config.metadata
737
+ metadata: @config.metadata,
738
+ retry_policy: @config.retry_policy
742
739
 
743
740
  @projects_stub.list_xpn_hosts request, options do |result, response|
744
741
  result = ::Gapic::Rest::PagedEnumerable.new @projects_stub, :list_xpn_hosts, "items", request, result, options
745
742
  yield result, response if block_given?
746
743
  return result
747
744
  end
748
- rescue ::Faraday::Error => e
749
- begin
750
- raise ::Gapic::Rest::Error.wrap_faraday_error e
751
- rescue ::Gapic::Rest::Error => gapic_error
752
- raise ::Google::Cloud::Error.from_error gapic_error
753
- end
745
+ rescue ::Gapic::Rest::Error => e
746
+ raise ::Google::Cloud::Error.from_error(e)
754
747
  end
755
748
 
756
749
  ##
@@ -765,8 +758,6 @@ module Google
765
758
  # parameters, or to keep all the default parameter values, pass an empty Hash.
766
759
  # @param options [::Gapic::CallOptions, ::Hash]
767
760
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
768
- # Note: currently retry functionality is not implemented. While it is possible
769
- # to set it using ::Gapic::CallOptions, it will not be applied
770
761
  #
771
762
  # @overload move_disk(disk_move_request_resource: nil, project: nil, request_id: nil)
772
763
  # Pass arguments to `move_disk` via keyword arguments. Note that at
@@ -797,17 +788,21 @@ module Google
797
788
  # Customize the options with defaults
798
789
  call_metadata = @config.rpcs.move_disk.metadata.to_h
799
790
 
800
- # Set x-goog-api-client header
791
+ # Set x-goog-api-client and x-goog-user-project headers
801
792
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
802
793
  lib_name: @config.lib_name, lib_version: @config.lib_version,
803
794
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
804
795
  transports_version_send: [:rest]
805
796
 
797
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
798
+
806
799
  options.apply_defaults timeout: @config.rpcs.move_disk.timeout,
807
- metadata: call_metadata
800
+ metadata: call_metadata,
801
+ retry_policy: @config.rpcs.move_disk.retry_policy
808
802
 
809
803
  options.apply_defaults timeout: @config.timeout,
810
- metadata: @config.metadata
804
+ metadata: @config.metadata,
805
+ retry_policy: @config.retry_policy
811
806
 
812
807
  @projects_stub.move_disk request, options do |result, response|
813
808
  result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
@@ -821,12 +816,8 @@ module Google
821
816
  yield result, response if block_given?
822
817
  return result
823
818
  end
824
- rescue ::Faraday::Error => e
825
- begin
826
- raise ::Gapic::Rest::Error.wrap_faraday_error e
827
- rescue ::Gapic::Rest::Error => gapic_error
828
- raise ::Google::Cloud::Error.from_error gapic_error
829
- end
819
+ rescue ::Gapic::Rest::Error => e
820
+ raise ::Google::Cloud::Error.from_error(e)
830
821
  end
831
822
 
832
823
  ##
@@ -841,8 +832,6 @@ module Google
841
832
  # parameters, or to keep all the default parameter values, pass an empty Hash.
842
833
  # @param options [::Gapic::CallOptions, ::Hash]
843
834
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
844
- # Note: currently retry functionality is not implemented. While it is possible
845
- # to set it using ::Gapic::CallOptions, it will not be applied
846
835
  #
847
836
  # @overload move_instance(instance_move_request_resource: nil, project: nil, request_id: nil)
848
837
  # Pass arguments to `move_instance` via keyword arguments. Note that at
@@ -873,17 +862,21 @@ module Google
873
862
  # Customize the options with defaults
874
863
  call_metadata = @config.rpcs.move_instance.metadata.to_h
875
864
 
876
- # Set x-goog-api-client header
865
+ # Set x-goog-api-client and x-goog-user-project headers
877
866
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
878
867
  lib_name: @config.lib_name, lib_version: @config.lib_version,
879
868
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
880
869
  transports_version_send: [:rest]
881
870
 
871
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
872
+
882
873
  options.apply_defaults timeout: @config.rpcs.move_instance.timeout,
883
- metadata: call_metadata
874
+ metadata: call_metadata,
875
+ retry_policy: @config.rpcs.move_instance.retry_policy
884
876
 
885
877
  options.apply_defaults timeout: @config.timeout,
886
- metadata: @config.metadata
878
+ metadata: @config.metadata,
879
+ retry_policy: @config.retry_policy
887
880
 
888
881
  @projects_stub.move_instance request, options do |result, response|
889
882
  result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
@@ -897,12 +890,8 @@ module Google
897
890
  yield result, response if block_given?
898
891
  return result
899
892
  end
900
- rescue ::Faraday::Error => e
901
- begin
902
- raise ::Gapic::Rest::Error.wrap_faraday_error e
903
- rescue ::Gapic::Rest::Error => gapic_error
904
- raise ::Google::Cloud::Error.from_error gapic_error
905
- end
893
+ rescue ::Gapic::Rest::Error => e
894
+ raise ::Google::Cloud::Error.from_error(e)
906
895
  end
907
896
 
908
897
  ##
@@ -917,8 +906,6 @@ module Google
917
906
  # parameters, or to keep all the default parameter values, pass an empty Hash.
918
907
  # @param options [::Gapic::CallOptions, ::Hash]
919
908
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
920
- # Note: currently retry functionality is not implemented. While it is possible
921
- # to set it using ::Gapic::CallOptions, it will not be applied
922
909
  #
923
910
  # @overload set_common_instance_metadata(metadata_resource: nil, project: nil, request_id: nil)
924
911
  # Pass arguments to `set_common_instance_metadata` via keyword arguments. Note that at
@@ -949,17 +936,21 @@ module Google
949
936
  # Customize the options with defaults
950
937
  call_metadata = @config.rpcs.set_common_instance_metadata.metadata.to_h
951
938
 
952
- # Set x-goog-api-client header
939
+ # Set x-goog-api-client and x-goog-user-project headers
953
940
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
954
941
  lib_name: @config.lib_name, lib_version: @config.lib_version,
955
942
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
956
943
  transports_version_send: [:rest]
957
944
 
945
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
946
+
958
947
  options.apply_defaults timeout: @config.rpcs.set_common_instance_metadata.timeout,
959
- metadata: call_metadata
948
+ metadata: call_metadata,
949
+ retry_policy: @config.rpcs.set_common_instance_metadata.retry_policy
960
950
 
961
951
  options.apply_defaults timeout: @config.timeout,
962
- metadata: @config.metadata
952
+ metadata: @config.metadata,
953
+ retry_policy: @config.retry_policy
963
954
 
964
955
  @projects_stub.set_common_instance_metadata request, options do |result, response|
965
956
  result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
@@ -973,12 +964,8 @@ module Google
973
964
  yield result, response if block_given?
974
965
  return result
975
966
  end
976
- rescue ::Faraday::Error => e
977
- begin
978
- raise ::Gapic::Rest::Error.wrap_faraday_error e
979
- rescue ::Gapic::Rest::Error => gapic_error
980
- raise ::Google::Cloud::Error.from_error gapic_error
981
- end
967
+ rescue ::Gapic::Rest::Error => e
968
+ raise ::Google::Cloud::Error.from_error(e)
982
969
  end
983
970
 
984
971
  ##
@@ -993,8 +980,6 @@ module Google
993
980
  # parameters, or to keep all the default parameter values, pass an empty Hash.
994
981
  # @param options [::Gapic::CallOptions, ::Hash]
995
982
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
996
- # Note: currently retry functionality is not implemented. While it is possible
997
- # to set it using ::Gapic::CallOptions, it will not be applied
998
983
  #
999
984
  # @overload set_default_network_tier(project: nil, projects_set_default_network_tier_request_resource: nil, request_id: nil)
1000
985
  # Pass arguments to `set_default_network_tier` via keyword arguments. Note that at
@@ -1025,17 +1010,21 @@ module Google
1025
1010
  # Customize the options with defaults
1026
1011
  call_metadata = @config.rpcs.set_default_network_tier.metadata.to_h
1027
1012
 
1028
- # Set x-goog-api-client header
1013
+ # Set x-goog-api-client and x-goog-user-project headers
1029
1014
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1030
1015
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1031
1016
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1032
1017
  transports_version_send: [:rest]
1033
1018
 
1019
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1020
+
1034
1021
  options.apply_defaults timeout: @config.rpcs.set_default_network_tier.timeout,
1035
- metadata: call_metadata
1022
+ metadata: call_metadata,
1023
+ retry_policy: @config.rpcs.set_default_network_tier.retry_policy
1036
1024
 
1037
1025
  options.apply_defaults timeout: @config.timeout,
1038
- metadata: @config.metadata
1026
+ metadata: @config.metadata,
1027
+ retry_policy: @config.retry_policy
1039
1028
 
1040
1029
  @projects_stub.set_default_network_tier request, options do |result, response|
1041
1030
  result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
@@ -1049,12 +1038,8 @@ module Google
1049
1038
  yield result, response if block_given?
1050
1039
  return result
1051
1040
  end
1052
- rescue ::Faraday::Error => e
1053
- begin
1054
- raise ::Gapic::Rest::Error.wrap_faraday_error e
1055
- rescue ::Gapic::Rest::Error => gapic_error
1056
- raise ::Google::Cloud::Error.from_error gapic_error
1057
- end
1041
+ rescue ::Gapic::Rest::Error => e
1042
+ raise ::Google::Cloud::Error.from_error(e)
1058
1043
  end
1059
1044
 
1060
1045
  ##
@@ -1069,8 +1054,6 @@ module Google
1069
1054
  # parameters, or to keep all the default parameter values, pass an empty Hash.
1070
1055
  # @param options [::Gapic::CallOptions, ::Hash]
1071
1056
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1072
- # Note: currently retry functionality is not implemented. While it is possible
1073
- # to set it using ::Gapic::CallOptions, it will not be applied
1074
1057
  #
1075
1058
  # @overload set_usage_export_bucket(project: nil, request_id: nil, usage_export_location_resource: nil)
1076
1059
  # Pass arguments to `set_usage_export_bucket` via keyword arguments. Note that at
@@ -1101,17 +1084,21 @@ module Google
1101
1084
  # Customize the options with defaults
1102
1085
  call_metadata = @config.rpcs.set_usage_export_bucket.metadata.to_h
1103
1086
 
1104
- # Set x-goog-api-client header
1087
+ # Set x-goog-api-client and x-goog-user-project headers
1105
1088
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1106
1089
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1107
1090
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1108
1091
  transports_version_send: [:rest]
1109
1092
 
1093
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1094
+
1110
1095
  options.apply_defaults timeout: @config.rpcs.set_usage_export_bucket.timeout,
1111
- metadata: call_metadata
1096
+ metadata: call_metadata,
1097
+ retry_policy: @config.rpcs.set_usage_export_bucket.retry_policy
1112
1098
 
1113
1099
  options.apply_defaults timeout: @config.timeout,
1114
- metadata: @config.metadata
1100
+ metadata: @config.metadata,
1101
+ retry_policy: @config.retry_policy
1115
1102
 
1116
1103
  @projects_stub.set_usage_export_bucket request, options do |result, response|
1117
1104
  result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
@@ -1125,36 +1112,38 @@ module Google
1125
1112
  yield result, response if block_given?
1126
1113
  return result
1127
1114
  end
1128
- rescue ::Faraday::Error => e
1129
- begin
1130
- raise ::Gapic::Rest::Error.wrap_faraday_error e
1131
- rescue ::Gapic::Rest::Error => gapic_error
1132
- raise ::Google::Cloud::Error.from_error gapic_error
1133
- end
1115
+ rescue ::Gapic::Rest::Error => e
1116
+ raise ::Google::Cloud::Error.from_error(e)
1134
1117
  end
1135
1118
 
1136
1119
  ##
1137
1120
  # Configuration class for the Projects REST API.
1138
1121
  #
1139
1122
  # This class represents the configuration for Projects REST,
1140
- # providing control over credentials, timeouts, retry behavior, logging.
1123
+ # providing control over timeouts, retry behavior, logging, transport
1124
+ # parameters, and other low-level controls. Certain parameters can also be
1125
+ # applied individually to specific RPCs. See
1126
+ # {::Google::Cloud::Compute::V1::Projects::Rest::Client::Configuration::Rpcs}
1127
+ # for a list of RPCs that can be configured independently.
1141
1128
  #
1142
1129
  # Configuration can be applied globally to all clients, or to a single client
1143
1130
  # on construction.
1144
1131
  #
1145
- # # Examples
1146
- #
1147
- # To modify the global config, setting the timeout for all calls to 10 seconds:
1148
- #
1149
- # ::Google::Cloud::Compute::V1::Projects::Client.configure do |config|
1150
- # config.timeout = 10.0
1151
- # end
1132
+ # @example
1152
1133
  #
1153
- # To apply the above configuration only to a new client:
1134
+ # # Modify the global config, setting the timeout for
1135
+ # # disable_xpn_host to 20 seconds,
1136
+ # # and all remaining timeouts to 10 seconds.
1137
+ # ::Google::Cloud::Compute::V1::Projects::Rest::Client.configure do |config|
1138
+ # config.timeout = 10.0
1139
+ # config.rpcs.disable_xpn_host.timeout = 20.0
1140
+ # end
1154
1141
  #
1155
- # client = ::Google::Cloud::Compute::V1::Projects::Client.new do |config|
1156
- # config.timeout = 10.0
1157
- # end
1142
+ # # Apply the above configuration only to a new client.
1143
+ # client = ::Google::Cloud::Compute::V1::Projects::Rest::Client.new do |config|
1144
+ # config.timeout = 10.0
1145
+ # config.rpcs.disable_xpn_host.timeout = 20.0
1146
+ # end
1158
1147
  #
1159
1148
  # @!attribute [rw] endpoint
1160
1149
  # The hostname or hostname:port of the service endpoint.
@@ -1183,8 +1172,19 @@ module Google
1183
1172
  # The call timeout in seconds.
1184
1173
  # @return [::Numeric]
1185
1174
  # @!attribute [rw] metadata
1186
- # Additional REST headers to be sent with the call.
1175
+ # Additional headers to be sent with the call.
1187
1176
  # @return [::Hash{::Symbol=>::String}]
1177
+ # @!attribute [rw] retry_policy
1178
+ # The retry policy. The value is a hash with the following keys:
1179
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1180
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1181
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1182
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1183
+ # trigger a retry.
1184
+ # @return [::Hash]
1185
+ # @!attribute [rw] quota_project
1186
+ # A separate project against which to charge quota.
1187
+ # @return [::String]
1188
1188
  #
1189
1189
  class Configuration
1190
1190
  extend ::Gapic::Config
@@ -1199,6 +1199,8 @@ module Google
1199
1199
  config_attr :lib_version, nil, ::String, nil
1200
1200
  config_attr :timeout, nil, ::Numeric, nil
1201
1201
  config_attr :metadata, nil, ::Hash, nil
1202
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1203
+ config_attr :quota_project, nil, ::String, nil
1202
1204
 
1203
1205
  # @private
1204
1206
  def initialize parent_config = nil
@@ -1227,9 +1229,14 @@ module Google
1227
1229
  # the following configuration fields:
1228
1230
  #
1229
1231
  # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1230
- #
1231
- # there is one other field (`retry_policy`) that can be set
1232
- # but is currently not supported for REST Gapic libraries.
1232
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1233
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1234
+ # include the following keys:
1235
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1236
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1237
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1238
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1239
+ # trigger a retry.
1233
1240
  #
1234
1241
  class Rpcs
1235
1242
  ##