google-cloud-compute-v1 0.2.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (257) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -1
  3. data/AUTHENTICATION.md +19 -37
  4. data/README.md +4 -30
  5. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +127 -90
  6. data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +188 -0
  7. data/lib/google/cloud/compute/v1/accelerator_types/rest.rb +0 -2
  8. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +172 -130
  9. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +279 -0
  10. data/lib/google/cloud/compute/v1/addresses/rest.rb +0 -2
  11. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +218 -172
  12. data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +373 -0
  13. data/lib/google/cloud/compute/v1/autoscalers/rest.rb +0 -2
  14. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +236 -185
  15. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +413 -0
  16. data/lib/google/cloud/compute/v1/backend_buckets/rest.rb +0 -2
  17. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +308 -253
  18. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +553 -0
  19. data/lib/google/cloud/compute/v1/backend_services/rest.rb +0 -2
  20. data/lib/google/cloud/compute/v1/compute_pb.rb +8507 -7466
  21. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +127 -90
  22. data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +188 -0
  23. data/lib/google/cloud/compute/v1/disk_types/rest.rb +0 -2
  24. data/lib/google/cloud/compute/v1/disks/rest/client.rb +345 -272
  25. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +644 -0
  26. data/lib/google/cloud/compute/v1/disks/rest.rb +0 -2
  27. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +184 -129
  28. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +317 -0
  29. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest.rb +0 -2
  30. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +476 -343
  31. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +869 -0
  32. data/lib/google/cloud/compute/v1/firewall_policies/rest.rb +0 -2
  33. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +191 -145
  34. data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +321 -0
  35. data/lib/google/cloud/compute/v1/firewalls/rest.rb +0 -2
  36. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +296 -171
  37. data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +417 -0
  38. data/lib/google/cloud/compute/v1/forwarding_rules/rest.rb +0 -2
  39. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +145 -103
  40. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +229 -0
  41. data/lib/google/cloud/compute/v1/global_addresses/rest.rb +0 -2
  42. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +265 -144
  43. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +365 -0
  44. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest.rb +0 -2
  45. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +215 -172
  46. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +370 -0
  47. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest.rb +0 -2
  48. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +165 -118
  49. data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +274 -0
  50. data/lib/google/cloud/compute/v1/global_operations/rest.rb +0 -2
  51. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +118 -76
  52. data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +186 -0
  53. data/lib/google/cloud/compute/v1/global_organization_operations/rest.rb +0 -2
  54. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +175 -124
  55. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +275 -0
  56. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest.rb +0 -2
  57. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +218 -172
  58. data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +371 -0
  59. data/lib/google/cloud/compute/v1/health_checks/rest.rb +0 -2
  60. data/lib/google/cloud/compute/v1/image_family_views/credentials.rb +53 -0
  61. data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +318 -0
  62. data/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +89 -0
  63. data/lib/google/cloud/compute/v1/image_family_views/rest.rb +33 -0
  64. data/lib/google/cloud/compute/v1/image_family_views.rb +44 -0
  65. data/lib/google/cloud/compute/v1/images/rest/client.rb +291 -209
  66. data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +542 -0
  67. data/lib/google/cloud/compute/v1/images/rest.rb +0 -2
  68. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +526 -477
  69. data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +974 -0
  70. data/lib/google/cloud/compute/v1/instance_group_managers/rest.rb +0 -2
  71. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +271 -233
  72. data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +467 -0
  73. data/lib/google/cloud/compute/v1/instance_groups/rest.rb +0 -2
  74. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +202 -139
  75. data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +362 -0
  76. data/lib/google/cloud/compute/v1/instance_templates/rest.rb +0 -2
  77. data/lib/google/cloud/compute/v1/instances/rest/client.rb +1186 -797
  78. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +2018 -0
  79. data/lib/google/cloud/compute/v1/instances/rest.rb +0 -2
  80. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +195 -151
  81. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +326 -0
  82. data/lib/google/cloud/compute/v1/interconnect_attachments/rest.rb +0 -2
  83. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +100 -63
  84. data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +138 -0
  85. data/lib/google/cloud/compute/v1/interconnect_locations/rest.rb +0 -2
  86. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +189 -135
  87. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +318 -0
  88. data/lib/google/cloud/compute/v1/interconnects/rest.rb +0 -2
  89. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +93 -50
  90. data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +133 -0
  91. data/lib/google/cloud/compute/v1/license_codes/rest.rb +0 -2
  92. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +209 -146
  93. data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +362 -0
  94. data/lib/google/cloud/compute/v1/licenses/rest.rb +0 -2
  95. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +127 -90
  96. data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +188 -0
  97. data/lib/google/cloud/compute/v1/machine_types/rest.rb +0 -2
  98. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +261 -213
  99. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +465 -0
  100. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest.rb +0 -2
  101. data/lib/google/cloud/compute/v1/networks/rest/client.rb +363 -234
  102. data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +553 -0
  103. data/lib/google/cloud/compute/v1/networks/rest.rb +0 -2
  104. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +345 -277
  105. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +646 -0
  106. data/lib/google/cloud/compute/v1/node_groups/rest.rb +0 -2
  107. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +229 -166
  108. data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +412 -0
  109. data/lib/google/cloud/compute/v1/node_templates/rest.rb +0 -2
  110. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +127 -90
  111. data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +188 -0
  112. data/lib/google/cloud/compute/v1/node_types/rest.rb +0 -2
  113. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +213 -163
  114. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +369 -0
  115. data/lib/google/cloud/compute/v1/packet_mirrorings/rest.rb +0 -2
  116. data/lib/google/cloud/compute/v1/projects/rest/client.rb +351 -288
  117. data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +643 -0
  118. data/lib/google/cloud/compute/v1/projects/rest.rb +0 -2
  119. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +175 -124
  120. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +275 -0
  121. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest.rb +0 -2
  122. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +203 -151
  123. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +325 -0
  124. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest.rb +0 -2
  125. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +191 -145
  126. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +323 -0
  127. data/lib/google/cloud/compute/v1/region_autoscalers/rest.rb +0 -2
  128. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +212 -160
  129. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +365 -0
  130. data/lib/google/cloud/compute/v1/region_backend_services/rest.rb +0 -2
  131. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +151 -112
  132. data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +234 -0
  133. data/lib/google/cloud/compute/v1/region_commitments/rest.rb +0 -2
  134. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +100 -63
  135. data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +138 -0
  136. data/lib/google/cloud/compute/v1/region_disk_types/rest.rb +0 -2
  137. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +318 -245
  138. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +593 -0
  139. data/lib/google/cloud/compute/v1/region_disks/rest.rb +0 -2
  140. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +168 -124
  141. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +275 -0
  142. data/lib/google/cloud/compute/v1/region_health_check_services/rest.rb +0 -2
  143. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +191 -145
  144. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +321 -0
  145. data/lib/google/cloud/compute/v1/region_health_checks/rest.rb +0 -2
  146. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +498 -445
  147. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +924 -0
  148. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest.rb +0 -2
  149. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +148 -113
  150. data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +234 -0
  151. data/lib/google/cloud/compute/v1/region_instance_groups/rest.rb +0 -2
  152. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +76 -45
  153. data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +92 -0
  154. data/lib/google/cloud/compute/v1/region_instances/rest.rb +0 -2
  155. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +145 -103
  156. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +229 -0
  157. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest.rb +0 -2
  158. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +145 -103
  159. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +229 -0
  160. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest.rb +0 -2
  161. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +137 -90
  162. data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +224 -0
  163. data/lib/google/cloud/compute/v1/region_operations/rest.rb +0 -2
  164. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +145 -103
  165. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +229 -0
  166. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest.rb +0 -2
  167. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +168 -124
  168. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +275 -0
  169. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest.rb +0 -2
  170. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +191 -145
  171. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +321 -0
  172. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest.rb +0 -2
  173. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +205 -137
  174. data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +365 -0
  175. data/lib/google/cloud/compute/v1/region_url_maps/rest.rb +0 -2
  176. data/lib/google/cloud/compute/v1/regions/rest/client.rb +100 -63
  177. data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +138 -0
  178. data/lib/google/cloud/compute/v1/regions/rest.rb +0 -2
  179. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +252 -187
  180. data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +458 -0
  181. data/lib/google/cloud/compute/v1/reservations/rest.rb +0 -2
  182. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +229 -166
  183. data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +412 -0
  184. data/lib/google/cloud/compute/v1/resource_policies/rest.rb +0 -2
  185. data/lib/google/cloud/compute/v1/routers/rest/client.rb +284 -222
  186. data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +507 -0
  187. data/lib/google/cloud/compute/v1/routers/rest.rb +0 -2
  188. data/lib/google/cloud/compute/v1/routes/rest/client.rb +145 -103
  189. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +229 -0
  190. data/lib/google/cloud/compute/v1/routes/rest.rb +0 -2
  191. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +277 -205
  192. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +504 -0
  193. data/lib/google/cloud/compute/v1/security_policies/rest.rb +0 -2
  194. data/lib/google/cloud/compute/v1/service_attachments/credentials.rb +52 -0
  195. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +954 -0
  196. data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +458 -0
  197. data/lib/google/cloud/compute/v1/service_attachments/rest.rb +33 -0
  198. data/lib/google/cloud/compute/v1/service_attachments.rb +44 -0
  199. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +201 -135
  200. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +360 -0
  201. data/lib/google/cloud/compute/v1/snapshots/rest.rb +0 -2
  202. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +172 -130
  203. data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +279 -0
  204. data/lib/google/cloud/compute/v1/ssl_certificates/rest.rb +0 -2
  205. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +192 -149
  206. data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +324 -0
  207. data/lib/google/cloud/compute/v1/ssl_policies/rest.rb +0 -2
  208. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +325 -256
  209. data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +600 -0
  210. data/lib/google/cloud/compute/v1/subnetworks/rest.rb +0 -2
  211. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +168 -124
  212. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +275 -0
  213. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest.rb +0 -2
  214. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +219 -173
  215. data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +371 -0
  216. data/lib/google/cloud/compute/v1/target_http_proxies/rest.rb +0 -2
  217. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +340 -213
  218. data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +509 -0
  219. data/lib/google/cloud/compute/v1/target_https_proxies/rest.rb +0 -2
  220. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +172 -130
  221. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +279 -0
  222. data/lib/google/cloud/compute/v1/target_instances/rest.rb +0 -2
  223. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +305 -247
  224. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +554 -0
  225. data/lib/google/cloud/compute/v1/target_pools/rest.rb +0 -2
  226. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +237 -187
  227. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +413 -0
  228. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest.rb +0 -2
  229. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +191 -145
  230. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +321 -0
  231. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest.rb +0 -2
  232. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +172 -130
  233. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +279 -0
  234. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest.rb +0 -2
  235. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +260 -208
  236. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +461 -0
  237. data/lib/google/cloud/compute/v1/url_maps/rest.rb +0 -2
  238. data/lib/google/cloud/compute/v1/version.rb +1 -1
  239. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +234 -174
  240. data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +412 -0
  241. data/lib/google/cloud/compute/v1/vpn_gateways/rest.rb +0 -2
  242. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +172 -130
  243. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +279 -0
  244. data/lib/google/cloud/compute/v1/vpn_tunnels/rest.rb +0 -2
  245. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +137 -90
  246. data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +224 -0
  247. data/lib/google/cloud/compute/v1/zone_operations/rest.rb +0 -2
  248. data/lib/google/cloud/compute/v1/zones/rest/client.rb +100 -63
  249. data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +138 -0
  250. data/lib/google/cloud/compute/v1/zones/rest.rb +0 -2
  251. data/lib/google/cloud/compute/v1.rb +7 -0
  252. data/proto_docs/README.md +1 -1
  253. data/proto_docs/google/api/field_behavior.rb +6 -0
  254. data/proto_docs/google/api/resource.rb +10 -71
  255. data/proto_docs/google/cloud/compute/v1/compute.rb +18964 -19481
  256. data/proto_docs/google/cloud/extended_operations.rb +51 -0
  257. metadata +110 -9
