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/images/rest/service_stub"
21
22
 
22
23
  module Google
23
24
  module Cloud
@@ -31,8 +32,6 @@ module Google
31
32
  # The Images API.
32
33
  #
33
34
  class Client
34
- include GrpcTranscoding
35
-
36
35
  # @private
37
36
  attr_reader :images_stub
38
37
 
@@ -42,13 +41,12 @@ module Google
42
41
  # See {::Google::Cloud::Compute::V1::Images::Rest::Client::Configuration}
43
42
  # for a description of the configuration fields.
44
43
  #
45
- # ## Example
44
+ # @example
46
45
  #
47
- # To modify the configuration for all Images clients:
48
- #
49
- # ::Google::Cloud::Compute::V1::Images::Rest::Client.configure do |config|
50
- # config.timeout = 10.0
51
- # end
46
+ # # Modify the configuration for all Images clients
47
+ # ::Google::Cloud::Compute::V1::Images::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,40 @@ module Google
66
64
  end
67
65
  default_config = Client::Configuration.new parent_config
68
66
 
67
+ default_config.rpcs.delete.timeout = 600.0
68
+
69
+ default_config.rpcs.deprecate.timeout = 600.0
70
+
71
+ default_config.rpcs.get.timeout = 600.0
72
+ default_config.rpcs.get.retry_policy = {
73
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
74
+ }
75
+
76
+ default_config.rpcs.get_from_family.timeout = 600.0
77
+ default_config.rpcs.get_from_family.retry_policy = {
78
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
79
+ }
80
+
81
+ default_config.rpcs.get_iam_policy.timeout = 600.0
82
+ default_config.rpcs.get_iam_policy.retry_policy = {
83
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
84
+ }
85
+
86
+ default_config.rpcs.insert.timeout = 600.0
87
+
88
+ default_config.rpcs.list.timeout = 600.0
89
+ default_config.rpcs.list.retry_policy = {
90
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
91
+ }
92
+
93
+ default_config.rpcs.patch.timeout = 600.0
94
+
95
+ default_config.rpcs.set_iam_policy.timeout = 600.0
96
+
97
+ default_config.rpcs.set_labels.timeout = 600.0
98
+
99
+ default_config.rpcs.test_iam_permissions.timeout = 600.0
100
+
69
101
  default_config
70
102
  end
71
103
  yield @configure if block_given?
@@ -95,28 +127,20 @@ module Google
95
127
  ##
96
128
  # Create a new Images REST client object.
97
129
  #
98
- # ## Examples
130
+ # @example
99
131
  #
100
- # To create a new Images REST client with the default
101
- # configuration:
132
+ # # Create a client using the default configuration
133
+ # client = ::Google::Cloud::Compute::V1::Images::Rest::Client.new
102
134
  #
103
- # client = ::Google::Cloud::Compute::V1::Images::Rest::Client.new
104
- #
105
- # To create a new Images REST client with a custom
106
- # configuration:
107
- #
108
- # client = ::Google::Cloud::Compute::V1::Images::Rest::Client.new do |config|
109
- # config.timeout = 10.0
110
- # end
135
+ # # Create a client using a custom configuration
136
+ # client = ::Google::Cloud::Compute::V1::Images::Rest::Client.new do |config|
137
+ # config.timeout = 10.0
138
+ # end
111
139
  #
112
140
  # @yield [config] Configure the Images client.
113
141
  # @yieldparam config [Client::Configuration]
114
142
  #
115
143
  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
144
  # Create the configuration object
121
145
  @config = Configuration.new Client.configure
122
146
 
@@ -126,11 +150,11 @@ module Google
126
150
  # Create credentials
127
151
  credentials = @config.credentials
128
152
  credentials ||= Credentials.default scope: @config.scope
129
- if credentials.is_a?(String) || credentials.is_a?(Hash)
153
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
130
154
  credentials = Credentials.new credentials, scope: @config.scope
131
155
  end
132
156
 
133
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: @config.endpoint, credentials: credentials
157
+ @images_stub = ::Google::Cloud::Compute::V1::Images::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
134
158
  end
135
159
 
136
160
  # Service calls
@@ -160,16 +184,12 @@ module Google
160
184
  # @param project [::String]
161
185
  # Project ID for this request.
