google-cloud-compute-v1 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (244) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -1
  3. data/AUTHENTICATION.md +12 -12
  4. data/README.md +4 -30
  5. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +123 -66
  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 +166 -96
  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 +210 -128
  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 +228 -143
  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 +294 -187
  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 +816 -135
  21. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +123 -66
  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 +334 -213
  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 +180 -107
  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 +463 -280
  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 +185 -113
  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 +292 -127
  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 +141 -81
  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 +259 -112
  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 +207 -128
  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 +159 -88
  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 +116 -64
  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 +170 -97
  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 +210 -128
  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/images/rest/client.rb +284 -174
  61. data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +542 -0
  62. data/lib/google/cloud/compute/v1/images/rest.rb +0 -2
  63. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +497 -328
  64. data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +974 -0
  65. data/lib/google/cloud/compute/v1/instance_group_managers/rest.rb +0 -2
  66. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +255 -161
  67. data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +467 -0
  68. data/lib/google/cloud/compute/v1/instance_groups/rest.rb +0 -2
  69. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +198 -117
  70. data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +362 -0
  71. data/lib/google/cloud/compute/v1/instance_templates/rest.rb +0 -2
  72. data/lib/google/cloud/compute/v1/instances/rest/client.rb +1079 -609
  73. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +1975 -0
  74. data/lib/google/cloud/compute/v1/instances/rest.rb +0 -2
  75. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +188 -112
  76. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +326 -0
  77. data/lib/google/cloud/compute/v1/interconnect_attachments/rest.rb +0 -2
  78. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +98 -51
  79. data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +138 -0
  80. data/lib/google/cloud/compute/v1/interconnect_locations/rest.rb +0 -2
  81. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +184 -108
  82. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +318 -0
  83. data/lib/google/cloud/compute/v1/interconnects/rest.rb +0 -2
  84. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +91 -48
  85. data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +133 -0
  86. data/lib/google/cloud/compute/v1/license_codes/rest.rb +0 -2
  87. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +198 -117
  88. data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +362 -0
  89. data/lib/google/cloud/compute/v1/licenses/rest.rb +0 -2
  90. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +123 -66
  91. data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +188 -0
  92. data/lib/google/cloud/compute/v1/machine_types/rest.rb +0 -2
  93. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +251 -157
  94. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +465 -0
  95. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest.rb +0 -2
  96. data/lib/google/cloud/compute/v1/networks/rest/client.rb +349 -173
  97. data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +553 -0
  98. data/lib/google/cloud/compute/v1/networks/rest.rb +0 -2
  99. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +333 -211
  100. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +646 -0
  101. data/lib/google/cloud/compute/v1/node_groups/rest.rb +0 -2
  102. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +223 -132
  103. data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +412 -0
  104. data/lib/google/cloud/compute/v1/node_templates/rest.rb +0 -2
  105. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +123 -66
  106. data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +188 -0
  107. data/lib/google/cloud/compute/v1/node_types/rest.rb +0 -2
  108. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +206 -124
  109. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +369 -0
  110. data/lib/google/cloud/compute/v1/packet_mirrorings/rest.rb +0 -2
  111. data/lib/google/cloud/compute/v1/projects/rest/client.rb +338 -219
  112. data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +643 -0
  113. data/lib/google/cloud/compute/v1/projects/rest.rb +0 -2
  114. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +170 -97
  115. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +275 -0
  116. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest.rb +0 -2
  117. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +196 -112
  118. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +325 -0
  119. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest.rb +0 -2
  120. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +185 -113
  121. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +323 -0
  122. data/lib/google/cloud/compute/v1/region_autoscalers/rest.rb +0 -2
  123. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +203 -125
  124. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +365 -0
  125. data/lib/google/cloud/compute/v1/region_backend_services/rest.rb +0 -2
  126. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +145 -82
  127. data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +234 -0
  128. data/lib/google/cloud/compute/v1/region_commitments/rest.rb +0 -2
  129. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +98 -51
  130. data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +138 -0
  131. data/lib/google/cloud/compute/v1/region_disk_types/rest.rb +0 -2
  132. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +309 -198
  133. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +593 -0
  134. data/lib/google/cloud/compute/v1/region_disks/rest.rb +0 -2
  135. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +163 -97
  136. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +275 -0
  137. data/lib/google/cloud/compute/v1/region_health_check_services/rest.rb +0 -2
  138. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +185 -113
  139. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +321 -0
  140. data/lib/google/cloud/compute/v1/region_health_checks/rest.rb +0 -2
  141. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +472 -313
  142. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +924 -0
  143. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest.rb +0 -2
  144. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +143 -84
  145. data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +234 -0
  146. data/lib/google/cloud/compute/v1/region_instance_groups/rest.rb +0 -2
  147. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +75 -40
  148. data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +92 -0
  149. data/lib/google/cloud/compute/v1/region_instances/rest.rb +0 -2
  150. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +141 -81
  151. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +229 -0
  152. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest.rb +0 -2
  153. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +141 -81
  154. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +229 -0
  155. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest.rb +0 -2
  156. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +134 -73
  157. data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +224 -0
  158. data/lib/google/cloud/compute/v1/region_operations/rest.rb +0 -2
  159. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +141 -81
  160. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +229 -0
  161. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest.rb +0 -2
  162. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +163 -97
  163. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +275 -0
  164. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest.rb +0 -2
  165. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +185 -113
  166. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +321 -0
  167. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest.rb +0 -2
  168. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +203 -125
  169. data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +365 -0
  170. data/lib/google/cloud/compute/v1/region_url_maps/rest.rb +0 -2
  171. data/lib/google/cloud/compute/v1/regions/rest/client.rb +98 -51
  172. data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +138 -0
  173. data/lib/google/cloud/compute/v1/regions/rest.rb +0 -2
  174. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +245 -148
  175. data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +458 -0
  176. data/lib/google/cloud/compute/v1/reservations/rest.rb +0 -2
  177. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +223 -132
  178. data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +412 -0
  179. data/lib/google/cloud/compute/v1/resource_policies/rest.rb +0 -2
  180. data/lib/google/cloud/compute/v1/routers/rest/client.rb +274 -166
  181. data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +507 -0
  182. data/lib/google/cloud/compute/v1/routers/rest.rb +0 -2
  183. data/lib/google/cloud/compute/v1/routes/rest/client.rb +141 -81
  184. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +229 -0
  185. data/lib/google/cloud/compute/v1/routes/rest.rb +0 -2
  186. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +270 -166
  187. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +504 -0
  188. data/lib/google/cloud/compute/v1/security_policies/rest.rb +0 -2
  189. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +197 -115
  190. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +360 -0
  191. data/lib/google/cloud/compute/v1/snapshots/rest.rb +0 -2
  192. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +166 -96
  193. data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +279 -0
  194. data/lib/google/cloud/compute/v1/ssl_certificates/rest.rb +0 -2
  195. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +185 -110
  196. data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +324 -0
  197. data/lib/google/cloud/compute/v1/ssl_policies/rest.rb +0 -2
  198. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +314 -195
  199. data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +600 -0
  200. data/lib/google/cloud/compute/v1/subnetworks/rest.rb +0 -2
  201. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +163 -97
  202. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +275 -0
  203. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest.rb +0 -2
  204. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +210 -128
  205. data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +371 -0
  206. data/lib/google/cloud/compute/v1/target_http_proxies/rest.rb +0 -2
  207. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +334 -159
  208. data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +509 -0
  209. data/lib/google/cloud/compute/v1/target_https_proxies/rest.rb +0 -2
  210. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +166 -96
  211. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +279 -0
  212. data/lib/google/cloud/compute/v1/target_instances/rest.rb +0 -2
  213. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +294 -188
  214. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +554 -0
  215. data/lib/google/cloud/compute/v1/target_pools/rest.rb +0 -2
  216. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +229 -145
  217. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +413 -0
  218. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest.rb +0 -2
  219. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +185 -113
  220. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +321 -0
  221. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest.rb +0 -2
  222. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +166 -96
  223. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +279 -0
  224. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest.rb +0 -2
  225. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +250 -156
  226. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +461 -0
  227. data/lib/google/cloud/compute/v1/url_maps/rest.rb +0 -2
  228. data/lib/google/cloud/compute/v1/version.rb +1 -1
  229. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +227 -135
  230. data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +412 -0
  231. data/lib/google/cloud/compute/v1/vpn_gateways/rest.rb +0 -2
  232. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +166 -96
  233. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +279 -0
  234. data/lib/google/cloud/compute/v1/vpn_tunnels/rest.rb +0 -2
  235. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +134 -73
  236. data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +224 -0
  237. data/lib/google/cloud/compute/v1/zone_operations/rest.rb +0 -2
  238. data/lib/google/cloud/compute/v1/zones/rest/client.rb +98 -51
  239. data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +138 -0
  240. data/lib/google/cloud/compute/v1/zones/rest.rb +0 -2
  241. data/lib/google/cloud/compute/v1.rb +5 -0
  242. data/proto_docs/README.md +1 -1
  243. data/proto_docs/google/cloud/compute/v1/compute.rb +2526 -640
  244. metadata +84 -8
