google-cloud-compute-v1 0.2.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (257) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -1
  3. data/AUTHENTICATION.md +19 -37
  4. data/README.md +4 -30
  5. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +127 -90
  6. data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +188 -0
  7. data/lib/google/cloud/compute/v1/accelerator_types/rest.rb +0 -2
  8. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +172 -130
  9. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +279 -0
  10. data/lib/google/cloud/compute/v1/addresses/rest.rb +0 -2
  11. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +218 -172
  12. data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +373 -0
  13. data/lib/google/cloud/compute/v1/autoscalers/rest.rb +0 -2
  14. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +236 -185
  15. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +413 -0
  16. data/lib/google/cloud/compute/v1/backend_buckets/rest.rb +0 -2
  17. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +308 -253
  18. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +553 -0
  19. data/lib/google/cloud/compute/v1/backend_services/rest.rb +0 -2
  20. data/lib/google/cloud/compute/v1/compute_pb.rb +8507 -7466
  21. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +127 -90
  22. data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +188 -0
  23. data/lib/google/cloud/compute/v1/disk_types/rest.rb +0 -2
  24. data/lib/google/cloud/compute/v1/disks/rest/client.rb +345 -272
  25. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +644 -0
  26. data/lib/google/cloud/compute/v1/disks/rest.rb +0 -2
  27. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +184 -129
  28. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +317 -0
  29. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest.rb +0 -2
  30. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +476 -343
  31. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +869 -0
  32. data/lib/google/cloud/compute/v1/firewall_policies/rest.rb +0 -2
  33. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +191 -145
  34. data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +321 -0
  35. data/lib/google/cloud/compute/v1/firewalls/rest.rb +0 -2
  36. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +296 -171
  37. data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +417 -0
  38. data/lib/google/cloud/compute/v1/forwarding_rules/rest.rb +0 -2
  39. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +145 -103
  40. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +229 -0
  41. data/lib/google/cloud/compute/v1/global_addresses/rest.rb +0 -2
  42. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +265 -144
  43. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +365 -0
  44. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest.rb +0 -2
  45. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +215 -172
  46. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +370 -0
  47. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest.rb +0 -2
  48. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +165 -118
  49. data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +274 -0
  50. data/lib/google/cloud/compute/v1/global_operations/rest.rb +0 -2
  51. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +118 -76
  52. data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +186 -0
  53. data/lib/google/cloud/compute/v1/global_organization_operations/rest.rb +0 -2
  54. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +175 -124
  55. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +275 -0
  56. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest.rb +0 -2
  57. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +218 -172
  58. data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +371 -0
  59. data/lib/google/cloud/compute/v1/health_checks/rest.rb +0 -2
  60. data/lib/google/cloud/compute/v1/image_family_views/credentials.rb +53 -0
  61. data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +318 -0
  62. data/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +89 -0
  63. data/lib/google/cloud/compute/v1/image_family_views/rest.rb +33 -0
  64. data/lib/google/cloud/compute/v1/image_family_views.rb +44 -0
  65. data/lib/google/cloud/compute/v1/images/rest/client.rb +291 -209
  66. data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +542 -0
  67. data/lib/google/cloud/compute/v1/images/rest.rb +0 -2
  68. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +526 -477
  69. data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +974 -0
  70. data/lib/google/cloud/compute/v1/instance_group_managers/rest.rb +0 -2
  71. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +271 -233
  72. data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +467 -0
  73. data/lib/google/cloud/compute/v1/instance_groups/rest.rb +0 -2
  74. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +202 -139
  75. data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +362 -0
  76. data/lib/google/cloud/compute/v1/instance_templates/rest.rb +0 -2
  77. data/lib/google/cloud/compute/v1/instances/rest/client.rb +1186 -797
  78. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +2018 -0
  79. data/lib/google/cloud/compute/v1/instances/rest.rb +0 -2
  80. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +195 -151
  81. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +326 -0
  82. data/lib/google/cloud/compute/v1/interconnect_attachments/rest.rb +0 -2
  83. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +100 -63
  84. data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +138 -0
  85. data/lib/google/cloud/compute/v1/interconnect_locations/rest.rb +0 -2
  86. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +189 -135
  87. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +318 -0
  88. data/lib/google/cloud/compute/v1/interconnects/rest.rb +0 -2
  89. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +93 -50
  90. data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +133 -0
  91. data/lib/google/cloud/compute/v1/license_codes/rest.rb +0 -2
  92. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +209 -146
  93. data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +362 -0
  94. data/lib/google/cloud/compute/v1/licenses/rest.rb +0 -2
  95. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +127 -90
  96. data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +188 -0
  97. data/lib/google/cloud/compute/v1/machine_types/rest.rb +0 -2
  98. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +261 -213
  99. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +465 -0
  100. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest.rb +0 -2
  101. data/lib/google/cloud/compute/v1/networks/rest/client.rb +363 -234
  102. data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +553 -0
  103. data/lib/google/cloud/compute/v1/networks/rest.rb +0 -2
  104. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +345 -277
  105. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +646 -0
  106. data/lib/google/cloud/compute/v1/node_groups/rest.rb +0 -2
  107. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +229 -166
  108. data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +412 -0
  109. data/lib/google/cloud/compute/v1/node_templates/rest.rb +0 -2
  110. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +127 -90
  111. data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +188 -0
  112. data/lib/google/cloud/compute/v1/node_types/rest.rb +0 -2
  113. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +213 -163
  114. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +369 -0
  115. data/lib/google/cloud/compute/v1/packet_mirrorings/rest.rb +0 -2
  116. data/lib/google/cloud/compute/v1/projects/rest/client.rb +351 -288
  117. data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +643 -0
  118. data/lib/google/cloud/compute/v1/projects/rest.rb +0 -2
  119. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +175 -124
  120. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +275 -0
  121. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest.rb +0 -2
  122. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +203 -151
  123. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +325 -0
  124. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest.rb +0 -2
  125. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +191 -145
  126. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +323 -0
  127. data/lib/google/cloud/compute/v1/region_autoscalers/rest.rb +0 -2
  128. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +212 -160
  129. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +365 -0
  130. data/lib/google/cloud/compute/v1/region_backend_services/rest.rb +0 -2
  131. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +151 -112
  132. data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +234 -0
  133. data/lib/google/cloud/compute/v1/region_commitments/rest.rb +0 -2
  134. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +100 -63
  135. data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +138 -0
  136. data/lib/google/cloud/compute/v1/region_disk_types/rest.rb +0 -2
  137. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +318 -245
  138. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +593 -0
  139. data/lib/google/cloud/compute/v1/region_disks/rest.rb +0 -2
  140. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +168 -124
  141. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +275 -0
  142. data/lib/google/cloud/compute/v1/region_health_check_services/rest.rb +0 -2
  143. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +191 -145
  144. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +321 -0
  145. data/lib/google/cloud/compute/v1/region_health_checks/rest.rb +0 -2
  146. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +498 -445
  147. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +924 -0
  148. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest.rb +0 -2
  149. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +148 -113
  150. data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +234 -0
  151. data/lib/google/cloud/compute/v1/region_instance_groups/rest.rb +0 -2
  152. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +76 -45
  153. data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +92 -0
  154. data/lib/google/cloud/compute/v1/region_instances/rest.rb +0 -2
  155. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +145 -103
  156. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +229 -0
  157. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest.rb +0 -2
  158. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +145 -103
  159. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +229 -0
  160. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest.rb +0 -2
  161. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +137 -90
  162. data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +224 -0
  163. data/lib/google/cloud/compute/v1/region_operations/rest.rb +0 -2
  164. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +145 -103
  165. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +229 -0
  166. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest.rb +0 -2
  167. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +168 -124
  168. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +275 -0
  169. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest.rb +0 -2
  170. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +191 -145
  171. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +321 -0
  172. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest.rb +0 -2
  173. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +205 -137
  174. data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +365 -0
  175. data/lib/google/cloud/compute/v1/region_url_maps/rest.rb +0 -2
  176. data/lib/google/cloud/compute/v1/regions/rest/client.rb +100 -63
  177. data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +138 -0
  178. data/lib/google/cloud/compute/v1/regions/rest.rb +0 -2
  179. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +252 -187
  180. data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +458 -0
  181. data/lib/google/cloud/compute/v1/reservations/rest.rb +0 -2
  182. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +229 -166
  183. data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +412 -0
  184. data/lib/google/cloud/compute/v1/resource_policies/rest.rb +0 -2
  185. data/lib/google/cloud/compute/v1/routers/rest/client.rb +284 -222
  186. data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +507 -0
  187. data/lib/google/cloud/compute/v1/routers/rest.rb +0 -2
  188. data/lib/google/cloud/compute/v1/routes/rest/client.rb +145 -103
  189. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +229 -0
  190. data/lib/google/cloud/compute/v1/routes/rest.rb +0 -2
  191. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +277 -205
  192. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +504 -0
  193. data/lib/google/cloud/compute/v1/security_policies/rest.rb +0 -2
  194. data/lib/google/cloud/compute/v1/service_attachments/credentials.rb +52 -0
  195. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +954 -0
  196. data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +458 -0
  197. data/lib/google/cloud/compute/v1/service_attachments/rest.rb +33 -0
  198. data/lib/google/cloud/compute/v1/service_attachments.rb +44 -0
  199. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +201 -135
  200. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +360 -0
  201. data/lib/google/cloud/compute/v1/snapshots/rest.rb +0 -2
  202. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +172 -130
  203. data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +279 -0
  204. data/lib/google/cloud/compute/v1/ssl_certificates/rest.rb +0 -2
  205. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +192 -149
  206. data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +324 -0
  207. data/lib/google/cloud/compute/v1/ssl_policies/rest.rb +0 -2
  208. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +325 -256
  209. data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +600 -0
  210. data/lib/google/cloud/compute/v1/subnetworks/rest.rb +0 -2
  211. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +168 -124
  212. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +275 -0
  213. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest.rb +0 -2
  214. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +219 -173
  215. data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +371 -0
  216. data/lib/google/cloud/compute/v1/target_http_proxies/rest.rb +0 -2
  217. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +340 -213
  218. data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +509 -0
  219. data/lib/google/cloud/compute/v1/target_https_proxies/rest.rb +0 -2
  220. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +172 -130
  221. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +279 -0
  222. data/lib/google/cloud/compute/v1/target_instances/rest.rb +0 -2
  223. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +305 -247
  224. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +554 -0
  225. data/lib/google/cloud/compute/v1/target_pools/rest.rb +0 -2
  226. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +237 -187
  227. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +413 -0
  228. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest.rb +0 -2
  229. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +191 -145
  230. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +321 -0
  231. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest.rb +0 -2
  232. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +172 -130
  233. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +279 -0
  234. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest.rb +0 -2
  235. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +260 -208
  236. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +461 -0
  237. data/lib/google/cloud/compute/v1/url_maps/rest.rb +0 -2
  238. data/lib/google/cloud/compute/v1/version.rb +1 -1
  239. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +234 -174
  240. data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +412 -0
  241. data/lib/google/cloud/compute/v1/vpn_gateways/rest.rb +0 -2
  242. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +172 -130
  243. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +279 -0
  244. data/lib/google/cloud/compute/v1/vpn_tunnels/rest.rb +0 -2
  245. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +137 -90
  246. data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +224 -0
  247. data/lib/google/cloud/compute/v1/zone_operations/rest.rb +0 -2
  248. data/lib/google/cloud/compute/v1/zones/rest/client.rb +100 -63
  249. data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +138 -0
  250. data/lib/google/cloud/compute/v1/zones/rest.rb +0 -2
  251. data/lib/google/cloud/compute/v1.rb +7 -0
  252. data/proto_docs/README.md +1 -1
  253. data/proto_docs/google/api/field_behavior.rb +6 -0
  254. data/proto_docs/google/api/resource.rb +10 -71
  255. data/proto_docs/google/cloud/compute/v1/compute.rb +18964 -19481
  256. data/proto_docs/google/cloud/extended_operations.rb +51 -0
  257. metadata +110 -9