@@ -18,6 +18,7 @@
18
18
 
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/compute/v1/compute_pb"
21
+ require "google/cloud/compute/v1/disks/rest/service_stub"
21
22
 
22
23
  module Google
23
24
  module Cloud
@@ -31,8 +32,6 @@ module Google
31
32
  # The Disks API.
32
33
  #
33
34
  class Client
34
- include GrpcTranscoding
35
-
36
35
  # @private
37
36
  attr_reader :disks_stub
38
37
 
@@ -42,13 +41,12 @@ module Google
42
41
  # See {::Google::Cloud::Compute::V1::Disks::Rest::Client::Configuration}
43
42
  # for a description of the configuration fields.
44
43
  #
45
- # ## Example
46
- #
47
- # To modify the configuration for all Disks clients:
44
+ # @example
48
45
  #
49
- # ::Google::Cloud::Compute::V1::Disks::Rest::Client.configure do |config|
50
- # config.timeout = 10.0
51
- # end
46
+ # # Modify the configuration for all Disks clients
47
+ # ::Google::Cloud::Compute::V1::Disks::Rest::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
52
50
  #
53
51
  # @yield [config] Configure the Client client.
54
52
  # @yieldparam config [Client::Configuration]
@@ -66,6 +64,44 @@ module Google
66
64
  end