162
186
  # @param request_id [::String]
163
- # 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.
164
- #
165
- # 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.
166
- #
167
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
168
- # @yield [result, env] Access the result along with the Faraday environment object
169
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
187
+ # 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).
188
+ # @yield [result, response] Access the result along with the Faraday response object
189
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
170
190
  # @yieldparam response [::Faraday::Response]
171
191
  #
172
- # @return [::Google::Cloud::Compute::V1::Operation]
192
+ # @return [::Gapic::Rest::BaseOperation]
173
193
  #
174
194
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
175
195
  def delete request, options = nil
@@ -181,7 +201,7 @@ module Google
181
201
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
182
202
 
183
203
  # Customize the options with defaults
184
- call_metadata = {}
204
+ call_metadata = @config.rpcs.delete.metadata.to_h
185
205
 
186
206
  # Set x-goog-api-client header
187
207
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -189,28 +209,24 @@ module Google
189
209
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
190
210
  transports_version_send: [:rest]
191
211
 
192
- options.apply_defaults timeout: @config.timeout,
212
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
193
213
  metadata: call_metadata
194
214
 
195
- uri, _body, query_string_params = transcode_delete request
196
- response = @client_stub.make_delete_request(
197
- uri: uri,
198
- params: query_string_params,
199
- options: options
200
- )
201
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
215
+ options.apply_defaults timeout: @config.timeout,
216
+ metadata: @config.metadata
202
217
 
203
- yield result, response if block_given?
204
- result
218
+ @images_stub.delete request, options do |result, response|
219
+ result = ::Gapic::Rest::BaseOperation.new result
220
+ yield result, response if block_given?
221
+ return result
222
+ end
205
223
  rescue ::Faraday::Error => e
206
224
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
207
225
  raise ::Google::Cloud::Error.from_error(gapic_error)
208
226
  end
209
227
 
210
228
  ##
211
- # Sets the deprecation status of an image.
212
- #
213
- # If an empty request body is given, clears the deprecation status instead.
229
+ # Sets the deprecation status of an image. If an empty request body is given, clears the deprecation status instead.
214
230
  #
215
231
  # @overload deprecate(request, options = nil)
216
232
  # Pass arguments to `deprecate` via a request object, either of type
@@ -236,16 +252,12 @@ module Google
236
252
  # @param project [::String]
237
253
  # Project ID for this request.
238
254
  # @param request_id [::String]
239
- # 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.
240
- #
241
- # 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.
242
- #
243
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
244
- # @yield [result, env] Access the result along with the Faraday environment object
245
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
255
+ # 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).
256
+ # @yield [result, response] Access the result along with the Faraday response object
257
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
246
258
  # @yieldparam response [::Faraday::Response]
247
259
  #
248
- # @return [::Google::Cloud::Compute::V1::Operation]
260
+ # @return [::Gapic::Rest::BaseOperation]
249
261
  #
250
262
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
251
263
  def deprecate request, options = nil
@@ -257,7 +269,7 @@ module Google
257
269
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
258
270
 
259
271
  # Customize the options with defaults
260
- call_metadata = {}
272
+ call_metadata = @config.rpcs.deprecate.metadata.to_h
261
273
 
262
274
  # Set x-goog-api-client header
263
275
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -265,20 +277,17 @@ module Google
265
277
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
266
278
  transports_version_send: [:rest]
267
279
 
268
- options.apply_defaults timeout: @config.timeout,
280
+ options.apply_defaults timeout: @config.rpcs.deprecate.timeout,
269
281
  metadata: call_metadata
270
282
 
271
- uri, body, query_string_params = transcode_deprecate request
272
- response = @client_stub.make_post_request(
273
- uri: uri,
274
- body: body,
275
- params: query_string_params,
276
- options: options
277
- )
278
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
279
-
280
- yield result, response if block_given?
281
- result
283
+ options.apply_defaults timeout: @config.timeout,
284
+ metadata: @config.metadata
285
+
286
+ @images_stub.deprecate request, options do |result, response|
287
+ result = ::Gapic::Rest::BaseOperation.new result
288
+ yield result, response if block_given?
289
+ return result
290
+ end
282
291
  rescue ::Faraday::Error => e
283
292
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
284
293
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -308,7 +317,7 @@ module Google
308
317
  # Name of the image resource to return.
