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/node_groups/rest/service_stub"
21
22
 
22
23
  module Google
23
24
  module Cloud
@@ -31,8 +32,6 @@ module Google
31
32
  # The NodeGroups API.
32
33
  #
33
34
  class Client
34
- include GrpcTranscoding
35
-
36
35
  # @private
37
36
  attr_reader :node_groups_stub
38
37
 
@@ -42,13 +41,12 @@ module Google
42
41
  # See {::Google::Cloud::Compute::V1::NodeGroups::Rest::Client::Configuration}
43
42
  # for a description of the configuration fields.
44
43
  #
45
- # ## Example
46
- #
47
- # To modify the configuration for all NodeGroups clients:
44
+ # @example
48
45
  #
49
- # ::Google::Cloud::Compute::V1::NodeGroups::Rest::Client.configure do |config|
50
- # config.timeout = 10.0
51
- # end
46
+ # # Modify the configuration for all NodeGroups clients
47
+ # ::Google::Cloud::Compute::V1::NodeGroups::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,44 @@ module Google
66
64
  end
67
65
  default_config = Client::Configuration.new parent_config
68
66
 
67
+ default_config.rpcs.add_nodes.timeout = 600.0
68
+
69
+ default_config.rpcs.aggregated_list.timeout = 600.0
70
+ default_config.rpcs.aggregated_list.retry_policy = {
71
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
72
+ }
73
+
74
+ default_config.rpcs.delete.timeout = 600.0
75
+
76
+ default_config.rpcs.delete_nodes.timeout = 600.0
77
+
78
+ default_config.rpcs.get.timeout = 600.0
79
+ default_config.rpcs.get.retry_policy = {
80
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
81
+ }
82
+
83
+ default_config.rpcs.get_iam_policy.timeout = 600.0
84
+ default_config.rpcs.get_iam_policy.retry_policy = {
85
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
86
+ }
87
+
88
+ default_config.rpcs.insert.timeout = 600.0
89
+
90
+ default_config.rpcs.list.timeout = 600.0
91
+ default_config.rpcs.list.retry_policy = {
92
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
93
+ }
94
+
95
+ default_config.rpcs.list_nodes.timeout = 600.0
96
+
97
+ default_config.rpcs.patch.timeout = 600.0
98
+
99
+ default_config.rpcs.set_iam_policy.timeout = 600.0
100
+
101
+ default_config.rpcs.set_node_template.timeout = 600.0
102
+
103
+ default_config.rpcs.test_iam_permissions.timeout = 600.0
104
+
69
105
  default_config
70
106
  end
71
107
  yield @configure if block_given?
@@ -95,28 +131,20 @@ module Google
95
131
  ##
96
132
  # Create a new NodeGroups REST client object.
97
133
  #
98
- # ## Examples
99
- #
100
- # To create a new NodeGroups REST client with the default
101
- # configuration:
102
- #
103
- # client = ::Google::Cloud::Compute::V1::NodeGroups::Rest::Client.new
134
+ # @example
104
135
  #
105
- # To create a new NodeGroups REST client with a custom
106
- # configuration:
136
+ # # Create a client using the default configuration
137
+ # client = ::Google::Cloud::Compute::V1::NodeGroups::Rest::Client.new
107
138
  #
108
- # client = ::Google::Cloud::Compute::V1::NodeGroups::Rest::Client.new do |config|
109
- # config.timeout = 10.0
110
- # end
139
+ # # Create a client using a custom configuration
140
+ # client = ::Google::Cloud::Compute::V1::NodeGroups::Rest::Client.new do |config|
141
+ # config.timeout = 10.0
142
+ # end
111
143
  #
112
144
  # @yield [config] Configure the NodeGroups client.
113
145
  # @yieldparam config [Client::Configuration]
114
146
  #
115
147
  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
148
  # Create the configuration object
121
149
  @config = Configuration.new Client.configure
122
150
 
@@ -126,11 +154,11 @@ module Google
126
154
  # Create credentials
127
155
  credentials = @config.credentials
128
156
  credentials ||= Credentials.default scope: @config.scope
129
- if credentials.is_a?(String) || credentials.is_a?(Hash)
157
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
130
158
  credentials = Credentials.new credentials, scope: @config.scope
131
159
  end
132
160
 
133
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: @config.endpoint, credentials: credentials
161
+ @node_groups_stub = ::Google::Cloud::Compute::V1::NodeGroups::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
134
162
  end
135
163
 
136
164
  # Service calls
@@ -162,18 +190,14 @@ module Google
162
190
  # @param project [::String]
163
191
  # Project ID for this request.
164
192
  # @param request_id [::String]
165
- # 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.
166
- #
167
- # 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.
168
- #
169
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
193
+ # 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).
170
194
  # @param zone [::String]