@@ -0,0 +1,1975 @@
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 set_deletion_protection REST call
964
+ #
965
+ # @param request_pb [::Google::Cloud::Compute::V1::SetDeletionProtectionInstanceRequest]
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::Operation]
972
+ # @yieldparam response [::Faraday::Response]
973
+ #
974
+ # @return [::Google::Cloud::Compute::V1::Operation]
975
+ # A result object deserialized from the server's reply
976
+ def set_deletion_protection request_pb, options = nil
977
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
978
+
979
+ uri, _body, query_string_params = transcode_set_deletion_protection_request request_pb
980
+ response = @client_stub.make_post_request(
981
+ uri: uri,
982
+ params: query_string_params,
983
+ options: options
984
+ )
985
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
986
+
987
+ yield result, response if block_given?
988
+ result
989
+ end
990
+
991
+ ##
992
+ # GRPC transcoding helper method for the set_deletion_protection REST call
993
+ #
994
+ # @param request_pb [::Google::Cloud::Compute::V1::SetDeletionProtectionInstanceRequest]
995
+ # A request object representing the call parameters. Required.
996
+ # @return [Array(String, [String, nil], Hash{String => String})]
997
+ # Uri, Body, Query string parameters
998
+ def transcode_set_deletion_protection_request request_pb
999
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.resource}/setDeletionProtection"
1000
+ body = nil
1001
+ query_string_params = {}
1002
+ query_string_params["deletionProtection"] = request_pb.deletion_protection.to_s if request_pb.has_deletion_protection?
1003
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1004
+
1005
+ [uri, body, query_string_params]
1006
+ end
1007
+
1008
+ ##
1009
+ # Baseline implementation for the set_disk_auto_delete REST call
1010
+ #
1011
+ # @param request_pb [::Google::Cloud::Compute::V1::SetDiskAutoDeleteInstanceRequest]
1012
+ # A request object representing the call parameters. Required.
1013
+ # @param options [::Gapic::CallOptions]
1014
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1015
+ #
1016
+ # @yield [result, response] Access the result along with the Faraday response object
1017
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1018
+ # @yieldparam response [::Faraday::Response]
1019
+ #
1020
+ # @return [::Google::Cloud::Compute::V1::Operation]
1021
+ # A result object deserialized from the server's reply
1022
+ def set_disk_auto_delete request_pb, options = nil
1023
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1024
+
1025
+ uri, _body, query_string_params = transcode_set_disk_auto_delete_request request_pb
1026
+ response = @client_stub.make_post_request(
1027
+ uri: uri,
1028
+ params: query_string_params,
1029
+ options: options
1030
+ )
1031
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1032
+
1033
+ yield result, response if block_given?
1034
+ result
1035
+ end
1036
+
1037
+ ##
1038
+ # GRPC transcoding helper method for the set_disk_auto_delete REST call
1039
+ #
1040
+ # @param request_pb [::Google::Cloud::Compute::V1::SetDiskAutoDeleteInstanceRequest]
1041
+ # A request object representing the call parameters. Required.
1042
+ # @return [Array(String, [String, nil], Hash{String => String})]
1043
+ # Uri, Body, Query string parameters
1044
+ def transcode_set_disk_auto_delete_request request_pb
1045
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/setDiskAutoDelete"
1046
+ body = nil
1047
+ query_string_params = {}
1048
+ query_string_params["autoDelete"] = request_pb.auto_delete.to_s
1049
+ query_string_params["deviceName"] = request_pb.device_name.to_s
1050
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1051
+
1052
+ [uri, body, query_string_params]
1053
+ end
1054
+
1055
+ ##
1056
+ # Baseline implementation for the set_iam_policy REST call
1057
+ #
1058
+ # @param request_pb [::Google::Cloud::Compute::V1::SetIamPolicyInstanceRequest]
1059
+ # A request object representing the call parameters. Required.
1060
+ # @param options [::Gapic::CallOptions]
1061
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1062
+ #
1063
+ # @yield [result, response] Access the result along with the Faraday response object
1064
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
1065
+ # @yieldparam response [::Faraday::Response]
1066
+ #
1067
+ # @return [::Google::Cloud::Compute::V1::Policy]
1068
+ # A result object deserialized from the server's reply
1069
+ def set_iam_policy request_pb, options = nil
1070
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1071
+
1072
+ uri, body, _query_string_params = transcode_set_iam_policy_request request_pb
1073
+ response = @client_stub.make_post_request(
1074
+ uri: uri,
1075
+ body: body,
1076
+ options: options
1077
+ )
1078
+ result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
1079
+
1080
+ yield result, response if block_given?
1081
+ result
1082
+ end
1083
+
1084
+ ##
1085
+ # GRPC transcoding helper method for the set_iam_policy REST call
1086
+ #
1087
+ # @param request_pb [::Google::Cloud::Compute::V1::SetIamPolicyInstanceRequest]
1088
+ # A request object representing the call parameters. Required.
1089
+ # @return [Array(String, [String, nil], Hash{String => String})]
1090
+ # Uri, Body, Query string parameters
1091
+ def transcode_set_iam_policy_request request_pb
1092
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.resource}/setIamPolicy"
1093
+ body = request_pb.zone_set_policy_request_resource.to_json
1094
+ query_string_params = {}
1095
+
1096
+ [uri, body, query_string_params]
1097
+ end
1098
+
1099
+ ##
1100
+ # Baseline implementation for the set_labels REST call
1101
+ #
1102
+ # @param request_pb [::Google::Cloud::Compute::V1::SetLabelsInstanceRequest]
1103
+ # A request object representing the call parameters. Required.
1104
+ # @param options [::Gapic::CallOptions]
1105
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1106
+ #
1107
+ # @yield [result, response] Access the result along with the Faraday response object
1108
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1109
+ # @yieldparam response [::Faraday::Response]
1110
+ #
1111
+ # @return [::Google::Cloud::Compute::V1::Operation]
1112
+ # A result object deserialized from the server's reply
1113
+ def set_labels request_pb, options = nil
1114
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1115
+
1116
+ uri, body, query_string_params = transcode_set_labels_request request_pb
1117
+ response = @client_stub.make_post_request(
1118
+ uri: uri,
1119
+ body: body,
1120
+ params: query_string_params,
1121
+ options: options
1122
+ )
1123
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1124
+
1125
+ yield result, response if block_given?
1126
+ result
1127
+ end
1128
+
1129
+ ##
1130
+ # GRPC transcoding helper method for the set_labels REST call
1131
+ #
1132
+ # @param request_pb [::Google::Cloud::Compute::V1::SetLabelsInstanceRequest]
1133
+ # A request object representing the call parameters. Required.
1134
+ # @return [Array(String, [String, nil], Hash{String => String})]
1135
+ # Uri, Body, Query string parameters
1136
+ def transcode_set_labels_request request_pb
1137
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/setLabels"
1138
+ body = request_pb.instances_set_labels_request_resource.to_json
1139
+ query_string_params = {}
1140
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1141
+
1142
+ [uri, body, query_string_params]
1143
+ end
1144
+
1145
+ ##
1146
+ # Baseline implementation for the set_machine_resources REST call
1147
+ #
1148
+ # @param request_pb [::Google::Cloud::Compute::V1::SetMachineResourcesInstanceRequest]
1149
+ # A request object representing the call parameters. Required.
1150
+ # @param options [::Gapic::CallOptions]
1151
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1152
+ #
1153
+ # @yield [result, response] Access the result along with the Faraday response object
1154
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1155
+ # @yieldparam response [::Faraday::Response]
1156
+ #
1157
+ # @return [::Google::Cloud::Compute::V1::Operation]
1158
+ # A result object deserialized from the server's reply
1159
+ def set_machine_resources request_pb, options = nil
1160
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1161
+
1162
+ uri, body, query_string_params = transcode_set_machine_resources_request request_pb
1163
+ response = @client_stub.make_post_request(
1164
+ uri: uri,
1165
+ body: body,
1166
+ params: query_string_params,
1167
+ options: options
1168
+ )
1169
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1170
+
1171
+ yield result, response if block_given?
1172
+ result
1173
+ end
1174
+
1175
+ ##
1176
+ # GRPC transcoding helper method for the set_machine_resources REST call
1177
+ #
1178
+ # @param request_pb [::Google::Cloud::Compute::V1::SetMachineResourcesInstanceRequest]
1179
+ # A request object representing the call parameters. Required.
1180
+ # @return [Array(String, [String, nil], Hash{String => String})]
1181
+ # Uri, Body, Query string parameters
1182
+ def transcode_set_machine_resources_request request_pb
1183
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/setMachineResources"
1184
+ body = request_pb.instances_set_machine_resources_request_resource.to_json
1185
+ query_string_params = {}
1186
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1187
+
1188
+ [uri, body, query_string_params]
1189
+ end
1190
+
1191
+ ##
1192
+ # Baseline implementation for the set_machine_type REST call
1193
+ #
1194
+ # @param request_pb [::Google::Cloud::Compute::V1::SetMachineTypeInstanceRequest]
1195
+ # A request object representing the call parameters. Required.
1196
+ # @param options [::Gapic::CallOptions]
1197
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1198
+ #
1199
+ # @yield [result, response] Access the result along with the Faraday response object
1200
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1201
+ # @yieldparam response [::Faraday::Response]
1202
+ #
1203
+ # @return [::Google::Cloud::Compute::V1::Operation]
1204
+ # A result object deserialized from the server's reply
1205
+ def set_machine_type request_pb, options = nil
1206
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1207
+
1208
+ uri, body, query_string_params = transcode_set_machine_type_request request_pb
1209
+ response = @client_stub.make_post_request(
1210
+ uri: uri,
1211
+ body: body,
1212
+ params: query_string_params,
1213
+ options: options
1214
+ )
1215
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1216
+
1217
+ yield result, response if block_given?
1218
+ result
1219
+ end
1220
+
1221
+ ##
1222
+ # GRPC transcoding helper method for the set_machine_type REST call
1223
+ #
1224
+ # @param request_pb [::Google::Cloud::Compute::V1::SetMachineTypeInstanceRequest]
1225
+ # A request object representing the call parameters. Required.
1226
+ # @return [Array(String, [String, nil], Hash{String => String})]
1227
+ # Uri, Body, Query string parameters
1228
+ def transcode_set_machine_type_request request_pb
1229
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/setMachineType"
1230
+ body = request_pb.instances_set_machine_type_request_resource.to_json
1231
+ query_string_params = {}
1232
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1233
+
1234
+ [uri, body, query_string_params]
1235
+ end
1236
+
1237
+ ##
1238
+ # Baseline implementation for the set_metadata REST call
1239
+ #
1240
+ # @param request_pb [::Google::Cloud::Compute::V1::SetMetadataInstanceRequest]
1241
+ # A request object representing the call parameters. Required.
1242
+ # @param options [::Gapic::CallOptions]
1243
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1244
+ #
1245
+ # @yield [result, response] Access the result along with the Faraday response object
1246
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1247
+ # @yieldparam response [::Faraday::Response]
1248
+ #
1249
+ # @return [::Google::Cloud::Compute::V1::Operation]
1250
+ # A result object deserialized from the server's reply
1251
+ def set_metadata request_pb, options = nil
1252
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1253
+
1254
+ uri, body, query_string_params = transcode_set_metadata_request request_pb
1255
+ response = @client_stub.make_post_request(
1256
+ uri: uri,
1257
+ body: body,
1258
+ params: query_string_params,
1259
+ options: options
1260
+ )
1261
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1262
+
1263
+ yield result, response if block_given?
1264
+ result
1265
+ end
1266
+
1267
+ ##
1268
+ # GRPC transcoding helper method for the set_metadata REST call
1269
+ #
1270
+ # @param request_pb [::Google::Cloud::Compute::V1::SetMetadataInstanceRequest]
1271
+ # A request object representing the call parameters. Required.
1272
+ # @return [Array(String, [String, nil], Hash{String => String})]
1273
+ # Uri, Body, Query string parameters
1274
+ def transcode_set_metadata_request request_pb
1275
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/setMetadata"
1276
+ body = request_pb.metadata_resource.to_json
1277
+ query_string_params = {}
1278
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1279
+
1280
+ [uri, body, query_string_params]
1281
+ end
1282
+
1283
+ ##
1284
+ # Baseline implementation for the set_min_cpu_platform REST call
1285
+ #
1286
+ # @param request_pb [::Google::Cloud::Compute::V1::SetMinCpuPlatformInstanceRequest]
1287
+ # A request object representing the call parameters. Required.
1288
+ # @param options [::Gapic::CallOptions]
1289
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1290
+ #
1291
+ # @yield [result, response] Access the result along with the Faraday response object
1292
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1293
+ # @yieldparam response [::Faraday::Response]
1294
+ #
1295
+ # @return [::Google::Cloud::Compute::V1::Operation]
1296
+ # A result object deserialized from the server's reply
1297
+ def set_min_cpu_platform request_pb, options = nil
1298
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1299
+
1300
+ uri, body, query_string_params = transcode_set_min_cpu_platform_request request_pb
1301
+ response = @client_stub.make_post_request(
1302
+ uri: uri,
1303
+ body: body,
1304
+ params: query_string_params,
1305
+ options: options
1306
+ )
1307
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1308
+
1309
+ yield result, response if block_given?
1310
+ result
1311
+ end
1312
+
1313
+ ##
1314
+ # GRPC transcoding helper method for the set_min_cpu_platform REST call
1315
+ #
1316
+ # @param request_pb [::Google::Cloud::Compute::V1::SetMinCpuPlatformInstanceRequest]
1317
+ # A request object representing the call parameters. Required.
1318
+ # @return [Array(String, [String, nil], Hash{String => String})]
1319
+ # Uri, Body, Query string parameters
1320
+ def transcode_set_min_cpu_platform_request request_pb
1321
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/setMinCpuPlatform"
1322
+ body = request_pb.instances_set_min_cpu_platform_request_resource.to_json
1323
+ query_string_params = {}
1324
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1325
+
1326
+ [uri, body, query_string_params]
1327
+ end
1328
+
1329
+ ##
1330
+ # Baseline implementation for the set_scheduling REST call
1331
+ #
1332
+ # @param request_pb [::Google::Cloud::Compute::V1::SetSchedulingInstanceRequest]
1333
+ # A request object representing the call parameters. Required.
1334
+ # @param options [::Gapic::CallOptions]
1335
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1336
+ #
1337
+ # @yield [result, response] Access the result along with the Faraday response object
1338
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1339
+ # @yieldparam response [::Faraday::Response]
1340
+ #
1341
+ # @return [::Google::Cloud::Compute::V1::Operation]
1342
+ # A result object deserialized from the server's reply
1343
+ def set_scheduling request_pb, options = nil
1344
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1345
+
1346
+ uri, body, query_string_params = transcode_set_scheduling_request request_pb
1347
+ response = @client_stub.make_post_request(
1348
+ uri: uri,
1349
+ body: body,
1350
+ params: query_string_params,
1351
+ options: options
1352
+ )
1353
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1354
+
1355
+ yield result, response if block_given?
1356
+ result
1357
+ end
1358
+
1359
+ ##
1360
+ # GRPC transcoding helper method for the set_scheduling REST call
1361
+ #
1362
+ # @param request_pb [::Google::Cloud::Compute::V1::SetSchedulingInstanceRequest]
1363
+ # A request object representing the call parameters. Required.
1364
+ # @return [Array(String, [String, nil], Hash{String => String})]
1365
+ # Uri, Body, Query string parameters
1366
+ def transcode_set_scheduling_request request_pb
1367
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/setScheduling"
1368
+ body = request_pb.scheduling_resource.to_json
1369
+ query_string_params = {}
1370
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1371
+
1372
+ [uri, body, query_string_params]
1373
+ end
1374
+
1375
+ ##
1376
+ # Baseline implementation for the set_service_account REST call
1377
+ #
1378
+ # @param request_pb [::Google::Cloud::Compute::V1::SetServiceAccountInstanceRequest]
1379
+ # A request object representing the call parameters. Required.
1380
+ # @param options [::Gapic::CallOptions]
1381
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1382
+ #
1383
+ # @yield [result, response] Access the result along with the Faraday response object
1384
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1385
+ # @yieldparam response [::Faraday::Response]
1386
+ #
1387
+ # @return [::Google::Cloud::Compute::V1::Operation]
1388
+ # A result object deserialized from the server's reply
1389
+ def set_service_account request_pb, options = nil
1390
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1391
+
1392
+ uri, body, query_string_params = transcode_set_service_account_request request_pb
1393
+ response = @client_stub.make_post_request(
1394
+ uri: uri,
1395
+ body: body,
1396
+ params: query_string_params,
1397
+ options: options
1398
+ )
1399
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1400
+
1401
+ yield result, response if block_given?
1402
+ result
1403
+ end
1404
+
1405
+ ##
1406
+ # GRPC transcoding helper method for the set_service_account REST call
1407
+ #
1408
+ # @param request_pb [::Google::Cloud::Compute::V1::SetServiceAccountInstanceRequest]
1409
+ # A request object representing the call parameters. Required.
1410
+ # @return [Array(String, [String, nil], Hash{String => String})]
1411
+ # Uri, Body, Query string parameters
1412
+ def transcode_set_service_account_request request_pb
1413
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/setServiceAccount"
1414
+ body = request_pb.instances_set_service_account_request_resource.to_json
1415
+ query_string_params = {}
1416
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1417
+
1418
+ [uri, body, query_string_params]
1419
+ end
1420
+
1421
+ ##
1422
+ # Baseline implementation for the set_shielded_instance_integrity_policy REST call
1423
+ #
1424
+ # @param request_pb [::Google::Cloud::Compute::V1::SetShieldedInstanceIntegrityPolicyInstanceRequest]
1425
+ # A request object representing the call parameters. Required.
1426
+ # @param options [::Gapic::CallOptions]
1427
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1428
+ #
1429
+ # @yield [result, response] Access the result along with the Faraday response object
1430
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1431
+ # @yieldparam response [::Faraday::Response]
1432
+ #
1433
+ # @return [::Google::Cloud::Compute::V1::Operation]
1434
+ # A result object deserialized from the server's reply
1435
+ def set_shielded_instance_integrity_policy request_pb, options = nil
1436
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1437
+
1438
+ uri, body, query_string_params = transcode_set_shielded_instance_integrity_policy_request request_pb
1439
+ response = @client_stub.make_patch_request(
1440
+ uri: uri,
1441
+ body: body,
1442
+ params: query_string_params,
1443
+ options: options
1444
+ )
1445
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1446
+
1447
+ yield result, response if block_given?
1448
+ result
1449
+ end
1450
+
1451
+ ##
1452
+ # GRPC transcoding helper method for the set_shielded_instance_integrity_policy REST call
1453
+ #
1454
+ # @param request_pb [::Google::Cloud::Compute::V1::SetShieldedInstanceIntegrityPolicyInstanceRequest]
1455
+ # A request object representing the call parameters. Required.
1456
+ # @return [Array(String, [String, nil], Hash{String => String})]
1457
+ # Uri, Body, Query string parameters
1458
+ def transcode_set_shielded_instance_integrity_policy_request request_pb
1459
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/setShieldedInstanceIntegrityPolicy"
1460
+ body = request_pb.shielded_instance_integrity_policy_resource.to_json
1461
+ query_string_params = {}
1462
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1463
+
1464
+ [uri, body, query_string_params]
1465
+ end
1466
+
1467
+ ##
1468
+ # Baseline implementation for the set_tags REST call
1469
+ #
1470
+ # @param request_pb [::Google::Cloud::Compute::V1::SetTagsInstanceRequest]
1471
+ # A request object representing the call parameters. Required.
1472
+ # @param options [::Gapic::CallOptions]
1473
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1474
+ #
1475
+ # @yield [result, response] Access the result along with the Faraday response object
1476
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1477
+ # @yieldparam response [::Faraday::Response]
1478
+ #
1479
+ # @return [::Google::Cloud::Compute::V1::Operation]
1480
+ # A result object deserialized from the server's reply
1481
+ def set_tags request_pb, options = nil
1482
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1483
+
1484
+ uri, body, query_string_params = transcode_set_tags_request request_pb
1485
+ response = @client_stub.make_post_request(
1486
+ uri: uri,
1487
+ body: body,
1488
+ params: query_string_params,
1489
+ options: options
1490
+ )
1491
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1492
+
1493
+ yield result, response if block_given?
1494
+ result
1495
+ end
1496
+
1497
+ ##
1498
+ # GRPC transcoding helper method for the set_tags REST call
1499
+ #
1500
+ # @param request_pb [::Google::Cloud::Compute::V1::SetTagsInstanceRequest]
1501
+ # A request object representing the call parameters. Required.
1502
+ # @return [Array(String, [String, nil], Hash{String => String})]
1503
+ # Uri, Body, Query string parameters
1504
+ def transcode_set_tags_request request_pb
1505
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/setTags"
1506
+ body = request_pb.tags_resource.to_json
1507
+ query_string_params = {}
1508
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1509
+
1510
+ [uri, body, query_string_params]
1511
+ end
1512
+
1513
+ ##
1514
+ # Baseline implementation for the simulate_maintenance_event REST call
1515
+ #
1516
+ # @param request_pb [::Google::Cloud::Compute::V1::SimulateMaintenanceEventInstanceRequest]
1517
+ # A request object representing the call parameters. Required.
1518
+ # @param options [::Gapic::CallOptions]
1519
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1520
+ #
1521
+ # @yield [result, response] Access the result along with the Faraday response object
1522
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1523
+ # @yieldparam response [::Faraday::Response]
1524
+ #
1525
+ # @return [::Google::Cloud::Compute::V1::Operation]
1526
+ # A result object deserialized from the server's reply
1527
+ def simulate_maintenance_event request_pb, options = nil
1528
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1529
+
1530
+ uri, _body, _query_string_params = transcode_simulate_maintenance_event_request request_pb
1531
+ response = @client_stub.make_post_request(
1532
+ uri: uri,
1533
+ options: options
1534
+ )
1535
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1536
+
1537
+ yield result, response if block_given?
1538
+ result
1539
+ end
1540
+
1541
+ ##
1542
+ # GRPC transcoding helper method for the simulate_maintenance_event REST call
1543
+ #
1544
+ # @param request_pb [::Google::Cloud::Compute::V1::SimulateMaintenanceEventInstanceRequest]
1545
+ # A request object representing the call parameters. Required.
1546
+ # @return [Array(String, [String, nil], Hash{String => String})]
1547
+ # Uri, Body, Query string parameters
1548
+ def transcode_simulate_maintenance_event_request request_pb
1549
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/simulateMaintenanceEvent"
1550
+ body = nil
1551
+ query_string_params = {}
1552
+
1553
+ [uri, body, query_string_params]
1554
+ end
1555
+
1556
+ ##
1557
+ # Baseline implementation for the start REST call
1558
+ #
1559
+ # @param request_pb [::Google::Cloud::Compute::V1::StartInstanceRequest]
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 start request_pb, options = nil
1571
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1572
+
1573
+ uri, _body, query_string_params = transcode_start_request request_pb
1574
+ response = @client_stub.make_post_request(
1575
+ uri: uri,
1576
+ params: query_string_params,
1577
+ options: options
1578
+ )
1579
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1580
+
1581
+ yield result, response if block_given?
1582
+ result
1583
+ end
1584
+
1585
+ ##
1586
+ # GRPC transcoding helper method for the start REST call
1587
+ #
1588
+ # @param request_pb [::Google::Cloud::Compute::V1::StartInstanceRequest]
1589
+ # A request object representing the call parameters. Required.
1590
+ # @return [Array(String, [String, nil], Hash{String => String})]
1591
+ # Uri, Body, Query string parameters
1592
+ def transcode_start_request request_pb
1593
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/start"
1594
+ body = nil
1595
+ query_string_params = {}
1596
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1597
+
1598
+ [uri, body, query_string_params]
1599
+ end
1600
+
1601
+ ##
1602
+ # Baseline implementation for the start_with_encryption_key REST call
1603
+ #
1604
+ # @param request_pb [::Google::Cloud::Compute::V1::StartWithEncryptionKeyInstanceRequest]
1605
+ # A request object representing the call parameters. Required.
1606
+ # @param options [::Gapic::CallOptions]
1607
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1608
+ #
1609
+ # @yield [result, response] Access the result along with the Faraday response object
1610
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1611
+ # @yieldparam response [::Faraday::Response]
1612
+ #
1613
+ # @return [::Google::Cloud::Compute::V1::Operation]
1614
+ # A result object deserialized from the server's reply
1615
+ def start_with_encryption_key request_pb, options = nil
1616
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1617
+
1618
+ uri, body, query_string_params = transcode_start_with_encryption_key_request request_pb
1619
+ response = @client_stub.make_post_request(
1620
+ uri: uri,
1621
+ body: body,
1622
+ params: query_string_params,
1623
+ options: options
1624
+ )
1625
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1626
+
1627
+ yield result, response if block_given?
1628
+ result
1629
+ end
1630
+
1631
+ ##
1632
+ # GRPC transcoding helper method for the start_with_encryption_key REST call
1633
+ #
1634
+ # @param request_pb [::Google::Cloud::Compute::V1::StartWithEncryptionKeyInstanceRequest]
1635
+ # A request object representing the call parameters. Required.
1636
+ # @return [Array(String, [String, nil], Hash{String => String})]
1637
+ # Uri, Body, Query string parameters
1638
+ def transcode_start_with_encryption_key_request request_pb
1639
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/startWithEncryptionKey"
1640
+ body = request_pb.instances_start_with_encryption_key_request_resource.to_json
1641
+ query_string_params = {}
1642
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1643
+
1644
+ [uri, body, query_string_params]
1645
+ end
1646
+
1647
+ ##
1648
+ # Baseline implementation for the stop REST call
1649
+ #
1650
+ # @param request_pb [::Google::Cloud::Compute::V1::StopInstanceRequest]
1651
+ # A request object representing the call parameters. Required.
1652
+ # @param options [::Gapic::CallOptions]
1653
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1654
+ #
1655
+ # @yield [result, response] Access the result along with the Faraday response object
1656
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1657
+ # @yieldparam response [::Faraday::Response]
1658
+ #
1659
+ # @return [::Google::Cloud::Compute::V1::Operation]
1660
+ # A result object deserialized from the server's reply
1661
+ def stop request_pb, options = nil
1662
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1663
+
1664
+ uri, _body, query_string_params = transcode_stop_request request_pb
1665
+ response = @client_stub.make_post_request(
1666
+ uri: uri,
1667
+ params: query_string_params,
1668
+ options: options
1669
+ )
1670
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1671
+
1672
+ yield result, response if block_given?
1673
+ result
1674
+ end
1675
+
1676
+ ##
1677
+ # GRPC transcoding helper method for the stop REST call
1678
+ #
1679
+ # @param request_pb [::Google::Cloud::Compute::V1::StopInstanceRequest]
1680
+ # A request object representing the call parameters. Required.
1681
+ # @return [Array(String, [String, nil], Hash{String => String})]
1682
+ # Uri, Body, Query string parameters
1683
+ def transcode_stop_request request_pb
1684
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/stop"
1685
+ body = nil
1686
+ query_string_params = {}
1687
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1688
+
1689
+ [uri, body, query_string_params]
1690
+ end
1691
+
1692
+ ##
1693
+ # Baseline implementation for the test_iam_permissions REST call
1694
+ #
1695
+ # @param request_pb [::Google::Cloud::Compute::V1::TestIamPermissionsInstanceRequest]
1696
+ # A request object representing the call parameters. Required.
1697
+ # @param options [::Gapic::CallOptions]
1698
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1699
+ #
1700
+ # @yield [result, response] Access the result along with the Faraday response object
1701
+ # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
1702
+ # @yieldparam response [::Faraday::Response]
1703
+ #
1704
+ # @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
1705
+ # A result object deserialized from the server's reply
1706
+ def test_iam_permissions request_pb, options = nil
1707
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1708
+
1709
+ uri, body, _query_string_params = transcode_test_iam_permissions_request request_pb
1710
+ response = @client_stub.make_post_request(
1711
+ uri: uri,
1712
+ body: body,
1713
+ options: options
1714
+ )
1715
+ result = ::Google::Cloud::Compute::V1::TestPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
1716
+
1717
+ yield result, response if block_given?
1718
+ result
1719
+ end
1720
+
1721
+ ##
1722
+ # GRPC transcoding helper method for the test_iam_permissions REST call
1723
+ #
1724
+ # @param request_pb [::Google::Cloud::Compute::V1::TestIamPermissionsInstanceRequest]
1725
+ # A request object representing the call parameters. Required.
1726
+ # @return [Array(String, [String, nil], Hash{String => String})]
1727
+ # Uri, Body, Query string parameters
1728
+ def transcode_test_iam_permissions_request request_pb
1729
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.resource}/testIamPermissions"
1730
+ body = request_pb.test_permissions_request_resource.to_json
1731
+ query_string_params = {}
1732
+
1733
+ [uri, body, query_string_params]
1734
+ end
1735
+
1736
+ ##
1737
+ # Baseline implementation for the update REST call
1738
+ #
1739
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateInstanceRequest]
1740
+ # A request object representing the call parameters. Required.
1741
+ # @param options [::Gapic::CallOptions]
1742
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1743
+ #
1744
+ # @yield [result, response] Access the result along with the Faraday response object
1745
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1746
+ # @yieldparam response [::Faraday::Response]
1747
+ #
1748
+ # @return [::Google::Cloud::Compute::V1::Operation]
1749
+ # A result object deserialized from the server's reply
1750
+ def update request_pb, options = nil
1751
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1752
+
1753
+ uri, body, query_string_params = transcode_update_request request_pb
1754
+ response = @client_stub.make_put_request(
1755
+ uri: uri,
1756
+ body: body,
1757
+ params: query_string_params,
1758
+ options: options
1759
+ )
1760
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1761
+
1762
+ yield result, response if block_given?
1763
+ result
1764
+ end
1765
+
1766
+ ##
1767
+ # GRPC transcoding helper method for the update REST call
1768
+ #
1769
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateInstanceRequest]
1770
+ # A request object representing the call parameters. Required.
1771
+ # @return [Array(String, [String, nil], Hash{String => String})]
1772
+ # Uri, Body, Query string parameters
1773
+ def transcode_update_request request_pb
1774
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}"
1775
+ body = request_pb.instance_resource.to_json
1776
+ query_string_params = {}
1777
+ query_string_params["minimalAction"] = request_pb.minimal_action.to_s if request_pb.has_minimal_action?
1778
+ query_string_params["mostDisruptiveAllowedAction"] = request_pb.most_disruptive_allowed_action.to_s if request_pb.has_most_disruptive_allowed_action?
1779
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1780
+
1781
+ [uri, body, query_string_params]
1782
+ end
1783
+
1784
+ ##
1785
+ # Baseline implementation for the update_access_config REST call
1786
+ #
1787
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateAccessConfigInstanceRequest]
1788
+ # A request object representing the call parameters. Required.
1789
+ # @param options [::Gapic::CallOptions]
1790
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1791
+ #
1792
+ # @yield [result, response] Access the result along with the Faraday response object
1793
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1794
+ # @yieldparam response [::Faraday::Response]
1795
+ #
1796
+ # @return [::Google::Cloud::Compute::V1::Operation]
1797
+ # A result object deserialized from the server's reply
1798
+ def update_access_config request_pb, options = nil
1799
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1800
+
1801
+ uri, body, query_string_params = transcode_update_access_config_request request_pb
1802
+ response = @client_stub.make_post_request(
1803
+ uri: uri,
1804
+ body: body,
1805
+ params: query_string_params,
1806
+ options: options
1807
+ )
1808
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1809
+
1810
+ yield result, response if block_given?
1811
+ result
1812
+ end
1813
+
1814
+ ##
1815
+ # GRPC transcoding helper method for the update_access_config REST call
1816
+ #
1817
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateAccessConfigInstanceRequest]
1818
+ # A request object representing the call parameters. Required.
1819
+ # @return [Array(String, [String, nil], Hash{String => String})]
1820
+ # Uri, Body, Query string parameters
1821
+ def transcode_update_access_config_request request_pb
1822
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/updateAccessConfig"
1823
+ body = request_pb.access_config_resource.to_json
1824
+ query_string_params = {}
1825
+ query_string_params["networkInterface"] = request_pb.network_interface.to_s
1826
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1827
+
1828
+ [uri, body, query_string_params]
1829
+ end
1830
+
1831
+ ##
1832
+ # Baseline implementation for the update_display_device REST call
1833
+ #
1834
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateDisplayDeviceInstanceRequest]
1835
+ # A request object representing the call parameters. Required.
1836
+ # @param options [::Gapic::CallOptions]
1837
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1838
+ #
1839
+ # @yield [result, response] Access the result along with the Faraday response object
1840
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1841
+ # @yieldparam response [::Faraday::Response]
1842
+ #
1843
+ # @return [::Google::Cloud::Compute::V1::Operation]
1844
+ # A result object deserialized from the server's reply
1845
+ def update_display_device request_pb, options = nil
1846
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1847
+
1848
+ uri, body, query_string_params = transcode_update_display_device_request request_pb
1849
+ response = @client_stub.make_patch_request(
1850
+ uri: uri,
1851
+ body: body,
1852
+ params: query_string_params,
1853
+ options: options
1854
+ )
1855
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1856
+
1857
+ yield result, response if block_given?
1858
+ result
1859
+ end
1860
+
1861
+ ##
1862
+ # GRPC transcoding helper method for the update_display_device REST call
1863
+ #
1864
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateDisplayDeviceInstanceRequest]
1865
+ # A request object representing the call parameters. Required.
1866
+ # @return [Array(String, [String, nil], Hash{String => String})]
1867
+ # Uri, Body, Query string parameters
1868
+ def transcode_update_display_device_request request_pb
1869
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/updateDisplayDevice"
1870
+ body = request_pb.display_device_resource.to_json
1871
+ query_string_params = {}
1872
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1873
+
1874
+ [uri, body, query_string_params]
1875
+ end
1876
+
1877
+ ##
1878
+ # Baseline implementation for the update_network_interface REST call
1879
+ #
1880
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateNetworkInterfaceInstanceRequest]
1881
+ # A request object representing the call parameters. Required.
1882
+ # @param options [::Gapic::CallOptions]
1883
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1884
+ #
1885
+ # @yield [result, response] Access the result along with the Faraday response object
1886
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1887
+ # @yieldparam response [::Faraday::Response]
1888
+ #
1889
+ # @return [::Google::Cloud::Compute::V1::Operation]
1890
+ # A result object deserialized from the server's reply
1891
+ def update_network_interface request_pb, options = nil
1892
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1893
+
1894
+ uri, body, query_string_params = transcode_update_network_interface_request request_pb
1895
+ response = @client_stub.make_patch_request(
1896
+ uri: uri,
1897
+ body: body,
1898
+ params: query_string_params,
1899
+ options: options
1900
+ )
1901
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1902
+
1903
+ yield result, response if block_given?
1904
+ result
1905
+ end
1906
+
1907
+ ##
1908
+ # GRPC transcoding helper method for the update_network_interface REST call
1909
+ #
1910
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateNetworkInterfaceInstanceRequest]
1911
+ # A request object representing the call parameters. Required.
1912
+ # @return [Array(String, [String, nil], Hash{String => String})]
1913
+ # Uri, Body, Query string parameters
1914
+ def transcode_update_network_interface_request request_pb
1915
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/updateNetworkInterface"
1916
+ body = request_pb.network_interface_resource.to_json
1917
+ query_string_params = {}
1918
+ query_string_params["networkInterface"] = request_pb.network_interface.to_s
1919
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1920
+
1921
+ [uri, body, query_string_params]
1922
+ end
1923
+
1924
+ ##
1925
+ # Baseline implementation for the update_shielded_instance_config REST call
1926
+ #
1927
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateShieldedInstanceConfigInstanceRequest]
1928
+ # A request object representing the call parameters. Required.
1929
+ # @param options [::Gapic::CallOptions]
1930
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1931
+ #
1932
+ # @yield [result, response] Access the result along with the Faraday response object
1933
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1934
+ # @yieldparam response [::Faraday::Response]
1935
+ #
1936
+ # @return [::Google::Cloud::Compute::V1::Operation]
1937
+ # A result object deserialized from the server's reply
1938
+ def update_shielded_instance_config request_pb, options = nil
1939
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1940
+
1941
+ uri, body, query_string_params = transcode_update_shielded_instance_config_request request_pb
1942
+ response = @client_stub.make_patch_request(
1943
+ uri: uri,
1944
+ body: body,
1945
+ params: query_string_params,
1946
+ options: options
1947
+ )
1948
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1949
+
1950
+ yield result, response if block_given?
1951
+ result
1952
+ end
1953
+
1954
+ ##
1955
+ # GRPC transcoding helper method for the update_shielded_instance_config REST call
1956
+ #
1957
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateShieldedInstanceConfigInstanceRequest]
1958
+ # A request object representing the call parameters. Required.
1959
+ # @return [Array(String, [String, nil], Hash{String => String})]
1960
+ # Uri, Body, Query string parameters
1961
+ def transcode_update_shielded_instance_config_request request_pb
1962
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instances/#{request_pb.instance}/updateShieldedInstanceConfig"
1963
+ body = request_pb.shielded_instance_config_resource.to_json
1964
+ query_string_params = {}
1965
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
1966
+
1967
+ [uri, body, query_string_params]
1968
+ end
1969
+ end
1970
+ end
1971
+ end
1972
+ end
1973
+ end
1974
+ end
1975
+ end