google-cloud-compute-v1 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (244) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -1
  3. data/AUTHENTICATION.md +12 -12
  4. data/README.md +4 -30
  5. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +123 -66
  6. data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +188 -0
  7. data/lib/google/cloud/compute/v1/accelerator_types/rest.rb +0 -2
  8. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +166 -96
  9. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +279 -0
  10. data/lib/google/cloud/compute/v1/addresses/rest.rb +0 -2
  11. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +210 -128
  12. data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +373 -0
  13. data/lib/google/cloud/compute/v1/autoscalers/rest.rb +0 -2
  14. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +228 -143
  15. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +413 -0
  16. data/lib/google/cloud/compute/v1/backend_buckets/rest.rb +0 -2
  17. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +294 -187
  18. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +553 -0
  19. data/lib/google/cloud/compute/v1/backend_services/rest.rb +0 -2
  20. data/lib/google/cloud/compute/v1/compute_pb.rb +816 -135
  21. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +123 -66
  22. data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +188 -0
  23. data/lib/google/cloud/compute/v1/disk_types/rest.rb +0 -2
  24. data/lib/google/cloud/compute/v1/disks/rest/client.rb +334 -213
  25. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +644 -0
  26. data/lib/google/cloud/compute/v1/disks/rest.rb +0 -2
  27. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +180 -107
  28. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +317 -0
  29. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest.rb +0 -2
  30. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +463 -280
  31. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +869 -0
  32. data/lib/google/cloud/compute/v1/firewall_policies/rest.rb +0 -2
  33. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +185 -113
  34. data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +321 -0
  35. data/lib/google/cloud/compute/v1/firewalls/rest.rb +0 -2
  36. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +292 -127
  37. data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +417 -0
  38. data/lib/google/cloud/compute/v1/forwarding_rules/rest.rb +0 -2
  39. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +141 -81
  40. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +229 -0
  41. data/lib/google/cloud/compute/v1/global_addresses/rest.rb +0 -2
  42. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +259 -112
  43. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +365 -0
  44. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest.rb +0 -2
  45. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +207 -128
  46. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +370 -0
  47. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest.rb +0 -2
  48. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +159 -88
  49. data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +274 -0
  50. data/lib/google/cloud/compute/v1/global_operations/rest.rb +0 -2
  51. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +116 -64
  52. data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +186 -0
  53. data/lib/google/cloud/compute/v1/global_organization_operations/rest.rb +0 -2
  54. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +170 -97
  55. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +275 -0
  56. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest.rb +0 -2
  57. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +210 -128
  58. data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +371 -0
  59. data/lib/google/cloud/compute/v1/health_checks/rest.rb +0 -2
  60. data/lib/google/cloud/compute/v1/images/rest/client.rb +284 -174
  61. data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +542 -0
  62. data/lib/google/cloud/compute/v1/images/rest.rb +0 -2
  63. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +497 -328
  64. data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +974 -0
  65. data/lib/google/cloud/compute/v1/instance_group_managers/rest.rb +0 -2
  66. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +255 -161
  67. data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +467 -0
  68. data/lib/google/cloud/compute/v1/instance_groups/rest.rb +0 -2
  69. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +198 -117
  70. data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +362 -0
  71. data/lib/google/cloud/compute/v1/instance_templates/rest.rb +0 -2
  72. data/lib/google/cloud/compute/v1/instances/rest/client.rb +1079 -609
  73. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +1975 -0
  74. data/lib/google/cloud/compute/v1/instances/rest.rb +0 -2
  75. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +188 -112
  76. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +326 -0
  77. data/lib/google/cloud/compute/v1/interconnect_attachments/rest.rb +0 -2
  78. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +98 -51
  79. data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +138 -0
  80. data/lib/google/cloud/compute/v1/interconnect_locations/rest.rb +0 -2
  81. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +184 -108
  82. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +318 -0
  83. data/lib/google/cloud/compute/v1/interconnects/rest.rb +0 -2
  84. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +91 -48
  85. data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +133 -0
  86. data/lib/google/cloud/compute/v1/license_codes/rest.rb +0 -2
  87. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +198 -117
  88. data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +362 -0
  89. data/lib/google/cloud/compute/v1/licenses/rest.rb +0 -2
  90. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +123 -66
  91. data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +188 -0
  92. data/lib/google/cloud/compute/v1/machine_types/rest.rb +0 -2
  93. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +251 -157
  94. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +465 -0
  95. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest.rb +0 -2
  96. data/lib/google/cloud/compute/v1/networks/rest/client.rb +349 -173
  97. data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +553 -0
  98. data/lib/google/cloud/compute/v1/networks/rest.rb +0 -2
  99. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +333 -211
  100. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +646 -0
  101. data/lib/google/cloud/compute/v1/node_groups/rest.rb +0 -2
  102. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +223 -132
  103. data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +412 -0
  104. data/lib/google/cloud/compute/v1/node_templates/rest.rb +0 -2
  105. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +123 -66
  106. data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +188 -0
  107. data/lib/google/cloud/compute/v1/node_types/rest.rb +0 -2
  108. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +206 -124
  109. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +369 -0
  110. data/lib/google/cloud/compute/v1/packet_mirrorings/rest.rb +0 -2
  111. data/lib/google/cloud/compute/v1/projects/rest/client.rb +338 -219
  112. data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +643 -0
  113. data/lib/google/cloud/compute/v1/projects/rest.rb +0 -2
  114. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +170 -97
  115. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +275 -0
  116. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest.rb +0 -2
  117. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +196 -112
  118. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +325 -0
  119. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest.rb +0 -2
  120. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +185 -113
  121. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +323 -0
  122. data/lib/google/cloud/compute/v1/region_autoscalers/rest.rb +0 -2
  123. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +203 -125
  124. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +365 -0
  125. data/lib/google/cloud/compute/v1/region_backend_services/rest.rb +0 -2
  126. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +145 -82
  127. data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +234 -0
  128. data/lib/google/cloud/compute/v1/region_commitments/rest.rb +0 -2
  129. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +98 -51
  130. data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +138 -0
  131. data/lib/google/cloud/compute/v1/region_disk_types/rest.rb +0 -2
  132. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +309 -198
  133. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +593 -0
  134. data/lib/google/cloud/compute/v1/region_disks/rest.rb +0 -2
  135. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +163 -97
  136. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +275 -0
  137. data/lib/google/cloud/compute/v1/region_health_check_services/rest.rb +0 -2
  138. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +185 -113
  139. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +321 -0
  140. data/lib/google/cloud/compute/v1/region_health_checks/rest.rb +0 -2
  141. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +472 -313
  142. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +924 -0
  143. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest.rb +0 -2
  144. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +143 -84
  145. data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +234 -0
  146. data/lib/google/cloud/compute/v1/region_instance_groups/rest.rb +0 -2
  147. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +75 -40
  148. data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +92 -0
  149. data/lib/google/cloud/compute/v1/region_instances/rest.rb +0 -2
  150. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +141 -81
  151. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +229 -0
  152. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest.rb +0 -2
  153. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +141 -81
  154. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +229 -0
  155. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest.rb +0 -2
  156. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +134 -73
  157. data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +224 -0
  158. data/lib/google/cloud/compute/v1/region_operations/rest.rb +0 -2
  159. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +141 -81
  160. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +229 -0
  161. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest.rb +0 -2
  162. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +163 -97
  163. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +275 -0
  164. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest.rb +0 -2
  165. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +185 -113
  166. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +321 -0
  167. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest.rb +0 -2
  168. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +203 -125
  169. data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +365 -0
  170. data/lib/google/cloud/compute/v1/region_url_maps/rest.rb +0 -2
  171. data/lib/google/cloud/compute/v1/regions/rest/client.rb +98 -51
  172. data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +138 -0
  173. data/lib/google/cloud/compute/v1/regions/rest.rb +0 -2
  174. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +245 -148
  175. data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +458 -0
  176. data/lib/google/cloud/compute/v1/reservations/rest.rb +0 -2
  177. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +223 -132
  178. data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +412 -0
  179. data/lib/google/cloud/compute/v1/resource_policies/rest.rb +0 -2
  180. data/lib/google/cloud/compute/v1/routers/rest/client.rb +274 -166
  181. data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +507 -0
  182. data/lib/google/cloud/compute/v1/routers/rest.rb +0 -2
  183. data/lib/google/cloud/compute/v1/routes/rest/client.rb +141 -81
  184. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +229 -0
  185. data/lib/google/cloud/compute/v1/routes/rest.rb +0 -2
  186. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +270 -166
  187. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +504 -0
  188. data/lib/google/cloud/compute/v1/security_policies/rest.rb +0 -2
  189. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +197 -115
  190. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +360 -0
  191. data/lib/google/cloud/compute/v1/snapshots/rest.rb +0 -2
  192. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +166 -96
  193. data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +279 -0
  194. data/lib/google/cloud/compute/v1/ssl_certificates/rest.rb +0 -2
  195. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +185 -110
  196. data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +324 -0
  197. data/lib/google/cloud/compute/v1/ssl_policies/rest.rb +0 -2
  198. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +314 -195
  199. data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +600 -0
  200. data/lib/google/cloud/compute/v1/subnetworks/rest.rb +0 -2
  201. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +163 -97
  202. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +275 -0
  203. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest.rb +0 -2
  204. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +210 -128
  205. data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +371 -0
  206. data/lib/google/cloud/compute/v1/target_http_proxies/rest.rb +0 -2
  207. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +334 -159
  208. data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +509 -0
  209. data/lib/google/cloud/compute/v1/target_https_proxies/rest.rb +0 -2
  210. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +166 -96
  211. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +279 -0
  212. data/lib/google/cloud/compute/v1/target_instances/rest.rb +0 -2
  213. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +294 -188
  214. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +554 -0
  215. data/lib/google/cloud/compute/v1/target_pools/rest.rb +0 -2
  216. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +229 -145
  217. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +413 -0
  218. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest.rb +0 -2
  219. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +185 -113
  220. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +321 -0
  221. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest.rb +0 -2
  222. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +166 -96
  223. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +279 -0
  224. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest.rb +0 -2
  225. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +250 -156
  226. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +461 -0
  227. data/lib/google/cloud/compute/v1/url_maps/rest.rb +0 -2
  228. data/lib/google/cloud/compute/v1/version.rb +1 -1
  229. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +227 -135
  230. data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +412 -0
  231. data/lib/google/cloud/compute/v1/vpn_gateways/rest.rb +0 -2
  232. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +166 -96
  233. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +279 -0
  234. data/lib/google/cloud/compute/v1/vpn_tunnels/rest.rb +0 -2
  235. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +134 -73
  236. data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +224 -0
  237. data/lib/google/cloud/compute/v1/zone_operations/rest.rb +0 -2
  238. data/lib/google/cloud/compute/v1/zones/rest/client.rb +98 -51
  239. data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +138 -0
  240. data/lib/google/cloud/compute/v1/zones/rest.rb +0 -2
  241. data/lib/google/cloud/compute/v1.rb +5 -0
  242. data/proto_docs/README.md +1 -1
  243. data/proto_docs/google/cloud/compute/v1/compute.rb +2526 -640
  244. metadata +84 -8