171
195
  # The name of the zone for this request.
172
- # @yield [result, env] Access the result along with the Faraday environment object
173
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
196
+ # @yield [result, response] Access the result along with the Faraday response object
197
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
174
198
  # @yieldparam response [::Faraday::Response]
175
199
  #
176
- # @return [::Google::Cloud::Compute::V1::Operation]
200
+ # @return [::Gapic::Rest::BaseOperation]
177
201
  #
178
202
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
179
203
  def add_nodes request, options = nil
@@ -185,7 +209,7 @@ module Google
185
209
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
186
210
 
187
211
  # Customize the options with defaults
188
- call_metadata = {}
212
+ call_metadata = @config.rpcs.add_nodes.metadata.to_h
189
213
 
190
214
  # Set x-goog-api-client header
191
215
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -193,20 +217,17 @@ module Google
193
217
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
194
218
  transports_version_send: [:rest]
195
219
 
196
- options.apply_defaults timeout: @config.timeout,
220
+ options.apply_defaults timeout: @config.rpcs.add_nodes.timeout,
197
221
  metadata: call_metadata
198
222
 
199
- uri, body, query_string_params = transcode_add_nodes request
200
- response = @client_stub.make_post_request(
201
- uri: uri,
202
- body: body,
203
- params: query_string_params,
204
- options: options
205
- )
206
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
207
-
208
- yield result, response if block_given?
209
- result
223
+ options.apply_defaults timeout: @config.timeout,
224
+ metadata: @config.metadata
225
+
226
+ @node_groups_stub.add_nodes request, options do |result, response|
227
+ result = ::Gapic::Rest::BaseOperation.new result
228
+ yield result, response if block_given?
229
+ return result
230
+ end
210
231
  rescue ::Faraday::Error => e
211
232
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
212
233
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -233,34 +254,24 @@ module Google
233
254
  # the default parameter values, pass an empty Hash as a request object (see above).
234
255
  #
235
256
  # @param filter [::String]
236
- # 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 `<`.
237
- #
238
- # For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
239
- #
240
- # 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.
241
- #
242
- # 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) ```
257
+ # 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) ```
243
258
  # @param include_all_scopes [::Boolean]
244
259
  # Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.
245
260
  # @param max_results [::Integer]
246
261
  # 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`)
247
262
  # @param order_by [::String]
248
- # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
249
- #
250
- # 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.
251
- #
252
- # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
263
+ # 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.
253
264
  # @param page_token [::String]
254
265
  # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
255
266
  # @param project [::String]
256
267
  # Project ID for this request.
257
268
  # @param return_partial_success [::Boolean]
258
- # 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.
259
- # @yield [result, env] Access the result along with the Faraday environment object
260
- # @yieldparam result [::Google::Cloud::Compute::V1::NodeGroupAggregatedList]
269
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
270
+ # @yield [result, response] Access the result along with the Faraday response object
271
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::NodeGroupsScopedList>]
261
272
  # @yieldparam response [::Faraday::Response]
262
273
  #
263
- # @return [::Google::Cloud::Compute::V1::NodeGroupAggregatedList]
274
+ # @return [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::NodeGroupsScopedList>]
264
275
  #
265
276
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
266
277
  def aggregated_list request, options = nil
@@ -272,7 +283,7 @@ module Google
272
283
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
273
284
 
274
285
  # Customize the options with defaults
275
- call_metadata = {}
286
+ call_metadata = @config.rpcs.aggregated_list.metadata.to_h
276
287
 
277
288
  # Set x-goog-api-client header
278
289
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -280,19 +291,17 @@ module Google
280
291
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
281
292
  transports_version_send: [:rest]
282
293
 
283
- options.apply_defaults timeout: @config.timeout,
294
+ options.apply_defaults timeout: @config.rpcs.aggregated_list.timeout,
284
295
  metadata: call_metadata
285
296
 
286
- uri, _body, query_string_params = transcode_aggregated_list request
287
- response = @client_stub.make_get_request(
288
- uri: uri,
289
- params: query_string_params,
290
- options: options
291
- )
292
- result = ::Google::Cloud::Compute::V1::NodeGroupAggregatedList.decode_json response.body, ignore_unknown_fields: true
297
+ options.apply_defaults timeout: @config.timeout,
298
+ metadata: @config.metadata
293
299
 
294
- yield result, response if block_given?
295
- result
300
+ @node_groups_stub.aggregated_list request, options do |result, response|
301
+ result = ::Gapic::Rest::PagedEnumerable.new @node_groups_stub, :aggregated_list, "items", request, result, options
302
+ yield result, response if block_given?
303
+ return result
304
+ end
296
305
  rescue ::Faraday::Error => e
