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/network_endpoint_groups/rest/grpc_transcoding"
21
19
  require "google/cloud/compute/v1/network_endpoint_groups/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/networks/rest/service_stub"
21
22
 
22
23
  module Google
23
24
  module Cloud
@@ -31,8 +32,6 @@ module Google
31
32
  # The Networks API.
32
33
  #
33
34
  class Client
34
- include GrpcTranscoding
35
-
36
35
  # @private
37
36
  attr_reader :networks_stub
38
37
 
@@ -42,13 +41,12 @@ module Google
42
41
  # See {::Google::Cloud::Compute::V1::Networks::Rest::Client::Configuration}
43
42
  # for a description of the configuration fields.
44
43
  #
45
- # ## Example
46
- #
47
- # To modify the configuration for all Networks clients:
44
+ # @example
48
45
  #
49
- # ::Google::Cloud::Compute::V1::Networks::Rest::Client.configure do |config|
50
- # config.timeout = 10.0
51
- # end
46
+ # # Modify the configuration for all Networks clients
47
+ # ::Google::Cloud::Compute::V1::Networks::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.add_peering.timeout = 600.0
68
+
69
+ default_config.rpcs.delete.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_effective_firewalls.timeout = 600.0
77
+ default_config.rpcs.get_effective_firewalls.retry_policy = {
78
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
79
+ }
80
+
81
+ default_config.rpcs.insert.timeout = 600.0
82
+
83
+ default_config.rpcs.list.timeout = 600.0
84
+ default_config.rpcs.list.retry_policy = {
85
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
86
+ }
87
+
88
+ default_config.rpcs.list_peering_routes.timeout = 600.0
89
+ default_config.rpcs.list_peering_routes.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.remove_peering.timeout = 600.0
96
+
97
+ default_config.rpcs.switch_to_custom_mode.timeout = 600.0
98
+
99
+ default_config.rpcs.update_peering.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 Networks REST client object.
97
129
  #
98
- # ## Examples
130
+ # @example
99
131
  #
100
- # To create a new Networks REST client with the default
101
- # configuration:
132
+ # # Create a client using the default configuration
133
+ # client = ::Google::Cloud::Compute::V1::Networks::Rest::Client.new
102
134
  #
103
- # client = ::Google::Cloud::Compute::V1::Networks::Rest::Client.new
104
- #
105
- # To create a new Networks REST client with a custom
106
- # configuration:
107
- #
108
- # client = ::Google::Cloud::Compute::V1::Networks::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::Networks::Rest::Client.new do |config|
137
+ # config.timeout = 10.0
138
+ # end
111
139
  #
112
140
  # @yield [config] Configure the Networks 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
+ @networks_stub = ::Google::Cloud::Compute::V1::Networks::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
134
158
  end
135
159
 
136
160
  # Service calls
@@ -167,11 +191,11 @@ module Google
167
191
  # For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
168
192
  #
169
193
  # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
170
- # @yield [result, env] Access the result along with the Faraday environment object
171
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
194
+ # @yield [result, response] Access the result along with the Faraday response object
195
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
172
196
  # @yieldparam response [::Faraday::Response]
173
197
  #
174
- # @return [::Google::Cloud::Compute::V1::Operation]
198
+ # @return [::Gapic::Rest::BaseOperation]
175
199
  #
176
200
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
177
201
  def add_peering request, options = nil
@@ -183,7 +207,7 @@ module Google
183
207
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
184
208
 
185
209
  # Customize the options with defaults
186
- call_metadata = {}
210
+ call_metadata = @config.rpcs.add_peering.metadata.to_h
187
211
 
188
212
  # Set x-goog-api-client header
189
213
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -191,20 +215,17 @@ module Google
191
215
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
192
216
  transports_version_send: [:rest]
193
217
 
194
- options.apply_defaults timeout: @config.timeout,
218
+ options.apply_defaults timeout: @config.rpcs.add_peering.timeout,
195
219
  metadata: call_metadata
196
220
 
197
- uri, body, query_string_params = transcode_add_peering request
198
- response = @client_stub.make_post_request(
199
- uri: uri,
200
- body: body,
201
- params: query_string_params,
202
- options: options
203
- )
204
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
205
-
206
- yield result, response if block_given?
207
- result
221
+ options.apply_defaults timeout: @config.timeout,
222
+ metadata: @config.metadata
223
+
224
+ @networks_stub.add_peering request, options do |result, response|
225
+ result = ::Gapic::Rest::BaseOperation.new result
226
+ yield result, response if block_given?
227
+ return result
228
+ end
208
229
  rescue ::Faraday::Error => e