@@ -16,8 +16,6 @@
16
16
 
17
17
  # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
18
 
19
- require "gapic/rest"
20
- require "google/cloud/compute/v1/images/rest/grpc_transcoding"
21
19
  require "google/cloud/compute/v1/images/rest/client"
22
20
 
23
21
  module Google
@@ -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/instance_group_managers/rest/service_stub"
21
22
 
22
23
  module Google
23
24
  module Cloud
@@ -31,8 +32,6 @@ module Google
31
32
  # The InstanceGroupManagers API.
32
33
  #
33
34
  class Client
34
- include GrpcTranscoding
35
-
36
35
  # @private
37
36
  attr_reader :instance_group_managers_stub
38
37
 
@@ -42,13 +41,12 @@ module Google
42
41
  # See {::Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::Client::Configuration}
43
42
  # for a description of the configuration fields.
44
43
  #
45
- # ## Example
46
- #
47
- # To modify the configuration for all InstanceGroupManagers clients:
44
+ # @example
48
45
  #
49
- # ::Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::Client.configure do |config|
50
- # config.timeout = 10.0
51
- # end
46
+ # # Modify the configuration for all InstanceGroupManagers clients
47
+ # ::Google::Cloud::Compute::V1::InstanceGroupManagers::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,58 @@ module Google
66
64
  end
67
65
  default_config = Client::Configuration.new parent_config
68
66
 
67
+ default_config.rpcs.abandon_instances.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.apply_updates_to_instances.timeout = 600.0
75
+
76
+ default_config.rpcs.create_instances.timeout = 600.0
77
+
78
+ default_config.rpcs.delete.timeout = 600.0
79
+
80
+ default_config.rpcs.delete_instances.timeout = 600.0
81
+
82
+ default_config.rpcs.delete_per_instance_configs.timeout = 600.0
83
+
84
+ default_config.rpcs.get.timeout = 600.0
85
+ default_config.rpcs.get.retry_policy = {
86
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
87
+ }
88
+
89
+ default_config.rpcs.insert.timeout = 600.0
90
+
91
+ default_config.rpcs.list.timeout = 600.0
92
+ default_config.rpcs.list.retry_policy = {
93
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
94
+ }
95
+
96
+ default_config.rpcs.list_errors.timeout = 600.0
97
+ default_config.rpcs.list_errors.retry_policy = {
98
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
99
+ }
100
+
101
+ default_config.rpcs.list_managed_instances.timeout = 600.0
102
+
103
+ default_config.rpcs.list_per_instance_configs.timeout = 600.0
104
+
105
+ default_config.rpcs.patch.timeout = 600.0
106
+
107
+ default_config.rpcs.patch_per_instance_configs.timeout = 600.0
108
+
109
+ default_config.rpcs.recreate_instances.timeout = 600.0
110
+
111
+ default_config.rpcs.resize.timeout = 600.0
112
+
113
+ default_config.rpcs.set_instance_template.timeout = 600.0
114
+
115
+ default_config.rpcs.set_target_pools.timeout = 600.0
116
+
117
+ default_config.rpcs.update_per_instance_configs.timeout = 600.0
118
+
69
119
  default_config
70
120
  end
71
121
  yield @configure if block_given?
@@ -95,28 +145,20 @@ module Google
95
145
  ##
96
146
  # Create a new InstanceGroupManagers REST client object.
97
147
  #
98
- # ## Examples
99
- #
100
- # To create a new InstanceGroupManagers REST client with the default
101
- # configuration:
102
- #
103
- # client = ::Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::Client.new
148
+ # @example
104
149
  #
105
- # To create a new InstanceGroupManagers REST client with a custom
106
- # configuration:
150
+ # # Create a client using the default configuration
151
+ # client = ::Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::Client.new
107
152
  #
108
- # client = ::Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::Client.new do |config|
109
- # config.timeout = 10.0
110
- # end
153
+ # # Create a client using a custom configuration
154
+ # client = ::Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::Client.new do |config|
155
+ # config.timeout = 10.0
156
+ # end
111
157
  #
112
158
  # @yield [config] Configure the InstanceGroupManagers client.
113
159
  # @yieldparam config [Client::Configuration]
114
160
  #
115
161
  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
162
  # Create the configuration object
121
163
  @config = Configuration.new Client.configure
122
164
 
@@ -126,11 +168,11 @@ module Google
126
168
  # Create credentials
127
169
  credentials = @config.credentials
128
170
  credentials ||= Credentials.default scope: @config.scope
129
- if credentials.is_a?(String) || credentials.is_a?(Hash)
171
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
130
172
  credentials = Credentials.new credentials, scope: @config.scope
131
173
  end
132
174
 
133
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: @config.endpoint, credentials: credentials
175
+ @instance_group_managers_stub = ::Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
134
176
  end
135
177
 
136
178
  # Service calls
@@ -173,11 +215,11 @@ module Google
173
215
  # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
174
216
  # @param zone [::String]
175
217
  # The name of the zone where the managed instance group is located.
176
- # @yield [result, env] Access the result along with the Faraday environment object
177
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
218
+ # @yield [result, response] Access the result along with the Faraday response object
219
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
178
220
  # @yieldparam response [::Faraday::Response]
179
221
  #
180
- # @return [::Google::Cloud::Compute::V1::Operation]
222
+ # @return [::Gapic::Rest::BaseOperation]
181
223
  #
182
224
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
183
225
  def abandon_instances request, options = nil
@@ -189,7 +231,7 @@ module Google
189
231
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
190
232
 
191
233
  # Customize the options with defaults
192
- call_metadata = {}
234
+ call_metadata = @config.rpcs.abandon_instances.metadata.to_h
193
235
 
194
236
  # Set x-goog-api-client header