297
306
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
298
307
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -323,18 +332,14 @@ module Google
323
332
  # @param project [::String]
324
333
  # Project ID for this request.
325
334
  # @param request_id [::String]
326
- # 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.
327
- #
328
- # 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.
329
- #
330
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
335
+ # 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).
331
336
  # @param zone [::String]
332
337
  # The name of the zone for this request.
333
- # @yield [result, env] Access the result along with the Faraday environment object
334
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
338
+ # @yield [result, response] Access the result along with the Faraday response object
339
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
335
340
  # @yieldparam response [::Faraday::Response]
336
341
  #
337
- # @return [::Google::Cloud::Compute::V1::Operation]
342
+ # @return [::Gapic::Rest::BaseOperation]
338
343
  #
339
344
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
340
345
  def delete request, options = nil
@@ -346,7 +351,7 @@ module Google
346
351
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
347
352
 
348
353
  # Customize the options with defaults
349
- call_metadata = {}
354
+ call_metadata = @config.rpcs.delete.metadata.to_h
350
355
 
351
356
  # Set x-goog-api-client header
352
357
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -354,19 +359,17 @@ module Google
354
359
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
355
360
  transports_version_send: [:rest]
356
361
 
357
- options.apply_defaults timeout: @config.timeout,
362
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
358
363
  metadata: call_metadata
359
364
 
360
- uri, _body, query_string_params = transcode_delete request
361
- response = @client_stub.make_delete_request(
362
- uri: uri,
363
- params: query_string_params,
364
- options: options
365
- )
366
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
365
+ options.apply_defaults timeout: @config.timeout,
366
+ metadata: @config.metadata
367
367
 
368
- yield result, response if block_given?
369
- result
368
+ @node_groups_stub.delete request, options do |result, response|
369
+ result = ::Gapic::Rest::BaseOperation.new result
370
+ yield result, response if block_given?
371
+ return result
372
+ end
370
373
  rescue ::Faraday::Error => e
371
374
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
372
375
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -399,18 +402,14 @@ module Google
399
402
  # @param project [::String]
400
403
  # Project ID for this request.
401
404
  # @param request_id [::String]
402
- # 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.
403
- #
404
- # 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.
405
- #
406
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
405
+ # 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).
407
406
  # @param zone [::String]
408
407
  # The name of the zone for this request.
409
- # @yield [result, env] Access the result along with the Faraday environment object
410
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
408
+ # @yield [result, response] Access the result along with the Faraday response object
409
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
411
410
  # @yieldparam response [::Faraday::Response]
412
411
  #
413
- # @return [::Google::Cloud::Compute::V1::Operation]
412
+ # @return [::Gapic::Rest::BaseOperation]
414
413
  #
415
414
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
416
415
  def delete_nodes request, options = nil
@@ -422,7 +421,7 @@ module Google
422
421
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
423
422
 
424
423
  # Customize the options with defaults
425
- call_metadata = {}
424
+ call_metadata = @config.rpcs.delete_nodes.metadata.to_h
426
425
 
427
426
  # Set x-goog-api-client header
428
427
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -430,20 +429,17 @@ module Google
430
429
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
431
430
  transports_version_send: [:rest]
432
431
 
433
- options.apply_defaults timeout: @config.timeout,
432
+ options.apply_defaults timeout: @config.rpcs.delete_nodes.timeout,
434
433
  metadata: call_metadata
435
434
 
436
- uri, body, query_string_params = transcode_delete_nodes request
437
- response = @client_stub.make_post_request(
438
- uri: uri,
439
- body: body,
440
- params: query_string_params,
441
- options: options
442
- )
443
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
444
-
445
- yield result, response if block_given?
446
- result
435
+ options.apply_defaults timeout: @config.timeout,
436
+ metadata: @config.metadata
437
+
438
+ @node_groups_stub.delete_nodes request, options do |result, response|
439
+ result = ::Gapic::Rest::BaseOperation.new result
440
+ yield result, response if block_given?
441
+ return result
442
+ end
447
443
  rescue ::Faraday::Error => e
448
444
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
449
445
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -475,7 +471,7 @@ module Google
475
471
  # Project ID for this request.
476
472
  # @param zone [::String]
477
473
  # The name of the zone for this request.
478
- # @yield [result, env] Access the result along with the Faraday environment object
474
+ # @yield [result, response] Access the result along with the Faraday response object
479
475
  # @yieldparam result [::Google::Cloud::Compute::V1::NodeGroup]
480
476
  # @yieldparam response [::Faraday::Response]
481
477
  #
@@ -491,7 +487,7 @@ module Google
491
487
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
492
488
 
493
489
  # Customize the options with defaults
494
- call_metadata = {}
490
+ call_metadata = @config.rpcs.get.metadata.to_h
495
491
 