209
230
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
210
231
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -240,11 +261,11 @@ module Google
240
261
  # 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.
241
262
  #
242
263
  # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
243
- # @yield [result, env] Access the result along with the Faraday environment object
244
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
264
+ # @yield [result, response] Access the result along with the Faraday response object
265
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
245
266
  # @yieldparam response [::Faraday::Response]
246
267
  #
247
- # @return [::Google::Cloud::Compute::V1::Operation]
268
+ # @return [::Gapic::Rest::BaseOperation]
248
269
  #
249
270
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
250
271
  def delete request, options = nil
@@ -256,7 +277,7 @@ module Google
256
277
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
257
278
 
258
279
  # Customize the options with defaults
259
- call_metadata = {}
280
+ call_metadata = @config.rpcs.delete.metadata.to_h
260
281
 
261
282
  # Set x-goog-api-client header
262
283
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -264,19 +285,17 @@ module Google
264
285
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
265
286
  transports_version_send: [:rest]
266
287
 
267
- options.apply_defaults timeout: @config.timeout,
288
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
268
289
  metadata: call_metadata
269
290
 
270
- uri, _body, query_string_params = transcode_delete request
271
- response = @client_stub.make_delete_request(
272
- uri: uri,
273
- params: query_string_params,
274
- options: options
275
- )
276
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
291
+ options.apply_defaults timeout: @config.timeout,
292
+ metadata: @config.metadata
277
293
 
278
- yield result, response if block_given?
279
- result
294
+ @networks_stub.delete request, options do |result, response|
295
+ result = ::Gapic::Rest::BaseOperation.new result
296
+ yield result, response if block_given?
297
+ return result
298
+ end
280
299
  rescue ::Faraday::Error => e
281
300
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
282
301
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -306,7 +325,7 @@ module Google
306
325
  # Name of the network to return.
307
326
  # @param project [::String]
308
327
  # Project ID for this request.
309
- # @yield [result, env] Access the result along with the Faraday environment object
328
+ # @yield [result, response] Access the result along with the Faraday response object
310
329
  # @yieldparam result [::Google::Cloud::Compute::V1::Network]
311
330
  # @yieldparam response [::Faraday::Response]
312
331
  #
@@ -322,7 +341,7 @@ module Google
322
341
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
323
342
 
324
343
  # Customize the options with defaults
325
- call_metadata = {}
344
+ call_metadata = @config.rpcs.get.metadata.to_h
326
345
 
327
346
  # Set x-goog-api-client header
328
347
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -330,18 +349,79 @@ module Google
330
349
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
331
350
  transports_version_send: [:rest]
332
351
 
352
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
353
+ metadata: call_metadata
354
+
333
355
  options.apply_defaults timeout: @config.timeout,