@@ -18,6 +18,7 @@
18
18
 
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/compute/v1/compute_pb"
21
+ require "google/cloud/compute/v1/projects/rest/service_stub"
21
22
 
22
23
  module Google
23
24
  module Cloud
@@ -31,8 +32,6 @@ module Google
31
32
  # The Projects API.
32
33
  #
33
34
  class Client
34
- include GrpcTranscoding
35
-
36
35
  # @private
37
36
  attr_reader :projects_stub
38
37
 
@@ -42,13 +41,12 @@ module Google
42
41
  # See {::Google::Cloud::Compute::V1::Projects::Rest::Client::Configuration}
43
42
  # for a description of the configuration fields.
44
43
  #
45
- # ## Example
46
- #
47
- # To modify the configuration for all Projects clients:
44
+ # @example
48
45
  #
49
- # ::Google::Cloud::Compute::V1::Projects::Rest::Client.configure do |config|
50
- # config.timeout = 10.0
51
- # end
46
+ # # Modify the configuration for all Projects clients
47
+ # ::Google::Cloud::Compute::V1::Projects::Rest::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
52
50
  #
53
51
  # @yield [config] Configure the Client client.
54
52
  # @yieldparam config [Client::Configuration]
@@ -66,6 +64,41 @@ module Google
66
64
  end