496
492
  # Set x-goog-api-client header
497
493
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -499,18 +495,16 @@ module Google
499
495
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
500
496
  transports_version_send: [:rest]
501
497
 
502
- options.apply_defaults timeout: @config.timeout,
498
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
503
499
  metadata: call_metadata
504
500
 
505
- uri, _body, _query_string_params = transcode_get request
506
- response = @client_stub.make_get_request(
507
- uri: uri,
508
- options: options
509
- )
510
- result = ::Google::Cloud::Compute::V1::NodeGroup.decode_json response.body, ignore_unknown_fields: true
501
+ options.apply_defaults timeout: @config.timeout,
502
+ metadata: @config.metadata
511
503
 
512
- yield result, response if block_given?
513
- result
504
+ @node_groups_stub.get request, options do |result, response|
505
+ yield result, response if block_given?
506
+ return result
507
+ end
514
508
  rescue ::Faraday::Error => e
515
509
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
516
510
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -544,7 +538,7 @@ module Google
544
538
  # Name or id of the resource for this request.
545
539
  # @param zone [::String]
546
540
  # The name of the zone for this request.
547
- # @yield [result, env] Access the result along with the Faraday environment object
541
+ # @yield [result, response] Access the result along with the Faraday response object
548
542
  # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
549
543
  # @yieldparam response [::Faraday::Response]
550
544
  #
@@ -560,7 +554,7 @@ module Google
560
554
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
561
555
 
562
556
  # Customize the options with defaults
563
- call_metadata = {}
557
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
564
558
 
565
559
  # Set x-goog-api-client header
566
560
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -568,19 +562,16 @@ module Google
568
562
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
569
563
  transports_version_send: [:rest]
570
564
 
571
- options.apply_defaults timeout: @config.timeout,
565
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
572
566
  metadata: call_metadata
573
567
 
574
- uri, _body, query_string_params = transcode_get_iam_policy request
575
- response = @client_stub.make_get_request(
576
- uri: uri,
577
- params: query_string_params,
578
- options: options
579
- )
580
- result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
568
+ options.apply_defaults timeout: @config.timeout,
569
+ metadata: @config.metadata
581
570
 
582
- yield result, response if block_given?
583
- result
571
+ @node_groups_stub.get_iam_policy request, options do |result, response|
572
+ yield result, response if block_given?
573
+ return result
574
+ end
584
575
  rescue ::Faraday::Error => e
585
576
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
586
577
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -613,18 +604,14 @@ module Google
613
604
  # @param project [::String]
614
605
  # Project ID for this request.
615
606
  # @param request_id [::String]
616
- # 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.
617
- #
618
- # 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.
619
- #
620
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
607
+ # 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).
621
608
  # @param zone [::String]
622
609
  # The name of the zone for this request.
623
- # @yield [result, env] Access the result along with the Faraday environment object
624
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
610
+ # @yield [result, response] Access the result along with the Faraday response object
611
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
625
612
  # @yieldparam response [::Faraday::Response]
626
613
  #
627
- # @return [::Google::Cloud::Compute::V1::Operation]
614
+ # @return [::Gapic::Rest::BaseOperation]
628
615
  #
629
616
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
630
617
  def insert request, options = nil
@@ -636,7 +623,7 @@ module Google
636
623
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
637
624
 
638
625
  # Customize the options with defaults
639
- call_metadata = {}
626
+ call_metadata = @config.rpcs.insert.metadata.to_h
640
627
 
641
628
  # Set x-goog-api-client header
642
629
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -644,20 +631,17 @@ module Google
644
631
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
645
632
  transports_version_send: [:rest]
646
633
 
647
- options.apply_defaults timeout: @config.timeout,
634
+ options.apply_defaults timeout: @config.rpcs.insert.timeout,
648
635
  metadata: call_metadata
649
636
 
650
- uri, body, query_string_params = transcode_insert request
651
- response = @client_stub.make_post_request(
652
- uri: uri,
653
- body: body,
654
- params: query_string_params,
655
- options: options
656
- )
657
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
658
-
659
- yield result, response if block_given?
660
- result
637
+ options.apply_defaults timeout: @config.timeout,
638
+ metadata: @config.metadata
639
+
640
+ @node_groups_stub.insert request, options do |result, response|
641
+ result = ::Gapic::Rest::BaseOperation.new result
642
+ yield result, response if block_given?
643
+ return result
644
+ end
661
645
  rescue ::Faraday::Error => e
662
646
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
663
647
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -684,34 +668,24 @@ module Google
684
668
  # the default parameter values, pass an empty Hash as a request object (see above).
685
669
  #
686
670
  # @param filter [::String]
687
- # 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 `<`.
688
- #
689
- # For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
690
- #
691
- # 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.
692
- #
693
- # 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) ```
671
+ # 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) ```
694
672
  # @param max_results [::Integer]