356
+ metadata: @config.metadata
357
+
358
+ @networks_stub.get request, options do |result, response|
359
+ yield result, response if block_given?
360
+ return result
361
+ end
362
+ rescue ::Faraday::Error => e
363
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
364
+ raise ::Google::Cloud::Error.from_error(gapic_error)
365
+ end
366
+
367
+ ##
368
+ # Returns the effective firewalls on a given network.
369
+ #
370
+ # @overload get_effective_firewalls(request, options = nil)
371
+ # Pass arguments to `get_effective_firewalls` via a request object, either of type
372
+ # {::Google::Cloud::Compute::V1::GetEffectiveFirewallsNetworkRequest} or an equivalent Hash.
373
+ #
374
+ # @param request [::Google::Cloud::Compute::V1::GetEffectiveFirewallsNetworkRequest, ::Hash]
375
+ # A request object representing the call parameters. Required. To specify no
376
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
377
+ # @param options [::Gapic::CallOptions, ::Hash]
378
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
379
+ # Note: currently retry functionality is not implemented. While it is possible
380
+ # to set it using ::Gapic::CallOptions, it will not be applied
381
+ #
382
+ # @overload get_effective_firewalls(network: nil, project: nil)
383
+ # Pass arguments to `get_effective_firewalls` via keyword arguments. Note that at
384
+ # least one keyword argument is required. To specify no parameters, or to keep all
385
+ # the default parameter values, pass an empty Hash as a request object (see above).
386
+ #
387
+ # @param network [::String]
388
+ # Name of the network for this request.
389
+ # @param project [::String]
390
+ # Project ID for this request.
391
+ # @yield [result, response] Access the result along with the Faraday response object
392
+ # @yieldparam result [::Google::Cloud::Compute::V1::NetworksGetEffectiveFirewallsResponse]
393
+ # @yieldparam response [::Faraday::Response]
394
+ #
395
+ # @return [::Google::Cloud::Compute::V1::NetworksGetEffectiveFirewallsResponse]
396
+ #
397
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
398
+ def get_effective_firewalls request, options = nil
399
+ raise ::ArgumentError, "request must be provided" if request.nil?
400
+
401
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetEffectiveFirewallsNetworkRequest
402
+
403
+ # Converts hash and nil to an options object
404
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
405
+
406
+ # Customize the options with defaults
407
+ call_metadata = @config.rpcs.get_effective_firewalls.metadata.to_h
408
+
409
+ # Set x-goog-api-client header
410
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
411
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
412
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
413
+ transports_version_send: [:rest]
414
+
415
+ options.apply_defaults timeout: @config.rpcs.get_effective_firewalls.timeout,
334
416
  metadata: call_metadata
335
417
 
336
- uri, _body, _query_string_params = transcode_get request
337
- response = @client_stub.make_get_request(
338
- uri: uri,
339
- options: options
340
- )
341
- result = ::Google::Cloud::Compute::V1::Network.decode_json response.body, ignore_unknown_fields: true
418
+ options.apply_defaults timeout: @config.timeout,
419
+ metadata: @config.metadata
342
420
 
343
- yield result, response if block_given?
344
- result
421
+ @networks_stub.get_effective_firewalls request, options do |result, response|
422
+ yield result, response if block_given?
423
+ return result
424
+ end
345
425
  rescue ::Faraday::Error => e
346
426
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
347
427
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -377,11 +457,11 @@ module Google
377
457
  # 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.
378
458
  #
379
459
  # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
380
- # @yield [result, env] Access the result along with the Faraday environment object
381
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
460
+ # @yield [result, response] Access the result along with the Faraday response object
461
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
382
462
  # @yieldparam response [::Faraday::Response]
383
463
  #
384
- # @return [::Google::Cloud::Compute::V1::Operation]
464
+ # @return [::Gapic::Rest::BaseOperation]
385
465
  #
386
466
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
387
467
  def insert request, options = nil
@@ -393,7 +473,7 @@ module Google
393
473
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
394
474
 
395
475
  # Customize the options with defaults
396
- call_metadata = {}
476
+ call_metadata = @config.rpcs.insert.metadata.to_h
397
477
 
398
478
  # Set x-goog-api-client header
399
479
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -401,20 +481,17 @@ module Google
401
481
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
402
482
  transports_version_send: [:rest]
403
483
 
404
- options.apply_defaults timeout: @config.timeout,
484
+ options.apply_defaults timeout: @config.rpcs.insert.timeout,
405
485
  metadata: call_metadata
406
486
 
407
- uri, body, query_string_params = transcode_insert request
408
- response = @client_stub.make_post_request(
409
- uri: uri,
410
- body: body,
411
- params: query_string_params,
412
- options: options
413
- )
414
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
415
-
416
- yield result, response if block_given?
417
- result
487
+ options.apply_defaults timeout: @config.timeout,
488
+ metadata: @config.metadata
489
+
490
+ @networks_stub.insert request, options do |result, response|
491
+ result = ::Gapic::Rest::BaseOperation.new result
492
+ yield result, response if block_given?
493
+ return result
494
+ end
418
495
  rescue ::Faraday::Error => e
419
496
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
420
497
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -461,12 +538,12 @@ module Google
461
538
  # @param project [::String]
462
539
  # Project ID for this request.
463
540
  # @param return_partial_success [::Boolean]
464
- # 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.
465
- # @yield [result, env] Access the result along with the Faraday environment object
466
- # @yieldparam result [::Google::Cloud::Compute::V1::NetworkList]
541
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
542
+ # @yield [result, response] Access the result along with the Faraday response object
543
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Network>]
467
544
  # @yieldparam response [::Faraday::Response]