67
65
  default_config = Client::Configuration.new parent_config
68
66
 
67
+ default_config.rpcs.disable_xpn_host.timeout = 600.0
68
+
69
+ default_config.rpcs.disable_xpn_resource.timeout = 600.0
70
+
71
+ default_config.rpcs.enable_xpn_host.timeout = 600.0
72
+
73
+ default_config.rpcs.enable_xpn_resource.timeout = 600.0
74
+
75
+ default_config.rpcs.get.timeout = 600.0
76
+ default_config.rpcs.get.retry_policy = {
77
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
78
+ }
79
+
80
+ default_config.rpcs.get_xpn_host.timeout = 600.0
81
+ default_config.rpcs.get_xpn_host.retry_policy = {
82
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
83
+ }
84
+
85
+ default_config.rpcs.get_xpn_resources.timeout = 600.0
86
+ default_config.rpcs.get_xpn_resources.retry_policy = {
87
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
88
+ }
89
+
90
+ default_config.rpcs.list_xpn_hosts.timeout = 600.0
91
+
92
+ default_config.rpcs.move_disk.timeout = 600.0
93
+
94
+ default_config.rpcs.move_instance.timeout = 600.0
95
+
96
+ default_config.rpcs.set_common_instance_metadata.timeout = 600.0
97
+
98
+ default_config.rpcs.set_default_network_tier.timeout = 600.0
99
+
100
+ default_config.rpcs.set_usage_export_bucket.timeout = 600.0
101
+
69
102
  default_config
70
103
  end
71
104
  yield @configure if block_given?
@@ -95,28 +128,20 @@ module Google
95
128
  ##
96
129
  # Create a new Projects REST client object.
97
130
  #
98
- # ## Examples
131
+ # @example
99
132
  #
100
- # To create a new Projects REST client with the default
101
- # configuration:
133
+ # # Create a client using the default configuration
134
+ # client = ::Google::Cloud::Compute::V1::Projects::Rest::Client.new
102
135
  #
103
- # client = ::Google::Cloud::Compute::V1::Projects::Rest::Client.new
104
- #
105
- # To create a new Projects REST client with a custom
106
- # configuration:
107
- #
108
- # client = ::Google::Cloud::Compute::V1::Projects::Rest::Client.new do |config|
109
- # config.timeout = 10.0
110
- # end
136
+ # # Create a client using a custom configuration
137
+ # client = ::Google::Cloud::Compute::V1::Projects::Rest::Client.new do |config|
138
+ # config.timeout = 10.0
139
+ # end
111
140
  #
112
141
  # @yield [config] Configure the Projects client.
113
142
  # @yieldparam config [Client::Configuration]
114
143
  #
115
144
  def initialize
116
- # These require statements are intentionally placed here to initialize
117
- # the REST modules only when it's required.
118
- require "gapic/rest"
119
-
120
145
  # Create the configuration object
121
146
  @config = Configuration.new Client.configure
122
147
 
@@ -126,11 +151,11 @@ module Google
126
151
  # Create credentials
127
152
  credentials = @config.credentials
128
153
  credentials ||= Credentials.default scope: @config.scope
129
- if credentials.is_a?(String) || credentials.is_a?(Hash)
154
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
130
155
  credentials = Credentials.new credentials, scope: @config.scope
131
156
  end
132
157
 
133
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: @config.endpoint, credentials: credentials
158
+ @projects_stub = ::Google::Cloud::Compute::V1::Projects::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
134
159
  end
135
160
 
136
161
  # Service calls
@@ -158,16 +183,12 @@ module Google
158
183
  # @param project [::String]
159
184
  # Project ID for this request.
160
185
  # @param request_id [::String]
161
- # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
162
- #
163
- # For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
164
- #
165
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
166
- # @yield [result, env] Access the result along with the Faraday environment object
167
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
186
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
187
+ # @yield [result, response] Access the result along with the Faraday response object
188
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
168
189
  # @yieldparam response [::Faraday::Response]
169
190
  #
170
- # @return [::Google::Cloud::Compute::V1::Operation]
191
+ # @return [::Gapic::Rest::BaseOperation]
171
192
  #
172
193
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
173
194
  def disable_xpn_host request, options = nil
@@ -179,7 +200,7 @@ module Google
179
200
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
180
201
 
181
202
  # Customize the options with defaults
182
- call_metadata = {}
203
+ call_metadata = @config.rpcs.disable_xpn_host.metadata.to_h
183
204
 
184
205
  # Set x-goog-api-client header
185
206
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -187,19 +208,17 @@ module Google
187
208
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
188
209
  transports_version_send: [:rest]
189
210
 
190
- options.apply_defaults timeout: @config.timeout,
211
+ options.apply_defaults timeout: @config.rpcs.disable_xpn_host.timeout,
191
212
  metadata: call_metadata
192
213
 
193
- uri, _body, query_string_params = transcode_disable_xpn_host request
194
- response = @client_stub.make_post_request(
195
- uri: uri,
196
- params: query_string_params,
197
- options: options
198
- )
199
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
214
+ options.apply_defaults timeout: @config.timeout,
215
+ metadata: @config.metadata
200
216
 
201
- yield result, response if block_given?
202
- result
217
+ @projects_stub.disable_xpn_host request, options do |result, response|
218
+ result = ::Gapic::Rest::BaseOperation.new result
219
+ yield result, response if block_given?
220
+ return result
221
+ end
203
222
  rescue ::Faraday::Error => e
204
223
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
205
224
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -230,16 +249,12 @@ module Google
230
249
  # @param projects_disable_xpn_resource_request_resource [::Google::Cloud::Compute::V1::ProjectsDisableXpnResourceRequest, ::Hash]
231
250
  # The body resource for this request
232
251
  # @param request_id [::String]
233
- # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
234
- #
235
- # For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
236
- #
237
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
238
- # @yield [result, env] Access the result along with the Faraday environment object
239
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
252
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
253
+ # @yield [result, response] Access the result along with the Faraday response object
254
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
240
255
  # @yieldparam response [::Faraday::Response]
241
256
  #