67
65
  default_config = Client::Configuration.new parent_config
68
66
 
67
+ default_config.rpcs.add_resource_policies.timeout = 600.0
68
+
69
+ default_config.rpcs.aggregated_list.timeout = 600.0
70
+ default_config.rpcs.aggregated_list.retry_policy = {
71
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
72
+ }
73
+
74
+ default_config.rpcs.create_snapshot.timeout = 600.0
75
+
76
+ default_config.rpcs.delete.timeout = 600.0
77
+
78
+ default_config.rpcs.get.timeout = 600.0
79
+ default_config.rpcs.get.retry_policy = {
80
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
81
+ }
82
+
83
+ default_config.rpcs.get_iam_policy.timeout = 600.0
84
+ default_config.rpcs.get_iam_policy.retry_policy = {
85
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
86
+ }
87
+
88
+ default_config.rpcs.insert.timeout = 600.0
89
+
90
+ default_config.rpcs.list.timeout = 600.0
91
+ default_config.rpcs.list.retry_policy = {
92
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
93
+ }
94
+
95
+ default_config.rpcs.remove_resource_policies.timeout = 600.0
96
+
97
+ default_config.rpcs.resize.timeout = 600.0
98
+
99
+ default_config.rpcs.set_iam_policy.timeout = 600.0
100
+
101
+ default_config.rpcs.set_labels.timeout = 600.0
102
+
103
+ default_config.rpcs.test_iam_permissions.timeout = 600.0
104
+
69
105
  default_config
70
106
  end
71
107
  yield @configure if block_given?
@@ -95,28 +131,20 @@ module Google
95
131
  ##
96
132
  # Create a new Disks REST client object.
97
133
  #
98
- # ## Examples
99
- #
100
- # To create a new Disks REST client with the default
101
- # configuration:
134
+ # @example
102
135
  #
103
- # client = ::Google::Cloud::Compute::V1::Disks::Rest::Client.new
136
+ # # Create a client using the default configuration
137
+ # client = ::Google::Cloud::Compute::V1::Disks::Rest::Client.new
104
138
  #
105
- # To create a new Disks REST client with a custom
106
- # configuration:
107
- #
108
- # client = ::Google::Cloud::Compute::V1::Disks::Rest::Client.new do |config|
109
- # config.timeout = 10.0
110
- # end
139
+ # # Create a client using a custom configuration
140
+ # client = ::Google::Cloud::Compute::V1::Disks::Rest::Client.new do |config|
141
+ # config.timeout = 10.0
142
+ # end
111
143
  #
112
144
  # @yield [config] Configure the Disks client.
113
145
  # @yieldparam config [Client::Configuration]
114
146
  #
115
147
  def initialize
116
- # These require statements are intentionally placed here to initialize
117
- # the REST modules only when it's required.
118
- require "gapic/rest"
119
-
120
148
  # Create the configuration object
121
149
  @config = Configuration.new Client.configure
122
150
 
@@ -126,11 +154,11 @@ module Google
126
154
  # Create credentials
127
155
  credentials = @config.credentials
128
156
  credentials ||= Credentials.default scope: @config.scope
129
- if credentials.is_a?(String) || credentials.is_a?(Hash)
157
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
130
158
  credentials = Credentials.new credentials, scope: @config.scope
131
159
  end
132
160
 
133
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: @config.endpoint, credentials: credentials
161
+ @disks_stub = ::Google::Cloud::Compute::V1::Disks::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
134
162
  end
135
163
 
136
164
  # Service calls
@@ -162,18 +190,14 @@ module Google
162
190
  # @param project [::String]
163
191
  # Project ID for this request.
164
192
  # @param request_id [::String]
165
- # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
166
- #
167
- # For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
168
- #
169
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
193
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
170
194
  # @param zone [::String]
171
195
  # The name of the zone for this request.
172
- # @yield [result, env] Access the result along with the Faraday environment object
173
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
196
+ # @yield [result, response] Access the result along with the Faraday response object
197
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
174
198
  # @yieldparam response [::Faraday::Response]
175
199
  #
176
- # @return [::Google::Cloud::Compute::V1::Operation]
200
+ # @return [::Gapic::Rest::BaseOperation]
177
201
  #
178
202
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
179
203
  def add_resource_policies request, options = nil
@@ -185,7 +209,7 @@ module Google
185
209
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
186
210
 
187
211
  # Customize the options with defaults
188
- call_metadata = {}
212
+ call_metadata = @config.rpcs.add_resource_policies.metadata.to_h
189
213
 
190
214
  # Set x-goog-api-client header
191
215
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -193,20 +217,17 @@ module Google
193
217
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
194
218
  transports_version_send: [:rest]
195
219
 
196
- options.apply_defaults timeout: @config.timeout,
220
+ options.apply_defaults timeout: @config.rpcs.add_resource_policies.timeout,
197
221
  metadata: call_metadata
198
222
 