695
673
  # 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`)
696
674
  # @param order_by [::String]
697
- # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
698
- #
699
- # 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.
700
- #
701
- # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
675
+ # 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.
702
676
  # @param page_token [::String]
703
677
  # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
704
678
  # @param project [::String]
705
679
  # Project ID for this request.
706
680
  # @param return_partial_success [::Boolean]
707
- # 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.
681
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
708
682
  # @param zone [::String]
709
683
  # The name of the zone for this request.
710
- # @yield [result, env] Access the result along with the Faraday environment object
711
- # @yieldparam result [::Google::Cloud::Compute::V1::NodeGroupList]
684
+ # @yield [result, response] Access the result along with the Faraday response object
685
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::NodeGroup>]
712
686
  # @yieldparam response [::Faraday::Response]
713
687
  #
714
- # @return [::Google::Cloud::Compute::V1::NodeGroupList]
688
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::NodeGroup>]
715
689
  #
716
690
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
717
691
  def list request, options = nil
@@ -723,7 +697,7 @@ module Google
723
697
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
724
698
 
725
699
  # Customize the options with defaults
726
- call_metadata = {}
700
+ call_metadata = @config.rpcs.list.metadata.to_h
727
701
 
728
702
  # Set x-goog-api-client header
729
703
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -731,19 +705,17 @@ module Google
731
705
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
732
706
  transports_version_send: [:rest]
733
707
 
734
- options.apply_defaults timeout: @config.timeout,
708
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
735
709
  metadata: call_metadata
736
710
 
737
- uri, _body, query_string_params = transcode_list request
738
- response = @client_stub.make_get_request(
739
- uri: uri,
740
- params: query_string_params,
741
- options: options
742
- )
743
- result = ::Google::Cloud::Compute::V1::NodeGroupList.decode_json response.body, ignore_unknown_fields: true
711
+ options.apply_defaults timeout: @config.timeout,
712
+ metadata: @config.metadata
744
713
 
745
- yield result, response if block_given?
746
- result
714
+ @node_groups_stub.list request, options do |result, response|
715
+ result = ::Gapic::Rest::PagedEnumerable.new @node_groups_stub, :list, "items", request, result, options
716
+ yield result, response if block_given?
717
+ return result
718
+ end
747
719
  rescue ::Faraday::Error => e
748
720
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
749
721
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -770,36 +742,26 @@ module Google
770
742
  # the default parameter values, pass an empty Hash as a request object (see above).
771
743
  #
772
744
  # @param filter [::String]
773
- # 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 `<`.
774
- #
775
- # For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
776
- #
777
- # 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.
778
- #
779
- # 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) ```
745
+ # 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) ```
780
746
  # @param max_results [::Integer]
781
747
  # 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`)
782
748
  # @param node_group [::String]
783
749
  # Name of the NodeGroup resource whose nodes you want to list.
784
750
  # @param order_by [::String]
785
- # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
786
- #
787
- # 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.
788
- #
789
- # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
751
+ # 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.
790
752
  # @param page_token [::String]
791
753
  # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
792
754
  # @param project [::String]
793
755
  # Project ID for this request.
794
756
  # @param return_partial_success [::Boolean]
795
- # 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.
757
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
796
758
  # @param zone [::String]
797
759
  # The name of the zone for this request.
798
- # @yield [result, env] Access the result along with the Faraday environment object
799
- # @yieldparam result [::Google::Cloud::Compute::V1::NodeGroupsListNodes]
760
+ # @yield [result, response] Access the result along with the Faraday response object
761
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::NodeGroupNode>]
800
762
  # @yieldparam response [::Faraday::Response]
801
763
  #
802
- # @return [::Google::Cloud::Compute::V1::NodeGroupsListNodes]
764
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::NodeGroupNode>]
803
765
  #
804
766
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
805
767
  def list_nodes request, options = nil
@@ -811,7 +773,7 @@ module Google
811
773
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
812
774
 
813
775
  # Customize the options with defaults
814
- call_metadata = {}
776
+ call_metadata = @config.rpcs.list_nodes.metadata.to_h
815
777
 
816
778
  # Set x-goog-api-client header
817
779
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -819,19 +781,17 @@ module Google
819
781
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
820
782
  transports_version_send: [:rest]
821
783
 
822
- options.apply_defaults timeout: @config.timeout,
784
+ options.apply_defaults timeout: @config.rpcs.list_nodes.timeout,
823
785
  metadata: call_metadata
824
786
 