242
- # @return [::Google::Cloud::Compute::V1::Operation]
257
+ # @return [::Gapic::Rest::BaseOperation]
243
258
  #
244
259
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
245
260
  def disable_xpn_resource request, options = nil
@@ -251,7 +266,7 @@ module Google
251
266
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
252
267
 
253
268
  # Customize the options with defaults
254
- call_metadata = {}
269
+ call_metadata = @config.rpcs.disable_xpn_resource.metadata.to_h
255
270
 
256
271
  # Set x-goog-api-client header
257
272
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -259,20 +274,17 @@ module Google
259
274
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
260
275
  transports_version_send: [:rest]
261
276
 
262
- options.apply_defaults timeout: @config.timeout,
277
+ options.apply_defaults timeout: @config.rpcs.disable_xpn_resource.timeout,
263
278
  metadata: call_metadata
264
279
 
265
- uri, body, query_string_params = transcode_disable_xpn_resource request
266
- response = @client_stub.make_post_request(
267
- uri: uri,
268
- body: body,
269
- params: query_string_params,
270
- options: options
271
- )
272
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
273
-
274
- yield result, response if block_given?
275
- result
280
+ options.apply_defaults timeout: @config.timeout,
281
+ metadata: @config.metadata
282
+
283
+ @projects_stub.disable_xpn_resource request, options do |result, response|
284
+ result = ::Gapic::Rest::BaseOperation.new result
285
+ yield result, response if block_given?
286
+ return result
287
+ end
276
288
  rescue ::Faraday::Error => e
277
289
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
278
290
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -301,16 +313,12 @@ module Google
301
313
  # @param project [::String]
302
314
  # Project ID for this request.
303
315
  # @param request_id [::String]
304
- # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
305
- #
306
- # For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
307
- #
308
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
309
- # @yield [result, env] Access the result along with the Faraday environment object
310
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
316
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
317
+ # @yield [result, response] Access the result along with the Faraday response object
318
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
311
319
  # @yieldparam response [::Faraday::Response]
312
320
  #
313
- # @return [::Google::Cloud::Compute::V1::Operation]
321
+ # @return [::Gapic::Rest::BaseOperation]
314
322
  #
315
323
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
316
324
  def enable_xpn_host request, options = nil
@@ -322,7 +330,7 @@ module Google
322
330
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
323
331
 
324
332
  # Customize the options with defaults
325
- call_metadata = {}
333
+ call_metadata = @config.rpcs.enable_xpn_host.metadata.to_h
326
334
 
327
335
  # Set x-goog-api-client header
328
336
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -330,19 +338,17 @@ module Google
330
338
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
331
339
  transports_version_send: [:rest]
332
340
 
333
- options.apply_defaults timeout: @config.timeout,
341
+ options.apply_defaults timeout: @config.rpcs.enable_xpn_host.timeout,
334
342
  metadata: call_metadata
335
343
 
336
- uri, _body, query_string_params = transcode_enable_xpn_host request
337
- response = @client_stub.make_post_request(
338
- uri: uri,
339
- params: query_string_params,
340
- options: options
341
- )
342
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
344
+ options.apply_defaults timeout: @config.timeout,
345
+ metadata: @config.metadata
343
346
 
344
- yield result, response if block_given?
345
- result
347
+ @projects_stub.enable_xpn_host request, options do |result, response|
348
+ result = ::Gapic::Rest::BaseOperation.new result
349
+ yield result, response if block_given?
350
+ return result
351
+ end
346
352
  rescue ::Faraday::Error => e
347
353
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
348
354
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -373,16 +379,12 @@ module Google
373
379
  # @param projects_enable_xpn_resource_request_resource [::Google::Cloud::Compute::V1::ProjectsEnableXpnResourceRequest, ::Hash]
374
380
  # The body resource for this request
375
381
  # @param request_id [::String]
376
- # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
377
- #
378
- # For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
379
- #
380
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
381
- # @yield [result, env] Access the result along with the Faraday environment object
382
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
382
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
383
+ # @yield [result, response] Access the result along with the Faraday response object
384
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
383
385
  # @yieldparam response [::Faraday::Response]
384
386
  #
385
- # @return [::Google::Cloud::Compute::V1::Operation]
387
+ # @return [::Gapic::Rest::BaseOperation]
386
388
  #
387
389
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
388
390
  def enable_xpn_resource request, options = nil
@@ -394,7 +396,7 @@ module Google
394
396
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
395
397
 
396
398
  # Customize the options with defaults
397
- call_metadata = {}
399
+ call_metadata = @config.rpcs.enable_xpn_resource.metadata.to_h
398
400
 
399
401
  # Set x-goog-api-client header
400
402
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -402,20 +404,17 @@ module Google
402
404
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
403
405
  transports_version_send: [:rest]
404
406
 
405
- options.apply_defaults timeout: @config.timeout,
407
+ options.apply_defaults timeout: @config.rpcs.enable_xpn_resource.timeout,
406
408
  metadata: call_metadata
407
409
 
408
- uri, body, query_string_params = transcode_enable_xpn_resource request
409
- response = @client_stub.make_post_request(
410
- uri: uri,
411
- body: body,
412
- params: query_string_params,
413
- options: options
414
- )
415
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
416
-
417
- yield result, response if block_given?
418
- result
410
+ options.apply_defaults timeout: @config.timeout,
411
+ metadata: @config.metadata
412
+
413
+ @projects_stub.enable_xpn_resource request, options do |result, response|
414
+ result = ::Gapic::Rest::BaseOperation.new result
415
+ yield result, response if block_given?
416
+ return result
417
+ end
419
418
  rescue ::Faraday::Error => e
420
419
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
421
420
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -443,7 +442,7 @@ module Google
443
442
  #
444
443
  # @param project [::String]
445
444
  # Project ID for this request.
446
- # @yield [result, env] Access the result along with the Faraday environment object
445
+ # @yield [result, response] Access the result along with the Faraday response object
447
446
  # @yieldparam result [::Google::Cloud::Compute::V1::Project]
448
447
  # @yieldparam response [::Faraday::Response]
449
448
  #
@@ -459,7 +458,7 @@ module Google
459
458
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
460
459
 
461
460
  # Customize the options with defaults
462
- call_metadata = {}
461
+ call_metadata = @config.rpcs.get.metadata.to_h
463
462
 
464
463
  # Set x-goog-api-client header
465
464
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -467,18 +466,16 @@ module Google
467
466
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
468
467
  transports_version_send: [:rest]
469
468
 
470
- options.apply_defaults timeout: @config.timeout,
469
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
471
470
  metadata: call_metadata