195
237
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -197,20 +239,17 @@ module Google
197
239
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
198
240
  transports_version_send: [:rest]
199
241
 
200
- options.apply_defaults timeout: @config.timeout,
242
+ options.apply_defaults timeout: @config.rpcs.abandon_instances.timeout,
201
243
  metadata: call_metadata
202
244
 
203
- uri, body, query_string_params = transcode_abandon_instances request
204
- response = @client_stub.make_post_request(
205
- uri: uri,
206
- body: body,
207
- params: query_string_params,
208
- options: options
209
- )
210
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
211
-
212
- yield result, response if block_given?
213
- result
245
+ options.apply_defaults timeout: @config.timeout,
246
+ metadata: @config.metadata
247
+
248
+ @instance_group_managers_stub.abandon_instances request, options do |result, response|
249
+ result = ::Gapic::Rest::BaseOperation.new result
250
+ yield result, response if block_given?
251
+ return result
252
+ end
214
253
  rescue ::Faraday::Error => e
215
254
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
216
255
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -259,12 +298,12 @@ module Google
259
298
  # @param project [::String]
260
299
  # Project ID for this request.
261
300
  # @param return_partial_success [::Boolean]
262
- # 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.
263
- # @yield [result, env] Access the result along with the Faraday environment object
264
- # @yieldparam result [::Google::Cloud::Compute::V1::InstanceGroupManagerAggregatedList]
301
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
302
+ # @yield [result, response] Access the result along with the Faraday response object
303
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::InstanceGroupManagersScopedList>]
265
304
  # @yieldparam response [::Faraday::Response]
266
305
  #
267
- # @return [::Google::Cloud::Compute::V1::InstanceGroupManagerAggregatedList]
306
+ # @return [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::InstanceGroupManagersScopedList>]
268
307
  #
269
308
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
270
309
  def aggregated_list request, options = nil
@@ -276,7 +315,7 @@ module Google
276
315
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
277
316
 
278
317
  # Customize the options with defaults
279
- call_metadata = {}
318
+ call_metadata = @config.rpcs.aggregated_list.metadata.to_h
280
319
 
281
320
  # Set x-goog-api-client header
282
321
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -284,19 +323,17 @@ module Google
284
323
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
285
324
  transports_version_send: [:rest]
286
325
 
287
- options.apply_defaults timeout: @config.timeout,
326
+ options.apply_defaults timeout: @config.rpcs.aggregated_list.timeout,
288
327
  metadata: call_metadata
289
328
 
290
- uri, _body, query_string_params = transcode_aggregated_list request
291
- response = @client_stub.make_get_request(
292
- uri: uri,
293
- params: query_string_params,
294
- options: options
295
- )
296
- result = ::Google::Cloud::Compute::V1::InstanceGroupManagerAggregatedList.decode_json response.body, ignore_unknown_fields: true
329
+ options.apply_defaults timeout: @config.timeout,
330
+ metadata: @config.metadata
297
331
 
298
- yield result, response if block_given?
299
- result
332
+ @instance_group_managers_stub.aggregated_list request, options do |result, response|
333
+ result = ::Gapic::Rest::PagedEnumerable.new @instance_group_managers_stub, :aggregated_list, "items", request, result, options
334
+ yield result, response if block_given?
335
+ return result
336
+ end
300
337
  rescue ::Faraday::Error => e
301
338
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
302
339
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -330,11 +367,11 @@ module Google
330
367
  # Project ID for this request.
331
368
  # @param zone [::String]
332
369
  # The name of the zone where the managed instance group is located. Should conform to RFC1035.
333
- # @yield [result, env] Access the result along with the Faraday environment object
334
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
370
+ # @yield [result, response] Access the result along with the Faraday response object
371
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
335
372
  # @yieldparam response [::Faraday::Response]
336
373
  #
337
- # @return [::Google::Cloud::Compute::V1::Operation]
374
+ # @return [::Gapic::Rest::BaseOperation]
338
375
  #
339
376
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
340
377
  def apply_updates_to_instances request, options = nil
@@ -346,7 +383,7 @@ module Google
346
383
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
347
384
 
348
385
  # Customize the options with defaults
349
- call_metadata = {}
386
+ call_metadata = @config.rpcs.apply_updates_to_instances.metadata.to_h
350
387
 
351
388
  # Set x-goog-api-client header
352
389
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -354,19 +391,17 @@ module Google
354
391
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
355
392
  transports_version_send: [:rest]
356
393
 
357
- options.apply_defaults timeout: @config.timeout,
394
+ options.apply_defaults timeout: @config.rpcs.apply_updates_to_instances.timeout,
358
395
  metadata: call_metadata
359
396
 
360
- uri, body, _query_string_params = transcode_apply_updates_to_instances request
361
- response = @client_stub.make_post_request(
362
- uri: uri,
363
- body: body,
364
- options: options
365
- )
366
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
397
+ options.apply_defaults timeout: @config.timeout,
398
+ metadata: @config.metadata
367
399
 
368
- yield result, response if block_given?
369
- result
400
+ @instance_group_managers_stub.apply_updates_to_instances request, options do |result, response|
401
+ result = ::Gapic::Rest::BaseOperation.new result
402
+ yield result, response if block_given?
403
+ return result
404
+ end
370
405
  rescue ::Faraday::Error => e
371
406
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
372
407
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -406,11 +441,11 @@ module Google
406
441
  # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
407
442
  # @param zone [::String]
408
443
  # The name of the zone where the managed instance group is located. It should conform to RFC1035.
409
- # @yield [result, env] Access the result along with the Faraday environment object
410
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
444
+ # @yield [result, response] Access the result along with the Faraday response object
445
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
411
446
  # @yieldparam response [::Faraday::Response]
412
447
  #
413
- # @return [::Google::Cloud::Compute::V1::Operation]
448
+ # @return [::Gapic::Rest::BaseOperation]
414
449
  #
415
450
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
416
451
  def create_instances request, options = nil
@@ -422,7 +457,7 @@ module Google
422
457
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
423
458
 
424
459
  # Customize the options with defaults
425
- call_metadata = {}
460
+ call_metadata = @config.rpcs.create_instances.metadata.to_h
426
461
 
427
462
  # Set x-goog-api-client header
428
463
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -430,20 +465,17 @@ module Google
430
465
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
431
466
  transports_version_send: [:rest]
432
467
 
433
- options.apply_defaults timeout: @config.timeout,
468
+ options.apply_defaults timeout: @config.rpcs.create_instances.timeout,
434
469
  metadata: call_metadata
435
470
 
436
- uri, body, query_string_params = transcode_create_instances request
437
- response = @client_stub.make_post_request(
438
- uri: uri,
439
- body: body,
440
- params: query_string_params,
441
- options: options
442
- )
443
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
444
-
445
- yield result, response if block_given?
446
- result
471
+ options.apply_defaults timeout: @config.timeout,
472
+ metadata: @config.metadata
473
+
474
+ @instance_group_managers_stub.create_instances request, options do |result, response|
475
+ result = ::Gapic::Rest::BaseOperation.new result
476
+ yield result, response if block_given?
477
+ return result
478
+ end
447
479
  rescue ::Faraday::Error => e
448
480
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
449
481
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -481,11 +513,11 @@ module Google
481
513
  # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
482
514
  # @param zone [::String]
483
515
  # The name of the zone where the managed instance group is located.
484
- # @yield [result, env] Access the result along with the Faraday environment object
485
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
516
+ # @yield [result, response] Access the result along with the Faraday response object
517
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
486
518
  # @yieldparam response [::Faraday::Response]
487
519
  #
488
- # @return [::Google::Cloud::Compute::V1::Operation]
520
+ # @return [::Gapic::Rest::BaseOperation]
489
521
  #
490
522
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
491
523
  def delete request, options = nil
@@ -497,7 +529,7 @@ module Google
497
529
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
498
530
 
499
531
  # Customize the options with defaults
500
- call_metadata = {}
532
+ call_metadata = @config.rpcs.delete.metadata.to_h
501
533
 
502
534
  # Set x-goog-api-client header
503
535
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -505,19 +537,17 @@ module Google
505
537
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
506
538
  transports_version_send: [:rest]
507
539
 
508
- options.apply_defaults timeout: @config.timeout,
540
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
509
541
  metadata: call_metadata
510
542
 
511
- uri, _body, query_string_params = transcode_delete request
512
- response = @client_stub.make_delete_request(
513
- uri: uri,
514
- params: query_string_params,
515
- options: options
516
- )
517
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
543
+ options.apply_defaults timeout: @config.timeout,
544
+ metadata: @config.metadata
518
545
 