468
545
  #
469
- # @return [::Google::Cloud::Compute::V1::NetworkList]
546
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Network>]
470
547
  #
471
548
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
472
549
  def list request, options = nil
@@ -478,7 +555,7 @@ module Google
478
555
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
479
556
 
480
557
  # Customize the options with defaults
481
- call_metadata = {}
558
+ call_metadata = @config.rpcs.list.metadata.to_h
482
559
 
483
560
  # Set x-goog-api-client header
484
561
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -486,19 +563,17 @@ module Google
486
563
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
487
564
  transports_version_send: [:rest]
488
565
 
489
- options.apply_defaults timeout: @config.timeout,
566
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
490
567
  metadata: call_metadata
491
568
 
492
- uri, _body, query_string_params = transcode_list request
493
- response = @client_stub.make_get_request(
494
- uri: uri,
495
- params: query_string_params,
496
- options: options
497
- )
498
- result = ::Google::Cloud::Compute::V1::NetworkList.decode_json response.body, ignore_unknown_fields: true
569
+ options.apply_defaults timeout: @config.timeout,
570
+ metadata: @config.metadata
499
571
 
500
- yield result, response if block_given?
501
- result
572
+ @networks_stub.list request, options do |result, response|
573
+ result = ::Gapic::Rest::PagedEnumerable.new @networks_stub, :list, "items", request, result, options
574
+ yield result, response if block_given?
575
+ return result
576
+ end
502
577
  rescue ::Faraday::Error => e
503
578
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
504
579
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -553,12 +628,12 @@ module Google
553
628
  # @param region [::String]
554
629
  # The region of the request. The response will include all subnet routes, static routes and dynamic routes in the region.
555
630
  # @param return_partial_success [::Boolean]
556
- # 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.
557
- # @yield [result, env] Access the result along with the Faraday environment object
558
- # @yieldparam result [::Google::Cloud::Compute::V1::ExchangedPeeringRoutesList]
631
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
632
+ # @yield [result, response] Access the result along with the Faraday response object
633
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::ExchangedPeeringRoute>]
559
634
  # @yieldparam response [::Faraday::Response]
560
635
  #
561
- # @return [::Google::Cloud::Compute::V1::ExchangedPeeringRoutesList]
636
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::ExchangedPeeringRoute>]
562
637
  #
563
638
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
564
639
  def list_peering_routes request, options = nil
@@ -570,7 +645,7 @@ module Google
570
645
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
571
646
 
572
647
  # Customize the options with defaults
573
- call_metadata = {}
648
+ call_metadata = @config.rpcs.list_peering_routes.metadata.to_h
574
649
 
575
650
  # Set x-goog-api-client header
576
651
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -578,19 +653,17 @@ module Google
578
653
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
579
654
  transports_version_send: [:rest]
580
655
 
581
- options.apply_defaults timeout: @config.timeout,
656
+ options.apply_defaults timeout: @config.rpcs.list_peering_routes.timeout,
582
657
  metadata: call_metadata
583
658
 
584
- uri, _body, query_string_params = transcode_list_peering_routes request
585
- response = @client_stub.make_get_request(
586
- uri: uri,
587
- params: query_string_params,
588
- options: options
589
- )
590
- result = ::Google::Cloud::Compute::V1::ExchangedPeeringRoutesList.decode_json response.body, ignore_unknown_fields: true
659
+ options.apply_defaults timeout: @config.timeout,
660
+ metadata: @config.metadata
591
661
 
592
- yield result, response if block_given?
593
- result
662
+ @networks_stub.list_peering_routes request, options do |result, response|
663
+ result = ::Gapic::Rest::PagedEnumerable.new @networks_stub, :list_peering_routes, "items", request, result, options
664
+ yield result, response if block_given?
665
+ return result
666
+ end
594
667
  rescue ::Faraday::Error => e
595
668
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
596
669
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -628,11 +701,11 @@ module Google
628
701
  # 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.
629
702
  #
630
703
  # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
631
- # @yield [result, env] Access the result along with the Faraday environment object
632
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
704
+ # @yield [result, response] Access the result along with the Faraday response object
705
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
633
706
  # @yieldparam response [::Faraday::Response]
634
707
  #