472
471
 
473
- uri, _body, _query_string_params = transcode_get request
474
- response = @client_stub.make_get_request(
475
- uri: uri,
476
- options: options
477
- )
478
- result = ::Google::Cloud::Compute::V1::Project.decode_json response.body, ignore_unknown_fields: true
472
+ options.apply_defaults timeout: @config.timeout,
473
+ metadata: @config.metadata
479
474
 
480
- yield result, response if block_given?
481
- result
475
+ @projects_stub.get request, options do |result, response|
476
+ yield result, response if block_given?
477
+ return result
478
+ end
482
479
  rescue ::Faraday::Error => e
483
480
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
484
481
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -506,7 +503,7 @@ module Google
506
503
  #
507
504
  # @param project [::String]
508
505
  # Project ID for this request.
509
- # @yield [result, env] Access the result along with the Faraday environment object
506
+ # @yield [result, response] Access the result along with the Faraday response object
510
507
  # @yieldparam result [::Google::Cloud::Compute::V1::Project]
511
508
  # @yieldparam response [::Faraday::Response]
512
509
  #
@@ -522,7 +519,7 @@ module Google
522
519
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
523
520
 
524
521
  # Customize the options with defaults
525
- call_metadata = {}
522
+ call_metadata = @config.rpcs.get_xpn_host.metadata.to_h
526
523
 
527
524
  # Set x-goog-api-client header
528
525
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -530,18 +527,16 @@ module Google
530
527
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
531
528
  transports_version_send: [:rest]
532
529
 
533
- options.apply_defaults timeout: @config.timeout,
530
+ options.apply_defaults timeout: @config.rpcs.get_xpn_host.timeout,
534
531
  metadata: call_metadata
535
532
 
536
- uri, _body, _query_string_params = transcode_get_xpn_host request
537
- response = @client_stub.make_get_request(
538
- uri: uri,
539
- options: options
540
- )
541
- result = ::Google::Cloud::Compute::V1::Project.decode_json response.body, ignore_unknown_fields: true
533
+ options.apply_defaults timeout: @config.timeout,
534
+ metadata: @config.metadata
542
535
 
543
- yield result, response if block_given?
544
- result
536
+ @projects_stub.get_xpn_host request, options do |result, response|
537
+ yield result, response if block_given?
538
+ return result
539
+ end
545
540
  rescue ::Faraday::Error => e
546
541
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
547
542
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -568,32 +563,22 @@ module Google
568
563
  # the default parameter values, pass an empty Hash as a request object (see above).
569
564
  #
570
565
  # @param filter [::String]
571
- # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`.
572
- #
573
- # For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
574
- #
575
- # You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
576
- #
577
- # To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
566
+ # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
578
567
  # @param max_results [::Integer]
579
568
  # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
580
569
  # @param order_by [::String]
581
- # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
582
- #
583
- # You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
584
- #
585
- # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
570
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.
586
571
  # @param page_token [::String]
587
572
  # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
588
573
  # @param project [::String]
589
574
  # Project ID for this request.
590
575
  # @param return_partial_success [::Boolean]
591
- # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
592
- # @yield [result, env] Access the result along with the Faraday environment object
593
- # @yieldparam result [::Google::Cloud::Compute::V1::ProjectsGetXpnResources]
576
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
577
+ # @yield [result, response] Access the result along with the Faraday response object
578
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::XpnResourceId>]
594
579
  # @yieldparam response [::Faraday::Response]
595
580
  #
596
- # @return [::Google::Cloud::Compute::V1::ProjectsGetXpnResources]
581
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::XpnResourceId>]
597
582
  #
598
583
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
599
584
  def get_xpn_resources request, options = nil
@@ -605,7 +590,7 @@ module Google
605
590
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
606
591
 
607
592
  # Customize the options with defaults
608
- call_metadata = {}
593
+ call_metadata = @config.rpcs.get_xpn_resources.metadata.to_h
609
594
 
610
595
  # Set x-goog-api-client header
611
596
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -613,19 +598,17 @@ module Google
613
598
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
614
599
  transports_version_send: [:rest]
615
600
 
616
- options.apply_defaults timeout: @config.timeout,
601
+ options.apply_defaults timeout: @config.rpcs.get_xpn_resources.timeout,
617
602
  metadata: call_metadata
618
603
 
619
- uri, _body, query_string_params = transcode_get_xpn_resources request
620
- response = @client_stub.make_get_request(
621
- uri: uri,
622
- params: query_string_params,
623
- options: options
624
- )
625
- result = ::Google::Cloud::Compute::V1::ProjectsGetXpnResources.decode_json response.body, ignore_unknown_fields: true
604
+ options.apply_defaults timeout: @config.timeout,
605
+ metadata: @config.metadata
626
606
 
627
- yield result, response if block_given?
628
- result
607
+ @projects_stub.get_xpn_resources request, options do |result, response|
608
+ result = ::Gapic::Rest::PagedEnumerable.new @projects_stub, :get_xpn_resources, "resources", request, result, options
609
+ yield result, response if block_given?
610
+ return result
611
+ end
629
612
  rescue ::Faraday::Error => e
630
613
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
631
614
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -652,21 +635,11 @@ module Google
652
635
  # the default parameter values, pass an empty Hash as a request object (see above).
653
636
  #
654
637
  # @param filter [::String]
655
- # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`.
656
- #
657
- # For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
658
- #
659
- # You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
660
- #
661
- # To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
638
+ # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
662
639
  # @param max_results [::Integer]
663
640
  # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
664
641
  # @param order_by [::String]
665
- # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
666
- #
667
- # You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
668
- #
669
- # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
642
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.
670
643
  # @param page_token [::String]
671
644
  # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
672
645
  # @param project [::String]
@@ -674,12 +647,12 @@ module Google
674
647
  # @param projects_list_xpn_hosts_request_resource [::Google::Cloud::Compute::V1::ProjectsListXpnHostsRequest, ::Hash]
675
648
  # The body resource for this request
676
649
  # @param return_partial_success [::Boolean]
677
- # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
678
- # @yield [result, env] Access the result along with the Faraday environment object
679
- # @yieldparam result [::Google::Cloud::Compute::V1::XpnHostList]
650
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
651
+ # @yield [result, response] Access the result along with the Faraday response object
652
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Project>]
680
653
  # @yieldparam response [::Faraday::Response]
681
654
  #
682
- # @return [::Google::Cloud::Compute::V1::XpnHostList]
655
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Project>]
683
656
  #