519
- yield result, response if block_given?
520
- result
546
+ @instance_group_managers_stub.delete request, options do |result, response|
547
+ result = ::Gapic::Rest::BaseOperation.new result
548
+ yield result, response if block_given?
549
+ return result
550
+ end
521
551
  rescue ::Faraday::Error => e
522
552
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
523
553
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -561,11 +591,11 @@ module Google
561
591
  # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
562
592
  # @param zone [::String]
563
593
  # The name of the zone where the managed instance group is located.
564
- # @yield [result, env] Access the result along with the Faraday environment object
565
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
594
+ # @yield [result, response] Access the result along with the Faraday response object
595
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
566
596
  # @yieldparam response [::Faraday::Response]
567
597
  #
568
- # @return [::Google::Cloud::Compute::V1::Operation]
598
+ # @return [::Gapic::Rest::BaseOperation]
569
599
  #
570
600
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
571
601
  def delete_instances request, options = nil
@@ -577,7 +607,7 @@ module Google
577
607
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
578
608
 
579
609
  # Customize the options with defaults
580
- call_metadata = {}
610
+ call_metadata = @config.rpcs.delete_instances.metadata.to_h
581
611
 
582
612
  # Set x-goog-api-client header
583
613
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -585,20 +615,17 @@ module Google
585
615
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
586
616
  transports_version_send: [:rest]
587
617
 
588
- options.apply_defaults timeout: @config.timeout,
618
+ options.apply_defaults timeout: @config.rpcs.delete_instances.timeout,
589
619
  metadata: call_metadata
590
620
 
591
- uri, body, query_string_params = transcode_delete_instances request
592
- response = @client_stub.make_post_request(
593
- uri: uri,
594
- body: body,
595
- params: query_string_params,
596
- options: options
597
- )
598
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
599
-
600
- yield result, response if block_given?
601
- result
621
+ options.apply_defaults timeout: @config.timeout,
622
+ metadata: @config.metadata
623
+
624
+ @instance_group_managers_stub.delete_instances request, options do |result, response|
625
+ result = ::Gapic::Rest::BaseOperation.new result
626
+ yield result, response if block_given?
627
+ return result
628
+ end
602
629
  rescue ::Faraday::Error => e
603
630
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
604
631
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -632,11 +659,11 @@ module Google
632
659
  # Project ID for this request.
633
660
  # @param zone [::String]
634
661
  # The name of the zone where the managed instance group is located. It should conform to RFC1035.
635
- # @yield [result, env] Access the result along with the Faraday environment object
636
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
662
+ # @yield [result, response] Access the result along with the Faraday response object
663
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
637
664
  # @yieldparam response [::Faraday::Response]
638
665
  #
639
- # @return [::Google::Cloud::Compute::V1::Operation]
666
+ # @return [::Gapic::Rest::BaseOperation]
640
667
  #
641
668
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
642
669
  def delete_per_instance_configs request, options = nil
@@ -648,7 +675,7 @@ module Google
648
675
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
649
676
 
650
677
  # Customize the options with defaults
651
- call_metadata = {}
678
+ call_metadata = @config.rpcs.delete_per_instance_configs.metadata.to_h
652
679
 
653
680
  # Set x-goog-api-client header
654
681
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -656,19 +683,17 @@ module Google
656
683
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
657
684
  transports_version_send: [:rest]
658
685
 
659
- options.apply_defaults timeout: @config.timeout,
686
+ options.apply_defaults timeout: @config.rpcs.delete_per_instance_configs.timeout,
660
687
  metadata: call_metadata
661
688
 
662
- uri, body, _query_string_params = transcode_delete_per_instance_configs request
663
- response = @client_stub.make_post_request(
664
- uri: uri,
665
- body: body,
666
- options: options
667
- )
668
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
689
+ options.apply_defaults timeout: @config.timeout,
690
+ metadata: @config.metadata
669
691
 
670
- yield result, response if block_given?
671
- result
692
+ @instance_group_managers_stub.delete_per_instance_configs request, options do |result, response|
693
+ result = ::Gapic::Rest::BaseOperation.new result
694
+ yield result, response if block_given?
695
+ return result
696
+ end
672
697
  rescue ::Faraday::Error => e
673
698
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
674
699
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -700,7 +725,7 @@ module Google
700
725
  # Project ID for this request.
701
726
  # @param zone [::String]
702
727
  # The name of the zone where the managed instance group is located.
703
- # @yield [result, env] Access the result along with the Faraday environment object
728
+ # @yield [result, response] Access the result along with the Faraday response object
704
729
  # @yieldparam result [::Google::Cloud::Compute::V1::InstanceGroupManager]
705
730
  # @yieldparam response [::Faraday::Response]
706
731
  #
@@ -716,7 +741,7 @@ module Google
716
741
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
717
742
 
718
743
  # Customize the options with defaults
719
- call_metadata = {}
744
+ call_metadata = @config.rpcs.get.metadata.to_h
720
745
 
721
746
  # Set x-goog-api-client header
722
747
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -724,18 +749,16 @@ module Google
724
749
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
725
750
  transports_version_send: [:rest]
726
751
 
727
- options.apply_defaults timeout: @config.timeout,
752
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
728
753
  metadata: call_metadata
729
754
 
730
- uri, _body, _query_string_params = transcode_get request
731
- response = @client_stub.make_get_request(
732
- uri: uri,
733
- options: options
734
- )
735
- result = ::Google::Cloud::Compute::V1::InstanceGroupManager.decode_json response.body, ignore_unknown_fields: true
755
+ options.apply_defaults timeout: @config.timeout,
756
+ metadata: @config.metadata
736
757
 
737
- yield result, response if block_given?
738
- result
758
+ @instance_group_managers_stub.get request, options do |result, response|
759
+ yield result, response if block_given?
760
+ return result
761
+ end
739
762
  rescue ::Faraday::Error => e
740
763
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
741
764
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -775,11 +798,11 @@ module Google
775
798
  # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
776
799
  # @param zone [::String]
777
800
  # The name of the zone where you want to create the managed instance group.
778
- # @yield [result, env] Access the result along with the Faraday environment object
779
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
801
+ # @yield [result, response] Access the result along with the Faraday response object
802
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
780
803
  # @yieldparam response [::Faraday::Response]
781
804
  #
782
- # @return [::Google::Cloud::Compute::V1::Operation]
805
+ # @return [::Gapic::Rest::BaseOperation]
783
806
  #
784
807
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
785
808
  def insert request, options = nil
@@ -791,7 +814,7 @@ module Google
791
814
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
792
815
 
793
816
  # Customize the options with defaults
794
- call_metadata = {}
817
+ call_metadata = @config.rpcs.insert.metadata.to_h
795
818
 
796
819
  # Set x-goog-api-client header
797
820
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -799,20 +822,17 @@ module Google
799
822
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
800
823
  transports_version_send: [:rest]
801
824
 
802
- options.apply_defaults timeout: @config.timeout,
825
+ options.apply_defaults timeout: @config.rpcs.insert.timeout,
803
826
  metadata: call_metadata
804
827
 
805
- uri, body, query_string_params = transcode_insert request
806
- response = @client_stub.make_post_request(
807
- uri: uri,
808
- body: body,
809
- params: query_string_params,
810
- options: options
811
- )
812
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
813
-
814
- yield result, response if block_given?
815
- result
828
+ options.apply_defaults timeout: @config.timeout,
829
+ metadata: @config.metadata
830
+
831
+ @instance_group_managers_stub.insert request, options do |result, response|
832
+ result = ::Gapic::Rest::BaseOperation.new result
833
+ yield result, response if block_given?
834
+ return result
835
+ end
816
836
  rescue ::Faraday::Error => e
817
837
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
818
838
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -859,14 +879,14 @@ module Google
859
879
  # @param project [::String]
860
880
  # Project ID for this request.
861
881
  # @param return_partial_success [::Boolean]
862
- # 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.
882
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
863
883
  # @param zone [::String]
864
884
  # The name of the zone where the managed instance group is located.
865
- # @yield [result, env] Access the result along with the Faraday environment object
866
- # @yieldparam result [::Google::Cloud::Compute::V1::InstanceGroupManagerList]
885
+ # @yield [result, response] Access the result along with the Faraday response object
886
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InstanceGroupManager>]
867
887
  # @yieldparam response [::Faraday::Response]