199
- uri, body, query_string_params = transcode_add_resource_policies request
200
- response = @client_stub.make_post_request(
201
- uri: uri,
202
- body: body,
203
- params: query_string_params,
204
- options: options
205
- )
206
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
207
-
208
- yield result, response if block_given?
209
- result
223
+ options.apply_defaults timeout: @config.timeout,
224
+ metadata: @config.metadata
225
+
226
+ @disks_stub.add_resource_policies request, options do |result, response|
227
+ result = ::Gapic::Rest::BaseOperation.new result
228
+ yield result, response if block_given?
229
+ return result
230
+ end
210
231
  rescue ::Faraday::Error => e
211
232
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
212
233
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -233,34 +254,24 @@ module Google
233
254
  # the default parameter values, pass an empty Hash as a request object (see above).
234
255
  #
235
256
  # @param filter [::String]
236
- # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`.
237
- #
238
- # For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
239
- #
240
- # You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
241
- #
242
- # To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
257
+ # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
243
258
  # @param include_all_scopes [::Boolean]
244
259
  # Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.
245
260
  # @param max_results [::Integer]
246
261
  # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
247
262
  # @param order_by [::String]
248
- # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
249
- #
250
- # You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
251
- #
252
- # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
263
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.
253
264
  # @param page_token [::String]
254
265
  # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
255
266
  # @param project [::String]
256
267
  # Project ID for this request.
257
268
  # @param return_partial_success [::Boolean]
258
- # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
259
- # @yield [result, env] Access the result along with the Faraday environment object
260
- # @yieldparam result [::Google::Cloud::Compute::V1::DiskAggregatedList]
269
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
270
+ # @yield [result, response] Access the result along with the Faraday response object
271
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::DisksScopedList>]
261
272
  # @yieldparam response [::Faraday::Response]
262
273
  #
263
- # @return [::Google::Cloud::Compute::V1::DiskAggregatedList]
274
+ # @return [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::DisksScopedList>]
264
275
  #
265
276
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
266
277
  def aggregated_list request, options = nil
@@ -272,7 +283,7 @@ module Google
272
283
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
273
284
 
274
285
  # Customize the options with defaults
275
- call_metadata = {}
286
+ call_metadata = @config.rpcs.aggregated_list.metadata.to_h
276
287
 
277
288
  # Set x-goog-api-client header
278
289
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -280,19 +291,17 @@ module Google
280
291
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
281
292
  transports_version_send: [:rest]
282
293
 
283
- options.apply_defaults timeout: @config.timeout,
294
+ options.apply_defaults timeout: @config.rpcs.aggregated_list.timeout,
284
295
  metadata: call_metadata
285
296
 
286
- uri, _body, query_string_params = transcode_aggregated_list request
287
- response = @client_stub.make_get_request(
288
- uri: uri,
289
- params: query_string_params,
290
- options: options
291
- )
292
- result = ::Google::Cloud::Compute::V1::DiskAggregatedList.decode_json response.body, ignore_unknown_fields: true
297
+ options.apply_defaults timeout: @config.timeout,
298
+ metadata: @config.metadata
293
299
 
294
- yield result, response if block_given?
295
- result
300
+ @disks_stub.aggregated_list request, options do |result, response|
301
+ result = ::Gapic::Rest::PagedEnumerable.new @disks_stub, :aggregated_list, "items", request, result, options
302
+ yield result, response if block_given?
303
+ return result
304
+ end
296
305
  rescue ::Faraday::Error => e
297
306
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
298
307
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -325,20 +334,16 @@ module Google
325
334
  # @param project [::String]
326
335
  # Project ID for this request.
327
336
  # @param request_id [::String]
328
- # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
329
- #
330
- # For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
331
- #
332
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
337
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
333
338
  # @param snapshot_resource [::Google::Cloud::Compute::V1::Snapshot, ::Hash]
334
339
  # The body resource for this request
335
340
  # @param zone [::String]
336
341
  # The name of the zone for this request.
337
- # @yield [result, env] Access the result along with the Faraday environment object
338
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
342
+ # @yield [result, response] Access the result along with the Faraday response object
343
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
339
344
  # @yieldparam response [::Faraday::Response]
340
345
  #
341
- # @return [::Google::Cloud::Compute::V1::Operation]
346
+ # @return [::Gapic::Rest::BaseOperation]
342
347
  #
343
348
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
344
349
  def create_snapshot request, options = nil
@@ -350,7 +355,7 @@ module Google
350
355
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
351
356
 
352
357
  # Customize the options with defaults
353
- call_metadata = {}
358
+ call_metadata = @config.rpcs.create_snapshot.metadata.to_h
354
359
 
355
360
  # Set x-goog-api-client header
356
361
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -358,20 +363,17 @@ module Google
358
363
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
359
364
  transports_version_send: [:rest]
360
365
 
361
- options.apply_defaults timeout: @config.timeout,
366
+ options.apply_defaults timeout: @config.rpcs.create_snapshot.timeout,
362
367
  metadata: call_metadata
363
368
 
364
- uri, body, query_string_params = transcode_create_snapshot request
365
- response = @client_stub.make_post_request(
366
- uri: uri,
367
- body: body,
368
- params: query_string_params,
369
- options: options
370
- )
371
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
372
-
373
- yield result, response if block_given?
374
- result
369
+ options.apply_defaults timeout: @config.timeout,
370
+ metadata: @config.metadata
371
+
372
+ @disks_stub.create_snapshot request, options do |result, response|
373
+ result = ::Gapic::Rest::BaseOperation.new result
374
+ yield result, response if block_given?
375
+ return result
376
+ end
375
377
  rescue ::Faraday::Error => e
376
378
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
377
379
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -402,18 +404,14 @@ module Google
402
404
  # @param project [::String]
403
405
  # Project ID for this request.
404
406
  # @param request_id [::String]
405
- # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
406
- #
407
- # For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
408
- #
409
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
407
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
410
408
  # @param zone [::String]
411
409
  # The name of the zone for this request.
412
- # @yield [result, env] Access the result along with the Faraday environment object
413
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
410
+ # @yield [result, response] Access the result along with the Faraday response object
411
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
414
412
  # @yieldparam response [::Faraday::Response]
415
413
  #
416
- # @return [::Google::Cloud::Compute::V1::Operation]
414
+ # @return [::Gapic::Rest::BaseOperation]
417
415
  #
418
416
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
419
417
  def delete request, options = nil