825
- uri, _body, query_string_params = transcode_list_nodes request
826
- response = @client_stub.make_post_request(
827
- uri: uri,
828
- params: query_string_params,
829
- options: options
830
- )
831
- result = ::Google::Cloud::Compute::V1::NodeGroupsListNodes.decode_json response.body, ignore_unknown_fields: true
787
+ options.apply_defaults timeout: @config.timeout,
788
+ metadata: @config.metadata
832
789
 
833
- yield result, response if block_given?
834
- result
790
+ @node_groups_stub.list_nodes request, options do |result, response|
791
+ result = ::Gapic::Rest::PagedEnumerable.new @node_groups_stub, :list_nodes, "items", request, result, options
792
+ yield result, response if block_given?
793
+ return result
794
+ end
835
795
  rescue ::Faraday::Error => e
836
796
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
837
797
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -864,18 +824,14 @@ module Google
864
824
  # @param project [::String]
865
825
  # Project ID for this request.
866
826
  # @param request_id [::String]
867
- # 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.
868
- #
869
- # 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.
870
- #
871
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
827
+ # 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).
872
828
  # @param zone [::String]
873
829
  # The name of the zone for this request.
874
- # @yield [result, env] Access the result along with the Faraday environment object
875
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
830
+ # @yield [result, response] Access the result along with the Faraday response object
831
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
876
832
  # @yieldparam response [::Faraday::Response]
877
833
  #
878
- # @return [::Google::Cloud::Compute::V1::Operation]
834
+ # @return [::Gapic::Rest::BaseOperation]
879
835
  #
880
836
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
881
837
  def patch request, options = nil
@@ -887,7 +843,7 @@ module Google
887
843
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
888
844
 
889
845
  # Customize the options with defaults
890
- call_metadata = {}
846
+ call_metadata = @config.rpcs.patch.metadata.to_h
891
847
 
892
848
  # Set x-goog-api-client header
893
849
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -895,20 +851,17 @@ module Google
895
851
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
896
852
  transports_version_send: [:rest]
897
853
 
898
- options.apply_defaults timeout: @config.timeout,
854
+ options.apply_defaults timeout: @config.rpcs.patch.timeout,
899
855
  metadata: call_metadata
900
856
 
901
- uri, body, query_string_params = transcode_patch request
902
- response = @client_stub.make_patch_request(
903
- uri: uri,
904
- body: body,
905
- params: query_string_params,
906
- options: options
907
- )
908
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
909
-
910
- yield result, response if block_given?
911
- result
857
+ options.apply_defaults timeout: @config.timeout,
858
+ metadata: @config.metadata
859
+
860
+ @node_groups_stub.patch request, options do |result, response|
861
+ result = ::Gapic::Rest::BaseOperation.new result
862
+ yield result, response if block_given?
863
+ return result
864
+ end
912
865
  rescue ::Faraday::Error => e
913
866
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
914
867
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -942,7 +895,7 @@ module Google
942
895
  # The name of the zone for this request.
943
896
  # @param zone_set_policy_request_resource [::Google::Cloud::Compute::V1::ZoneSetPolicyRequest, ::Hash]
944
897
  # The body resource for this request
945
- # @yield [result, env] Access the result along with the Faraday environment object
898
+ # @yield [result, response] Access the result along with the Faraday response object
946
899
  # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
947
900
  # @yieldparam response [::Faraday::Response]
948
901
  #
@@ -958,7 +911,7 @@ module Google
958
911
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
959
912
 
960
913
  # Customize the options with defaults
961
- call_metadata = {}
914
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
962
915
 
963
916
  # Set x-goog-api-client header
964
917
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -966,19 +919,16 @@ module Google
966
919
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
967
920
  transports_version_send: [:rest]
968
921
 
969
- options.apply_defaults timeout: @config.timeout,
922
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
970
923
  metadata: call_metadata
971
924
 
972
- uri, body, _query_string_params = transcode_set_iam_policy request
973
- response = @client_stub.make_post_request(
974
- uri: uri,
975
- body: body,
976
- options: options
977
- )
978
- result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
925
+ options.apply_defaults timeout: @config.timeout,
926
+ metadata: @config.metadata
979
927
 
980
- yield result, response if block_given?
981
- result
928
+ @node_groups_stub.set_iam_policy request, options do |result, response|
929
+ yield result, response if block_given?
930
+ return result
931
+ end
982
932
  rescue ::Faraday::Error => e
983
933
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
984
934
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -1011,18 +961,14 @@ module Google
1011
961
  # @param project [::String]
1012
962
  # Project ID for this request.
1013
963
  # @param request_id [::String]
1014
- # 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.
1015
- #
1016
- # 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.
1017
- #
1018
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
964
+ # 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).
1019
965
  # @param zone [::String]
1020
966
  # The name of the zone for this request.