868
888
  #
869
- # @return [::Google::Cloud::Compute::V1::InstanceGroupManagerList]
889
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InstanceGroupManager>]
870
890
  #
871
891
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
872
892
  def list request, options = nil
@@ -878,7 +898,7 @@ module Google
878
898
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
879
899
 
880
900
  # Customize the options with defaults
881
- call_metadata = {}
901
+ call_metadata = @config.rpcs.list.metadata.to_h
882
902
 
883
903
  # Set x-goog-api-client header
884
904
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -886,19 +906,17 @@ module Google
886
906
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
887
907
  transports_version_send: [:rest]
888
908
 
889
- options.apply_defaults timeout: @config.timeout,
909
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
890
910
  metadata: call_metadata
891
911
 
892
- uri, _body, query_string_params = transcode_list request
893
- response = @client_stub.make_get_request(
894
- uri: uri,
895
- params: query_string_params,
896
- options: options
897
- )
898
- result = ::Google::Cloud::Compute::V1::InstanceGroupManagerList.decode_json response.body, ignore_unknown_fields: true
912
+ options.apply_defaults timeout: @config.timeout,
913
+ metadata: @config.metadata
899
914
 
900
- yield result, response if block_given?
901
- result
915
+ @instance_group_managers_stub.list request, options do |result, response|
916
+ result = ::Gapic::Rest::PagedEnumerable.new @instance_group_managers_stub, :list, "items", request, result, options
917
+ yield result, response if block_given?
918
+ return result
919
+ end
902
920
  rescue ::Faraday::Error => e
903
921
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
904
922
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -947,14 +965,14 @@ module Google
947
965
  # @param project [::String]
948
966
  # Project ID for this request.
949
967
  # @param return_partial_success [::Boolean]
950
- # 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.
968
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
951
969
  # @param zone [::String]
952
970
  # The name of the zone where the managed instance group is located. It should conform to RFC1035.
953
- # @yield [result, env] Access the result along with the Faraday environment object
954
- # @yieldparam result [::Google::Cloud::Compute::V1::InstanceGroupManagersListErrorsResponse]
971
+ # @yield [result, response] Access the result along with the Faraday response object
972
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InstanceManagedByIgmError>]
955
973
  # @yieldparam response [::Faraday::Response]
956
974
  #
957
- # @return [::Google::Cloud::Compute::V1::InstanceGroupManagersListErrorsResponse]
975
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InstanceManagedByIgmError>]
958
976
  #
959
977
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
960
978
  def list_errors request, options = nil
@@ -966,7 +984,7 @@ module Google
966
984
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
967
985
 
968
986
  # Customize the options with defaults
969
- call_metadata = {}
987
+ call_metadata = @config.rpcs.list_errors.metadata.to_h
970
988
 
971
989
  # Set x-goog-api-client header
972
990
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -974,19 +992,17 @@ module Google
974
992
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
975
993
  transports_version_send: [:rest]
976
994
 
977
- options.apply_defaults timeout: @config.timeout,
995
+ options.apply_defaults timeout: @config.rpcs.list_errors.timeout,
978
996
  metadata: call_metadata
979
997
 
980
- uri, _body, query_string_params = transcode_list_errors request
981
- response = @client_stub.make_get_request(
982
- uri: uri,
983
- params: query_string_params,
984
- options: options
985
- )
986
- result = ::Google::Cloud::Compute::V1::InstanceGroupManagersListErrorsResponse.decode_json response.body, ignore_unknown_fields: true
998
+ options.apply_defaults timeout: @config.timeout,
999
+ metadata: @config.metadata
987
1000
 
988
- yield result, response if block_given?
989
- result
1001
+ @instance_group_managers_stub.list_errors request, options do |result, response|
1002
+ result = ::Gapic::Rest::PagedEnumerable.new @instance_group_managers_stub, :list_errors, "items", request, result, options
1003
+ yield result, response if block_given?
1004
+ return result
1005
+ end
990
1006
  rescue ::Faraday::Error => e
991
1007
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
992
1008
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -1035,14 +1051,14 @@ module Google
1035
1051
  # @param project [::String]
1036
1052
  # Project ID for this request.
1037
1053
  # @param return_partial_success [::Boolean]
1038
- # 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.
1054
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
1039
1055
  # @param zone [::String]
1040
1056
  # The name of the zone where the managed instance group is located.
1041
- # @yield [result, env] Access the result along with the Faraday environment object
1042
- # @yieldparam result [::Google::Cloud::Compute::V1::InstanceGroupManagersListManagedInstancesResponse]
1057
+ # @yield [result, response] Access the result along with the Faraday response object
1058
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::ManagedInstance>]
1043
1059
  # @yieldparam response [::Faraday::Response]
1044
1060
  #
1045
- # @return [::Google::Cloud::Compute::V1::InstanceGroupManagersListManagedInstancesResponse]
1061
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::ManagedInstance>]
1046
1062
  #
1047
1063
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1048
1064
  def list_managed_instances request, options = nil
@@ -1054,7 +1070,7 @@ module Google
1054
1070
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1055
1071
 
1056
1072
  # Customize the options with defaults
1057
- call_metadata = {}
1073
+ call_metadata = @config.rpcs.list_managed_instances.metadata.to_h
1058
1074
 
1059
1075
  # Set x-goog-api-client header
1060
1076
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -1062,19 +1078,17 @@ module Google
1062
1078
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1063
1079
  transports_version_send: [:rest]
1064
1080
 
1065
- options.apply_defaults timeout: @config.timeout,
1081
+ options.apply_defaults timeout: @config.rpcs.list_managed_instances.timeout,
1066
1082
  metadata: call_metadata
1067
1083
 
1068
- uri, _body, query_string_params = transcode_list_managed_instances request
1069
- response = @client_stub.make_post_request(
1070
- uri: uri,
1071
- params: query_string_params,
1072
- options: options
1073
- )
1074
- result = ::Google::Cloud::Compute::V1::InstanceGroupManagersListManagedInstancesResponse.decode_json response.body, ignore_unknown_fields: true
1084
+ options.apply_defaults timeout: @config.timeout,
1085
+ metadata: @config.metadata
1075
1086
 
1076
- yield result, response if block_given?
1077
- result
1087
+ @instance_group_managers_stub.list_managed_instances request, options do |result, response|
1088
+ result = ::Gapic::Rest::PagedEnumerable.new @instance_group_managers_stub, :list_managed_instances, "managed_instances", request, result, options
1089
+ yield result, response if block_given?
1090
+ return result
1091
+ end
1078
1092
  rescue ::Faraday::Error => e
1079
1093
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1080
1094
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -1123,14 +1137,14 @@ module Google
1123
1137
  # @param project [::String]
1124
1138
  # Project ID for this request.
1125
1139
  # @param return_partial_success [::Boolean]
1126
- # 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.
1140
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
1127
1141
  # @param zone [::String]
1128
1142
  # The name of the zone where the managed instance group is located. It should conform to RFC1035.
1129
- # @yield [result, env] Access the result along with the Faraday environment object
1130
- # @yieldparam result [::Google::Cloud::Compute::V1::InstanceGroupManagersListPerInstanceConfigsResp]
1143
+ # @yield [result, response] Access the result along with the Faraday response object
1144
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::PerInstanceConfig>]
1131
1145
  # @yieldparam response [::Faraday::Response]
1132
1146
  #
1133
- # @return [::Google::Cloud::Compute::V1::InstanceGroupManagersListPerInstanceConfigsResp]
1147
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::PerInstanceConfig>]
1134
1148
  #
1135
1149
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1136
1150
  def list_per_instance_configs request, options = nil
@@ -1142,7 +1156,7 @@ module Google
1142
1156
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1143
1157
 
1144
1158
  # Customize the options with defaults
1145
- call_metadata = {}
1159
+ call_metadata = @config.rpcs.list_per_instance_configs.metadata.to_h
1146
1160
 
1147
1161
  # Set x-goog-api-client header
1148
1162
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -1150,19 +1164,17 @@ module Google
1150
1164
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1151
1165
  transports_version_send: [:rest]
1152
1166
 
1153
- options.apply_defaults timeout: @config.timeout,
1167
+ options.apply_defaults timeout: @config.rpcs.list_per_instance_configs.timeout,
1154
1168
  metadata: call_metadata
1155
1169
 