635
- # @return [::Google::Cloud::Compute::V1::Operation]
708
+ # @return [::Gapic::Rest::BaseOperation]
636
709
  #
637
710
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
638
711
  def patch request, options = nil
@@ -644,7 +717,7 @@ module Google
644
717
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
645
718
 
646
719
  # Customize the options with defaults
647
- call_metadata = {}
720
+ call_metadata = @config.rpcs.patch.metadata.to_h
648
721
 
649
722
  # Set x-goog-api-client header
650
723
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -652,20 +725,17 @@ module Google
652
725
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
653
726
  transports_version_send: [:rest]
654
727
 
655
- options.apply_defaults timeout: @config.timeout,
728
+ options.apply_defaults timeout: @config.rpcs.patch.timeout,
656
729
  metadata: call_metadata
657
730
 
658
- uri, body, query_string_params = transcode_patch request
659
- response = @client_stub.make_patch_request(
660
- uri: uri,
661
- body: body,
662
- params: query_string_params,
663
- options: options
664
- )
665
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
666
-
667
- yield result, response if block_given?
668
- result
731
+ options.apply_defaults timeout: @config.timeout,
732
+ metadata: @config.metadata
733
+
734
+ @networks_stub.patch request, options do |result, response|
735
+ result = ::Gapic::Rest::BaseOperation.new result
736
+ yield result, response if block_given?
737
+ return result
738
+ end
669
739
  rescue ::Faraday::Error => e
670
740
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
671
741
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -703,11 +773,11 @@ module Google
703
773
  # 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.
704
774
  #
705
775
  # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
706
- # @yield [result, env] Access the result along with the Faraday environment object
707
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
776
+ # @yield [result, response] Access the result along with the Faraday response object
777
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
708
778
  # @yieldparam response [::Faraday::Response]
709
779
  #
710
- # @return [::Google::Cloud::Compute::V1::Operation]
780
+ # @return [::Gapic::Rest::BaseOperation]
711
781
  #
712
782
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
713
783
  def remove_peering request, options = nil
@@ -719,7 +789,7 @@ module Google
719
789
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
720
790
 
721
791
  # Customize the options with defaults
722
- call_metadata = {}
792
+ call_metadata = @config.rpcs.remove_peering.metadata.to_h
723
793
 
724
794
  # Set x-goog-api-client header
725
795
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -727,20 +797,17 @@ module Google
727
797
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
728
798
  transports_version_send: [:rest]
729
799
 
730
- options.apply_defaults timeout: @config.timeout,
800
+ options.apply_defaults timeout: @config.rpcs.remove_peering.timeout,
731
801
  metadata: call_metadata
732
802
 
733
- uri, body, query_string_params = transcode_remove_peering request
734
- response = @client_stub.make_post_request(
735
- uri: uri,
736
- body: body,
737
- params: query_string_params,
738
- options: options
739
- )
740
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
741
-
742
- yield result, response if block_given?
743
- result
803
+ options.apply_defaults timeout: @config.timeout,
804
+ metadata: @config.metadata
805
+
806
+ @networks_stub.remove_peering request, options do |result, response|
807
+ result = ::Gapic::Rest::BaseOperation.new result
808
+ yield result, response if block_given?
809
+ return result
810
+ end
744
811
  rescue ::Faraday::Error => e
745
812
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
746
813
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -776,11 +843,11 @@ module Google
776
843
  # 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.
777
844
  #
778
845
  # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
779
- # @yield [result, env] Access the result along with the Faraday environment object
780
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
846
+ # @yield [result, response] Access the result along with the Faraday response object
847
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
781
848
  # @yieldparam response [::Faraday::Response]
782
849
  #
783
- # @return [::Google::Cloud::Compute::V1::Operation]
850
+ # @return [::Gapic::Rest::BaseOperation]
784
851
  #
785
852
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
786
853
  def switch_to_custom_mode request, options = nil
@@ -792,7 +859,7 @@ module Google
792
859
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
793
860
 
794
861
  # Customize the options with defaults
795
- call_metadata = {}
862
+ call_metadata = @config.rpcs.switch_to_custom_mode.metadata.to_h
796
863
 
797
864
  # Set x-goog-api-client header
798
865
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -800,19 +867,17 @@ module Google
800
867
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
801
868
  transports_version_send: [:rest]
802
869
 