309
318
  # @param project [::String]
310
319
  # Project ID for this request.
311
- # @yield [result, env] Access the result along with the Faraday environment object
320
+ # @yield [result, response] Access the result along with the Faraday response object
312
321
  # @yieldparam result [::Google::Cloud::Compute::V1::Image]
313
322
  # @yieldparam response [::Faraday::Response]
314
323
  #
@@ -324,7 +333,7 @@ module Google
324
333
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
325
334
 
326
335
  # Customize the options with defaults
327
- call_metadata = {}
336
+ call_metadata = @config.rpcs.get.metadata.to_h
328
337
 
329
338
  # Set x-goog-api-client header
330
339
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -332,18 +341,16 @@ module Google
332
341
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
333
342
  transports_version_send: [:rest]
334
343
 
335
- options.apply_defaults timeout: @config.timeout,
344
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
336
345
  metadata: call_metadata
337
346
 
338
- uri, _body, _query_string_params = transcode_get request
339
- response = @client_stub.make_get_request(
340
- uri: uri,
341
- options: options
342
- )
343
- result = ::Google::Cloud::Compute::V1::Image.decode_json response.body, ignore_unknown_fields: true
347
+ options.apply_defaults timeout: @config.timeout,
348
+ metadata: @config.metadata
344
349
 
345
- yield result, response if block_given?
346
- result
350
+ @images_stub.get request, options do |result, response|
351
+ yield result, response if block_given?
352
+ return result
353
+ end
347
354
  rescue ::Faraday::Error => e
348
355
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
349
356
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -373,7 +380,7 @@ module Google
373
380
  # Name of the image family to search for.
374
381
  # @param project [::String]
375
382
  # Project ID for this request.
376
- # @yield [result, env] Access the result along with the Faraday environment object
383
+ # @yield [result, response] Access the result along with the Faraday response object
377
384
  # @yieldparam result [::Google::Cloud::Compute::V1::Image]
378
385
  # @yieldparam response [::Faraday::Response]
379
386
  #
@@ -389,7 +396,7 @@ module Google
389
396
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
390
397
 
391
398
  # Customize the options with defaults
392
- call_metadata = {}
399
+ call_metadata = @config.rpcs.get_from_family.metadata.to_h
393
400
 
394
401
  # Set x-goog-api-client header
395
402
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -397,18 +404,16 @@ module Google
397
404
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
398
405
  transports_version_send: [:rest]
399
406
 
400
- options.apply_defaults timeout: @config.timeout,
407
+ options.apply_defaults timeout: @config.rpcs.get_from_family.timeout,
401
408
  metadata: call_metadata
402
409
 
403
- uri, _body, _query_string_params = transcode_get_from_family request
404
- response = @client_stub.make_get_request(
405
- uri: uri,
406
- options: options
407
- )
408
- result = ::Google::Cloud::Compute::V1::Image.decode_json response.body, ignore_unknown_fields: true
410
+ options.apply_defaults timeout: @config.timeout,
411
+ metadata: @config.metadata
409
412
 
410
- yield result, response if block_given?
411
- result
413
+ @images_stub.get_from_family request, options do |result, response|
414
+ yield result, response if block_given?
415
+ return result
416
+ end
412
417
  rescue ::Faraday::Error => e
413
418
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
414
419
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -440,7 +445,7 @@ module Google
440
445
  # Project ID for this request.
441
446
  # @param resource [::String]
442
447
  # Name or id of the resource for this request.
443
- # @yield [result, env] Access the result along with the Faraday environment object
448
+ # @yield [result, response] Access the result along with the Faraday response object
444
449
  # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
445
450
  # @yieldparam response [::Faraday::Response]
446
451
  #
@@ -456,7 +461,7 @@ module Google
456
461
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
457
462
 
458
463
  # Customize the options with defaults
459
- call_metadata = {}
464
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
460
465
 
461
466
  # Set x-goog-api-client header
462
467
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -464,19 +469,16 @@ module Google
464
469
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
465
470
  transports_version_send: [:rest]
466
471
 
467
- options.apply_defaults timeout: @config.timeout,
472
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
468
473
  metadata: call_metadata
469
474
 
