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
@@ -0,0 +1,2018 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/compute/v1/compute_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Compute
24
+ module V1
25
+ module Instances
26
+ module Rest
27
+ ##
28
+ # REST service stub for the Instances service.
29
+ # service stub contains baseline method implementations
30
+ # including transcoding, making the REST call and deserialing the response
31
+ #
32
+ class ServiceStub
33
+ def initialize endpoint:, credentials:
34
+ # These require statements are intentionally placed here to initialize
35
+ # the REST modules only when it's required.
36
+ require "gapic/rest"
37
+
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials
39
+ end
40
+
41
+ ##
42
+ # Baseline implementation for the add_access_config REST call
43
+ #
44
+ # @param request_pb [::Google::Cloud::Compute::V1::AddAccessConfigInstanceRequest]
45
+ # A request object representing the call parameters. Required.
46
+ # @param options [::Gapic::CallOptions]
47
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
48
+ #
49
+ # @yield [result, response] Access the result along with the Faraday response object
50
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
51
+ # @yieldparam response [::Faraday::Response]
52
+ #
53
+ # @return [::Google::Cloud::Compute::V1::Operation]
54
+ # A result object deserialized from the server's reply
55
+ def add_access_config request_pb, options = nil
56
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
57
+
58
+ uri, body, query_string_params = transcode_add_access_config_request request_pb
59
+ response = @client_stub.make_post_request(
60
+ uri: uri,
61
+ body: body,
62
+ params: query_string_params,
63
+ options: options
64
+ )
65
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
66
+
67
+ yield result, response if block_given?
68
+ result
69
+ end
70
+
71
+ ##
72
+ # GRPC transcoding helper method for the add_access_config REST call
73
+ #
74
+ # @param request_pb [::Google::Cloud::Compute::V1::AddAccessConfigInstanceRequest]
75
+ # A request object representing the call parameters. Required.
76
+ # @return [Array(String, [String, nil], Hash{String => String})]
77
+ # Uri, Body, Query string parameters
78
+ def transcode_add_access_config_request request_pb
79
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/addAccessConfig"
80
+ body = request_pb.access_config_resource.to_json
81
+ query_string_params = {}
82
+ query_string_params["networkInterface"] = request_pb.network_interface.to_s
83
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
84
+
85
+ [uri, body, query_string_params]
86
+ end
87
+
88
+ ##
89
+ # Baseline implementation for the add_resource_policies REST call
90
+ #
91
+ # @param request_pb [::Google::Cloud::Compute::V1::AddResourcePoliciesInstanceRequest]
92
+ # A request object representing the call parameters. Required.
93
+ # @param options [::Gapic::CallOptions]
94
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
95
+ #
96
+ # @yield [result, response] Access the result along with the Faraday response object
97
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
98
+ # @yieldparam response [::Faraday::Response]
99
+ #
100
+ # @return [::Google::Cloud::Compute::V1::Operation]
101
+ # A result object deserialized from the server's reply
102
+ def add_resource_policies request_pb, options = nil
103
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
104
+
105
+ uri, body, query_string_params = transcode_add_resource_policies_request request_pb
106
+ response = @client_stub.make_post_request(
107
+ uri: uri,
108
+ body: body,
109
+ params: query_string_params,
110
+ options: options
111
+ )
112
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
113
+
114
+ yield result, response if block_given?
115
+ result
116
+ end
117
+
118
+ ##
119
+ # GRPC transcoding helper method for the add_resource_policies REST call
120
+ #
121
+ # @param request_pb [::Google::Cloud::Compute::V1::AddResourcePoliciesInstanceRequest]
122
+ # A request object representing the call parameters. Required.
123
+ # @return [Array(String, [String, nil], Hash{String => String})]
124
+ # Uri, Body, Query string parameters
125
+ def transcode_add_resource_policies_request request_pb
126
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/addResourcePolicies"
127
+ body = request_pb.instances_add_resource_policies_request_resource.to_json
128
+ query_string_params = {}
129
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
130
+
131
+ [uri, body, query_string_params]
132
+ end
133
+
134
+ ##
135
+ # Baseline implementation for the aggregated_list REST call
136
+ #
137
+ # @param request_pb [::Google::Cloud::Compute::V1::AggregatedListInstancesRequest]
138
+ # A request object representing the call parameters. Required.
139
+ # @param options [::Gapic::CallOptions]
140
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
141
+ #
142
+ # @yield [result, response] Access the result along with the Faraday response object
143
+ # @yieldparam result [::Google::Cloud::Compute::V1::InstanceAggregatedList]
144
+ # @yieldparam response [::Faraday::Response]
145
+ #
146
+ # @return [::Google::Cloud::Compute::V1::InstanceAggregatedList]
147
+ # A result object deserialized from the server's reply
148
+ def aggregated_list request_pb, options = nil
149
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
150
+
151
+ uri, _body, query_string_params = transcode_aggregated_list_request request_pb
152
+ response = @client_stub.make_get_request(
153
+ uri: uri,
154
+ params: query_string_params,
155
+ options: options
156
+ )
157
+ result = ::Google::Cloud::Compute::V1::InstanceAggregatedList.decode_json response.body, ignore_unknown_fields: true
158
+
159
+ yield result, response if block_given?
160
+ result
161
+ end
162
+
163
+ ##
164
+ # GRPC transcoding helper method for the aggregated_list REST call
165
+ #
166
+ # @param request_pb [::Google::Cloud::Compute::V1::AggregatedListInstancesRequest]
167
+ # A request object representing the call parameters. Required.
168
+ # @return [Array(String, [String, nil], Hash{String => String})]
169
+ # Uri, Body, Query string parameters
170
+ def transcode_aggregated_list_request request_pb
171
+ uri = "/compute/v1/projects/#{request_pb.project}/aggregated/instances"
172
+ body = nil
173
+ query_string_params = {}
174
+ query_string_params["filter"] = request_pb.filter.to_s if request_pb.has_filter?
175
+ query_string_params["includeAllScopes"] = request_pb.include_all_scopes.to_s if request_pb.has_include_all_scopes?
176
+ query_string_params["maxResults"] = request_pb.max_results.to_s if request_pb.has_max_results?
177
+ query_string_params["orderBy"] = request_pb.order_by.to_s if request_pb.has_order_by?
178
+ query_string_params["pageToken"] = request_pb.page_token.to_s if request_pb.has_page_token?
179
+ query_string_params["returnPartialSuccess"] = request_pb.return_partial_success.to_s if request_pb.has_return_partial_success?
180
+
181
+ [uri, body, query_string_params]
182
+ end
183
+
184
+ ##
185
+ # Baseline implementation for the attach_disk REST call
186
+ #
187
+ # @param request_pb [::Google::Cloud::Compute::V1::AttachDiskInstanceRequest]
188
+ # A request object representing the call parameters. Required.
189
+ # @param options [::Gapic::CallOptions]
190
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
191
+ #
192
+ # @yield [result, response] Access the result along with the Faraday response object
193
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
194
+ # @yieldparam response [::Faraday::Response]
195
+ #
196
+ # @return [::Google::Cloud::Compute::V1::Operation]
197
+ # A result object deserialized from the server's reply
198
+ def attach_disk request_pb, options = nil
199
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
200
+
201
+ uri, body, query_string_params = transcode_attach_disk_request request_pb
202
+ response = @client_stub.make_post_request(
203
+ uri: uri,
204
+ body: body,
205
+ params: query_string_params,
206
+ options: options
207
+ )
208
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
209
+
210
+ yield result, response if block_given?
211
+ result
212
+ end
213
+
214
+ ##
215
+ # GRPC transcoding helper method for the attach_disk REST call
216
+ #
217
+ # @param request_pb [::Google::Cloud::Compute::V1::AttachDiskInstanceRequest]
218
+ # A request object representing the call parameters. Required.
219
+ # @return [Array(String, [String, nil], Hash{String => String})]
220
+ # Uri, Body, Query string parameters
221
+ def transcode_attach_disk_request request_pb
222
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/attachDisk"
223
+ body = request_pb.attached_disk_resource.to_json
224
+ query_string_params = {}
225
+ query_string_params["forceAttach"] = request_pb.force_attach.to_s if request_pb.has_force_attach?
226
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
227
+
228
+ [uri, body, query_string_params]
229
+ end
230
+
231
+ ##
232
+ # Baseline implementation for the bulk_insert REST call
233
+ #
234
+ # @param request_pb [::Google::Cloud::Compute::V1::BulkInsertInstanceRequest]
235
+ # A request object representing the call parameters. Required.
236
+ # @param options [::Gapic::CallOptions]
237
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
238
+ #
239
+ # @yield [result, response] Access the result along with the Faraday response object
240
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
241
+ # @yieldparam response [::Faraday::Response]
242
+ #
243
+ # @return [::Google::Cloud::Compute::V1::Operation]
244
+ # A result object deserialized from the server's reply
245
+ def bulk_insert request_pb, options = nil
246
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
247
+
248
+ uri, body, query_string_params = transcode_bulk_insert_request request_pb
249
+ response = @client_stub.make_post_request(
250
+ uri: uri,
251
+ body: body,
252
+ params: query_string_params,
253
+ options: options
254
+ )
255
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
256
+
257
+ yield result, response if block_given?
258
+ result
259
+ end
260
+
261
+ ##
262
+ # GRPC transcoding helper method for the bulk_insert REST call
263
+ #
264
+ # @param request_pb [::Google::Cloud::Compute::V1::BulkInsertInstanceRequest]
265
+ # A request object representing the call parameters. Required.
266
+ # @return [Array(String, [String, nil], Hash{String => String})]
267
+ # Uri, Body, Query string parameters
268
+ def transcode_bulk_insert_request request_pb
269
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/bulkInsert"
270
+ body = request_pb.bulk_insert_instance_resource_resource.to_json
271
+ query_string_params = {}
272
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
273
+
274
+ [uri, body, query_string_params]
275
+ end
276
+
277
+ ##
278
+ # Baseline implementation for the delete REST call
279
+ #
280
+ # @param request_pb [::Google::Cloud::Compute::V1::DeleteInstanceRequest]
281
+ # A request object representing the call parameters. Required.
282
+ # @param options [::Gapic::CallOptions]
283
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
284
+ #
285
+ # @yield [result, response] Access the result along with the Faraday response object
286
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
287
+ # @yieldparam response [::Faraday::Response]
288
+ #
289
+ # @return [::Google::Cloud::Compute::V1::Operation]
290
+ # A result object deserialized from the server's reply
291
+ def delete request_pb, options = nil
292
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
293
+
294
+ uri, _body, query_string_params = transcode_delete_request request_pb
295
+ response = @client_stub.make_delete_request(
296
+ uri: uri,
297
+ params: query_string_params,
298
+ options: options
299
+ )
300
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
301
+
302
+ yield result, response if block_given?
303
+ result
304
+ end
305
+
306
+ ##
307
+ # GRPC transcoding helper method for the delete REST call
308
+ #
309
+ # @param request_pb [::Google::Cloud::Compute::V1::DeleteInstanceRequest]
310
+ # A request object representing the call parameters. Required.
311
+ # @return [Array(String, [String, nil], Hash{String => String})]
312
+ # Uri, Body, Query string parameters
313
+ def transcode_delete_request request_pb
314
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}"
315
+ body = nil
316
+ query_string_params = {}
317
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
318
+
319
+ [uri, body, query_string_params]
320
+ end
321
+
322
+ ##
323
+ # Baseline implementation for the delete_access_config REST call
324
+ #
325
+ # @param request_pb [::Google::Cloud::Compute::V1::DeleteAccessConfigInstanceRequest]
326
+ # A request object representing the call parameters. Required.
327
+ # @param options [::Gapic::CallOptions]
328
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
329
+ #
330
+ # @yield [result, response] Access the result along with the Faraday response object
331
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
332
+ # @yieldparam response [::Faraday::Response]
333
+ #
334
+ # @return [::Google::Cloud::Compute::V1::Operation]
335
+ # A result object deserialized from the server's reply
336
+ def delete_access_config request_pb, options = nil
337
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
338
+
339
+ uri, _body, query_string_params = transcode_delete_access_config_request request_pb
340
+ response = @client_stub.make_post_request(
341
+ uri: uri,
342
+ params: query_string_params,
343
+ options: options
344
+ )
345
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
346
+
347
+ yield result, response if block_given?
348
+ result
349
+ end
350
+
351
+ ##
352
+ # GRPC transcoding helper method for the delete_access_config REST call
353
+ #
354
+ # @param request_pb [::Google::Cloud::Compute::V1::DeleteAccessConfigInstanceRequest]
355
+ # A request object representing the call parameters. Required.
356
+ # @return [Array(String, [String, nil], Hash{String => String})]
357
+ # Uri, Body, Query string parameters
358
+ def transcode_delete_access_config_request request_pb
359
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/deleteAccessConfig"
360
+ body = nil
361
+ query_string_params = {}
362
+ query_string_params["accessConfig"] = request_pb.access_config.to_s
363
+ query_string_params["networkInterface"] = request_pb.network_interface.to_s
364
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
365
+
366
+ [uri, body, query_string_params]
367
+ end
368
+
369
+ ##
370
+ # Baseline implementation for the detach_disk REST call
371
+ #
372
+ # @param request_pb [::Google::Cloud::Compute::V1::DetachDiskInstanceRequest]
373
+ # A request object representing the call parameters. Required.
374
+ # @param options [::Gapic::CallOptions]
375
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
376
+ #
377
+ # @yield [result, response] Access the result along with the Faraday response object
378
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
379
+ # @yieldparam response [::Faraday::Response]
380
+ #
381
+ # @return [::Google::Cloud::Compute::V1::Operation]
382
+ # A result object deserialized from the server's reply
383
+ def detach_disk request_pb, options = nil
384
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
385
+
386
+ uri, _body, query_string_params = transcode_detach_disk_request request_pb
387
+ response = @client_stub.make_post_request(
388
+ uri: uri,
389
+ params: query_string_params,
390
+ options: options
391
+ )
392
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
393
+
394
+ yield result, response if block_given?
395
+ result
396
+ end
397
+
398
+ ##
399
+ # GRPC transcoding helper method for the detach_disk REST call
400
+ #
401
+ # @param request_pb [::Google::Cloud::Compute::V1::DetachDiskInstanceRequest]
402
+ # A request object representing the call parameters. Required.
403
+ # @return [Array(String, [String, nil], Hash{String => String})]
404
+ # Uri, Body, Query string parameters
405
+ def transcode_detach_disk_request request_pb
406
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/detachDisk"
407
+ body = nil
408
+ query_string_params = {}
409
+ query_string_params["deviceName"] = request_pb.device_name.to_s
410
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
411
+
412
+ [uri, body, query_string_params]
413
+ end
414
+
415
+ ##
416
+ # Baseline implementation for the get REST call
417
+ #
418
+ # @param request_pb [::Google::Cloud::Compute::V1::GetInstanceRequest]
419
+ # A request object representing the call parameters. Required.
420
+ # @param options [::Gapic::CallOptions]
421
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
422
+ #
423
+ # @yield [result, response] Access the result along with the Faraday response object
424
+ # @yieldparam result [::Google::Cloud::Compute::V1::Instance]
425
+ # @yieldparam response [::Faraday::Response]
426
+ #
427
+ # @return [::Google::Cloud::Compute::V1::Instance]
428
+ # A result object deserialized from the server's reply
429
+ def get request_pb, options = nil
430
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
431
+
432
+ uri, _body, _query_string_params = transcode_get_request request_pb
433
+ response = @client_stub.make_get_request(
434
+ uri: uri,
435
+ options: options
436
+ )
437
+ result = ::Google::Cloud::Compute::V1::Instance.decode_json response.body, ignore_unknown_fields: true
438
+
439
+ yield result, response if block_given?
440
+ result
441
+ end
442
+
443
+ ##
444
+ # GRPC transcoding helper method for the get REST call
445
+ #
446
+ # @param request_pb [::Google::Cloud::Compute::V1::GetInstanceRequest]
447
+ # A request object representing the call parameters. Required.
448
+ # @return [Array(String, [String, nil], Hash{String => String})]
449
+ # Uri, Body, Query string parameters
450
+ def transcode_get_request request_pb
451
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}"
452
+ body = nil
453
+ query_string_params = {}
454
+
455
+ [uri, body, query_string_params]
456
+ end
457
+
458
+ ##
459
+ # Baseline implementation for the get_effective_firewalls REST call
460
+ #
461
+ # @param request_pb [::Google::Cloud::Compute::V1::GetEffectiveFirewallsInstanceRequest]
462
+ # A request object representing the call parameters. Required.
463
+ # @param options [::Gapic::CallOptions]
464
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
465
+ #
466
+ # @yield [result, response] Access the result along with the Faraday response object
467
+ # @yieldparam result [::Google::Cloud::Compute::V1::InstancesGetEffectiveFirewallsResponse]
468
+ # @yieldparam response [::Faraday::Response]
469
+ #
470
+ # @return [::Google::Cloud::Compute::V1::InstancesGetEffectiveFirewallsResponse]
471
+ # A result object deserialized from the server's reply
472
+ def get_effective_firewalls request_pb, options = nil
473
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
474
+
475
+ uri, _body, query_string_params = transcode_get_effective_firewalls_request request_pb
476
+ response = @client_stub.make_get_request(
477
+ uri: uri,
478
+ params: query_string_params,
479
+ options: options
480
+ )
481
+ result = ::Google::Cloud::Compute::V1::InstancesGetEffectiveFirewallsResponse.decode_json response.body, ignore_unknown_fields: true
482
+
483
+ yield result, response if block_given?
484
+ result
485
+ end
486
+
487
+ ##
488
+ # GRPC transcoding helper method for the get_effective_firewalls REST call
489
+ #
490
+ # @param request_pb [::Google::Cloud::Compute::V1::GetEffectiveFirewallsInstanceRequest]
491
+ # A request object representing the call parameters. Required.
492
+ # @return [Array(String, [String, nil], Hash{String => String})]
493
+ # Uri, Body, Query string parameters
494
+ def transcode_get_effective_firewalls_request request_pb
495
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/getEffectiveFirewalls"
496
+ body = nil
497
+ query_string_params = {}
498
+ query_string_params["networkInterface"] = request_pb.network_interface.to_s
499
+
500
+ [uri, body, query_string_params]
501
+ end
502
+
503
+ ##
504
+ # Baseline implementation for the get_guest_attributes REST call
505
+ #
506
+ # @param request_pb [::Google::Cloud::Compute::V1::GetGuestAttributesInstanceRequest]
507
+ # A request object representing the call parameters. Required.
508
+ # @param options [::Gapic::CallOptions]
509
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
510
+ #
511
+ # @yield [result, response] Access the result along with the Faraday response object
512
+ # @yieldparam result [::Google::Cloud::Compute::V1::GuestAttributes]
513
+ # @yieldparam response [::Faraday::Response]
514
+ #
515
+ # @return [::Google::Cloud::Compute::V1::GuestAttributes]
516
+ # A result object deserialized from the server's reply
517
+ def get_guest_attributes request_pb, options = nil
518
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
519
+
520
+ uri, _body, query_string_params = transcode_get_guest_attributes_request request_pb
521
+ response = @client_stub.make_get_request(
522
+ uri: uri,
523
+ params: query_string_params,
524
+ options: options
525
+ )
526
+ result = ::Google::Cloud::Compute::V1::GuestAttributes.decode_json response.body, ignore_unknown_fields: true
527
+
528
+ yield result, response if block_given?
529
+ result
530
+ end
531
+
532
+ ##
533
+ # GRPC transcoding helper method for the get_guest_attributes REST call
534
+ #
535
+ # @param request_pb [::Google::Cloud::Compute::V1::GetGuestAttributesInstanceRequest]
536
+ # A request object representing the call parameters. Required.
537
+ # @return [Array(String, [String, nil], Hash{String => String})]
538
+ # Uri, Body, Query string parameters
539
+ def transcode_get_guest_attributes_request request_pb
540
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/getGuestAttributes"
541
+ body = nil
542
+ query_string_params = {}
543
+ query_string_params["queryPath"] = request_pb.query_path.to_s if request_pb.has_query_path?
544
+ query_string_params["variableKey"] = request_pb.variable_key.to_s if request_pb.has_variable_key?
545
+
546
+ [uri, body, query_string_params]
547
+ end
548
+
549
+ ##
550
+ # Baseline implementation for the get_iam_policy REST call
551
+ #
552
+ # @param request_pb [::Google::Cloud::Compute::V1::GetIamPolicyInstanceRequest]
553
+ # A request object representing the call parameters. Required.
554
+ # @param options [::Gapic::CallOptions]
555
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
556
+ #
557
+ # @yield [result, response] Access the result along with the Faraday response object
558
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
559
+ # @yieldparam response [::Faraday::Response]
560
+ #
561
+ # @return [::Google::Cloud::Compute::V1::Policy]
562
+ # A result object deserialized from the server's reply
563
+ def get_iam_policy request_pb, options = nil
564
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
565
+
566
+ uri, _body, query_string_params = transcode_get_iam_policy_request request_pb
567
+ response = @client_stub.make_get_request(
568
+ uri: uri,
569
+ params: query_string_params,
570
+ options: options
571
+ )
572
+ result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
573
+
574
+ yield result, response if block_given?
575
+ result
576
+ end
577
+
578
+ ##
579
+ # GRPC transcoding helper method for the get_iam_policy REST call
580
+ #
581
+ # @param request_pb [::Google::Cloud::Compute::V1::GetIamPolicyInstanceRequest]
582
+ # A request object representing the call parameters. Required.
583
+ # @return [Array(String, [String, nil], Hash{String => String})]
584
+ # Uri, Body, Query string parameters
585
+ def transcode_get_iam_policy_request request_pb
586
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.resource}/getIamPolicy"
587
+ body = nil
588
+ query_string_params = {}
589
+ query_string_params["optionsRequestedPolicyVersion"] = request_pb.options_requested_policy_version.to_s if request_pb.has_options_requested_policy_version?
590
+
591
+ [uri, body, query_string_params]
592
+ end
593
+
594
+ ##
595
+ # Baseline implementation for the get_screenshot REST call
596
+ #
597
+ # @param request_pb [::Google::Cloud::Compute::V1::GetScreenshotInstanceRequest]
598
+ # A request object representing the call parameters. Required.
599
+ # @param options [::Gapic::CallOptions]
600
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
601
+ #
602
+ # @yield [result, response] Access the result along with the Faraday response object
603
+ # @yieldparam result [::Google::Cloud::Compute::V1::Screenshot]
604
+ # @yieldparam response [::Faraday::Response]
605
+ #
606
+ # @return [::Google::Cloud::Compute::V1::Screenshot]
607
+ # A result object deserialized from the server's reply
608
+ def get_screenshot request_pb, options = nil
609
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
610
+
611
+ uri, _body, _query_string_params = transcode_get_screenshot_request request_pb
612
+ response = @client_stub.make_get_request(
613
+ uri: uri,
614
+ options: options
615
+ )
616
+ result = ::Google::Cloud::Compute::V1::Screenshot.decode_json response.body, ignore_unknown_fields: true
617
+
618
+ yield result, response if block_given?
619
+ result
620
+ end
621
+
622
+ ##
623
+ # GRPC transcoding helper method for the get_screenshot REST call
624
+ #
625
+ # @param request_pb [::Google::Cloud::Compute::V1::GetScreenshotInstanceRequest]
626
+ # A request object representing the call parameters. Required.
627
+ # @return [Array(String, [String, nil], Hash{String => String})]
628
+ # Uri, Body, Query string parameters
629
+ def transcode_get_screenshot_request request_pb
630
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/screenshot"
631
+ body = nil
632
+ query_string_params = {}
633
+
634
+ [uri, body, query_string_params]
635
+ end
636
+
637
+ ##
638
+ # Baseline implementation for the get_serial_port_output REST call
639
+ #
640
+ # @param request_pb [::Google::Cloud::Compute::V1::GetSerialPortOutputInstanceRequest]
641
+ # A request object representing the call parameters. Required.
642
+ # @param options [::Gapic::CallOptions]
643
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
644
+ #
645
+ # @yield [result, response] Access the result along with the Faraday response object
646
+ # @yieldparam result [::Google::Cloud::Compute::V1::SerialPortOutput]
647
+ # @yieldparam response [::Faraday::Response]
648
+ #
649
+ # @return [::Google::Cloud::Compute::V1::SerialPortOutput]
650
+ # A result object deserialized from the server's reply
651
+ def get_serial_port_output request_pb, options = nil
652
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
653
+
654
+ uri, _body, query_string_params = transcode_get_serial_port_output_request request_pb
655
+ response = @client_stub.make_get_request(
656
+ uri: uri,
657
+ params: query_string_params,
658
+ options: options
659
+ )
660
+ result = ::Google::Cloud::Compute::V1::SerialPortOutput.decode_json response.body, ignore_unknown_fields: true
661
+
662
+ yield result, response if block_given?
663
+ result
664
+ end
665
+
666
+ ##
667
+ # GRPC transcoding helper method for the get_serial_port_output REST call
668
+ #
669
+ # @param request_pb [::Google::Cloud::Compute::V1::GetSerialPortOutputInstanceRequest]
670
+ # A request object representing the call parameters. Required.
671
+ # @return [Array(String, [String, nil], Hash{String => String})]
672
+ # Uri, Body, Query string parameters
673
+ def transcode_get_serial_port_output_request request_pb
674
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/serialPort"
675
+ body = nil
676
+ query_string_params = {}
677
+ query_string_params["port"] = request_pb.port.to_s if request_pb.has_port?
678
+ query_string_params["start"] = request_pb.start.to_s if request_pb.has_start?
679
+
680
+ [uri, body, query_string_params]
681
+ end
682
+
683
+ ##
684
+ # Baseline implementation for the get_shielded_instance_identity REST call
685
+ #
686
+ # @param request_pb [::Google::Cloud::Compute::V1::GetShieldedInstanceIdentityInstanceRequest]
687
+ # A request object representing the call parameters. Required.
688
+ # @param options [::Gapic::CallOptions]
689
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
690
+ #
691
+ # @yield [result, response] Access the result along with the Faraday response object
692
+ # @yieldparam result [::Google::Cloud::Compute::V1::ShieldedInstanceIdentity]
693
+ # @yieldparam response [::Faraday::Response]
694
+ #
695
+ # @return [::Google::Cloud::Compute::V1::ShieldedInstanceIdentity]
696
+ # A result object deserialized from the server's reply
697
+ def get_shielded_instance_identity request_pb, options = nil
698
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
699
+
700
+ uri, _body, _query_string_params = transcode_get_shielded_instance_identity_request request_pb
701
+ response = @client_stub.make_get_request(
702
+ uri: uri,
703
+ options: options
704
+ )
705
+ result = ::Google::Cloud::Compute::V1::ShieldedInstanceIdentity.decode_json response.body, ignore_unknown_fields: true
706
+
707
+ yield result, response if block_given?
708
+ result
709
+ end
710
+
711
+ ##
712
+ # GRPC transcoding helper method for the get_shielded_instance_identity REST call
713
+ #
714
+ # @param request_pb [::Google::Cloud::Compute::V1::GetShieldedInstanceIdentityInstanceRequest]
715
+ # A request object representing the call parameters. Required.
716
+ # @return [Array(String, [String, nil], Hash{String => String})]
717
+ # Uri, Body, Query string parameters
718
+ def transcode_get_shielded_instance_identity_request request_pb
719
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/getShieldedInstanceIdentity"
720
+ body = nil
721
+ query_string_params = {}
722
+
723
+ [uri, body, query_string_params]
724
+ end
725
+
726
+ ##
727
+ # Baseline implementation for the insert REST call
728
+ #
729
+ # @param request_pb [::Google::Cloud::Compute::V1::InsertInstanceRequest]
730
+ # A request object representing the call parameters. Required.
731
+ # @param options [::Gapic::CallOptions]
732
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
733
+ #
734
+ # @yield [result, response] Access the result along with the Faraday response object
735
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
736
+ # @yieldparam response [::Faraday::Response]
737
+ #
738
+ # @return [::Google::Cloud::Compute::V1::Operation]
739
+ # A result object deserialized from the server's reply
740
+ def insert request_pb, options = nil
741
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
742
+
743
+ uri, body, query_string_params = transcode_insert_request request_pb
744
+ response = @client_stub.make_post_request(
745
+ uri: uri,
746
+ body: body,
747
+ params: query_string_params,
748
+ options: options
749
+ )
750
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
751
+
752
+ yield result, response if block_given?
753
+ result
754
+ end
755
+
756
+ ##
757
+ # GRPC transcoding helper method for the insert REST call
758
+ #
759
+ # @param request_pb [::Google::Cloud::Compute::V1::InsertInstanceRequest]
760
+ # A request object representing the call parameters. Required.
761
+ # @return [Array(String, [String, nil], Hash{String => String})]
762
+ # Uri, Body, Query string parameters
763
+ def transcode_insert_request request_pb
764
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances"
765
+ body = request_pb.instance_resource.to_json
766
+ query_string_params = {}
767
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
768
+ query_string_params["sourceInstanceTemplate"] = request_pb.source_instance_template.to_s if request_pb.has_source_instance_template?
769
+
770
+ [uri, body, query_string_params]
771
+ end
772
+
773
+ ##
774
+ # Baseline implementation for the list REST call
775
+ #
776
+ # @param request_pb [::Google::Cloud::Compute::V1::ListInstancesRequest]
777
+ # A request object representing the call parameters. Required.
778
+ # @param options [::Gapic::CallOptions]
779
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
780
+ #
781
+ # @yield [result, response] Access the result along with the Faraday response object
782
+ # @yieldparam result [::Google::Cloud::Compute::V1::InstanceList]
783
+ # @yieldparam response [::Faraday::Response]
784
+ #
785
+ # @return [::Google::Cloud::Compute::V1::InstanceList]
786
+ # A result object deserialized from the server's reply
787
+ def list request_pb, options = nil
788
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
789
+
790
+ uri, _body, query_string_params = transcode_list_request request_pb
791
+ response = @client_stub.make_get_request(
792
+ uri: uri,
793
+ params: query_string_params,
794
+ options: options
795
+ )
796
+ result = ::Google::Cloud::Compute::V1::InstanceList.decode_json response.body, ignore_unknown_fields: true
797
+
798
+ yield result, response if block_given?
799
+ result
800
+ end
801
+
802
+ ##
803
+ # GRPC transcoding helper method for the list REST call
804
+ #
805
+ # @param request_pb [::Google::Cloud::Compute::V1::ListInstancesRequest]
806
+ # A request object representing the call parameters. Required.
807
+ # @return [Array(String, [String, nil], Hash{String => String})]
808
+ # Uri, Body, Query string parameters
809
+ def transcode_list_request request_pb
810
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances"
811
+ body = nil
812
+ query_string_params = {}
813
+ query_string_params["filter"] = request_pb.filter.to_s if request_pb.has_filter?
814
+ query_string_params["maxResults"] = request_pb.max_results.to_s if request_pb.has_max_results?
815
+ query_string_params["orderBy"] = request_pb.order_by.to_s if request_pb.has_order_by?
816
+ query_string_params["pageToken"] = request_pb.page_token.to_s if request_pb.has_page_token?
817
+ query_string_params["returnPartialSuccess"] = request_pb.return_partial_success.to_s if request_pb.has_return_partial_success?
818
+
819
+ [uri, body, query_string_params]
820
+ end
821
+
822
+ ##
823
+ # Baseline implementation for the list_referrers REST call
824
+ #
825
+ # @param request_pb [::Google::Cloud::Compute::V1::ListReferrersInstancesRequest]
826
+ # A request object representing the call parameters. Required.
827
+ # @param options [::Gapic::CallOptions]
828
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
829
+ #
830
+ # @yield [result, response] Access the result along with the Faraday response object
831
+ # @yieldparam result [::Google::Cloud::Compute::V1::InstanceListReferrers]
832
+ # @yieldparam response [::Faraday::Response]
833
+ #
834
+ # @return [::Google::Cloud::Compute::V1::InstanceListReferrers]
835
+ # A result object deserialized from the server's reply
836
+ def list_referrers request_pb, options = nil
837
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
838
+
839
+ uri, _body, query_string_params = transcode_list_referrers_request request_pb
840
+ response = @client_stub.make_get_request(
841
+ uri: uri,
842
+ params: query_string_params,
843
+ options: options
844
+ )
845
+ result = ::Google::Cloud::Compute::V1::InstanceListReferrers.decode_json response.body, ignore_unknown_fields: true
846
+
847
+ yield result, response if block_given?
848
+ result
849
+ end
850
+
851
+ ##
852
+ # GRPC transcoding helper method for the list_referrers REST call
853
+ #
854
+ # @param request_pb [::Google::Cloud::Compute::V1::ListReferrersInstancesRequest]
855
+ # A request object representing the call parameters. Required.
856
+ # @return [Array(String, [String, nil], Hash{String => String})]
857
+ # Uri, Body, Query string parameters
858
+ def transcode_list_referrers_request request_pb
859
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/referrers"
860
+ body = nil
861
+ query_string_params = {}
862
+ query_string_params["filter"] = request_pb.filter.to_s if request_pb.has_filter?
863
+ query_string_params["maxResults"] = request_pb.max_results.to_s if request_pb.has_max_results?
864
+ query_string_params["orderBy"] = request_pb.order_by.to_s if request_pb.has_order_by?
865
+ query_string_params["pageToken"] = request_pb.page_token.to_s if request_pb.has_page_token?
866
+ query_string_params["returnPartialSuccess"] = request_pb.return_partial_success.to_s if request_pb.has_return_partial_success?
867
+
868
+ [uri, body, query_string_params]
869
+ end
870
+
871
+ ##
872
+ # Baseline implementation for the remove_resource_policies REST call
873
+ #
874
+ # @param request_pb [::Google::Cloud::Compute::V1::RemoveResourcePoliciesInstanceRequest]
875
+ # A request object representing the call parameters. Required.
876
+ # @param options [::Gapic::CallOptions]
877
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
878
+ #
879
+ # @yield [result, response] Access the result along with the Faraday response object
880
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
881
+ # @yieldparam response [::Faraday::Response]
882
+ #
883
+ # @return [::Google::Cloud::Compute::V1::Operation]
884
+ # A result object deserialized from the server's reply
885
+ def remove_resource_policies request_pb, options = nil
886
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
887
+
888
+ uri, body, query_string_params = transcode_remove_resource_policies_request request_pb
889
+ response = @client_stub.make_post_request(
890
+ uri: uri,
891
+ body: body,
892
+ params: query_string_params,
893
+ options: options
894
+ )
895
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
896
+
897
+ yield result, response if block_given?
898
+ result
899
+ end
900
+
901
+ ##
902
+ # GRPC transcoding helper method for the remove_resource_policies REST call
903
+ #
904
+ # @param request_pb [::Google::Cloud::Compute::V1::RemoveResourcePoliciesInstanceRequest]
905
+ # A request object representing the call parameters. Required.
906
+ # @return [Array(String, [String, nil], Hash{String => String})]
907
+ # Uri, Body, Query string parameters
908
+ def transcode_remove_resource_policies_request request_pb
909
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/removeResourcePolicies"
910
+ body = request_pb.instances_remove_resource_policies_request_resource.to_json
911
+ query_string_params = {}
912
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
913
+
914
+ [uri, body, query_string_params]
915
+ end
916
+
917
+ ##
918
+ # Baseline implementation for the reset REST call
919
+ #
920
+ # @param request_pb [::Google::Cloud::Compute::V1::ResetInstanceRequest]
921
+ # A request object representing the call parameters. Required.
922
+ # @param options [::Gapic::CallOptions]
923
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
924
+ #
925
+ # @yield [result, response] Access the result along with the Faraday response object
926
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
927
+ # @yieldparam response [::Faraday::Response]
928
+ #
929
+ # @return [::Google::Cloud::Compute::V1::Operation]
930
+ # A result object deserialized from the server's reply
931
+ def reset request_pb, options = nil
932
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
933
+
934
+ uri, _body, query_string_params = transcode_reset_request request_pb
935
+ response = @client_stub.make_post_request(
936
+ uri: uri,
937
+ params: query_string_params,
938
+ options: options
939
+ )
940
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
941
+
942
+ yield result, response if block_given?
943
+ result
944
+ end
945
+
946
+ ##
947
+ # GRPC transcoding helper method for the reset REST call
948
+ #
949
+ # @param request_pb [::Google::Cloud::Compute::V1::ResetInstanceRequest]
950
+ # A request object representing the call parameters. Required.
951
+ # @return [Array(String, [String, nil], Hash{String => String})]
952
+ # Uri, Body, Query string parameters
953
+ def transcode_reset_request request_pb
954
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/reset"
955
+ body = nil
956
+ query_string_params = {}
957
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
958
+
959
+ [uri, body, query_string_params]
960
+ end
961
+
962
+ ##
963
+ # Baseline implementation for the send_diagnostic_interrupt REST call
964
+ #
965
+ # @param request_pb [::Google::Cloud::Compute::V1::SendDiagnosticInterruptInstanceRequest]
966
+ # A request object representing the call parameters. Required.
967
+ # @param options [::Gapic::CallOptions]
968
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
969
+ #
970
+ # @yield [result, response] Access the result along with the Faraday response object
971
+ # @yieldparam result [::Google::Cloud::Compute::V1::SendDiagnosticInterruptInstanceResponse]
972
+ # @yieldparam response [::Faraday::Response]
973
+ #
974
+ # @return [::Google::Cloud::Compute::V1::SendDiagnosticInterruptInstanceResponse]
975
+ # A result object deserialized from the server's reply
976
+ def send_diagnostic_interrupt request_pb, options = nil
977
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
978
+
979
+ uri, _body, _query_string_params = transcode_send_diagnostic_interrupt_request request_pb
980
+ response = @client_stub.make_post_request(
981
+ uri: uri,
982
+ options: options
983
+ )
984
+ result = ::Google::Cloud::Compute::V1::SendDiagnosticInterruptInstanceResponse.decode_json response.body, ignore_unknown_fields: true
985
+
986
+ yield result, response if block_given?
987
+ result
988
+ end
989
+
990
+ ##
991
+ # GRPC transcoding helper method for the send_diagnostic_interrupt REST call
992
+ #
993
+ # @param request_pb [::Google::Cloud::Compute::V1::SendDiagnosticInterruptInstanceRequest]
994
+ # A request object representing the call parameters. Required.
995
+ # @return [Array(String, [String, nil], Hash{String => String})]
996
+ # Uri, Body, Query string parameters
997
+ def transcode_send_diagnostic_interrupt_request request_pb
998
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/sendDiagnosticInterrupt"
999
+ body = nil
1000
+ query_string_params = {}
1001
+
1002
+ [uri, body, query_string_params]
1003
+ end
1004
+
1005
+ ##
1006
+ # Baseline implementation for the set_deletion_protection REST call
1007
+ #
1008
+ # @param request_pb [::Google::Cloud::Compute::V1::SetDeletionProtectionInstanceRequest]
1009
+ # A request object representing the call parameters. Required.
1010
+ # @param options [::Gapic::CallOptions]
1011
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1012
+ #
1013
+ # @yield [result, response] Access the result along with the Faraday response object
1014
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1015
+ # @yieldparam response [::Faraday::Response]
1016
+ #
1017
+ # @return [::Google::Cloud::Compute::V1::Operation]
1018
+ # A result object deserialized from the server's reply
1019
+ def set_deletion_protection request_pb, options = nil
1020
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1021
+
1022
+ uri, _body, query_string_params = transcode_set_deletion_protection_request request_pb
1023
+ response = @client_stub.make_post_request(
1024
+ uri: uri,
1025
+ params: query_string_params,
1026
+ options: options
1027
+ )
1028
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1029
+
1030
+ yield result, response if block_given?
1031
+ result
1032
+ end
1033
+
1034
+ ##
1035
+ # GRPC transcoding helper method for the set_deletion_protection REST call
1036
+ #
1037
+ # @param request_pb [::Google::Cloud::Compute::V1::SetDeletionProtectionInstanceRequest]
1038
+ # A request object representing the call parameters. Required.
1039
+ # @return [Array(String, [String, nil], Hash{String => String})]
1040
+ # Uri, Body, Query string parameters
1041
+ def transcode_set_deletion_protection_request request_pb
1042
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.resource}/setDeletionProtection"
1043
+ body = nil
1044
+ query_string_params = {}
1045
+ query_string_params["deletionProtection"] = request_pb.deletion_protection.to_s if request_pb.has_deletion_protection?
1046
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1047
+
1048
+ [uri, body, query_string_params]
1049
+ end
1050
+
1051
+ ##
1052
+ # Baseline implementation for the set_disk_auto_delete REST call
1053
+ #
1054
+ # @param request_pb [::Google::Cloud::Compute::V1::SetDiskAutoDeleteInstanceRequest]
1055
+ # A request object representing the call parameters. Required.
1056
+ # @param options [::Gapic::CallOptions]
1057
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1058
+ #
1059
+ # @yield [result, response] Access the result along with the Faraday response object
1060
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1061
+ # @yieldparam response [::Faraday::Response]
1062
+ #
1063
+ # @return [::Google::Cloud::Compute::V1::Operation]
1064
+ # A result object deserialized from the server's reply
1065
+ def set_disk_auto_delete request_pb, options = nil
1066
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1067
+
1068
+ uri, _body, query_string_params = transcode_set_disk_auto_delete_request request_pb
1069
+ response = @client_stub.make_post_request(
1070
+ uri: uri,
1071
+ params: query_string_params,
1072
+ options: options
1073
+ )
1074
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1075
+
1076
+ yield result, response if block_given?
1077
+ result
1078
+ end
1079
+
1080
+ ##
1081
+ # GRPC transcoding helper method for the set_disk_auto_delete REST call
1082
+ #
1083
+ # @param request_pb [::Google::Cloud::Compute::V1::SetDiskAutoDeleteInstanceRequest]
1084
+ # A request object representing the call parameters. Required.
1085
+ # @return [Array(String, [String, nil], Hash{String => String})]
1086
+ # Uri, Body, Query string parameters
1087
+ def transcode_set_disk_auto_delete_request request_pb
1088
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/setDiskAutoDelete"
1089
+ body = nil
1090
+ query_string_params = {}
1091
+ query_string_params["autoDelete"] = request_pb.auto_delete.to_s
1092
+ query_string_params["deviceName"] = request_pb.device_name.to_s
1093
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1094
+
1095
+ [uri, body, query_string_params]
1096
+ end
1097
+
1098
+ ##
1099
+ # Baseline implementation for the set_iam_policy REST call
1100
+ #
1101
+ # @param request_pb [::Google::Cloud::Compute::V1::SetIamPolicyInstanceRequest]
1102
+ # A request object representing the call parameters. Required.
1103
+ # @param options [::Gapic::CallOptions]
1104
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1105
+ #
1106
+ # @yield [result, response] Access the result along with the Faraday response object
1107
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
1108
+ # @yieldparam response [::Faraday::Response]
1109
+ #
1110
+ # @return [::Google::Cloud::Compute::V1::Policy]
1111
+ # A result object deserialized from the server's reply
1112
+ def set_iam_policy request_pb, options = nil
1113
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1114
+
1115
+ uri, body, _query_string_params = transcode_set_iam_policy_request request_pb
1116
+ response = @client_stub.make_post_request(
1117
+ uri: uri,
1118
+ body: body,
1119
+ options: options
1120
+ )
1121
+ result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
1122
+
1123
+ yield result, response if block_given?
1124
+ result
1125
+ end
1126
+
1127
+ ##
1128
+ # GRPC transcoding helper method for the set_iam_policy REST call
1129
+ #
1130
+ # @param request_pb [::Google::Cloud::Compute::V1::SetIamPolicyInstanceRequest]
1131
+ # A request object representing the call parameters. Required.
1132
+ # @return [Array(String, [String, nil], Hash{String => String})]
1133
+ # Uri, Body, Query string parameters
1134
+ def transcode_set_iam_policy_request request_pb
1135
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.resource}/setIamPolicy"
1136
+ body = request_pb.zone_set_policy_request_resource.to_json
1137
+ query_string_params = {}
1138
+
1139
+ [uri, body, query_string_params]
1140
+ end
1141
+
1142
+ ##
1143
+ # Baseline implementation for the set_labels REST call
1144
+ #
1145
+ # @param request_pb [::Google::Cloud::Compute::V1::SetLabelsInstanceRequest]
1146
+ # A request object representing the call parameters. Required.
1147
+ # @param options [::Gapic::CallOptions]
1148
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1149
+ #
1150
+ # @yield [result, response] Access the result along with the Faraday response object
1151
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1152
+ # @yieldparam response [::Faraday::Response]
1153
+ #
1154
+ # @return [::Google::Cloud::Compute::V1::Operation]
1155
+ # A result object deserialized from the server's reply
1156
+ def set_labels request_pb, options = nil
1157
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1158
+
1159
+ uri, body, query_string_params = transcode_set_labels_request request_pb
1160
+ response = @client_stub.make_post_request(
1161
+ uri: uri,
1162
+ body: body,
1163
+ params: query_string_params,
1164
+ options: options
1165
+ )
1166
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1167
+
1168
+ yield result, response if block_given?
1169
+ result
1170
+ end
1171
+
1172
+ ##
1173
+ # GRPC transcoding helper method for the set_labels REST call
1174
+ #
1175
+ # @param request_pb [::Google::Cloud::Compute::V1::SetLabelsInstanceRequest]
1176
+ # A request object representing the call parameters. Required.
1177
+ # @return [Array(String, [String, nil], Hash{String => String})]
1178
+ # Uri, Body, Query string parameters
1179
+ def transcode_set_labels_request request_pb
1180
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/setLabels"
1181
+ body = request_pb.instances_set_labels_request_resource.to_json
1182
+ query_string_params = {}
1183
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1184
+
1185
+ [uri, body, query_string_params]
1186
+ end
1187
+
1188
+ ##
1189
+ # Baseline implementation for the set_machine_resources REST call
1190
+ #
1191
+ # @param request_pb [::Google::Cloud::Compute::V1::SetMachineResourcesInstanceRequest]
1192
+ # A request object representing the call parameters. Required.
1193
+ # @param options [::Gapic::CallOptions]
1194
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1195
+ #
1196
+ # @yield [result, response] Access the result along with the Faraday response object
1197
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1198
+ # @yieldparam response [::Faraday::Response]
1199
+ #
1200
+ # @return [::Google::Cloud::Compute::V1::Operation]
1201
+ # A result object deserialized from the server's reply
1202
+ def set_machine_resources request_pb, options = nil
1203
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1204
+
1205
+ uri, body, query_string_params = transcode_set_machine_resources_request request_pb
1206
+ response = @client_stub.make_post_request(
1207
+ uri: uri,
1208
+ body: body,
1209
+ params: query_string_params,
1210
+ options: options
1211
+ )
1212
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1213
+
1214
+ yield result, response if block_given?
1215
+ result
1216
+ end
1217
+
1218
+ ##
1219
+ # GRPC transcoding helper method for the set_machine_resources REST call
1220
+ #
1221
+ # @param request_pb [::Google::Cloud::Compute::V1::SetMachineResourcesInstanceRequest]
1222
+ # A request object representing the call parameters. Required.
1223
+ # @return [Array(String, [String, nil], Hash{String => String})]
1224
+ # Uri, Body, Query string parameters
1225
+ def transcode_set_machine_resources_request request_pb
1226
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/setMachineResources"
1227
+ body = request_pb.instances_set_machine_resources_request_resource.to_json
1228
+ query_string_params = {}
1229
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1230
+
1231
+ [uri, body, query_string_params]
1232
+ end
1233
+
1234
+ ##
1235
+ # Baseline implementation for the set_machine_type REST call
1236
+ #
1237
+ # @param request_pb [::Google::Cloud::Compute::V1::SetMachineTypeInstanceRequest]
1238
+ # A request object representing the call parameters. Required.
1239
+ # @param options [::Gapic::CallOptions]
1240
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1241
+ #
1242
+ # @yield [result, response] Access the result along with the Faraday response object
1243
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1244
+ # @yieldparam response [::Faraday::Response]
1245
+ #
1246
+ # @return [::Google::Cloud::Compute::V1::Operation]
1247
+ # A result object deserialized from the server's reply
1248
+ def set_machine_type request_pb, options = nil
1249
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1250
+
1251
+ uri, body, query_string_params = transcode_set_machine_type_request request_pb
1252
+ response = @client_stub.make_post_request(
1253
+ uri: uri,
1254
+ body: body,
1255
+ params: query_string_params,
1256
+ options: options
1257
+ )
1258
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1259
+
1260
+ yield result, response if block_given?
1261
+ result
1262
+ end
1263
+
1264
+ ##
1265
+ # GRPC transcoding helper method for the set_machine_type REST call
1266
+ #
1267
+ # @param request_pb [::Google::Cloud::Compute::V1::SetMachineTypeInstanceRequest]
1268
+ # A request object representing the call parameters. Required.
1269
+ # @return [Array(String, [String, nil], Hash{String => String})]
1270
+ # Uri, Body, Query string parameters
1271
+ def transcode_set_machine_type_request request_pb
1272
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/setMachineType"
1273
+ body = request_pb.instances_set_machine_type_request_resource.to_json
1274
+ query_string_params = {}
1275
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1276
+
1277
+ [uri, body, query_string_params]
1278
+ end
1279
+
1280
+ ##
1281
+ # Baseline implementation for the set_metadata REST call
1282
+ #
1283
+ # @param request_pb [::Google::Cloud::Compute::V1::SetMetadataInstanceRequest]
1284
+ # A request object representing the call parameters. Required.
1285
+ # @param options [::Gapic::CallOptions]
1286
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1287
+ #
1288
+ # @yield [result, response] Access the result along with the Faraday response object
1289
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1290
+ # @yieldparam response [::Faraday::Response]
1291
+ #
1292
+ # @return [::Google::Cloud::Compute::V1::Operation]
1293
+ # A result object deserialized from the server's reply
1294
+ def set_metadata request_pb, options = nil
1295
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1296
+
1297
+ uri, body, query_string_params = transcode_set_metadata_request request_pb
1298
+ response = @client_stub.make_post_request(
1299
+ uri: uri,
1300
+ body: body,
1301
+ params: query_string_params,
1302
+ options: options
1303
+ )
1304
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1305
+
1306
+ yield result, response if block_given?
1307
+ result
1308
+ end
1309
+
1310
+ ##
1311
+ # GRPC transcoding helper method for the set_metadata REST call
1312
+ #
1313
+ # @param request_pb [::Google::Cloud::Compute::V1::SetMetadataInstanceRequest]
1314
+ # A request object representing the call parameters. Required.
1315
+ # @return [Array(String, [String, nil], Hash{String => String})]
1316
+ # Uri, Body, Query string parameters
1317
+ def transcode_set_metadata_request request_pb
1318
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/setMetadata"
1319
+ body = request_pb.metadata_resource.to_json
1320
+ query_string_params = {}
1321
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1322
+
1323
+ [uri, body, query_string_params]
1324
+ end
1325
+
1326
+ ##
1327
+ # Baseline implementation for the set_min_cpu_platform REST call
1328
+ #
1329
+ # @param request_pb [::Google::Cloud::Compute::V1::SetMinCpuPlatformInstanceRequest]
1330
+ # A request object representing the call parameters. Required.
1331
+ # @param options [::Gapic::CallOptions]
1332
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1333
+ #
1334
+ # @yield [result, response] Access the result along with the Faraday response object
1335
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1336
+ # @yieldparam response [::Faraday::Response]
1337
+ #
1338
+ # @return [::Google::Cloud::Compute::V1::Operation]
1339
+ # A result object deserialized from the server's reply
1340
+ def set_min_cpu_platform request_pb, options = nil
1341
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1342
+
1343
+ uri, body, query_string_params = transcode_set_min_cpu_platform_request request_pb
1344
+ response = @client_stub.make_post_request(
1345
+ uri: uri,
1346
+ body: body,
1347
+ params: query_string_params,
1348
+ options: options
1349
+ )
1350
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1351
+
1352
+ yield result, response if block_given?
1353
+ result
1354
+ end
1355
+
1356
+ ##
1357
+ # GRPC transcoding helper method for the set_min_cpu_platform REST call
1358
+ #
1359
+ # @param request_pb [::Google::Cloud::Compute::V1::SetMinCpuPlatformInstanceRequest]
1360
+ # A request object representing the call parameters. Required.
1361
+ # @return [Array(String, [String, nil], Hash{String => String})]
1362
+ # Uri, Body, Query string parameters
1363
+ def transcode_set_min_cpu_platform_request request_pb
1364
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/setMinCpuPlatform"
1365
+ body = request_pb.instances_set_min_cpu_platform_request_resource.to_json
1366
+ query_string_params = {}
1367
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1368
+
1369
+ [uri, body, query_string_params]
1370
+ end
1371
+
1372
+ ##
1373
+ # Baseline implementation for the set_scheduling REST call
1374
+ #
1375
+ # @param request_pb [::Google::Cloud::Compute::V1::SetSchedulingInstanceRequest]
1376
+ # A request object representing the call parameters. Required.
1377
+ # @param options [::Gapic::CallOptions]
1378
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1379
+ #
1380
+ # @yield [result, response] Access the result along with the Faraday response object
1381
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1382
+ # @yieldparam response [::Faraday::Response]
1383
+ #
1384
+ # @return [::Google::Cloud::Compute::V1::Operation]
1385
+ # A result object deserialized from the server's reply
1386
+ def set_scheduling request_pb, options = nil
1387
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1388
+
1389
+ uri, body, query_string_params = transcode_set_scheduling_request request_pb
1390
+ response = @client_stub.make_post_request(
1391
+ uri: uri,
1392
+ body: body,
1393
+ params: query_string_params,
1394
+ options: options
1395
+ )
1396
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1397
+
1398
+ yield result, response if block_given?
1399
+ result
1400
+ end
1401
+
1402
+ ##
1403
+ # GRPC transcoding helper method for the set_scheduling REST call
1404
+ #
1405
+ # @param request_pb [::Google::Cloud::Compute::V1::SetSchedulingInstanceRequest]
1406
+ # A request object representing the call parameters. Required.
1407
+ # @return [Array(String, [String, nil], Hash{String => String})]
1408
+ # Uri, Body, Query string parameters
1409
+ def transcode_set_scheduling_request request_pb
1410
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/setScheduling"
1411
+ body = request_pb.scheduling_resource.to_json
1412
+ query_string_params = {}
1413
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1414
+
1415
+ [uri, body, query_string_params]
1416
+ end
1417
+
1418
+ ##
1419
+ # Baseline implementation for the set_service_account REST call
1420
+ #
1421
+ # @param request_pb [::Google::Cloud::Compute::V1::SetServiceAccountInstanceRequest]
1422
+ # A request object representing the call parameters. Required.
1423
+ # @param options [::Gapic::CallOptions]
1424
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1425
+ #
1426
+ # @yield [result, response] Access the result along with the Faraday response object
1427
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1428
+ # @yieldparam response [::Faraday::Response]
1429
+ #
1430
+ # @return [::Google::Cloud::Compute::V1::Operation]
1431
+ # A result object deserialized from the server's reply
1432
+ def set_service_account request_pb, options = nil
1433
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1434
+
1435
+ uri, body, query_string_params = transcode_set_service_account_request request_pb
1436
+ response = @client_stub.make_post_request(
1437
+ uri: uri,
1438
+ body: body,
1439
+ params: query_string_params,
1440
+ options: options
1441
+ )
1442
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1443
+
1444
+ yield result, response if block_given?
1445
+ result
1446
+ end
1447
+
1448
+ ##
1449
+ # GRPC transcoding helper method for the set_service_account REST call
1450
+ #
1451
+ # @param request_pb [::Google::Cloud::Compute::V1::SetServiceAccountInstanceRequest]
1452
+ # A request object representing the call parameters. Required.
1453
+ # @return [Array(String, [String, nil], Hash{String => String})]
1454
+ # Uri, Body, Query string parameters
1455
+ def transcode_set_service_account_request request_pb
1456
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/setServiceAccount"
1457
+ body = request_pb.instances_set_service_account_request_resource.to_json
1458
+ query_string_params = {}
1459
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1460
+
1461
+ [uri, body, query_string_params]
1462
+ end
1463
+
1464
+ ##
1465
+ # Baseline implementation for the set_shielded_instance_integrity_policy REST call
1466
+ #
1467
+ # @param request_pb [::Google::Cloud::Compute::V1::SetShieldedInstanceIntegrityPolicyInstanceRequest]
1468
+ # A request object representing the call parameters. Required.
1469
+ # @param options [::Gapic::CallOptions]
1470
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1471
+ #
1472
+ # @yield [result, response] Access the result along with the Faraday response object
1473
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1474
+ # @yieldparam response [::Faraday::Response]
1475
+ #
1476
+ # @return [::Google::Cloud::Compute::V1::Operation]
1477
+ # A result object deserialized from the server's reply
1478
+ def set_shielded_instance_integrity_policy request_pb, options = nil
1479
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1480
+
1481
+ uri, body, query_string_params = transcode_set_shielded_instance_integrity_policy_request request_pb
1482
+ response = @client_stub.make_patch_request(
1483
+ uri: uri,
1484
+ body: body,
1485
+ params: query_string_params,
1486
+ options: options
1487
+ )
1488
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1489
+
1490
+ yield result, response if block_given?
1491
+ result
1492
+ end
1493
+
1494
+ ##
1495
+ # GRPC transcoding helper method for the set_shielded_instance_integrity_policy REST call
1496
+ #
1497
+ # @param request_pb [::Google::Cloud::Compute::V1::SetShieldedInstanceIntegrityPolicyInstanceRequest]
1498
+ # A request object representing the call parameters. Required.
1499
+ # @return [Array(String, [String, nil], Hash{String => String})]
1500
+ # Uri, Body, Query string parameters
1501
+ def transcode_set_shielded_instance_integrity_policy_request request_pb
1502
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/setShieldedInstanceIntegrityPolicy"
1503
+ body = request_pb.shielded_instance_integrity_policy_resource.to_json
1504
+ query_string_params = {}
1505
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1506
+
1507
+ [uri, body, query_string_params]
1508
+ end
1509
+
1510
+ ##
1511
+ # Baseline implementation for the set_tags REST call
1512
+ #
1513
+ # @param request_pb [::Google::Cloud::Compute::V1::SetTagsInstanceRequest]
1514
+ # A request object representing the call parameters. Required.
1515
+ # @param options [::Gapic::CallOptions]
1516
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1517
+ #
1518
+ # @yield [result, response] Access the result along with the Faraday response object
1519
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1520
+ # @yieldparam response [::Faraday::Response]
1521
+ #
1522
+ # @return [::Google::Cloud::Compute::V1::Operation]
1523
+ # A result object deserialized from the server's reply
1524
+ def set_tags request_pb, options = nil
1525
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1526
+
1527
+ uri, body, query_string_params = transcode_set_tags_request request_pb
1528
+ response = @client_stub.make_post_request(
1529
+ uri: uri,
1530
+ body: body,
1531
+ params: query_string_params,
1532
+ options: options
1533
+ )
1534
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1535
+
1536
+ yield result, response if block_given?
1537
+ result
1538
+ end
1539
+
1540
+ ##
1541
+ # GRPC transcoding helper method for the set_tags REST call
1542
+ #
1543
+ # @param request_pb [::Google::Cloud::Compute::V1::SetTagsInstanceRequest]
1544
+ # A request object representing the call parameters. Required.
1545
+ # @return [Array(String, [String, nil], Hash{String => String})]
1546
+ # Uri, Body, Query string parameters
1547
+ def transcode_set_tags_request request_pb
1548
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/setTags"
1549
+ body = request_pb.tags_resource.to_json
1550
+ query_string_params = {}
1551
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1552
+
1553
+ [uri, body, query_string_params]
1554
+ end
1555
+
1556
+ ##
1557
+ # Baseline implementation for the simulate_maintenance_event REST call
1558
+ #
1559
+ # @param request_pb [::Google::Cloud::Compute::V1::SimulateMaintenanceEventInstanceRequest]
1560
+ # A request object representing the call parameters. Required.
1561
+ # @param options [::Gapic::CallOptions]
1562
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1563
+ #
1564
+ # @yield [result, response] Access the result along with the Faraday response object
1565
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1566
+ # @yieldparam response [::Faraday::Response]
1567
+ #
1568
+ # @return [::Google::Cloud::Compute::V1::Operation]
1569
+ # A result object deserialized from the server's reply
1570
+ def simulate_maintenance_event request_pb, options = nil
1571
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1572
+
1573
+ uri, _body, _query_string_params = transcode_simulate_maintenance_event_request request_pb
1574
+ response = @client_stub.make_post_request(
1575
+ uri: uri,
1576
+ options: options
1577
+ )
1578
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1579
+
1580
+ yield result, response if block_given?
1581
+ result
1582
+ end
1583
+
1584
+ ##
1585
+ # GRPC transcoding helper method for the simulate_maintenance_event REST call
1586
+ #
1587
+ # @param request_pb [::Google::Cloud::Compute::V1::SimulateMaintenanceEventInstanceRequest]
1588
+ # A request object representing the call parameters. Required.
1589
+ # @return [Array(String, [String, nil], Hash{String => String})]
1590
+ # Uri, Body, Query string parameters
1591
+ def transcode_simulate_maintenance_event_request request_pb
1592
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/simulateMaintenanceEvent"
1593
+ body = nil
1594
+ query_string_params = {}
1595
+
1596
+ [uri, body, query_string_params]
1597
+ end
1598
+
1599
+ ##
1600
+ # Baseline implementation for the start REST call
1601
+ #
1602
+ # @param request_pb [::Google::Cloud::Compute::V1::StartInstanceRequest]
1603
+ # A request object representing the call parameters. Required.
1604
+ # @param options [::Gapic::CallOptions]
1605
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1606
+ #
1607
+ # @yield [result, response] Access the result along with the Faraday response object
1608
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1609
+ # @yieldparam response [::Faraday::Response]
1610
+ #
1611
+ # @return [::Google::Cloud::Compute::V1::Operation]
1612
+ # A result object deserialized from the server's reply
1613
+ def start request_pb, options = nil
1614
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1615
+
1616
+ uri, _body, query_string_params = transcode_start_request request_pb
1617
+ response = @client_stub.make_post_request(
1618
+ uri: uri,
1619
+ params: query_string_params,
1620
+ options: options
1621
+ )
1622
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1623
+
1624
+ yield result, response if block_given?
1625
+ result
1626
+ end
1627
+
1628
+ ##
1629
+ # GRPC transcoding helper method for the start REST call
1630
+ #
1631
+ # @param request_pb [::Google::Cloud::Compute::V1::StartInstanceRequest]
1632
+ # A request object representing the call parameters. Required.
1633
+ # @return [Array(String, [String, nil], Hash{String => String})]
1634
+ # Uri, Body, Query string parameters
1635
+ def transcode_start_request request_pb
1636
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/start"
1637
+ body = nil
1638
+ query_string_params = {}
1639
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1640
+
1641
+ [uri, body, query_string_params]
1642
+ end
1643
+
1644
+ ##
1645
+ # Baseline implementation for the start_with_encryption_key REST call
1646
+ #
1647
+ # @param request_pb [::Google::Cloud::Compute::V1::StartWithEncryptionKeyInstanceRequest]
1648
+ # A request object representing the call parameters. Required.
1649
+ # @param options [::Gapic::CallOptions]
1650
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1651
+ #
1652
+ # @yield [result, response] Access the result along with the Faraday response object
1653
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1654
+ # @yieldparam response [::Faraday::Response]
1655
+ #
1656
+ # @return [::Google::Cloud::Compute::V1::Operation]
1657
+ # A result object deserialized from the server's reply
1658
+ def start_with_encryption_key request_pb, options = nil
1659
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1660
+
1661
+ uri, body, query_string_params = transcode_start_with_encryption_key_request request_pb
1662
+ response = @client_stub.make_post_request(
1663
+ uri: uri,
1664
+ body: body,
1665
+ params: query_string_params,
1666
+ options: options
1667
+ )
1668
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1669
+
1670
+ yield result, response if block_given?
1671
+ result
1672
+ end
1673
+
1674
+ ##
1675
+ # GRPC transcoding helper method for the start_with_encryption_key REST call
1676
+ #
1677
+ # @param request_pb [::Google::Cloud::Compute::V1::StartWithEncryptionKeyInstanceRequest]
1678
+ # A request object representing the call parameters. Required.
1679
+ # @return [Array(String, [String, nil], Hash{String => String})]
1680
+ # Uri, Body, Query string parameters
1681
+ def transcode_start_with_encryption_key_request request_pb
1682
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/startWithEncryptionKey"
1683
+ body = request_pb.instances_start_with_encryption_key_request_resource.to_json
1684
+ query_string_params = {}
1685
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1686
+
1687
+ [uri, body, query_string_params]
1688
+ end
1689
+
1690
+ ##
1691
+ # Baseline implementation for the stop REST call
1692
+ #
1693
+ # @param request_pb [::Google::Cloud::Compute::V1::StopInstanceRequest]
1694
+ # A request object representing the call parameters. Required.
1695
+ # @param options [::Gapic::CallOptions]
1696
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1697
+ #
1698
+ # @yield [result, response] Access the result along with the Faraday response object
1699
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1700
+ # @yieldparam response [::Faraday::Response]
1701
+ #
1702
+ # @return [::Google::Cloud::Compute::V1::Operation]
1703
+ # A result object deserialized from the server's reply
1704
+ def stop request_pb, options = nil
1705
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1706
+
1707
+ uri, _body, query_string_params = transcode_stop_request request_pb
1708
+ response = @client_stub.make_post_request(
1709
+ uri: uri,
1710
+ params: query_string_params,
1711
+ options: options
1712
+ )
1713
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1714
+
1715
+ yield result, response if block_given?
1716
+ result
1717
+ end
1718
+
1719
+ ##
1720
+ # GRPC transcoding helper method for the stop REST call
1721
+ #
1722
+ # @param request_pb [::Google::Cloud::Compute::V1::StopInstanceRequest]
1723
+ # A request object representing the call parameters. Required.
1724
+ # @return [Array(String, [String, nil], Hash{String => String})]
1725
+ # Uri, Body, Query string parameters
1726
+ def transcode_stop_request request_pb
1727
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/stop"
1728
+ body = nil
1729
+ query_string_params = {}
1730
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1731
+
1732
+ [uri, body, query_string_params]
1733
+ end
1734
+
1735
+ ##
1736
+ # Baseline implementation for the test_iam_permissions REST call
1737
+ #
1738
+ # @param request_pb [::Google::Cloud::Compute::V1::TestIamPermissionsInstanceRequest]
1739
+ # A request object representing the call parameters. Required.
1740
+ # @param options [::Gapic::CallOptions]
1741
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1742
+ #
1743
+ # @yield [result, response] Access the result along with the Faraday response object
1744
+ # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
1745
+ # @yieldparam response [::Faraday::Response]
1746
+ #
1747
+ # @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
1748
+ # A result object deserialized from the server's reply
1749
+ def test_iam_permissions request_pb, options = nil
1750
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1751
+
1752
+ uri, body, _query_string_params = transcode_test_iam_permissions_request request_pb
1753
+ response = @client_stub.make_post_request(
1754
+ uri: uri,
1755
+ body: body,
1756
+ options: options
1757
+ )
1758
+ result = ::Google::Cloud::Compute::V1::TestPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
1759
+
1760
+ yield result, response if block_given?
1761
+ result
1762
+ end
1763
+
1764
+ ##
1765
+ # GRPC transcoding helper method for the test_iam_permissions REST call
1766
+ #
1767
+ # @param request_pb [::Google::Cloud::Compute::V1::TestIamPermissionsInstanceRequest]
1768
+ # A request object representing the call parameters. Required.
1769
+ # @return [Array(String, [String, nil], Hash{String => String})]
1770
+ # Uri, Body, Query string parameters
1771
+ def transcode_test_iam_permissions_request request_pb
1772
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.resource}/testIamPermissions"
1773
+ body = request_pb.test_permissions_request_resource.to_json
1774
+ query_string_params = {}
1775
+
1776
+ [uri, body, query_string_params]
1777
+ end
1778
+
1779
+ ##
1780
+ # Baseline implementation for the update REST call
1781
+ #
1782
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateInstanceRequest]
1783
+ # A request object representing the call parameters. Required.
1784
+ # @param options [::Gapic::CallOptions]
1785
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1786
+ #
1787
+ # @yield [result, response] Access the result along with the Faraday response object
1788
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1789
+ # @yieldparam response [::Faraday::Response]
1790
+ #
1791
+ # @return [::Google::Cloud::Compute::V1::Operation]
1792
+ # A result object deserialized from the server's reply
1793
+ def update request_pb, options = nil
1794
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1795
+
1796
+ uri, body, query_string_params = transcode_update_request request_pb
1797
+ response = @client_stub.make_put_request(
1798
+ uri: uri,
1799
+ body: body,
1800
+ params: query_string_params,
1801
+ options: options
1802
+ )
1803
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1804
+
1805
+ yield result, response if block_given?
1806
+ result
1807
+ end
1808
+
1809
+ ##
1810
+ # GRPC transcoding helper method for the update REST call
1811
+ #
1812
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateInstanceRequest]
1813
+ # A request object representing the call parameters. Required.
1814
+ # @return [Array(String, [String, nil], Hash{String => String})]
1815
+ # Uri, Body, Query string parameters
1816
+ def transcode_update_request request_pb
1817
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}"
1818
+ body = request_pb.instance_resource.to_json
1819
+ query_string_params = {}
1820
+ query_string_params["minimalAction"] = request_pb.minimal_action.to_s if request_pb.has_minimal_action?
1821
+ query_string_params["mostDisruptiveAllowedAction"] = request_pb.most_disruptive_allowed_action.to_s if request_pb.has_most_disruptive_allowed_action?
1822
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1823
+
1824
+ [uri, body, query_string_params]
1825
+ end
1826
+
1827
+ ##
1828
+ # Baseline implementation for the update_access_config REST call
1829
+ #
1830
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateAccessConfigInstanceRequest]
1831
+ # A request object representing the call parameters. Required.
1832
+ # @param options [::Gapic::CallOptions]
1833
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1834
+ #
1835
+ # @yield [result, response] Access the result along with the Faraday response object
1836
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1837
+ # @yieldparam response [::Faraday::Response]
1838
+ #
1839
+ # @return [::Google::Cloud::Compute::V1::Operation]
1840
+ # A result object deserialized from the server's reply
1841
+ def update_access_config request_pb, options = nil
1842
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1843
+
1844
+ uri, body, query_string_params = transcode_update_access_config_request request_pb
1845
+ response = @client_stub.make_post_request(
1846
+ uri: uri,
1847
+ body: body,
1848
+ params: query_string_params,
1849
+ options: options
1850
+ )
1851
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1852
+
1853
+ yield result, response if block_given?
1854
+ result
1855
+ end
1856
+
1857
+ ##
1858
+ # GRPC transcoding helper method for the update_access_config REST call
1859
+ #
1860
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateAccessConfigInstanceRequest]
1861
+ # A request object representing the call parameters. Required.
1862
+ # @return [Array(String, [String, nil], Hash{String => String})]
1863
+ # Uri, Body, Query string parameters
1864
+ def transcode_update_access_config_request request_pb
1865
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/updateAccessConfig"
1866
+ body = request_pb.access_config_resource.to_json
1867
+ query_string_params = {}
1868
+ query_string_params["networkInterface"] = request_pb.network_interface.to_s
1869
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1870
+
1871
+ [uri, body, query_string_params]
1872
+ end
1873
+
1874
+ ##
1875
+ # Baseline implementation for the update_display_device REST call
1876
+ #
1877
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateDisplayDeviceInstanceRequest]
1878
+ # A request object representing the call parameters. Required.
1879
+ # @param options [::Gapic::CallOptions]
1880
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1881
+ #
1882
+ # @yield [result, response] Access the result along with the Faraday response object
1883
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1884
+ # @yieldparam response [::Faraday::Response]
1885
+ #
1886
+ # @return [::Google::Cloud::Compute::V1::Operation]
1887
+ # A result object deserialized from the server's reply
1888
+ def update_display_device request_pb, options = nil
1889
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1890
+
1891
+ uri, body, query_string_params = transcode_update_display_device_request request_pb
1892
+ response = @client_stub.make_patch_request(
1893
+ uri: uri,
1894
+ body: body,
1895
+ params: query_string_params,
1896
+ options: options
1897
+ )
1898
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1899
+
1900
+ yield result, response if block_given?
1901
+ result
1902
+ end
1903
+
1904
+ ##
1905
+ # GRPC transcoding helper method for the update_display_device REST call
1906
+ #
1907
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateDisplayDeviceInstanceRequest]
1908
+ # A request object representing the call parameters. Required.
1909
+ # @return [Array(String, [String, nil], Hash{String => String})]
1910
+ # Uri, Body, Query string parameters
1911
+ def transcode_update_display_device_request request_pb
1912
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/updateDisplayDevice"
1913
+ body = request_pb.display_device_resource.to_json
1914
+ query_string_params = {}
1915
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1916
+
1917
+ [uri, body, query_string_params]
1918
+ end
1919
+
1920
+ ##
1921
+ # Baseline implementation for the update_network_interface REST call
1922
+ #
1923
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateNetworkInterfaceInstanceRequest]
1924
+ # A request object representing the call parameters. Required.
1925
+ # @param options [::Gapic::CallOptions]
1926
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1927
+ #
1928
+ # @yield [result, response] Access the result along with the Faraday response object
1929
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1930
+ # @yieldparam response [::Faraday::Response]
1931
+ #
1932
+ # @return [::Google::Cloud::Compute::V1::Operation]
1933
+ # A result object deserialized from the server's reply
1934
+ def update_network_interface request_pb, options = nil
1935
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1936
+
1937
+ uri, body, query_string_params = transcode_update_network_interface_request request_pb
1938
+ response = @client_stub.make_patch_request(
1939
+ uri: uri,
1940
+ body: body,
1941
+ params: query_string_params,
1942
+ options: options
1943
+ )
1944
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1945
+
1946
+ yield result, response if block_given?
1947
+ result
1948
+ end
1949
+
1950
+ ##
1951
+ # GRPC transcoding helper method for the update_network_interface REST call
1952
+ #
1953
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateNetworkInterfaceInstanceRequest]
1954
+ # A request object representing the call parameters. Required.
1955
+ # @return [Array(String, [String, nil], Hash{String => String})]
1956
+ # Uri, Body, Query string parameters
1957
+ def transcode_update_network_interface_request request_pb
1958
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/updateNetworkInterface"
1959
+ body = request_pb.network_interface_resource.to_json
1960
+ query_string_params = {}
1961
+ query_string_params["networkInterface"] = request_pb.network_interface.to_s
1962
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1963
+
1964
+ [uri, body, query_string_params]
1965
+ end
1966
+
1967
+ ##
1968
+ # Baseline implementation for the update_shielded_instance_config REST call
1969
+ #
1970
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateShieldedInstanceConfigInstanceRequest]
1971
+ # A request object representing the call parameters. Required.
1972
+ # @param options [::Gapic::CallOptions]
1973
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1974
+ #
1975
+ # @yield [result, response] Access the result along with the Faraday response object
1976
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1977
+ # @yieldparam response [::Faraday::Response]
1978
+ #
1979
+ # @return [::Google::Cloud::Compute::V1::Operation]
1980
+ # A result object deserialized from the server's reply
1981
+ def update_shielded_instance_config request_pb, options = nil
1982
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1983
+
1984
+ uri, body, query_string_params = transcode_update_shielded_instance_config_request request_pb
1985
+ response = @client_stub.make_patch_request(
1986
+ uri: uri,
1987
+ body: body,
1988
+ params: query_string_params,
1989
+ options: options
1990
+ )
1991
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1992
+
1993
+ yield result, response if block_given?
1994
+ result
1995
+ end
1996
+
1997
+ ##
1998
+ # GRPC transcoding helper method for the update_shielded_instance_config REST call
1999
+ #
2000
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateShieldedInstanceConfigInstanceRequest]
2001
+ # A request object representing the call parameters. Required.
2002
+ # @return [Array(String, [String, nil], Hash{String => String})]
2003
+ # Uri, Body, Query string parameters
2004
+ def transcode_update_shielded_instance_config_request request_pb
2005
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/updateShieldedInstanceConfig"
2006
+ body = request_pb.shielded_instance_config_resource.to_json
2007
+ query_string_params = {}
2008
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
2009
+
2010
+ [uri, body, query_string_params]
2011
+ end
2012
+ end
2013
+ end
2014
+ end
2015
+ end
2016
+ end
2017
+ end
2018
+ end