@@ -425,7 +423,7 @@ module Google
425
423
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
426
424
 
427
425
  # Customize the options with defaults
428
- call_metadata = {}
426
+ call_metadata = @config.rpcs.delete.metadata.to_h
429
427
 
430
428
  # Set x-goog-api-client header
431
429
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -433,19 +431,17 @@ module Google
433
431
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
434
432
  transports_version_send: [:rest]
435
433
 
436
- options.apply_defaults timeout: @config.timeout,
434
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
437
435
  metadata: call_metadata
438
436
 
439
- uri, _body, query_string_params = transcode_delete request
440
- response = @client_stub.make_delete_request(
441
- uri: uri,
442
- params: query_string_params,
443
- options: options
444
- )
445
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
437
+ options.apply_defaults timeout: @config.timeout,
438
+ metadata: @config.metadata
446
439
 
447
- yield result, response if block_given?
448
- result
440
+ @disks_stub.delete request, options do |result, response|
441
+ result = ::Gapic::Rest::BaseOperation.new result
442
+ yield result, response if block_given?
443
+ return result
444
+ end
449
445
  rescue ::Faraday::Error => e
450
446
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
451
447
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -477,7 +473,7 @@ module Google
477
473
  # Project ID for this request.
478
474
  # @param zone [::String]
479
475
  # The name of the zone for this request.
480
- # @yield [result, env] Access the result along with the Faraday environment object
476
+ # @yield [result, response] Access the result along with the Faraday response object
481
477
  # @yieldparam result [::Google::Cloud::Compute::V1::Disk]
482
478
  # @yieldparam response [::Faraday::Response]
483
479
  #
@@ -493,7 +489,7 @@ module Google
493
489
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
494
490
 
495
491
  # Customize the options with defaults
496
- call_metadata = {}
492
+ call_metadata = @config.rpcs.get.metadata.to_h
497
493
 
498
494
  # Set x-goog-api-client header
499
495
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -501,18 +497,16 @@ module Google
501
497
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
502
498
  transports_version_send: [:rest]
503
499
 
504
- options.apply_defaults timeout: @config.timeout,
500
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
505
501
  metadata: call_metadata
506
502
 
507
- uri, _body, _query_string_params = transcode_get request
508
- response = @client_stub.make_get_request(
509
- uri: uri,
510
- options: options
511
- )
512
- result = ::Google::Cloud::Compute::V1::Disk.decode_json response.body, ignore_unknown_fields: true
503
+ options.apply_defaults timeout: @config.timeout,
504
+ metadata: @config.metadata
513
505
 
514
- yield result, response if block_given?
515
- result
506
+ @disks_stub.get request, options do |result, response|
507
+ yield result, response if block_given?
508
+ return result
509
+ end
516
510
  rescue ::Faraday::Error => e
517
511
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
518
512
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -546,7 +540,7 @@ module Google
546
540
  # Name or id of the resource for this request.
547
541
  # @param zone [::String]
548
542
  # The name of the zone for this request.
549
- # @yield [result, env] Access the result along with the Faraday environment object
543
+ # @yield [result, response] Access the result along with the Faraday response object
550
544
  # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
551
545
  # @yieldparam response [::Faraday::Response]
552
546
  #
@@ -562,7 +556,7 @@ module Google
562
556
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
563
557
 
564
558
  # Customize the options with defaults
565
- call_metadata = {}
559
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
566
560
 
567
561
  # Set x-goog-api-client header
568
562
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -570,19 +564,16 @@ module Google
570
564
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
571
565
  transports_version_send: [:rest]
572
566
 
573
- options.apply_defaults timeout: @config.timeout,
567
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
574
568
  metadata: call_metadata
575
569
 
576
- uri, _body, query_string_params = transcode_get_iam_policy request
577
- response = @client_stub.make_get_request(
578
- uri: uri,
579
- params: query_string_params,
580
- options: options
581
- )
582
- result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
570
+ options.apply_defaults timeout: @config.timeout,
571
+ metadata: @config.metadata
583
572
 
584
- yield result, response if block_given?
585
- result
573
+ @disks_stub.get_iam_policy request, options do |result, response|
574
+ yield result, response if block_given?
575
+ return result
576
+ end
586
577
  rescue ::Faraday::Error => e
587
578
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
588
579
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -613,20 +604,16 @@ module Google
613
604
  # @param project [::String]
614
605
  # Project ID for this request.
615
606
  # @param request_id [::String]
616
- # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
617
- #
618
- # For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
619
- #
620
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
607
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
621
608
  # @param source_image [::String]
622
- # Optional. Source image to restore onto a disk.
609
+ # Source image to restore onto a disk. This field is optional.
623
610
  # @param zone [::String]
624
611
  # The name of the zone for this request.
625
- # @yield [result, env] Access the result along with the Faraday environment object
626
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
612
+ # @yield [result, response] Access the result along with the Faraday response object
613
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
627
614
  # @yieldparam response [::Faraday::Response]
628
615
  #
629
- # @return [::Google::Cloud::Compute::V1::Operation]
616
+ # @return [::Gapic::Rest::BaseOperation]
630
617
  #
631
618
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
632
619
  def insert request, options = nil
@@ -638,7 +625,7 @@ module Google
638
625
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
639
626
 
640
627
  # Customize the options with defaults
641
- call_metadata = {}
628
+ call_metadata = @config.rpcs.insert.metadata.to_h
642
629
 
643
630
  # Set x-goog-api-client header
644
631
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -646,20 +633,17 @@ module Google
646
633
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
647
634
  transports_version_send: [:rest]
648
635
 
649
- options.apply_defaults timeout: @config.timeout,
636
+ options.apply_defaults timeout: @config.rpcs.insert.timeout,
650
637
  metadata: call_metadata
651
638
 
652
- uri, body, query_string_params = transcode_insert request
653
- response = @client_stub.make_post_request(
654
- uri: uri,
655
- body: body,
656
- params: query_string_params,
657
- options: options
658
- )
659
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
660
-
661
- yield result, response if block_given?
662
- result
639
+ options.apply_defaults timeout: @config.timeout,
640
+ metadata: @config.metadata
641
+
642
+ @disks_stub.insert request, options do |result, response|
643
+ result = ::Gapic::Rest::BaseOperation.new result
644
+ yield result, response if block_given?
645
+ return result
646
+ end
663
647
  rescue ::Faraday::Error => e