684
657
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
685
658
  def list_xpn_hosts request, options = nil
@@ -691,7 +664,7 @@ module Google
691
664
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
692
665
 
693
666
  # Customize the options with defaults
694
- call_metadata = {}
667
+ call_metadata = @config.rpcs.list_xpn_hosts.metadata.to_h
695
668
 
696
669
  # Set x-goog-api-client header
697
670
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -699,20 +672,17 @@ module Google
699
672
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
700
673
  transports_version_send: [:rest]
701
674
 
702
- options.apply_defaults timeout: @config.timeout,
675
+ options.apply_defaults timeout: @config.rpcs.list_xpn_hosts.timeout,
703
676
  metadata: call_metadata
704
677
 
705
- uri, body, query_string_params = transcode_list_xpn_hosts request
706
- response = @client_stub.make_post_request(
707
- uri: uri,
708
- body: body,
709
- params: query_string_params,
710
- options: options
711
- )
712
- result = ::Google::Cloud::Compute::V1::XpnHostList.decode_json response.body, ignore_unknown_fields: true
713
-
714
- yield result, response if block_given?
715
- result
678
+ options.apply_defaults timeout: @config.timeout,
679
+ metadata: @config.metadata
680
+
681
+ @projects_stub.list_xpn_hosts request, options do |result, response|
682
+ result = ::Gapic::Rest::PagedEnumerable.new @projects_stub, :list_xpn_hosts, "items", request, result, options
683
+ yield result, response if block_given?
684
+ return result
685
+ end
716
686
  rescue ::Faraday::Error => e
717
687
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
718
688
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -743,16 +713,12 @@ module Google
743
713
  # @param project [::String]
744
714
  # Project ID for this request.
745
715
  # @param request_id [::String]
746
- # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
747
- #
748
- # For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
749
- #
750
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
751
- # @yield [result, env] Access the result along with the Faraday environment object
752
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
716
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
717
+ # @yield [result, response] Access the result along with the Faraday response object
718
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
753
719
  # @yieldparam response [::Faraday::Response]
754
720
  #
755
- # @return [::Google::Cloud::Compute::V1::Operation]
721
+ # @return [::Gapic::Rest::BaseOperation]
756
722
  #
757
723
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
758
724
  def move_disk request, options = nil
@@ -764,7 +730,7 @@ module Google
764
730
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
765
731
 
766
732
  # Customize the options with defaults
767
- call_metadata = {}
733
+ call_metadata = @config.rpcs.move_disk.metadata.to_h
768
734
 
769
735
  # Set x-goog-api-client header
770
736
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -772,20 +738,17 @@ module Google
772
738
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
773
739
  transports_version_send: [:rest]
774
740
 
775
- options.apply_defaults timeout: @config.timeout,
741
+ options.apply_defaults timeout: @config.rpcs.move_disk.timeout,
776
742
  metadata: call_metadata
777
743
 
778
- uri, body, query_string_params = transcode_move_disk request
779
- response = @client_stub.make_post_request(
780
- uri: uri,
781
- body: body,
782
- params: query_string_params,
783
- options: options
784
- )
785
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
786
-
787
- yield result, response if block_given?
788
- result
744
+ options.apply_defaults timeout: @config.timeout,
745
+ metadata: @config.metadata
746
+
747
+ @projects_stub.move_disk request, options do |result, response|
748
+ result = ::Gapic::Rest::BaseOperation.new result
749
+ yield result, response if block_given?
750
+ return result
751
+ end
789
752
  rescue ::Faraday::Error => e
790
753
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
791
754
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -816,16 +779,12 @@ module Google
816
779
  # @param project [::String]
817
780
  # Project ID for this request.
818
781
  # @param request_id [::String]
819
- # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
820
- #
821
- # For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
822
- #
823
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
824
- # @yield [result, env] Access the result along with the Faraday environment object
825
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
782
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
783
+ # @yield [result, response] Access the result along with the Faraday response object
784
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
826
785
  # @yieldparam response [::Faraday::Response]
827
786
  #
828
- # @return [::Google::Cloud::Compute::V1::Operation]
787
+ # @return [::Gapic::Rest::BaseOperation]
829
788
  #
830
789
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
831
790
  def move_instance request, options = nil
@@ -837,7 +796,7 @@ module Google
837
796
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
838
797
 
839
798
  # Customize the options with defaults
840
- call_metadata = {}
799
+ call_metadata = @config.rpcs.move_instance.metadata.to_h
841
800
 
842
801
  # Set x-goog-api-client header
843
802
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -845,20 +804,17 @@ module Google
845
804
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
846
805
  transports_version_send: [:rest]
847
806
 
848
- options.apply_defaults timeout: @config.timeout,
807
+ options.apply_defaults timeout: @config.rpcs.move_instance.timeout,
849
808
  metadata: call_metadata
850
809
 
851
- uri, body, query_string_params = transcode_move_instance request
852
- response = @client_stub.make_post_request(
853
- uri: uri,
854
- body: body,
855
- params: query_string_params,
856
- options: options
857
- )
858
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
859
-
860
- yield result, response if block_given?
861
- result
810
+ options.apply_defaults timeout: @config.timeout,
811
+ metadata: @config.metadata
812
+
813
+ @projects_stub.move_instance request, options do |result, response|
814
+ result = ::Gapic::Rest::BaseOperation.new result
815
+ yield result, response if block_given?
816
+ return result
817
+ end
862
818
  rescue ::Faraday::Error => e
863
819
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
864
820
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -889,16 +845,12 @@ module Google
889
845
  # @param project [::String]
890
846
  # Project ID for this request.
891
847
  # @param request_id [::String]
892
- # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
893
- #
894
- # For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
895
- #
896
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
897
- # @yield [result, env] Access the result along with the Faraday environment object
898
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
848
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
849
+ # @yield [result, response] Access the result along with the Faraday response object
850
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
899
851
  # @yieldparam response [::Faraday::Response]
900
852
  #
901
- # @return [::Google::Cloud::Compute::V1::Operation]
853
+ # @return [::Gapic::Rest::BaseOperation]
902
854
  #
903
855
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
904
856
  def set_common_instance_metadata request, options = nil
@@ -910,7 +862,7 @@ module Google
910
862
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
911
863
 
912
864
  # Customize the options with defaults
913
- call_metadata = {}
865
+ call_metadata = @config.rpcs.set_common_instance_metadata.metadata.to_h
914
866
 
915
867
  # Set x-goog-api-client header
916
868
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -918,20 +870,17 @@ module Google
918
870
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
919
871
  transports_version_send: [:rest]