1156
- uri, _body, query_string_params = transcode_list_per_instance_configs request
1157
- response = @client_stub.make_post_request(
1158
- uri: uri,
1159
- params: query_string_params,
1160
- options: options
1161
- )
1162
- result = ::Google::Cloud::Compute::V1::InstanceGroupManagersListPerInstanceConfigsResp.decode_json response.body, ignore_unknown_fields: true
1170
+ options.apply_defaults timeout: @config.timeout,
1171
+ metadata: @config.metadata
1163
1172
 
1164
- yield result, response if block_given?
1165
- result
1173
+ @instance_group_managers_stub.list_per_instance_configs request, options do |result, response|
1174
+ result = ::Gapic::Rest::PagedEnumerable.new @instance_group_managers_stub, :list_per_instance_configs, "items", request, result, options
1175
+ yield result, response if block_given?
1176
+ return result
1177
+ end
1166
1178
  rescue ::Faraday::Error => e
1167
1179
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1168
1180
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -1202,11 +1214,11 @@ module Google
1202
1214
  # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1203
1215
  # @param zone [::String]
1204
1216
  # The name of the zone where you want to create the managed instance group.
1205
- # @yield [result, env] Access the result along with the Faraday environment object
1206
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1217
+ # @yield [result, response] Access the result along with the Faraday response object
1218
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
1207
1219
  # @yieldparam response [::Faraday::Response]
1208
1220
  #
1209
- # @return [::Google::Cloud::Compute::V1::Operation]
1221
+ # @return [::Gapic::Rest::BaseOperation]
1210
1222
  #
1211
1223
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1212
1224
  def patch request, options = nil
@@ -1218,7 +1230,7 @@ module Google
1218
1230
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1219
1231
 
1220
1232
  # Customize the options with defaults
1221
- call_metadata = {}
1233
+ call_metadata = @config.rpcs.patch.metadata.to_h
1222
1234
 
1223
1235
  # Set x-goog-api-client header
1224
1236
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -1226,20 +1238,17 @@ module Google
1226
1238
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1227
1239
  transports_version_send: [:rest]
1228
1240
 
1229
- options.apply_defaults timeout: @config.timeout,
1241
+ options.apply_defaults timeout: @config.rpcs.patch.timeout,
1230
1242
  metadata: call_metadata
1231
1243
 
1232
- uri, body, query_string_params = transcode_patch request
1233
- response = @client_stub.make_patch_request(
1234
- uri: uri,
1235
- body: body,
1236
- params: query_string_params,
1237
- options: options
1238
- )
1239
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1240
-
1241
- yield result, response if block_given?
1242
- result
1244
+ options.apply_defaults timeout: @config.timeout,
1245
+ metadata: @config.metadata
1246
+
1247
+ @instance_group_managers_stub.patch request, options do |result, response|
1248
+ result = ::Gapic::Rest::BaseOperation.new result
1249
+ yield result, response if block_given?
1250
+ return result
1251
+ end
1243
1252
  rescue ::Faraday::Error => e
1244
1253
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1245
1254
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -1279,11 +1288,11 @@ module Google
1279
1288
  # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1280
1289
  # @param zone [::String]
1281
1290
  # The name of the zone where the managed instance group is located. It should conform to RFC1035.
1282
- # @yield [result, env] Access the result along with the Faraday environment object
1283
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1291
+ # @yield [result, response] Access the result along with the Faraday response object
1292
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
1284
1293
  # @yieldparam response [::Faraday::Response]
1285
1294
  #
1286
- # @return [::Google::Cloud::Compute::V1::Operation]
1295
+ # @return [::Gapic::Rest::BaseOperation]
1287
1296
  #
1288
1297
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1289
1298
  def patch_per_instance_configs request, options = nil
@@ -1295,7 +1304,7 @@ module Google
1295
1304
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1296
1305
 
1297
1306
  # Customize the options with defaults
1298
- call_metadata = {}
1307
+ call_metadata = @config.rpcs.patch_per_instance_configs.metadata.to_h
1299
1308
 
1300
1309
  # Set x-goog-api-client header
1301
1310
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -1303,27 +1312,24 @@ module Google
1303
1312
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1304
1313
  transports_version_send: [:rest]
1305
1314
 
1306
- options.apply_defaults timeout: @config.timeout,
1315
+ options.apply_defaults timeout: @config.rpcs.patch_per_instance_configs.timeout,
1307
1316
  metadata: call_metadata
1308
1317
 
1309
- uri, body, query_string_params = transcode_patch_per_instance_configs request
1310
- response = @client_stub.make_post_request(
1311
- uri: uri,
1312
- body: body,
1313
- params: query_string_params,
1314
- options: options
1315
- )
1316
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1317
-
1318
- yield result, response if block_given?
1319
- result
1318
+ options.apply_defaults timeout: @config.timeout,
1319
+ metadata: @config.metadata
1320
+
1321
+ @instance_group_managers_stub.patch_per_instance_configs request, options do |result, response|
1322
+ result = ::Gapic::Rest::BaseOperation.new result
1323
+ yield result, response if block_given?
1324
+ return result
1325
+ end
1320
1326
  rescue ::Faraday::Error => e
1321
1327
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1322
1328
  raise ::Google::Cloud::Error.from_error(gapic_error)
1323
1329
  end
1324
1330
 
1325
1331
  ##
1326
- # Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.
1332
+ # Flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group's current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances.
1327
1333
  #
1328
1334
  # If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
1329
1335
  #
@@ -1360,11 +1366,11 @@ module Google
1360
1366
  # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1361
1367
  # @param zone [::String]
1362
1368
  # The name of the zone where the managed instance group is located.
1363
- # @yield [result, env] Access the result along with the Faraday environment object
1364
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1369
+ # @yield [result, response] Access the result along with the Faraday response object
1370
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
1365
1371
  # @yieldparam response [::Faraday::Response]
1366
1372
  #
1367
- # @return [::Google::Cloud::Compute::V1::Operation]
1373
+ # @return [::Gapic::Rest::BaseOperation]
1368
1374
  #
1369
1375
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1370
1376
  def recreate_instances request, options = nil
@@ -1376,7 +1382,7 @@ module Google
1376
1382
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1377
1383
 
1378
1384
  # Customize the options with defaults
1379
- call_metadata = {}
1385
+ call_metadata = @config.rpcs.recreate_instances.metadata.to_h
1380
1386
 
1381
1387
  # Set x-goog-api-client header
1382
1388
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -1384,20 +1390,17 @@ module Google
1384
1390
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1385
1391
  transports_version_send: [:rest]
1386
1392
 
1387
- options.apply_defaults timeout: @config.timeout,
1393
+ options.apply_defaults timeout: @config.rpcs.recreate_instances.timeout,
1388
1394
  metadata: call_metadata
1389
1395
 
1390
- uri, body, query_string_params = transcode_recreate_instances request
1391
- response = @client_stub.make_post_request(
1392
- uri: uri,
1393
- body: body,
1394
- params: query_string_params,
1395
- options: options
1396
- )
1397
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1398
-
1399
- yield result, response if block_given?
1400
- result
1396
+ options.apply_defaults timeout: @config.timeout,
1397
+ metadata: @config.metadata
1398
+
1399
+ @instance_group_managers_stub.recreate_instances request, options do |result, response|
1400
+ result = ::Gapic::Rest::BaseOperation.new result
1401
+ yield result, response if block_given?
1402
+ return result
1403
+ end
1401
1404
  rescue ::Faraday::Error => e
1402
1405
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1403
1406
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -1445,11 +1448,11 @@ module Google
1445
1448
  # The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter.
1446
1449
  # @param zone [::String]
1447
1450
  # The name of the zone where the managed instance group is located.
1448
- # @yield [result, env] Access the result along with the Faraday environment object
1449
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1451
+ # @yield [result, response] Access the result along with the Faraday response object
1452
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
1450
1453
  # @yieldparam response [::Faraday::Response]
1451
1454
  #
1452
- # @return [::Google::Cloud::Compute::V1::Operation]
1455
+ # @return [::Gapic::Rest::BaseOperation]
1453
1456
  #
1454
1457
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1455
1458
  def resize request, options = nil
@@ -1461,7 +1464,7 @@ module Google
1461
1464
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1462
1465
 
1463
1466
  # Customize the options with defaults
1464
- call_metadata = {}
1467
+ call_metadata = @config.rpcs.resize.metadata.to_h
1465
1468
 
1466
1469
  # Set x-goog-api-client header
1467
1470
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -1469,19 +1472,17 @@ module Google
1469
1472
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1470
1473
  transports_version_send: [:rest]