664
648
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
665
649
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -686,34 +670,24 @@ module Google
686
670
  # the default parameter values, pass an empty Hash as a request object (see above).
687
671
  #
688
672
  # @param filter [::String]
689
- # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`.
690
- #
691
- # For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
692
- #
693
- # You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
694
- #
695
- # To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
673
+ # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
696
674
  # @param max_results [::Integer]
697
675
  # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
698
676
  # @param order_by [::String]
699
- # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
700
- #
701
- # You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
702
- #
703
- # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
677
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.
704
678
  # @param page_token [::String]
705
679
  # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
706
680
  # @param project [::String]
707
681
  # Project ID for this request.
708
682
  # @param return_partial_success [::Boolean]
709
- # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
683
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
710
684
  # @param zone [::String]
711
685
  # The name of the zone for this request.
712
- # @yield [result, env] Access the result along with the Faraday environment object
713
- # @yieldparam result [::Google::Cloud::Compute::V1::DiskList]
686
+ # @yield [result, response] Access the result along with the Faraday response object
687
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Disk>]
714
688
  # @yieldparam response [::Faraday::Response]
715
689
  #
716
- # @return [::Google::Cloud::Compute::V1::DiskList]
690
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Disk>]
717
691
  #
718
692
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
719
693
  def list request, options = nil
@@ -725,7 +699,7 @@ module Google
725
699
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
726
700
 
727
701
  # Customize the options with defaults
728
- call_metadata = {}
702
+ call_metadata = @config.rpcs.list.metadata.to_h
729
703
 
730
704
  # Set x-goog-api-client header
731
705
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -733,19 +707,17 @@ module Google
733
707
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
734
708
  transports_version_send: [:rest]
735
709
 
736
- options.apply_defaults timeout: @config.timeout,
710
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
737
711
  metadata: call_metadata
738
712
 
739
- uri, _body, query_string_params = transcode_list request
740
- response = @client_stub.make_get_request(
741
- uri: uri,
742
- params: query_string_params,
743
- options: options
744
- )
745
- result = ::Google::Cloud::Compute::V1::DiskList.decode_json response.body, ignore_unknown_fields: true
713
+ options.apply_defaults timeout: @config.timeout,
714
+ metadata: @config.metadata
746
715
 
747
- yield result, response if block_given?
748
- result
716
+ @disks_stub.list request, options do |result, response|
717
+ result = ::Gapic::Rest::PagedEnumerable.new @disks_stub, :list, "items", request, result, options
718
+ yield result, response if block_given?
719
+ return result
720
+ end
749
721
  rescue ::Faraday::Error => e
750
722
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
751
723
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -778,18 +750,14 @@ module Google
778
750
  # @param project [::String]
779
751
  # Project ID for this request.
780
752
  # @param request_id [::String]
781
- # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
782
- #
783
- # For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
784
- #
785
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
753
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
786
754
  # @param zone [::String]
787
755
  # The name of the zone for this request.
788
- # @yield [result, env] Access the result along with the Faraday environment object
789
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
756
+ # @yield [result, response] Access the result along with the Faraday response object
757
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
790
758
  # @yieldparam response [::Faraday::Response]
791
759
  #
792
- # @return [::Google::Cloud::Compute::V1::Operation]
760
+ # @return [::Gapic::Rest::BaseOperation]
793
761
  #
794
762
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
795
763
  def remove_resource_policies request, options = nil
@@ -801,7 +769,7 @@ module Google
801
769
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
802
770
 
803
771
  # Customize the options with defaults
804
- call_metadata = {}
772
+ call_metadata = @config.rpcs.remove_resource_policies.metadata.to_h
805
773
 
806
774
  # Set x-goog-api-client header
807
775
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -809,20 +777,17 @@ module Google
809
777
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
810
778
  transports_version_send: [:rest]
811
779
 
812
- options.apply_defaults timeout: @config.timeout,
780
+ options.apply_defaults timeout: @config.rpcs.remove_resource_policies.timeout,
813
781
  metadata: call_metadata
814
782
 
815
- uri, body, query_string_params = transcode_remove_resource_policies request
816
- response = @client_stub.make_post_request(
817
- uri: uri,
818
- body: body,
819
- params: query_string_params,
820
- options: options
821
- )
822
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
823
-
824
- yield result, response if block_given?
825
- result
783
+ options.apply_defaults timeout: @config.timeout,
784
+ metadata: @config.metadata
785
+
786
+ @disks_stub.remove_resource_policies request, options do |result, response|
787
+ result = ::Gapic::Rest::BaseOperation.new result
788
+ yield result, response if block_given?
789
+ return result
790
+ end
826
791
  rescue ::Faraday::Error => e
827
792
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
828
793
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -855,18 +820,14 @@ module Google
855
820
  # @param project [::String]
856
821
  # Project ID for this request.
857
822
  # @param request_id [::String]
858
- # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
859
- #
860
- # For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
861
- #
862
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
823
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
863
824
  # @param zone [::String]
864
825
  # The name of the zone for this request.
865
- # @yield [result, env] Access the result along with the Faraday environment object
866
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
826
+ # @yield [result, response] Access the result along with the Faraday response object
827
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
867
828
  # @yieldparam response [::Faraday::Response]
868
829
  #
869
- # @return [::Google::Cloud::Compute::V1::Operation]
830
+ # @return [::Gapic::Rest::BaseOperation]
870
831
  #
871
832
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
872
833
  def resize request, options = nil
@@ -878,7 +839,7 @@ module Google
878
839
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
879
840
 
880
841
  # Customize the options with defaults
881
- call_metadata = {}
842
+ call_metadata = @config.rpcs.resize.metadata.to_h
882
843
 
883
844
  # Set x-goog-api-client header
884
845
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -886,20 +847,17 @@ module Google
886
847
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
887
848
  transports_version_send: [:rest]
888
849
 
889
- options.apply_defaults timeout: @config.timeout,
850
+ options.apply_defaults timeout: @config.rpcs.resize.timeout,
890
851
  metadata: call_metadata
891
852
 