920
872
 
921
- options.apply_defaults timeout: @config.timeout,
873
+ options.apply_defaults timeout: @config.rpcs.set_common_instance_metadata.timeout,
922
874
  metadata: call_metadata
923
875
 
924
- uri, body, query_string_params = transcode_set_common_instance_metadata request
925
- response = @client_stub.make_post_request(
926
- uri: uri,
927
- body: body,
928
- params: query_string_params,
929
- options: options
930
- )
931
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
932
-
933
- yield result, response if block_given?
934
- result
876
+ options.apply_defaults timeout: @config.timeout,
877
+ metadata: @config.metadata
878
+
879
+ @projects_stub.set_common_instance_metadata request, options do |result, response|
880
+ result = ::Gapic::Rest::BaseOperation.new result
881
+ yield result, response if block_given?
882
+ return result
883
+ end
935
884
  rescue ::Faraday::Error => e
936
885
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
937
886
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -962,16 +911,12 @@ module Google
962
911
  # @param projects_set_default_network_tier_request_resource [::Google::Cloud::Compute::V1::ProjectsSetDefaultNetworkTierRequest, ::Hash]
963
912
  # The body resource for this request
964
913
  # @param request_id [::String]
965
- # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
966
- #
967
- # For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
968
- #
969
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
970
- # @yield [result, env] Access the result along with the Faraday environment object
971
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
914
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
915
+ # @yield [result, response] Access the result along with the Faraday response object
916
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
972
917
  # @yieldparam response [::Faraday::Response]
973
918
  #
974
- # @return [::Google::Cloud::Compute::V1::Operation]
919
+ # @return [::Gapic::Rest::BaseOperation]
975
920
  #
976
921
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
977
922
  def set_default_network_tier request, options = nil
@@ -983,7 +928,7 @@ module Google
983
928
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
984
929
 
985
930
  # Customize the options with defaults
986
- call_metadata = {}
931
+ call_metadata = @config.rpcs.set_default_network_tier.metadata.to_h
987
932
 
988
933
  # Set x-goog-api-client header
989
934
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -991,20 +936,17 @@ module Google
991
936
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
992
937
  transports_version_send: [:rest]
993
938
 
994
- options.apply_defaults timeout: @config.timeout,
939
+ options.apply_defaults timeout: @config.rpcs.set_default_network_tier.timeout,
995
940
  metadata: call_metadata
996
941
 
997
- uri, body, query_string_params = transcode_set_default_network_tier request
998
- response = @client_stub.make_post_request(
999
- uri: uri,
1000
- body: body,
1001
- params: query_string_params,
1002
- options: options
1003
- )
1004
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1005
-
1006
- yield result, response if block_given?
1007
- result
942
+ options.apply_defaults timeout: @config.timeout,
943
+ metadata: @config.metadata
944
+
945
+ @projects_stub.set_default_network_tier request, options do |result, response|
946
+ result = ::Gapic::Rest::BaseOperation.new result
947
+ yield result, response if block_given?
948
+ return result
949
+ end
1008
950
  rescue ::Faraday::Error => e
1009
951
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1010
952
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -1033,18 +975,14 @@ module Google
1033
975
  # @param project [::String]
1034
976
  # Project ID for this request.
1035
977
  # @param request_id [::String]
1036
- # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
1037
- #
1038
- # For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
1039
- #
1040
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
978
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
1041
979
  # @param usage_export_location_resource [::Google::Cloud::Compute::V1::UsageExportLocation, ::Hash]
1042
980
  # The body resource for this request
1043
- # @yield [result, env] Access the result along with the Faraday environment object
1044
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
981
+ # @yield [result, response] Access the result along with the Faraday response object
982
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
1045
983
  # @yieldparam response [::Faraday::Response]
1046
984
  #
1047
- # @return [::Google::Cloud::Compute::V1::Operation]
985
+ # @return [::Gapic::Rest::BaseOperation]
1048
986
  #
1049
987
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1050
988
  def set_usage_export_bucket request, options = nil
@@ -1056,7 +994,7 @@ module Google
1056
994
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1057
995
 
1058
996
  # Customize the options with defaults
1059
- call_metadata = {}
997
+ call_metadata = @config.rpcs.set_usage_export_bucket.metadata.to_h
1060
998
 
1061
999
  # Set x-goog-api-client header
1062
1000
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -1064,20 +1002,17 @@ module Google
1064
1002
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1065
1003
  transports_version_send: [:rest]
1066
1004
 
1067
- options.apply_defaults timeout: @config.timeout,
1005
+ options.apply_defaults timeout: @config.rpcs.set_usage_export_bucket.timeout,
1068
1006
  metadata: call_metadata
1069
1007
 
1070
- uri, body, query_string_params = transcode_set_usage_export_bucket request
1071
- response = @client_stub.make_post_request(
1072
- uri: uri,
1073
- body: body,
1074
- params: query_string_params,
1075
- options: options
1076
- )
1077
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1078
-
1079
- yield result, response if block_given?
1080
- result
1008
+ options.apply_defaults timeout: @config.timeout,
1009
+ metadata: @config.metadata
1010
+
1011
+ @projects_stub.set_usage_export_bucket request, options do |result, response|
1012
+ result = ::Gapic::Rest::BaseOperation.new result
1013
+ yield result, response if block_given?
1014
+ return result
1015
+ end
1081
1016
  rescue ::Faraday::Error => e
1082
1017
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1083
1018
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -1132,6 +1067,9 @@ module Google
1132
1067
  # @!attribute [rw] timeout
1133
1068
  # The call timeout in seconds.
1134
1069
  # @return [::Numeric]
1070
+ # @!attribute [rw] metadata
1071
+ # Additional REST headers to be sent with the call.
1072
+ # @return [::Hash{::Symbol=>::String}]
1135
1073
  #
1136
1074
  class Configuration
1137
1075
  extend ::Gapic::Config
@@ -1145,6 +1083,7 @@ module Google
1145
1083
  config_attr :lib_name, nil, ::String, nil
1146
1084
  config_attr :lib_version, nil, ::String, nil
1147
1085
  config_attr :timeout, nil, ::Numeric, nil
1086
+ config_attr :metadata, nil, ::Hash, nil
1148
1087
 
1149
1088
  # @private
1150
1089
  def initialize parent_config = nil
@@ -1152,6 +1091,130 @@ module Google
1152
1091
 
1153
1092
  yield self if block_given?
1154
1093
  end