1471
1474
 
1472
- options.apply_defaults timeout: @config.timeout,
1475
+ options.apply_defaults timeout: @config.rpcs.resize.timeout,
1473
1476
  metadata: call_metadata
1474
1477
 
1475
- uri, _body, query_string_params = transcode_resize request
1476
- response = @client_stub.make_post_request(
1477
- uri: uri,
1478
- params: query_string_params,
1479
- options: options
1480
- )
1481
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1478
+ options.apply_defaults timeout: @config.timeout,
1479
+ metadata: @config.metadata
1482
1480
 
1483
- yield result, response if block_given?
1484
- result
1481
+ @instance_group_managers_stub.resize request, options do |result, response|
1482
+ result = ::Gapic::Rest::BaseOperation.new result
1483
+ yield result, response if block_given?
1484
+ return result
1485
+ end
1485
1486
  rescue ::Faraday::Error => e
1486
1487
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1487
1488
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -1521,11 +1522,11 @@ module Google
1521
1522
  # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1522
1523
  # @param zone [::String]
1523
1524
  # The name of the zone where the managed instance group is located.
1524
- # @yield [result, env] Access the result along with the Faraday environment object
1525
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1525
+ # @yield [result, response] Access the result along with the Faraday response object
1526
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
1526
1527
  # @yieldparam response [::Faraday::Response]
1527
1528
  #
1528
- # @return [::Google::Cloud::Compute::V1::Operation]
1529
+ # @return [::Gapic::Rest::BaseOperation]
1529
1530
  #
1530
1531
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1531
1532
  def set_instance_template request, options = nil
@@ -1537,7 +1538,7 @@ module Google
1537
1538
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1538
1539
 
1539
1540
  # Customize the options with defaults
1540
- call_metadata = {}
1541
+ call_metadata = @config.rpcs.set_instance_template.metadata.to_h
1541
1542
 
1542
1543
  # Set x-goog-api-client header
1543
1544
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -1545,20 +1546,17 @@ module Google
1545
1546
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1546
1547
  transports_version_send: [:rest]
1547
1548
 
1548
- options.apply_defaults timeout: @config.timeout,
1549
+ options.apply_defaults timeout: @config.rpcs.set_instance_template.timeout,
1549
1550
  metadata: call_metadata
1550
1551
 
1551
- uri, body, query_string_params = transcode_set_instance_template request
1552
- response = @client_stub.make_post_request(
1553
- uri: uri,
1554
- body: body,
1555
- params: query_string_params,
1556
- options: options
1557
- )
1558
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1559
-
1560
- yield result, response if block_given?
1561
- result
1552
+ options.apply_defaults timeout: @config.timeout,
1553
+ metadata: @config.metadata
1554
+
1555
+ @instance_group_managers_stub.set_instance_template request, options do |result, response|
1556
+ result = ::Gapic::Rest::BaseOperation.new result
1557
+ yield result, response if block_given?
1558
+ return result
1559
+ end
1562
1560
  rescue ::Faraday::Error => e
1563
1561
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1564
1562
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -1598,11 +1596,11 @@ module Google
1598
1596
  # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1599
1597
  # @param zone [::String]
1600
1598
  # The name of the zone where the managed instance group is located.
1601
- # @yield [result, env] Access the result along with the Faraday environment object
1602
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1599
+ # @yield [result, response] Access the result along with the Faraday response object
1600
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
1603
1601
  # @yieldparam response [::Faraday::Response]
1604
1602
  #
1605
- # @return [::Google::Cloud::Compute::V1::Operation]
1603
+ # @return [::Gapic::Rest::BaseOperation]
1606
1604
  #
1607
1605
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1608
1606
  def set_target_pools request, options = nil
@@ -1614,7 +1612,7 @@ module Google
1614
1612
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1615
1613
 
1616
1614
  # Customize the options with defaults
1617
- call_metadata = {}
1615
+ call_metadata = @config.rpcs.set_target_pools.metadata.to_h
1618
1616
 
1619
1617
  # Set x-goog-api-client header
1620
1618
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -1622,20 +1620,17 @@ module Google
1622
1620
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1623
1621
  transports_version_send: [:rest]
1624
1622
 
1625
- options.apply_defaults timeout: @config.timeout,
1623
+ options.apply_defaults timeout: @config.rpcs.set_target_pools.timeout,
1626
1624
  metadata: call_metadata
1627
1625
 
1628
- uri, body, query_string_params = transcode_set_target_pools request
1629
- response = @client_stub.make_post_request(
1630
- uri: uri,
1631
- body: body,
1632
- params: query_string_params,
1633
- options: options
1634
- )
1635
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1636
-
1637
- yield result, response if block_given?
1638
- result
1626
+ options.apply_defaults timeout: @config.timeout,
1627
+ metadata: @config.metadata
1628
+
1629
+ @instance_group_managers_stub.set_target_pools request, options do |result, response|
1630
+ result = ::Gapic::Rest::BaseOperation.new result
1631
+ yield result, response if block_given?
1632
+ return result
1633
+ end
1639
1634
  rescue ::Faraday::Error => e
1640
1635
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1641
1636
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -1675,11 +1670,11 @@ module Google
1675
1670
  # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1676
1671
  # @param zone [::String]
1677
1672
  # The name of the zone where the managed instance group is located. It should conform to RFC1035.
1678
- # @yield [result, env] Access the result along with the Faraday environment object
1679
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1673
+ # @yield [result, response] Access the result along with the Faraday response object
1674
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
1680
1675
  # @yieldparam response [::Faraday::Response]
1681
1676
  #
1682
- # @return [::Google::Cloud::Compute::V1::Operation]
1677
+ # @return [::Gapic::Rest::BaseOperation]
1683
1678
  #
1684
1679
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1685
1680
  def update_per_instance_configs request, options = nil
@@ -1691,7 +1686,7 @@ module Google
1691
1686
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1692
1687
 
1693
1688
  # Customize the options with defaults
1694
- call_metadata = {}
1689
+ call_metadata = @config.rpcs.update_per_instance_configs.metadata.to_h
1695
1690
 
1696
1691
  # Set x-goog-api-client header
1697
1692
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -1699,20 +1694,17 @@ module Google
1699
1694
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1700
1695
  transports_version_send: [:rest]
1701
1696
 
1702
- options.apply_defaults timeout: @config.timeout,
1697
+ options.apply_defaults timeout: @config.rpcs.update_per_instance_configs.timeout,
1703
1698
  metadata: call_metadata
1704
1699
 
1705
- uri, body, query_string_params = transcode_update_per_instance_configs request
1706
- response = @client_stub.make_post_request(
1707
- uri: uri,
1708
- body: body,
1709
- params: query_string_params,
1710
- options: options
1711
- )
1712
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1713
-
1714
- yield result, response if block_given?
1715
- result
1700
+ options.apply_defaults timeout: @config.timeout,
1701
+ metadata: @config.metadata
1702
+
1703
+ @instance_group_managers_stub.update_per_instance_configs request, options do |result, response|
1704
+ result = ::Gapic::Rest::BaseOperation.new result
1705
+ yield result, response if block_given?
1706
+ return result
1707
+ end
1716
1708
  rescue ::Faraday::Error => e
1717
1709
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1718
1710
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -1767,6 +1759,9 @@ module Google
1767
1759
  # @!attribute [rw] timeout
1768
1760
  # The call timeout in seconds.
1769
1761
  # @return [::Numeric]
1762
+ # @!attribute [rw] metadata
1763
+ # Additional REST headers to be sent with the call.
1764
+ # @return [::Hash{::Symbol=>::String}]
1770
1765
  #
1771
1766
  class Configuration
1772
1767
  extend ::Gapic::Config
@@ -1780,6 +1775,7 @@ module Google
1780
1775
  config_attr :lib_name, nil, ::String, nil
1781
1776
  config_attr :lib_version, nil, ::String, nil
1782
1777
  config_attr :timeout, nil, ::Numeric, nil
1778
+ config_attr :metadata, nil, ::Hash, nil
1783
1779
 
1784
1780
  # @private
1785
1781
  def initialize parent_config = nil
@@ -1787,6 +1783,179 @@ module Google
1787
1783
 
1788
1784
  yield self if block_given?
1789
1785
  end