1021
- # @yield [result, env] Access the result along with the Faraday environment object
1022
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
967
+ # @yield [result, response] Access the result along with the Faraday response object
968
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
1023
969
  # @yieldparam response [::Faraday::Response]
1024
970
  #
1025
- # @return [::Google::Cloud::Compute::V1::Operation]
971
+ # @return [::Gapic::Rest::BaseOperation]
1026
972
  #
1027
973
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1028
974
  def set_node_template request, options = nil
@@ -1034,7 +980,7 @@ module Google
1034
980
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1035
981
 
1036
982
  # Customize the options with defaults
1037
- call_metadata = {}
983
+ call_metadata = @config.rpcs.set_node_template.metadata.to_h
1038
984
 
1039
985
  # Set x-goog-api-client header
1040
986
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -1042,20 +988,17 @@ module Google
1042
988
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1043
989
  transports_version_send: [:rest]
1044
990
 
1045
- options.apply_defaults timeout: @config.timeout,
991
+ options.apply_defaults timeout: @config.rpcs.set_node_template.timeout,
1046
992
  metadata: call_metadata
1047
993
 
1048
- uri, body, query_string_params = transcode_set_node_template request
1049
- response = @client_stub.make_post_request(
1050
- uri: uri,
1051
- body: body,
1052
- params: query_string_params,
1053
- options: options
1054
- )
1055
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1056
-
1057
- yield result, response if block_given?
1058
- result
994
+ options.apply_defaults timeout: @config.timeout,
995
+ metadata: @config.metadata
996
+
997
+ @node_groups_stub.set_node_template request, options do |result, response|
998
+ result = ::Gapic::Rest::BaseOperation.new result
999
+ yield result, response if block_given?
1000
+ return result
1001
+ end
1059
1002
  rescue ::Faraday::Error => e
1060
1003
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1061
1004
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -1089,7 +1032,7 @@ module Google
1089
1032
  # The body resource for this request
1090
1033
  # @param zone [::String]
1091
1034
  # The name of the zone for this request.
1092
- # @yield [result, env] Access the result along with the Faraday environment object
1035
+ # @yield [result, response] Access the result along with the Faraday response object
1093
1036
  # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
1094
1037
  # @yieldparam response [::Faraday::Response]
1095
1038
  #
@@ -1105,7 +1048,7 @@ module Google
1105
1048
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1106
1049
 
1107
1050
  # Customize the options with defaults
1108
- call_metadata = {}
1051
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
1109
1052
 
1110
1053
  # Set x-goog-api-client header
1111
1054
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -1113,19 +1056,16 @@ module Google
1113
1056
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1114
1057
  transports_version_send: [:rest]
1115
1058
 
1116
- options.apply_defaults timeout: @config.timeout,
1059
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
1117
1060
  metadata: call_metadata
1118
1061
 
1119
- uri, body, _query_string_params = transcode_test_iam_permissions request
1120
- response = @client_stub.make_post_request(
1121
- uri: uri,
1122
- body: body,
1123
- options: options
1124
- )
1125
- result = ::Google::Cloud::Compute::V1::TestPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
1062
+ options.apply_defaults timeout: @config.timeout,
1063
+ metadata: @config.metadata
1126
1064
 
1127
- yield result, response if block_given?
1128
- result
1065
+ @node_groups_stub.test_iam_permissions request, options do |result, response|
1066
+ yield result, response if block_given?
1067
+ return result
1068
+ end
1129
1069
  rescue ::Faraday::Error => e
1130
1070
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1131
1071
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -1180,6 +1120,9 @@ module Google
1180
1120
  # @!attribute [rw] timeout
1181
1121
  # The call timeout in seconds.
1182
1122
  # @return [::Numeric]
1123
+ # @!attribute [rw] metadata
1124
+ # Additional REST headers to be sent with the call.
1125
+ # @return [::Hash{::Symbol=>::String}]
1183
1126
  #
1184
1127
  class Configuration
1185
1128
  extend ::Gapic::Config
@@ -1193,6 +1136,7 @@ module Google
1193
1136
  config_attr :lib_name, nil, ::String, nil
1194
1137
  config_attr :lib_version, nil, ::String, nil
1195
1138
  config_attr :timeout, nil, ::Numeric, nil
1139
+ config_attr :metadata, nil, ::Hash, nil
1196
1140
 
1197
1141
  # @private
1198
1142
  def initialize parent_config = nil
@@ -1200,6 +1144,130 @@ module Google
1200
1144
 
1201
1145
  yield self if block_given?
1202
1146
  end