892
- uri, body, query_string_params = transcode_resize request
893
- response = @client_stub.make_post_request(
894
- uri: uri,
895
- body: body,
896
- params: query_string_params,
897
- options: options
898
- )
899
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
900
-
901
- yield result, response if block_given?
902
- result
853
+ options.apply_defaults timeout: @config.timeout,
854
+ metadata: @config.metadata
855
+
856
+ @disks_stub.resize request, options do |result, response|
857
+ result = ::Gapic::Rest::BaseOperation.new result
858
+ yield result, response if block_given?
859
+ return result
860
+ end
903
861
  rescue ::Faraday::Error => e
904
862
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
905
863
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -933,7 +891,7 @@ module Google
933
891
  # The name of the zone for this request.
934
892
  # @param zone_set_policy_request_resource [::Google::Cloud::Compute::V1::ZoneSetPolicyRequest, ::Hash]
935
893
  # The body resource for this request
936
- # @yield [result, env] Access the result along with the Faraday environment object
894
+ # @yield [result, response] Access the result along with the Faraday response object
937
895
  # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
938
896
  # @yieldparam response [::Faraday::Response]
939
897
  #
@@ -949,7 +907,7 @@ module Google
949
907
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
950
908
 
951
909
  # Customize the options with defaults
952
- call_metadata = {}
910
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
953
911
 
954
912
  # Set x-goog-api-client header
955
913
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -957,19 +915,16 @@ module Google
957
915
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
958
916
  transports_version_send: [:rest]
959
917
 
960
- options.apply_defaults timeout: @config.timeout,
918
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
961
919
  metadata: call_metadata
962
920
 
963
- uri, body, _query_string_params = transcode_set_iam_policy request
964
- response = @client_stub.make_post_request(
965
- uri: uri,
966
- body: body,
967
- options: options
968
- )
969
- result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
921
+ options.apply_defaults timeout: @config.timeout,
922
+ metadata: @config.metadata
970
923
 
971
- yield result, response if block_given?
972
- result
924
+ @disks_stub.set_iam_policy request, options do |result, response|
925
+ yield result, response if block_given?
926
+ return result
927
+ end
973
928
  rescue ::Faraday::Error => e
974
929
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
975
930
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -998,22 +953,18 @@ module Google
998
953
  # @param project [::String]
999
954
  # Project ID for this request.
1000
955
  # @param request_id [::String]
1001
- # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
1002
- #
1003
- # For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
1004
- #
1005
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
956
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
1006
957
  # @param resource [::String]
1007
958
  # Name or id of the resource for this request.
1008
959
  # @param zone [::String]
1009
960
  # The name of the zone for this request.
1010
961
  # @param zone_set_labels_request_resource [::Google::Cloud::Compute::V1::ZoneSetLabelsRequest, ::Hash]
1011
962
  # The body resource for this request
1012
- # @yield [result, env] Access the result along with the Faraday environment object
1013
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
963
+ # @yield [result, response] Access the result along with the Faraday response object
964
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
1014
965
  # @yieldparam response [::Faraday::Response]
1015
966
  #
1016
- # @return [::Google::Cloud::Compute::V1::Operation]
967
+ # @return [::Gapic::Rest::BaseOperation]
1017
968
  #
1018
969
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1019
970
  def set_labels request, options = nil
@@ -1025,7 +976,7 @@ module Google
1025
976
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1026
977
 
1027
978
  # Customize the options with defaults
1028
- call_metadata = {}
979
+ call_metadata = @config.rpcs.set_labels.metadata.to_h
1029
980
 
1030
981
  # Set x-goog-api-client header
1031
982
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -1033,20 +984,17 @@ module Google
1033
984
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1034
985
  transports_version_send: [:rest]
1035
986
 
1036
- options.apply_defaults timeout: @config.timeout,
987
+ options.apply_defaults timeout: @config.rpcs.set_labels.timeout,
1037
988
  metadata: call_metadata
1038
989
 
1039
- uri, body, query_string_params = transcode_set_labels request
1040
- response = @client_stub.make_post_request(
1041
- uri: uri,
1042
- body: body,
1043
- params: query_string_params,
1044
- options: options
1045
- )
1046
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1047
-
1048
- yield result, response if block_given?
1049
- result
990
+ options.apply_defaults timeout: @config.timeout,
991
+ metadata: @config.metadata
992
+
993
+ @disks_stub.set_labels request, options do |result, response|
994
+ result = ::Gapic::Rest::BaseOperation.new result
995
+ yield result, response if block_given?
996
+ return result
997
+ end
1050
998
  rescue ::Faraday::Error => e
1051
999
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1052
1000
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -1080,7 +1028,7 @@ module Google
1080
1028
  # The body resource for this request
1081
1029
  # @param zone [::String]
1082
1030
  # The name of the zone for this request.
1083
- # @yield [result, env] Access the result along with the Faraday environment object
1031
+ # @yield [result, response] Access the result along with the Faraday response object
1084
1032
  # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
1085
1033
  # @yieldparam response [::Faraday::Response]
1086
1034
  #
@@ -1096,7 +1044,7 @@ module Google
1096
1044
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1097
1045
 
1098
1046
  # Customize the options with defaults
1099
- call_metadata = {}
1047
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
1100
1048
 
1101
1049
  # Set x-goog-api-client header
1102
1050
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -1104,19 +1052,16 @@ module Google
1104
1052
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1105
1053
  transports_version_send: [:rest]
1106
1054
 
1107
- options.apply_defaults timeout: @config.timeout,
1055
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
1108
1056
  metadata: call_metadata
1109
1057
 
1110
- uri, body, _query_string_params = transcode_test_iam_permissions request
1111
- response = @client_stub.make_post_request(
1112
- uri: uri,
1113
- body: body,
1114
- options: options
1115
- )
1116
- result = ::Google::Cloud::Compute::V1::TestPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
1058
+ options.apply_defaults timeout: @config.timeout,
1059
+ metadata: @config.metadata
1117
1060
 
1118
- yield result, response if block_given?
1119
- result
1061
+ @disks_stub.test_iam_permissions request, options do |result, response|
1062
+ yield result, response if block_given?
1063
+ return result
1064
+ end
1120
1065
  rescue ::Faraday::Error => e