470
- uri, _body, query_string_params = transcode_get_iam_policy request
471
- response = @client_stub.make_get_request(
472
- uri: uri,
473
- params: query_string_params,
474
- options: options
475
- )
476
- result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
475
+ options.apply_defaults timeout: @config.timeout,
476
+ metadata: @config.metadata
477
477
 
478
- yield result, response if block_given?
479
- result
478
+ @images_stub.get_iam_policy request, options do |result, response|
479
+ yield result, response if block_given?
480
+ return result
481
+ end
480
482
  rescue ::Faraday::Error => e
481
483
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
482
484
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -509,16 +511,12 @@ module Google
509
511
  # @param project [::String]
510
512
  # Project ID for this request.
511
513
  # @param request_id [::String]
512
- # 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.
513
- #
514
- # 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.
515
- #
516
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
517
- # @yield [result, env] Access the result along with the Faraday environment object
518
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
514
+ # 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).
515
+ # @yield [result, response] Access the result along with the Faraday response object
516
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
519
517
  # @yieldparam response [::Faraday::Response]
520
518
  #
521
- # @return [::Google::Cloud::Compute::V1::Operation]
519
+ # @return [::Gapic::Rest::BaseOperation]
522
520
  #
523
521
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
524
522
  def insert request, options = nil
@@ -530,7 +528,7 @@ module Google
530
528
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
531
529
 
532
530
  # Customize the options with defaults
533
- call_metadata = {}
531
+ call_metadata = @config.rpcs.insert.metadata.to_h
534
532
 
535
533
  # Set x-goog-api-client header
536
534
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -538,20 +536,17 @@ module Google
538
536
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
539
537
  transports_version_send: [:rest]
540
538
 
541
- options.apply_defaults timeout: @config.timeout,
539
+ options.apply_defaults timeout: @config.rpcs.insert.timeout,
542
540
  metadata: call_metadata
543
541
 
544
- uri, body, query_string_params = transcode_insert request
545
- response = @client_stub.make_post_request(
546
- uri: uri,
547
- body: body,
548
- params: query_string_params,
549
- options: options
550
- )
551
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
552
-
553
- yield result, response if block_given?
554
- result
542
+ options.apply_defaults timeout: @config.timeout,
543
+ metadata: @config.metadata
544
+
545
+ @images_stub.insert request, options do |result, response|
546
+ result = ::Gapic::Rest::BaseOperation.new result
547
+ yield result, response if block_given?
548
+ return result
549
+ end
555
550
  rescue ::Faraday::Error => e
556
551
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
557
552
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -578,32 +573,22 @@ module Google
578
573
  # the default parameter values, pass an empty Hash as a request object (see above).
579
574
  #
580
575
  # @param filter [::String]
581
- # 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 `<`.
582
- #
583
- # For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
584
- #
585
- # 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.
586
- #
587
- # 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) ```
576
+ # 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) ```
588
577
  # @param max_results [::Integer]
589
578
  # 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`)
590
579
  # @param order_by [::String]
591
- # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
592
- #
593
- # 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.
594
- #
595
- # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
580
+ # 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.
596
581
  # @param page_token [::String]
597
582
  # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
598
583
  # @param project [::String]
599
584
  # Project ID for this request.
600
585
  # @param return_partial_success [::Boolean]
601
- # 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.
602
- # @yield [result, env] Access the result along with the Faraday environment object
603
- # @yieldparam result [::Google::Cloud::Compute::V1::ImageList]
586
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
587
+ # @yield [result, response] Access the result along with the Faraday response object
588
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Image>]
604
589
  # @yieldparam response [::Faraday::Response]
605
590
  #
606
- # @return [::Google::Cloud::Compute::V1::ImageList]
591
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Image>]
607
592
  #
608
593
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
609
594
  def list request, options = nil
@@ -615,7 +600,7 @@ module Google
615
600
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
616
601
 
617
602
  # Customize the options with defaults
618
- call_metadata = {}
603
+ call_metadata = @config.rpcs.list.metadata.to_h
619
604
 
620
605
  # Set x-goog-api-client header
621
606
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -623,19 +608,17 @@ module Google
623
608
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
624
609
  transports_version_send: [:rest]
625
610
 
626
- options.apply_defaults timeout: @config.timeout,
611
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
627
612
  metadata: call_metadata