1786
+
1787
+ ##
1788
+ # Configurations for individual RPCs
1789
+ # @return [Rpcs]
1790
+ #
1791
+ def rpcs
1792
+ @rpcs ||= begin
1793
+ parent_rpcs = nil
1794
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1795
+ Rpcs.new parent_rpcs
1796
+ end
1797
+ end
1798
+
1799
+ ##
1800
+ # Configuration RPC class for the InstanceGroupManagers API.
1801
+ #
1802
+ # Includes fields providing the configuration for each RPC in this service.
1803
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1804
+ # the following configuration fields:
1805
+ #
1806
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1807
+ #
1808
+ # there is one other field (`retry_policy`) that can be set
1809
+ # but is currently not supported for REST Gapic libraries.
1810
+ #
1811
+ class Rpcs
1812
+ ##
1813
+ # RPC-specific configuration for `abandon_instances`
1814
+ # @return [::Gapic::Config::Method]
1815
+ #
1816
+ attr_reader :abandon_instances
1817
+ ##
1818
+ # RPC-specific configuration for `aggregated_list`
1819
+ # @return [::Gapic::Config::Method]
1820
+ #
1821
+ attr_reader :aggregated_list
1822
+ ##
1823
+ # RPC-specific configuration for `apply_updates_to_instances`
1824
+ # @return [::Gapic::Config::Method]
1825
+ #
1826
+ attr_reader :apply_updates_to_instances
1827
+ ##
1828
+ # RPC-specific configuration for `create_instances`
1829
+ # @return [::Gapic::Config::Method]
1830
+ #
1831
+ attr_reader :create_instances
1832
+ ##
1833
+ # RPC-specific configuration for `delete`
1834
+ # @return [::Gapic::Config::Method]
1835
+ #
1836
+ attr_reader :delete
1837
+ ##
1838
+ # RPC-specific configuration for `delete_instances`
1839
+ # @return [::Gapic::Config::Method]
1840
+ #
1841
+ attr_reader :delete_instances
1842
+ ##
1843
+ # RPC-specific configuration for `delete_per_instance_configs`
1844
+ # @return [::Gapic::Config::Method]
1845
+ #
1846
+ attr_reader :delete_per_instance_configs
1847
+ ##
1848
+ # RPC-specific configuration for `get`
1849
+ # @return [::Gapic::Config::Method]
1850
+ #
1851
+ attr_reader :get
1852
+ ##
1853
+ # RPC-specific configuration for `insert`
1854
+ # @return [::Gapic::Config::Method]
1855
+ #
1856
+ attr_reader :insert
1857
+ ##
1858
+ # RPC-specific configuration for `list`
1859
+ # @return [::Gapic::Config::Method]
1860
+ #
1861
+ attr_reader :list
1862
+ ##
1863
+ # RPC-specific configuration for `list_errors`
1864
+ # @return [::Gapic::Config::Method]
1865
+ #
1866
+ attr_reader :list_errors
1867
+ ##
1868
+ # RPC-specific configuration for `list_managed_instances`
1869
+ # @return [::Gapic::Config::Method]
1870
+ #
1871
+ attr_reader :list_managed_instances
1872
+ ##
1873
+ # RPC-specific configuration for `list_per_instance_configs`
1874
+ # @return [::Gapic::Config::Method]
1875
+ #
1876
+ attr_reader :list_per_instance_configs
1877
+ ##
1878
+ # RPC-specific configuration for `patch`
1879
+ # @return [::Gapic::Config::Method]
1880
+ #
1881
+ attr_reader :patch
1882
+ ##
1883
+ # RPC-specific configuration for `patch_per_instance_configs`
1884
+ # @return [::Gapic::Config::Method]
1885
+ #
1886
+ attr_reader :patch_per_instance_configs
1887
+ ##
1888
+ # RPC-specific configuration for `recreate_instances`
1889
+ # @return [::Gapic::Config::Method]
1890
+ #
1891
+ attr_reader :recreate_instances
1892
+ ##
1893
+ # RPC-specific configuration for `resize`
1894
+ # @return [::Gapic::Config::Method]
1895
+ #
1896
+ attr_reader :resize
1897
+ ##
1898
+ # RPC-specific configuration for `set_instance_template`
1899
+ # @return [::Gapic::Config::Method]
1900
+ #
1901
+ attr_reader :set_instance_template
1902
+ ##
1903
+ # RPC-specific configuration for `set_target_pools`
1904
+ # @return [::Gapic::Config::Method]
1905
+ #
1906
+ attr_reader :set_target_pools
1907
+ ##
1908
+ # RPC-specific configuration for `update_per_instance_configs`
1909
+ # @return [::Gapic::Config::Method]
1910
+ #
1911
+ attr_reader :update_per_instance_configs
1912
+
1913
+ # @private
1914
+ def initialize parent_rpcs = nil
1915
+ abandon_instances_config = parent_rpcs.abandon_instances if parent_rpcs.respond_to? :abandon_instances
1916
+ @abandon_instances = ::Gapic::Config::Method.new abandon_instances_config
1917
+ aggregated_list_config = parent_rpcs.aggregated_list if parent_rpcs.respond_to? :aggregated_list
1918
+ @aggregated_list = ::Gapic::Config::Method.new aggregated_list_config
1919
+ apply_updates_to_instances_config = parent_rpcs.apply_updates_to_instances if parent_rpcs.respond_to? :apply_updates_to_instances
1920
+ @apply_updates_to_instances = ::Gapic::Config::Method.new apply_updates_to_instances_config
1921
+ create_instances_config = parent_rpcs.create_instances if parent_rpcs.respond_to? :create_instances
1922
+ @create_instances = ::Gapic::Config::Method.new create_instances_config
1923
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
1924
+ @delete = ::Gapic::Config::Method.new delete_config
1925
+ delete_instances_config = parent_rpcs.delete_instances if parent_rpcs.respond_to? :delete_instances
1926
+ @delete_instances = ::Gapic::Config::Method.new delete_instances_config
1927
+ delete_per_instance_configs_config = parent_rpcs.delete_per_instance_configs if parent_rpcs.respond_to? :delete_per_instance_configs
1928
+ @delete_per_instance_configs = ::Gapic::Config::Method.new delete_per_instance_configs_config
1929
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
1930
+ @get = ::Gapic::Config::Method.new get_config
1931
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
1932
+ @insert = ::Gapic::Config::Method.new insert_config
1933
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
1934
+ @list = ::Gapic::Config::Method.new list_config
1935
+ list_errors_config = parent_rpcs.list_errors if parent_rpcs.respond_to? :list_errors
1936
+ @list_errors = ::Gapic::Config::Method.new list_errors_config
1937
+ list_managed_instances_config = parent_rpcs.list_managed_instances if parent_rpcs.respond_to? :list_managed_instances
1938
+ @list_managed_instances = ::Gapic::Config::Method.new list_managed_instances_config
1939
+ list_per_instance_configs_config = parent_rpcs.list_per_instance_configs if parent_rpcs.respond_to? :list_per_instance_configs
1940
+ @list_per_instance_configs = ::Gapic::Config::Method.new list_per_instance_configs_config
1941
+ patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
1942
+ @patch = ::Gapic::Config::Method.new patch_config
1943
+ patch_per_instance_configs_config = parent_rpcs.patch_per_instance_configs if parent_rpcs.respond_to? :patch_per_instance_configs
1944
+ @patch_per_instance_configs = ::Gapic::Config::Method.new patch_per_instance_configs_config
1945
+ recreate_instances_config = parent_rpcs.recreate_instances if parent_rpcs.respond_to? :recreate_instances
1946
+ @recreate_instances = ::Gapic::Config::Method.new recreate_instances_config
1947
+ resize_config = parent_rpcs.resize if parent_rpcs.respond_to? :resize
1948
+ @resize = ::Gapic::Config::Method.new resize_config
1949
+ set_instance_template_config = parent_rpcs.set_instance_template if parent_rpcs.respond_to? :set_instance_template
1950
+ @set_instance_template = ::Gapic::Config::Method.new set_instance_template_config
1951
+ set_target_pools_config = parent_rpcs.set_target_pools if parent_rpcs.respond_to? :set_target_pools
1952
+ @set_target_pools = ::Gapic::Config::Method.new set_target_pools_config
1953
+ update_per_instance_configs_config = parent_rpcs.update_per_instance_configs if parent_rpcs.respond_to? :update_per_instance_configs
1954
+ @update_per_instance_configs = ::Gapic::Config::Method.new update_per_instance_configs_config
1955
+
1956
+ yield self if block_given?
1957
+ end
1958
+ end
1790
1959
  end
1791
1960
  end
1792
1961
  end