1147
+
1148
+ ##
1149
+ # Configurations for individual RPCs
1150
+ # @return [Rpcs]
1151
+ #
1152
+ def rpcs
1153
+ @rpcs ||= begin
1154
+ parent_rpcs = nil
1155
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1156
+ Rpcs.new parent_rpcs
1157
+ end
1158
+ end
1159
+
1160
+ ##
1161
+ # Configuration RPC class for the NodeGroups API.
1162
+ #
1163
+ # Includes fields providing the configuration for each RPC in this service.
1164
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1165
+ # the following configuration fields:
1166
+ #
1167
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1168
+ #
1169
+ # there is one other field (`retry_policy`) that can be set
1170
+ # but is currently not supported for REST Gapic libraries.
1171
+ #
1172
+ class Rpcs
1173
+ ##
1174
+ # RPC-specific configuration for `add_nodes`
1175
+ # @return [::Gapic::Config::Method]
1176
+ #
1177
+ attr_reader :add_nodes
1178
+ ##
1179
+ # RPC-specific configuration for `aggregated_list`
1180
+ # @return [::Gapic::Config::Method]
1181
+ #
1182
+ attr_reader :aggregated_list
1183
+ ##
1184
+ # RPC-specific configuration for `delete`
1185
+ # @return [::Gapic::Config::Method]
1186
+ #
1187
+ attr_reader :delete
1188
+ ##
1189
+ # RPC-specific configuration for `delete_nodes`
1190
+ # @return [::Gapic::Config::Method]
1191
+ #
1192
+ attr_reader :delete_nodes
1193
+ ##
1194
+ # RPC-specific configuration for `get`
1195
+ # @return [::Gapic::Config::Method]
1196
+ #
1197
+ attr_reader :get
1198
+ ##
1199
+ # RPC-specific configuration for `get_iam_policy`
1200
+ # @return [::Gapic::Config::Method]
1201
+ #
1202
+ attr_reader :get_iam_policy
1203
+ ##
1204
+ # RPC-specific configuration for `insert`
1205
+ # @return [::Gapic::Config::Method]
1206
+ #
1207
+ attr_reader :insert
1208
+ ##
1209
+ # RPC-specific configuration for `list`
1210
+ # @return [::Gapic::Config::Method]
1211
+ #
1212
+ attr_reader :list
1213
+ ##
1214
+ # RPC-specific configuration for `list_nodes`
1215
+ # @return [::Gapic::Config::Method]
1216
+ #
1217
+ attr_reader :list_nodes
1218
+ ##
1219
+ # RPC-specific configuration for `patch`
1220
+ # @return [::Gapic::Config::Method]
1221
+ #
1222
+ attr_reader :patch
1223
+ ##
1224
+ # RPC-specific configuration for `set_iam_policy`
1225
+ # @return [::Gapic::Config::Method]
1226
+ #
1227
+ attr_reader :set_iam_policy
1228
+ ##
1229
+ # RPC-specific configuration for `set_node_template`
1230
+ # @return [::Gapic::Config::Method]
1231
+ #
1232
+ attr_reader :set_node_template
1233
+ ##
1234
+ # RPC-specific configuration for `test_iam_permissions`
1235
+ # @return [::Gapic::Config::Method]
1236
+ #
1237
+ attr_reader :test_iam_permissions
1238
+
1239
+ # @private
1240
+ def initialize parent_rpcs = nil
1241
+ add_nodes_config = parent_rpcs.add_nodes if parent_rpcs.respond_to? :add_nodes
1242
+ @add_nodes = ::Gapic::Config::Method.new add_nodes_config
1243
+ aggregated_list_config = parent_rpcs.aggregated_list if parent_rpcs.respond_to? :aggregated_list
1244
+ @aggregated_list = ::Gapic::Config::Method.new aggregated_list_config
1245
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
1246
+ @delete = ::Gapic::Config::Method.new delete_config
1247
+ delete_nodes_config = parent_rpcs.delete_nodes if parent_rpcs.respond_to? :delete_nodes
1248
+ @delete_nodes = ::Gapic::Config::Method.new delete_nodes_config
1249
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
1250
+ @get = ::Gapic::Config::Method.new get_config
1251
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1252
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1253
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
1254
+ @insert = ::Gapic::Config::Method.new insert_config
1255
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
1256
+ @list = ::Gapic::Config::Method.new list_config
1257
+ list_nodes_config = parent_rpcs.list_nodes if parent_rpcs.respond_to? :list_nodes
1258
+ @list_nodes = ::Gapic::Config::Method.new list_nodes_config
1259
+ patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
1260
+ @patch = ::Gapic::Config::Method.new patch_config
1261
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1262
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1263
+ set_node_template_config = parent_rpcs.set_node_template if parent_rpcs.respond_to? :set_node_template
1264
+ @set_node_template = ::Gapic::Config::Method.new set_node_template_config
1265
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1266
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
1267
+
1268
+ yield self if block_given?
1269
+ end
1270
+ end
1203
1271
  end
1204
1272
  end
1205
1273
  end