628
613
 
629
- uri, _body, query_string_params = transcode_list request
630
- response = @client_stub.make_get_request(
631
- uri: uri,
632
- params: query_string_params,
633
- options: options
634
- )
635
- result = ::Google::Cloud::Compute::V1::ImageList.decode_json response.body, ignore_unknown_fields: true
614
+ options.apply_defaults timeout: @config.timeout,
615
+ metadata: @config.metadata
636
616
 
637
- yield result, response if block_given?
638
- result
617
+ @images_stub.list request, options do |result, response|
618
+ result = ::Gapic::Rest::PagedEnumerable.new @images_stub, :list, "items", request, result, options
619
+ yield result, response if block_given?
620
+ return result
621
+ end
639
622
  rescue ::Faraday::Error => e
640
623
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
641
624
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -668,16 +651,12 @@ module Google
668
651
  # @param project [::String]
669
652
  # Project ID for this request.
670
653
  # @param request_id [::String]
671
- # 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.
672
- #
673
- # 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.
674
- #
675
- # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
676
- # @yield [result, env] Access the result along with the Faraday environment object
677
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
654
+ # 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).
655
+ # @yield [result, response] Access the result along with the Faraday response object
656
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
678
657
  # @yieldparam response [::Faraday::Response]
679
658
  #
680
- # @return [::Google::Cloud::Compute::V1::Operation]
659
+ # @return [::Gapic::Rest::BaseOperation]
681
660
  #
682
661
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
683
662
  def patch request, options = nil
@@ -689,7 +668,7 @@ module Google
689
668
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
690
669
 
691
670
  # Customize the options with defaults
692
- call_metadata = {}
671
+ call_metadata = @config.rpcs.patch.metadata.to_h
693
672
 
694
673
  # Set x-goog-api-client header
695
674
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -697,20 +676,17 @@ module Google
697
676
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
698
677
  transports_version_send: [:rest]
699
678
 
700
- options.apply_defaults timeout: @config.timeout,
679
+ options.apply_defaults timeout: @config.rpcs.patch.timeout,
701
680
  metadata: call_metadata
702
681
 
703
- uri, body, query_string_params = transcode_patch request
704
- response = @client_stub.make_patch_request(
705
- uri: uri,
706
- body: body,
707
- params: query_string_params,
708
- options: options
709
- )
710
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
711
-
712
- yield result, response if block_given?
713
- result
682
+ options.apply_defaults timeout: @config.timeout,
683
+ metadata: @config.metadata
684
+
685
+ @images_stub.patch request, options do |result, response|
686
+ result = ::Gapic::Rest::BaseOperation.new result
687
+ yield result, response if block_given?
688
+ return result
689
+ end
714
690
  rescue ::Faraday::Error => e
715
691
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
716
692
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -742,7 +718,7 @@ module Google
742
718
  # Project ID for this request.
743
719
  # @param resource [::String]
744
720
  # Name or id of the resource for this request.
745
- # @yield [result, env] Access the result along with the Faraday environment object
721
+ # @yield [result, response] Access the result along with the Faraday response object
746
722
  # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
747
723
  # @yieldparam response [::Faraday::Response]
748
724
  #
@@ -758,7 +734,7 @@ module Google
758
734
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
759
735
 
760
736
  # Customize the options with defaults
761
- call_metadata = {}
737
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
762
738
 
763
739
  # Set x-goog-api-client header
764
740
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -766,19 +742,16 @@ module Google
766
742
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
767
743
  transports_version_send: [:rest]
768
744
 
769
- options.apply_defaults timeout: @config.timeout,
745
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
770
746
  metadata: call_metadata
771
747
 
772
- uri, body, _query_string_params = transcode_set_iam_policy request
773
- response = @client_stub.make_post_request(
774
- uri: uri,
775
- body: body,
776
- options: options
777
- )
778
- result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
748
+ options.apply_defaults timeout: @config.timeout,
749
+ metadata: @config.metadata
779
750
 
780
- yield result, response if block_given?
781
- result
751
+ @images_stub.set_iam_policy request, options do |result, response|
752
+ yield result, response if block_given?
753
+ return result
754
+ end
782
755
  rescue ::Faraday::Error => e
783
756
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
784
757
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -810,11 +783,11 @@ module Google
810
783
  # Project ID for this request.