803
- options.apply_defaults timeout: @config.timeout,
870
+ options.apply_defaults timeout: @config.rpcs.switch_to_custom_mode.timeout,
804
871
  metadata: call_metadata
805
872
 
806
- uri, _body, query_string_params = transcode_switch_to_custom_mode request
807
- response = @client_stub.make_post_request(
808
- uri: uri,
809
- params: query_string_params,
810
- options: options
811
- )
812
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
873
+ options.apply_defaults timeout: @config.timeout,
874
+ metadata: @config.metadata
813
875
 
814
- yield result, response if block_given?
815
- result
876
+ @networks_stub.switch_to_custom_mode request, options do |result, response|
877
+ result = ::Gapic::Rest::BaseOperation.new result
878
+ yield result, response if block_given?
879
+ return result
880
+ end
816
881
  rescue ::Faraday::Error => e
817
882
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
818
883
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -850,11 +915,11 @@ module Google
850
915
  # 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.
851
916
  #
852
917
  # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
853
- # @yield [result, env] Access the result along with the Faraday environment object
854
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
918
+ # @yield [result, response] Access the result along with the Faraday response object
919
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
855
920
  # @yieldparam response [::Faraday::Response]
856
921
  #
857
- # @return [::Google::Cloud::Compute::V1::Operation]
922
+ # @return [::Gapic::Rest::BaseOperation]
858
923
  #
859
924
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
860
925
  def update_peering request, options = nil
@@ -866,7 +931,7 @@ module Google
866
931
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
867
932
 
868
933
  # Customize the options with defaults
869
- call_metadata = {}
934
+ call_metadata = @config.rpcs.update_peering.metadata.to_h
870
935
 
871
936
  # Set x-goog-api-client header
872
937
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -874,20 +939,17 @@ module Google
874
939
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
875
940
  transports_version_send: [:rest]
876
941
 
877
- options.apply_defaults timeout: @config.timeout,
942
+ options.apply_defaults timeout: @config.rpcs.update_peering.timeout,
878
943
  metadata: call_metadata
879
944
 
880
- uri, body, query_string_params = transcode_update_peering request
881
- response = @client_stub.make_patch_request(
882
- uri: uri,
883
- body: body,
884
- params: query_string_params,
885
- options: options
886
- )
887
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
888
-
889
- yield result, response if block_given?
890
- result
945
+ options.apply_defaults timeout: @config.timeout,
946
+ metadata: @config.metadata
947
+
948
+ @networks_stub.update_peering request, options do |result, response|
949
+ result = ::Gapic::Rest::BaseOperation.new result
950
+ yield result, response if block_given?
951
+ return result
952
+ end
891
953
  rescue ::Faraday::Error => e
892
954
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
893
955
  raise ::Google::Cloud::Error.from_error(gapic_error)
@@ -942,6 +1004,9 @@ module Google
942
1004
  # @!attribute [rw] timeout
943
1005
  # The call timeout in seconds.
944
1006
  # @return [::Numeric]
1007
+ # @!attribute [rw] metadata
1008
+ # Additional REST headers to be sent with the call.
1009
+ # @return [::Hash{::Symbol=>::String}]
945
1010
  #
946
1011
  class Configuration
947
1012
  extend ::Gapic::Config
@@ -955,6 +1020,7 @@ module Google
955
1020
  config_attr :lib_name, nil, ::String, nil
956
1021
  config_attr :lib_version, nil, ::String, nil
957
1022
  config_attr :timeout, nil, ::Numeric, nil
1023
+ config_attr :metadata, nil, ::Hash, nil
958
1024
 
959
1025
  # @private
960
1026
  def initialize parent_config = nil
@@ -962,6 +1028,116 @@ module Google
962
1028
 
963
1029
  yield self if block_given?
964
1030
  end