1094
+
1095
+ ##
1096
+ # Configurations for individual RPCs
1097
+ # @return [Rpcs]
1098
+ #
1099
+ def rpcs
1100
+ @rpcs ||= begin
1101
+ parent_rpcs = nil
1102
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1103
+ Rpcs.new parent_rpcs
1104
+ end
1105
+ end
1106
+
1107
+ ##
1108
+ # Configuration RPC class for the Projects API.
1109
+ #
1110
+ # Includes fields providing the configuration for each RPC in this service.
1111
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1112
+ # the following configuration fields:
1113
+ #
1114
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1115
+ #
1116
+ # there is one other field (`retry_policy`) that can be set
1117
+ # but is currently not supported for REST Gapic libraries.
1118
+ #
1119
+ class Rpcs
1120
+ ##
1121
+ # RPC-specific configuration for `disable_xpn_host`
1122
+ # @return [::Gapic::Config::Method]
1123
+ #
1124
+ attr_reader :disable_xpn_host
1125
+ ##
1126
+ # RPC-specific configuration for `disable_xpn_resource`
1127
+ # @return [::Gapic::Config::Method]
1128
+ #
1129
+ attr_reader :disable_xpn_resource
1130
+ ##
1131
+ # RPC-specific configuration for `enable_xpn_host`
1132
+ # @return [::Gapic::Config::Method]
1133
+ #
1134
+ attr_reader :enable_xpn_host
1135
+ ##
1136
+ # RPC-specific configuration for `enable_xpn_resource`
1137
+ # @return [::Gapic::Config::Method]
1138
+ #
1139
+ attr_reader :enable_xpn_resource
1140
+ ##
1141
+ # RPC-specific configuration for `get`
1142
+ # @return [::Gapic::Config::Method]
1143
+ #
1144
+ attr_reader :get
1145
+ ##
1146
+ # RPC-specific configuration for `get_xpn_host`
1147
+ # @return [::Gapic::Config::Method]
1148
+ #
1149
+ attr_reader :get_xpn_host
1150
+ ##
1151
+ # RPC-specific configuration for `get_xpn_resources`
1152
+ # @return [::Gapic::Config::Method]
1153
+ #
1154
+ attr_reader :get_xpn_resources
1155
+ ##
1156
+ # RPC-specific configuration for `list_xpn_hosts`
1157
+ # @return [::Gapic::Config::Method]
1158
+ #
1159
+ attr_reader :list_xpn_hosts
1160
+ ##
1161
+ # RPC-specific configuration for `move_disk`
1162
+ # @return [::Gapic::Config::Method]
1163
+ #
1164
+ attr_reader :move_disk
1165
+ ##
1166
+ # RPC-specific configuration for `move_instance`
1167
+ # @return [::Gapic::Config::Method]
1168
+ #
1169
+ attr_reader :move_instance
1170
+ ##
1171
+ # RPC-specific configuration for `set_common_instance_metadata`
1172
+ # @return [::Gapic::Config::Method]
1173
+ #
1174
+ attr_reader :set_common_instance_metadata
1175
+ ##
1176
+ # RPC-specific configuration for `set_default_network_tier`
1177
+ # @return [::Gapic::Config::Method]
1178
+ #
1179
+ attr_reader :set_default_network_tier
1180
+ ##
1181
+ # RPC-specific configuration for `set_usage_export_bucket`
1182
+ # @return [::Gapic::Config::Method]
1183
+ #
1184
+ attr_reader :set_usage_export_bucket
1185
+
1186
+ # @private
1187
+ def initialize parent_rpcs = nil
1188
+ disable_xpn_host_config = parent_rpcs.disable_xpn_host if parent_rpcs.respond_to? :disable_xpn_host
1189
+ @disable_xpn_host = ::Gapic::Config::Method.new disable_xpn_host_config
1190
+ disable_xpn_resource_config = parent_rpcs.disable_xpn_resource if parent_rpcs.respond_to? :disable_xpn_resource
1191
+ @disable_xpn_resource = ::Gapic::Config::Method.new disable_xpn_resource_config
1192
+ enable_xpn_host_config = parent_rpcs.enable_xpn_host if parent_rpcs.respond_to? :enable_xpn_host
1193
+ @enable_xpn_host = ::Gapic::Config::Method.new enable_xpn_host_config
1194
+ enable_xpn_resource_config = parent_rpcs.enable_xpn_resource if parent_rpcs.respond_to? :enable_xpn_resource
1195
+ @enable_xpn_resource = ::Gapic::Config::Method.new enable_xpn_resource_config
1196
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
1197
+ @get = ::Gapic::Config::Method.new get_config
1198
+ get_xpn_host_config = parent_rpcs.get_xpn_host if parent_rpcs.respond_to? :get_xpn_host
1199
+ @get_xpn_host = ::Gapic::Config::Method.new get_xpn_host_config
1200
+ get_xpn_resources_config = parent_rpcs.get_xpn_resources if parent_rpcs.respond_to? :get_xpn_resources
1201
+ @get_xpn_resources = ::Gapic::Config::Method.new get_xpn_resources_config
1202
+ list_xpn_hosts_config = parent_rpcs.list_xpn_hosts if parent_rpcs.respond_to? :list_xpn_hosts
1203
+ @list_xpn_hosts = ::Gapic::Config::Method.new list_xpn_hosts_config
1204
+ move_disk_config = parent_rpcs.move_disk if parent_rpcs.respond_to? :move_disk
1205
+ @move_disk = ::Gapic::Config::Method.new move_disk_config
1206
+ move_instance_config = parent_rpcs.move_instance if parent_rpcs.respond_to? :move_instance
1207
+ @move_instance = ::Gapic::Config::Method.new move_instance_config
1208
+ set_common_instance_metadata_config = parent_rpcs.set_common_instance_metadata if parent_rpcs.respond_to? :set_common_instance_metadata
1209
+ @set_common_instance_metadata = ::Gapic::Config::Method.new set_common_instance_metadata_config
1210
+ set_default_network_tier_config = parent_rpcs.set_default_network_tier if parent_rpcs.respond_to? :set_default_network_tier
1211
+ @set_default_network_tier = ::Gapic::Config::Method.new set_default_network_tier_config
1212
+ set_usage_export_bucket_config = parent_rpcs.set_usage_export_bucket if parent_rpcs.respond_to? :set_usage_export_bucket
1213
+ @set_usage_export_bucket = ::Gapic::Config::Method.new set_usage_export_bucket_config
1214
+
1215
+ yield self if block_given?
1216
+ end
1217
+ end
1155
1218
  end
1156
1219
  end
1157
1220
  end