811
784
  # @param resource [::String]
812
785
  # Name or id of the resource for this request.
813
- # @yield [result, env] Access the result along with the Faraday environment object
814
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
786
+ # @yield [result, response] Access the result along with the Faraday response object
787
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
815
788
  # @yieldparam response [::Faraday::Response]
816
789
  #
817
- # @return [::Google::Cloud::Compute::V1::Operation]
790
+ # @return [::Gapic::Rest::BaseOperation]
818
791
  #
819
792
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
820
793
  def set_labels request, options = nil
@@ -826,7 +799,7 @@ module Google
826
799
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
827
800
 
828
801
  # Customize the options with defaults
829
- call_metadata = {}
802
+ call_metadata = @config.rpcs.set_labels.metadata.to_h
830
803
 
831
804
  # Set x-goog-api-client header
832
805
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -834,19 +807,17 @@ module Google
834
807
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
835
808
  transports_version_send: [:rest]
836
809
 
837
- options.apply_defaults timeout: @config.timeout,
810
+ options.apply_defaults timeout: @config.rpcs.set_labels.timeout,
838
811
  metadata: call_metadata
839
812
 
840
- uri, body, _query_string_params = transcode_set_labels request
841
- response = @client_stub.make_post_request(
842
- uri: uri,
843
- body: body,
844
- options: options
845
- )
846
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
813
+ options.apply_defaults timeout: @config.timeout,
814
+ metadata: @config.metadata
847
815
 
848
- yield result, response if block_given?
849
- result
816
+ @images_stub.set_labels request, options do |result, response|
817
+ result = ::Gapic::Rest::BaseOperation.new result
818
+ yield result, response if block_given?
819
+ return result
820
+ end
850
821
  rescue ::Faraday::Error => e
851
822
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
852
823
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -878,7 +849,7 @@ module Google
878
849
  # Name or id of the resource for this request.
879
850
  # @param test_permissions_request_resource [::Google::Cloud::Compute::V1::TestPermissionsRequest, ::Hash]
880
851
  # The body resource for this request
881
- # @yield [result, env] Access the result along with the Faraday environment object
852
+ # @yield [result, response] Access the result along with the Faraday response object
882
853
  # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
883
854
  # @yieldparam response [::Faraday::Response]
884
855
  #
@@ -894,7 +865,7 @@ module Google
894
865
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
895
866
 
896
867
  # Customize the options with defaults
897
- call_metadata = {}
868
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
898
869
 
899
870
  # Set x-goog-api-client header
900
871
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -902,19 +873,16 @@ module Google
902
873
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
903
874
  transports_version_send: [:rest]
904
875
 
905
- options.apply_defaults timeout: @config.timeout,
876
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
906
877
  metadata: call_metadata
907
878
 
908
- uri, body, _query_string_params = transcode_test_iam_permissions request
909
- response = @client_stub.make_post_request(
910
- uri: uri,
911
- body: body,
912
- options: options
913
- )
914
- result = ::Google::Cloud::Compute::V1::TestPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
879
+ options.apply_defaults timeout: @config.timeout,
880
+ metadata: @config.metadata
915
881
 
916
- yield result, response if block_given?
917
- result
882
+ @images_stub.test_iam_permissions request, options do |result, response|
883
+ yield result, response if block_given?
884
+ return result
885
+ end
918
886
  rescue ::Faraday::Error => e
919
887
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
920
888
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -969,6 +937,9 @@ module Google
969
937
  # @!attribute [rw] timeout
970
938
  # The call timeout in seconds.
971
939
  # @return [::Numeric]
940
+ # @!attribute [rw] metadata
941
+ # Additional REST headers to be sent with the call.
942
+ # @return [::Hash{::Symbol=>::String}]
972
943
  #
973
944
  class Configuration
974
945
  extend ::Gapic::Config
@@ -982,6 +953,7 @@ module Google
982
953
  config_attr :lib_name, nil, ::String, nil
983
954
  config_attr :lib_version, nil, ::String, nil
984
955
  config_attr :timeout, nil, ::Numeric, nil
956
+ config_attr :metadata, nil, ::Hash, nil
985
957
 
986
958
  # @private
987
959
  def initialize parent_config = nil