1031
+
1032
+ ##
1033
+ # Configurations for individual RPCs
1034
+ # @return [Rpcs]
1035
+ #
1036
+ def rpcs
1037
+ @rpcs ||= begin
1038
+ parent_rpcs = nil
1039
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1040
+ Rpcs.new parent_rpcs
1041
+ end
1042
+ end
1043
+
1044
+ ##
1045
+ # Configuration RPC class for the Networks API.
1046
+ #
1047
+ # Includes fields providing the configuration for each RPC in this service.
1048
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1049
+ # the following configuration fields:
1050
+ #
1051
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1052
+ #
1053
+ # there is one other field (`retry_policy`) that can be set
1054
+ # but is currently not supported for REST Gapic libraries.
1055
+ #
1056
+ class Rpcs
1057
+ ##
1058
+ # RPC-specific configuration for `add_peering`
1059
+ # @return [::Gapic::Config::Method]
1060
+ #
1061
+ attr_reader :add_peering
1062
+ ##
1063
+ # RPC-specific configuration for `delete`
1064
+ # @return [::Gapic::Config::Method]
1065
+ #
1066
+ attr_reader :delete
1067
+ ##
1068
+ # RPC-specific configuration for `get`
1069
+ # @return [::Gapic::Config::Method]
1070
+ #
1071
+ attr_reader :get
1072
+ ##
1073
+ # RPC-specific configuration for `get_effective_firewalls`
1074
+ # @return [::Gapic::Config::Method]
1075
+ #
1076
+ attr_reader :get_effective_firewalls
1077
+ ##
1078
+ # RPC-specific configuration for `insert`
1079
+ # @return [::Gapic::Config::Method]
1080
+ #
1081
+ attr_reader :insert
1082
+ ##
1083
+ # RPC-specific configuration for `list`
1084
+ # @return [::Gapic::Config::Method]
1085
+ #
1086
+ attr_reader :list
1087
+ ##
1088
+ # RPC-specific configuration for `list_peering_routes`
1089
+ # @return [::Gapic::Config::Method]
1090
+ #
1091
+ attr_reader :list_peering_routes
1092
+ ##
1093
+ # RPC-specific configuration for `patch`
1094
+ # @return [::Gapic::Config::Method]
1095
+ #
1096
+ attr_reader :patch
1097
+ ##
1098
+ # RPC-specific configuration for `remove_peering`
1099
+ # @return [::Gapic::Config::Method]
1100
+ #
1101
+ attr_reader :remove_peering
1102
+ ##
1103
+ # RPC-specific configuration for `switch_to_custom_mode`
1104
+ # @return [::Gapic::Config::Method]
1105
+ #
1106
+ attr_reader :switch_to_custom_mode
1107
+ ##
1108
+ # RPC-specific configuration for `update_peering`
1109
+ # @return [::Gapic::Config::Method]
1110
+ #
1111
+ attr_reader :update_peering
1112
+
1113
+ # @private
1114
+ def initialize parent_rpcs = nil
1115
+ add_peering_config = parent_rpcs.add_peering if parent_rpcs.respond_to? :add_peering
1116
+ @add_peering = ::Gapic::Config::Method.new add_peering_config
1117
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
1118
+ @delete = ::Gapic::Config::Method.new delete_config
1119
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
1120
+ @get = ::Gapic::Config::Method.new get_config
1121
+ get_effective_firewalls_config = parent_rpcs.get_effective_firewalls if parent_rpcs.respond_to? :get_effective_firewalls
1122
+ @get_effective_firewalls = ::Gapic::Config::Method.new get_effective_firewalls_config
1123
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
1124
+ @insert = ::Gapic::Config::Method.new insert_config
1125
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
1126
+ @list = ::Gapic::Config::Method.new list_config
1127
+ list_peering_routes_config = parent_rpcs.list_peering_routes if parent_rpcs.respond_to? :list_peering_routes
1128
+ @list_peering_routes = ::Gapic::Config::Method.new list_peering_routes_config
1129
+ patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
1130
+ @patch = ::Gapic::Config::Method.new patch_config
1131
+ remove_peering_config = parent_rpcs.remove_peering if parent_rpcs.respond_to? :remove_peering
1132
+ @remove_peering = ::Gapic::Config::Method.new remove_peering_config
1133
+ switch_to_custom_mode_config = parent_rpcs.switch_to_custom_mode if parent_rpcs.respond_to? :switch_to_custom_mode
1134
+ @switch_to_custom_mode = ::Gapic::Config::Method.new switch_to_custom_mode_config
1135
+ update_peering_config = parent_rpcs.update_peering if parent_rpcs.respond_to? :update_peering
1136
+ @update_peering = ::Gapic::Config::Method.new update_peering_config
1137
+
1138
+ yield self if block_given?
1139
+ end
1140
+ end
965
1141
  end
966
1142
  end
967
1143
  end