1121
1066
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1122
1067
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -1171,6 +1116,9 @@ module Google
1171
1116
  # @!attribute [rw] timeout
1172
1117
  # The call timeout in seconds.
1173
1118
  # @return [::Numeric]
1119
+ # @!attribute [rw] metadata
1120
+ # Additional REST headers to be sent with the call.
1121
+ # @return [::Hash{::Symbol=>::String}]
1174
1122
  #
1175
1123
  class Configuration
1176
1124
  extend ::Gapic::Config
@@ -1184,6 +1132,7 @@ module Google
1184
1132
  config_attr :lib_name, nil, ::String, nil
1185
1133
  config_attr :lib_version, nil, ::String, nil
1186
1134
  config_attr :timeout, nil, ::Numeric, nil
1135
+ config_attr :metadata, nil, ::Hash, nil
1187
1136
 
1188
1137
  # @private
1189
1138
  def initialize parent_config = nil
@@ -1191,6 +1140,130 @@ module Google
1191
1140
 
1192
1141
  yield self if block_given?
1193
1142
  end
1143
+
1144
+ ##
1145
+ # Configurations for individual RPCs
1146
+ # @return [Rpcs]
1147
+ #
1148
+ def rpcs
1149
+ @rpcs ||= begin
1150
+ parent_rpcs = nil
1151
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1152
+ Rpcs.new parent_rpcs
1153
+ end
1154
+ end
1155
+
1156
+ ##
1157
+ # Configuration RPC class for the Disks API.
1158
+ #
1159
+ # Includes fields providing the configuration for each RPC in this service.
1160
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1161
+ # the following configuration fields:
1162
+ #
1163
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1164
+ #
1165
+ # there is one other field (`retry_policy`) that can be set
1166
+ # but is currently not supported for REST Gapic libraries.
1167
+ #
1168
+ class Rpcs
1169
+ ##
1170
+ # RPC-specific configuration for `add_resource_policies`
1171
+ # @return [::Gapic::Config::Method]
1172
+ #
1173
+ attr_reader :add_resource_policies
1174
+ ##
1175
+ # RPC-specific configuration for `aggregated_list`
1176
+ # @return [::Gapic::Config::Method]
1177
+ #
1178
+ attr_reader :aggregated_list
1179
+ ##
1180
+ # RPC-specific configuration for `create_snapshot`
1181
+ # @return [::Gapic::Config::Method]
1182
+ #
1183
+ attr_reader :create_snapshot
1184
+ ##
1185
+ # RPC-specific configuration for `delete`
1186
+ # @return [::Gapic::Config::Method]
1187
+ #
1188
+ attr_reader :delete
1189
+ ##
1190
+ # RPC-specific configuration for `get`
1191
+ # @return [::Gapic::Config::Method]
1192
+ #
1193
+ attr_reader :get
1194
+ ##
1195
+ # RPC-specific configuration for `get_iam_policy`
1196
+ # @return [::Gapic::Config::Method]
1197
+ #
1198
+ attr_reader :get_iam_policy
1199
+ ##
1200
+ # RPC-specific configuration for `insert`
1201
+ # @return [::Gapic::Config::Method]
1202
+ #
1203
+ attr_reader :insert
1204
+ ##
1205
+ # RPC-specific configuration for `list`
1206
+ # @return [::Gapic::Config::Method]
1207
+ #
1208
+ attr_reader :list
1209
+ ##
1210
+ # RPC-specific configuration for `remove_resource_policies`
1211
+ # @return [::Gapic::Config::Method]
1212
+ #
1213
+ attr_reader :remove_resource_policies
1214
+ ##
1215
+ # RPC-specific configuration for `resize`
1216
+ # @return [::Gapic::Config::Method]
1217
+ #
1218
+ attr_reader :resize
1219
+ ##
1220
+ # RPC-specific configuration for `set_iam_policy`
1221
+ # @return [::Gapic::Config::Method]
1222
+ #
1223
+ attr_reader :set_iam_policy
1224
+ ##
1225
+ # RPC-specific configuration for `set_labels`
1226
+ # @return [::Gapic::Config::Method]
1227
+ #
1228
+ attr_reader :set_labels
1229
+ ##
1230
+ # RPC-specific configuration for `test_iam_permissions`
1231
+ # @return [::Gapic::Config::Method]
1232
+ #
1233
+ attr_reader :test_iam_permissions
1234
+
1235
+ # @private
1236
+ def initialize parent_rpcs = nil
1237
+ add_resource_policies_config = parent_rpcs.add_resource_policies if parent_rpcs.respond_to? :add_resource_policies
1238
+ @add_resource_policies = ::Gapic::Config::Method.new add_resource_policies_config
1239
+ aggregated_list_config = parent_rpcs.aggregated_list if parent_rpcs.respond_to? :aggregated_list
1240
+ @aggregated_list = ::Gapic::Config::Method.new aggregated_list_config
1241
+ create_snapshot_config = parent_rpcs.create_snapshot if parent_rpcs.respond_to? :create_snapshot
1242
+ @create_snapshot = ::Gapic::Config::Method.new create_snapshot_config
1243
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
1244
+ @delete = ::Gapic::Config::Method.new delete_config
1245
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
1246
+ @get = ::Gapic::Config::Method.new get_config
1247
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1248
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1249
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
1250
+ @insert = ::Gapic::Config::Method.new insert_config
1251
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
1252
+ @list = ::Gapic::Config::Method.new list_config
1253
+ remove_resource_policies_config = parent_rpcs.remove_resource_policies if parent_rpcs.respond_to? :remove_resource_policies
1254
+ @remove_resource_policies = ::Gapic::Config::Method.new remove_resource_policies_config
1255
+ resize_config = parent_rpcs.resize if parent_rpcs.respond_to? :resize
1256
+ @resize = ::Gapic::Config::Method.new resize_config
1257
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1258
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1259
+ set_labels_config = parent_rpcs.set_labels if parent_rpcs.respond_to? :set_labels
1260
+ @set_labels = ::Gapic::Config::Method.new set_labels_config
1261
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1262
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
1263
+
1264
+ yield self if block_given?
1265
+ end
1266
+ end
1194
1267
  end
1195
1268
  end
1196
1269
  end