@@ -989,6 +961,116 @@ module Google
989
961
 
990
962
  yield self if block_given?
991
963
  end
964
+
965
+ ##
966
+ # Configurations for individual RPCs
967
+ # @return [Rpcs]
968
+ #
969
+ def rpcs
970
+ @rpcs ||= begin
971
+ parent_rpcs = nil
972
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
973
+ Rpcs.new parent_rpcs
974
+ end
975
+ end
976
+
977
+ ##
978
+ # Configuration RPC class for the Images API.
979
+ #
980
+ # Includes fields providing the configuration for each RPC in this service.
981
+ # Each configuration object is of type `Gapic::Config::Method` and includes
982
+ # the following configuration fields:
983
+ #
984
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
985
+ #
986
+ # there is one other field (`retry_policy`) that can be set
987
+ # but is currently not supported for REST Gapic libraries.
988
+ #
989
+ class Rpcs
990
+ ##
991
+ # RPC-specific configuration for `delete`
992
+ # @return [::Gapic::Config::Method]
993
+ #
994
+ attr_reader :delete
995
+ ##
996
+ # RPC-specific configuration for `deprecate`
997
+ # @return [::Gapic::Config::Method]
998
+ #
999
+ attr_reader :deprecate
1000
+ ##
1001
+ # RPC-specific configuration for `get`
1002
+ # @return [::Gapic::Config::Method]
1003
+ #
1004
+ attr_reader :get
1005
+ ##
1006
+ # RPC-specific configuration for `get_from_family`
1007
+ # @return [::Gapic::Config::Method]
1008
+ #
1009
+ attr_reader :get_from_family
1010
+ ##
1011
+ # RPC-specific configuration for `get_iam_policy`
1012
+ # @return [::Gapic::Config::Method]
1013
+ #
1014
+ attr_reader :get_iam_policy
1015
+ ##
1016
+ # RPC-specific configuration for `insert`
1017
+ # @return [::Gapic::Config::Method]
1018
+ #
1019
+ attr_reader :insert
1020
+ ##
1021
+ # RPC-specific configuration for `list`
1022
+ # @return [::Gapic::Config::Method]
1023
+ #
1024
+ attr_reader :list
1025
+ ##
1026
+ # RPC-specific configuration for `patch`
1027
+ # @return [::Gapic::Config::Method]
1028
+ #
1029
+ attr_reader :patch
1030
+ ##
1031
+ # RPC-specific configuration for `set_iam_policy`
1032
+ # @return [::Gapic::Config::Method]
1033
+ #
1034
+ attr_reader :set_iam_policy
1035
+ ##
1036
+ # RPC-specific configuration for `set_labels`
1037
+ # @return [::Gapic::Config::Method]
1038
+ #
1039
+ attr_reader :set_labels
1040
+ ##
1041
+ # RPC-specific configuration for `test_iam_permissions`
1042
+ # @return [::Gapic::Config::Method]
1043
+ #
1044
+ attr_reader :test_iam_permissions
1045
+
1046
+ # @private
1047
+ def initialize parent_rpcs = nil
1048
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
1049
+ @delete = ::Gapic::Config::Method.new delete_config
1050
+ deprecate_config = parent_rpcs.deprecate if parent_rpcs.respond_to? :deprecate
1051
+ @deprecate = ::Gapic::Config::Method.new deprecate_config
1052
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
1053
+ @get = ::Gapic::Config::Method.new get_config
1054
+ get_from_family_config = parent_rpcs.get_from_family if parent_rpcs.respond_to? :get_from_family
1055
+ @get_from_family = ::Gapic::Config::Method.new get_from_family_config
1056
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1057
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1058
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
1059
+ @insert = ::Gapic::Config::Method.new insert_config
1060
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
1061
+ @list = ::Gapic::Config::Method.new list_config
1062
+ patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
1063
+ @patch = ::Gapic::Config::Method.new patch_config
1064
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1065
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1066
+ set_labels_config = parent_rpcs.set_labels if parent_rpcs.respond_to? :set_labels
1067
+ @set_labels = ::Gapic::Config::Method.new set_labels_config
1068
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1069
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
1070
+
1071
+ yield self if block_given?
1072
+ end
1073
+ end
992
1074
  end
993
1075
  end
994
1076
  end