google-cloud-compute-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (379) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +201 -0
  5. data/README.md +73 -0
  6. data/lib/google-cloud-compute-v1.rb +21 -0
  7. data/lib/google/cloud/compute/v1.rb +110 -0
  8. data/lib/google/cloud/compute/v1/accelerator_types.rb +44 -0
  9. data/lib/google/cloud/compute/v1/accelerator_types/credentials.rb +53 -0
  10. data/lib/google/cloud/compute/v1/accelerator_types/rest.rb +35 -0
  11. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +452 -0
  12. data/lib/google/cloud/compute/v1/accelerator_types/rest/grpc_transcoding.rb +81 -0
  13. data/lib/google/cloud/compute/v1/addresses.rb +44 -0
  14. data/lib/google/cloud/compute/v1/addresses/credentials.rb +52 -0
  15. data/lib/google/cloud/compute/v1/addresses/rest.rb +35 -0
  16. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +596 -0
  17. data/lib/google/cloud/compute/v1/addresses/rest/grpc_transcoding.rb +106 -0
  18. data/lib/google/cloud/compute/v1/autoscalers.rb +44 -0
  19. data/lib/google/cloud/compute/v1/autoscalers/credentials.rb +52 -0
  20. data/lib/google/cloud/compute/v1/autoscalers/rest.rb +35 -0
  21. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +746 -0
  22. data/lib/google/cloud/compute/v1/autoscalers/rest/grpc_transcoding.rb +130 -0
  23. data/lib/google/cloud/compute/v1/backend_buckets.rb +44 -0
  24. data/lib/google/cloud/compute/v1/backend_buckets/credentials.rb +52 -0
  25. data/lib/google/cloud/compute/v1/backend_buckets/rest.rb +35 -0
  26. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +795 -0
  27. data/lib/google/cloud/compute/v1/backend_buckets/rest/grpc_transcoding.rb +138 -0
  28. data/lib/google/cloud/compute/v1/backend_services.rb +44 -0
  29. data/lib/google/cloud/compute/v1/backend_services/credentials.rb +52 -0
  30. data/lib/google/cloud/compute/v1/backend_services/rest.rb +35 -0
  31. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +1023 -0
  32. data/lib/google/cloud/compute/v1/backend_services/rest/grpc_transcoding.rb +180 -0
  33. data/lib/google/cloud/compute/v1/compute_pb.rb +9482 -0
  34. data/lib/google/cloud/compute/v1/disk_types.rb +44 -0
  35. data/lib/google/cloud/compute/v1/disk_types/credentials.rb +53 -0
  36. data/lib/google/cloud/compute/v1/disk_types/rest.rb +35 -0
  37. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +450 -0
  38. data/lib/google/cloud/compute/v1/disk_types/rest/grpc_transcoding.rb +81 -0
  39. data/lib/google/cloud/compute/v1/disks.rb +44 -0
  40. data/lib/google/cloud/compute/v1/disks/credentials.rb +52 -0
  41. data/lib/google/cloud/compute/v1/disks/rest.rb +35 -0
  42. data/lib/google/cloud/compute/v1/disks/rest/client.rb +1182 -0
  43. data/lib/google/cloud/compute/v1/disks/rest/grpc_transcoding.rb +203 -0
  44. data/lib/google/cloud/compute/v1/external_vpn_gateways.rb +44 -0
  45. data/lib/google/cloud/compute/v1/external_vpn_gateways/credentials.rb +52 -0
  46. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest.rb +35 -0
  47. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +637 -0
  48. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/grpc_transcoding.rb +112 -0
  49. data/lib/google/cloud/compute/v1/firewalls.rb +44 -0
  50. data/lib/google/cloud/compute/v1/firewalls/credentials.rb +52 -0
  51. data/lib/google/cloud/compute/v1/firewalls/rest.rb +35 -0
  52. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +649 -0
  53. data/lib/google/cloud/compute/v1/firewalls/rest/grpc_transcoding.rb +112 -0
  54. data/lib/google/cloud/compute/v1/forwarding_rules.rb +44 -0
  55. data/lib/google/cloud/compute/v1/forwarding_rules/credentials.rb +52 -0
  56. data/lib/google/cloud/compute/v1/forwarding_rules/rest.rb +35 -0
  57. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +746 -0
  58. data/lib/google/cloud/compute/v1/forwarding_rules/rest/grpc_transcoding.rb +130 -0
  59. data/lib/google/cloud/compute/v1/global_addresses.rb +44 -0
  60. data/lib/google/cloud/compute/v1/global_addresses/credentials.rb +52 -0
  61. data/lib/google/cloud/compute/v1/global_addresses/rest.rb +35 -0
  62. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +503 -0
  63. data/lib/google/cloud/compute/v1/global_addresses/rest/grpc_transcoding.rb +88 -0
  64. data/lib/google/cloud/compute/v1/global_forwarding_rules.rb +44 -0
  65. data/lib/google/cloud/compute/v1/global_forwarding_rules/credentials.rb +52 -0
  66. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest.rb +35 -0
  67. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +649 -0
  68. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/grpc_transcoding.rb +112 -0
  69. data/lib/google/cloud/compute/v1/global_network_endpoint_groups.rb +44 -0
  70. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/credentials.rb +52 -0
  71. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest.rb +35 -0
  72. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +734 -0
  73. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/grpc_transcoding.rb +129 -0
  74. data/lib/google/cloud/compute/v1/global_operations.rb +44 -0
  75. data/lib/google/cloud/compute/v1/global_operations/credentials.rb +52 -0
  76. data/lib/google/cloud/compute/v1/global_operations/rest.rb +35 -0
  77. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +578 -0
  78. data/lib/google/cloud/compute/v1/global_operations/rest/grpc_transcoding.rb +105 -0
  79. data/lib/google/cloud/compute/v1/global_organization_operations.rb +44 -0
  80. data/lib/google/cloud/compute/v1/global_organization_operations/credentials.rb +52 -0
  81. data/lib/google/cloud/compute/v1/global_organization_operations/rest.rb +35 -0
  82. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +427 -0
  83. data/lib/google/cloud/compute/v1/global_organization_operations/rest/grpc_transcoding.rb +78 -0
  84. data/lib/google/cloud/compute/v1/health_checks.rb +44 -0
  85. data/lib/google/cloud/compute/v1/health_checks/credentials.rb +52 -0
  86. data/lib/google/cloud/compute/v1/health_checks/rest.rb +35 -0
  87. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +734 -0
  88. data/lib/google/cloud/compute/v1/health_checks/rest/grpc_transcoding.rb +130 -0
  89. data/lib/google/cloud/compute/v1/images.rb +44 -0
  90. data/lib/google/cloud/compute/v1/images/credentials.rb +52 -0
  91. data/lib/google/cloud/compute/v1/images/rest.rb +35 -0
  92. data/lib/google/cloud/compute/v1/images/rest/client.rb +985 -0
  93. data/lib/google/cloud/compute/v1/images/rest/grpc_transcoding.rb +173 -0
  94. data/lib/google/cloud/compute/v1/instance_group_managers.rb +44 -0
  95. data/lib/google/cloud/compute/v1/instance_group_managers/credentials.rb +52 -0
  96. data/lib/google/cloud/compute/v1/instance_group_managers/rest.rb +35 -0
  97. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +1767 -0
  98. data/lib/google/cloud/compute/v1/instance_group_managers/rest/grpc_transcoding.rb +303 -0
  99. data/lib/google/cloud/compute/v1/instance_groups.rb +44 -0
  100. data/lib/google/cloud/compute/v1/instance_groups/credentials.rb +52 -0
  101. data/lib/google/cloud/compute/v1/instance_groups/rest.rb +35 -0
  102. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +916 -0
  103. data/lib/google/cloud/compute/v1/instance_groups/rest/grpc_transcoding.rb +154 -0
  104. data/lib/google/cloud/compute/v1/instance_templates.rb +44 -0
  105. data/lib/google/cloud/compute/v1/instance_templates/credentials.rb +52 -0
  106. data/lib/google/cloud/compute/v1/instance_templates/rest.rb +35 -0
  107. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +704 -0
  108. data/lib/google/cloud/compute/v1/instance_templates/rest/grpc_transcoding.rb +125 -0
  109. data/lib/google/cloud/compute/v1/instances.rb +44 -0
  110. data/lib/google/cloud/compute/v1/instances/credentials.rb +52 -0
  111. data/lib/google/cloud/compute/v1/instances/rest.rb +35 -0
  112. data/lib/google/cloud/compute/v1/instances/rest/client.rb +3201 -0
  113. data/lib/google/cloud/compute/v1/instances/rest/grpc_transcoding.rb +549 -0
  114. data/lib/google/cloud/compute/v1/interconnect_attachments.rb +44 -0
  115. data/lib/google/cloud/compute/v1/interconnect_attachments/credentials.rb +52 -0
  116. data/lib/google/cloud/compute/v1/interconnect_attachments/rest.rb +35 -0
  117. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +673 -0
  118. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/grpc_transcoding.rb +118 -0
  119. data/lib/google/cloud/compute/v1/interconnect_locations.rb +44 -0
  120. data/lib/google/cloud/compute/v1/interconnect_locations/credentials.rb +53 -0
  121. data/lib/google/cloud/compute/v1/interconnect_locations/rest.rb +35 -0
  122. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +361 -0
  123. data/lib/google/cloud/compute/v1/interconnect_locations/rest/grpc_transcoding.rb +63 -0
  124. data/lib/google/cloud/compute/v1/interconnects.rb +44 -0
  125. data/lib/google/cloud/compute/v1/interconnects/credentials.rb +52 -0
  126. data/lib/google/cloud/compute/v1/interconnects/rest.rb +35 -0
  127. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +640 -0
  128. data/lib/google/cloud/compute/v1/interconnects/rest/grpc_transcoding.rb +112 -0
  129. data/lib/google/cloud/compute/v1/license_codes.rb +44 -0
  130. data/lib/google/cloud/compute/v1/license_codes/credentials.rb +53 -0
  131. data/lib/google/cloud/compute/v1/license_codes/rest.rb +35 -0
  132. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +345 -0
  133. data/lib/google/cloud/compute/v1/license_codes/rest/grpc_transcoding.rb +58 -0
  134. data/lib/google/cloud/compute/v1/licenses.rb +44 -0
  135. data/lib/google/cloud/compute/v1/licenses/credentials.rb +52 -0
  136. data/lib/google/cloud/compute/v1/licenses/rest.rb +35 -0
  137. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +704 -0
  138. data/lib/google/cloud/compute/v1/licenses/rest/grpc_transcoding.rb +125 -0
  139. data/lib/google/cloud/compute/v1/machine_types.rb +44 -0
  140. data/lib/google/cloud/compute/v1/machine_types/credentials.rb +53 -0
  141. data/lib/google/cloud/compute/v1/machine_types/rest.rb +35 -0
  142. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +450 -0
  143. data/lib/google/cloud/compute/v1/machine_types/rest/grpc_transcoding.rb +81 -0
  144. data/lib/google/cloud/compute/v1/network_endpoint_groups.rb +44 -0
  145. data/lib/google/cloud/compute/v1/network_endpoint_groups/credentials.rb +52 -0
  146. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest.rb +35 -0
  147. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +904 -0
  148. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/grpc_transcoding.rb +154 -0
  149. data/lib/google/cloud/compute/v1/networks.rb +44 -0
  150. data/lib/google/cloud/compute/v1/networks/credentials.rb +52 -0
  151. data/lib/google/cloud/compute/v1/networks/rest.rb +35 -0
  152. data/lib/google/cloud/compute/v1/networks/rest/client.rb +957 -0
  153. data/lib/google/cloud/compute/v1/networks/rest/grpc_transcoding.rb +169 -0
  154. data/lib/google/cloud/compute/v1/node_groups.rb +44 -0
  155. data/lib/google/cloud/compute/v1/node_groups/credentials.rb +52 -0
  156. data/lib/google/cloud/compute/v1/node_groups/rest.rb +35 -0
  157. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +1192 -0
  158. data/lib/google/cloud/compute/v1/node_groups/rest/grpc_transcoding.rb +208 -0
  159. data/lib/google/cloud/compute/v1/node_templates.rb +44 -0
  160. data/lib/google/cloud/compute/v1/node_templates/credentials.rb +52 -0
  161. data/lib/google/cloud/compute/v1/node_templates/rest.rb +35 -0
  162. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +803 -0
  163. data/lib/google/cloud/compute/v1/node_templates/rest/grpc_transcoding.rb +143 -0
  164. data/lib/google/cloud/compute/v1/node_types.rb +44 -0
  165. data/lib/google/cloud/compute/v1/node_types/credentials.rb +53 -0
  166. data/lib/google/cloud/compute/v1/node_types/rest.rb +35 -0
  167. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +450 -0
  168. data/lib/google/cloud/compute/v1/node_types/rest/grpc_transcoding.rb +81 -0
  169. data/lib/google/cloud/compute/v1/packet_mirrorings.rb +44 -0
  170. data/lib/google/cloud/compute/v1/packet_mirrorings/credentials.rb +52 -0
  171. data/lib/google/cloud/compute/v1/packet_mirrorings/rest.rb +35 -0
  172. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +740 -0
  173. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/grpc_transcoding.rb +130 -0
  174. data/lib/google/cloud/compute/v1/projects.rb +44 -0
  175. data/lib/google/cloud/compute/v1/projects/credentials.rb +52 -0
  176. data/lib/google/cloud/compute/v1/projects/rest.rb +35 -0
  177. data/lib/google/cloud/compute/v1/projects/rest/client.rb +1141 -0
  178. data/lib/google/cloud/compute/v1/projects/rest/grpc_transcoding.rb +197 -0
  179. data/lib/google/cloud/compute/v1/region_autoscalers.rb +44 -0
  180. data/lib/google/cloud/compute/v1/region_autoscalers/credentials.rb +52 -0
  181. data/lib/google/cloud/compute/v1/region_autoscalers/rest.rb +35 -0
  182. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +661 -0
  183. data/lib/google/cloud/compute/v1/region_autoscalers/rest/grpc_transcoding.rb +112 -0
  184. data/lib/google/cloud/compute/v1/region_backend_services.rb +44 -0
  185. data/lib/google/cloud/compute/v1/region_backend_services/credentials.rb +52 -0
  186. data/lib/google/cloud/compute/v1/region_backend_services/rest.rb +35 -0
  187. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +729 -0
  188. data/lib/google/cloud/compute/v1/region_backend_services/rest/grpc_transcoding.rb +124 -0
  189. data/lib/google/cloud/compute/v1/region_commitments.rb +44 -0
  190. data/lib/google/cloud/compute/v1/region_commitments/credentials.rb +52 -0
  191. data/lib/google/cloud/compute/v1/region_commitments/rest.rb +35 -0
  192. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +523 -0
  193. data/lib/google/cloud/compute/v1/region_commitments/rest/grpc_transcoding.rb +93 -0
  194. data/lib/google/cloud/compute/v1/region_disk_types.rb +44 -0
  195. data/lib/google/cloud/compute/v1/region_disk_types/credentials.rb +53 -0
  196. data/lib/google/cloud/compute/v1/region_disk_types/rest.rb +35 -0
  197. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +365 -0
  198. data/lib/google/cloud/compute/v1/region_disk_types/rest/grpc_transcoding.rb +63 -0
  199. data/lib/google/cloud/compute/v1/region_disks.rb +44 -0
  200. data/lib/google/cloud/compute/v1/region_disks/credentials.rb +52 -0
  201. data/lib/google/cloud/compute/v1/region_disks/rest.rb +35 -0
  202. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +1095 -0
  203. data/lib/google/cloud/compute/v1/region_disks/rest/grpc_transcoding.rb +185 -0
  204. data/lib/google/cloud/compute/v1/region_health_check_services.rb +44 -0
  205. data/lib/google/cloud/compute/v1/region_health_check_services/credentials.rb +52 -0
  206. data/lib/google/cloud/compute/v1/region_health_check_services/rest.rb +35 -0
  207. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +586 -0
  208. data/lib/google/cloud/compute/v1/region_health_check_services/rest/grpc_transcoding.rb +100 -0
  209. data/lib/google/cloud/compute/v1/region_health_checks.rb +44 -0
  210. data/lib/google/cloud/compute/v1/region_health_checks/credentials.rb +52 -0
  211. data/lib/google/cloud/compute/v1/region_health_checks/rest.rb +35 -0
  212. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +661 -0
  213. data/lib/google/cloud/compute/v1/region_health_checks/rest/grpc_transcoding.rb +112 -0
  214. data/lib/google/cloud/compute/v1/region_instance_group_managers.rb +44 -0
  215. data/lib/google/cloud/compute/v1/region_instance_group_managers/credentials.rb +52 -0
  216. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest.rb +35 -0
  217. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +1678 -0
  218. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/grpc_transcoding.rb +285 -0
  219. data/lib/google/cloud/compute/v1/region_instance_groups.rb +44 -0
  220. data/lib/google/cloud/compute/v1/region_instance_groups/credentials.rb +52 -0
  221. data/lib/google/cloud/compute/v1/region_instance_groups/rest.rb +35 -0
  222. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +529 -0
  223. data/lib/google/cloud/compute/v1/region_instance_groups/rest/grpc_transcoding.rb +87 -0
  224. data/lib/google/cloud/compute/v1/region_network_endpoint_groups.rb +44 -0
  225. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/credentials.rb +52 -0
  226. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest.rb +35 -0
  227. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +511 -0
  228. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/grpc_transcoding.rb +88 -0
  229. data/lib/google/cloud/compute/v1/region_notification_endpoints.rb +44 -0
  230. data/lib/google/cloud/compute/v1/region_notification_endpoints/credentials.rb +52 -0
  231. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest.rb +35 -0
  232. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +511 -0
  233. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/grpc_transcoding.rb +88 -0
  234. data/lib/google/cloud/compute/v1/region_operations.rb +44 -0
  235. data/lib/google/cloud/compute/v1/region_operations/credentials.rb +52 -0
  236. data/lib/google/cloud/compute/v1/region_operations/rest.rb +35 -0
  237. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +501 -0
  238. data/lib/google/cloud/compute/v1/region_operations/rest/grpc_transcoding.rb +87 -0
  239. data/lib/google/cloud/compute/v1/region_ssl_certificates.rb +44 -0
  240. data/lib/google/cloud/compute/v1/region_ssl_certificates/credentials.rb +52 -0
  241. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest.rb +35 -0
  242. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +511 -0
  243. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/grpc_transcoding.rb +88 -0
  244. data/lib/google/cloud/compute/v1/region_target_http_proxies.rb +44 -0
  245. data/lib/google/cloud/compute/v1/region_target_http_proxies/credentials.rb +52 -0
  246. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest.rb +35 -0
  247. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +586 -0
  248. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/grpc_transcoding.rb +100 -0
  249. data/lib/google/cloud/compute/v1/region_target_https_proxies.rb +44 -0
  250. data/lib/google/cloud/compute/v1/region_target_https_proxies/credentials.rb +52 -0
  251. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest.rb +35 -0
  252. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +661 -0
  253. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/grpc_transcoding.rb +112 -0
  254. data/lib/google/cloud/compute/v1/region_url_maps.rb +44 -0
  255. data/lib/google/cloud/compute/v1/region_url_maps/credentials.rb +52 -0
  256. data/lib/google/cloud/compute/v1/region_url_maps/rest.rb +35 -0
  257. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +714 -0
  258. data/lib/google/cloud/compute/v1/region_url_maps/rest/grpc_transcoding.rb +124 -0
  259. data/lib/google/cloud/compute/v1/regions.rb +44 -0
  260. data/lib/google/cloud/compute/v1/regions/credentials.rb +53 -0
  261. data/lib/google/cloud/compute/v1/regions/rest.rb +35 -0
  262. data/lib/google/cloud/compute/v1/regions/rest/client.rb +361 -0
  263. data/lib/google/cloud/compute/v1/regions/rest/grpc_transcoding.rb +63 -0
  264. data/lib/google/cloud/compute/v1/reservations.rb +44 -0
  265. data/lib/google/cloud/compute/v1/reservations/credentials.rb +52 -0
  266. data/lib/google/cloud/compute/v1/reservations/rest.rb +35 -0
  267. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +878 -0
  268. data/lib/google/cloud/compute/v1/reservations/rest/grpc_transcoding.rb +155 -0
  269. data/lib/google/cloud/compute/v1/resource_policies.rb +44 -0
  270. data/lib/google/cloud/compute/v1/resource_policies/credentials.rb +52 -0
  271. data/lib/google/cloud/compute/v1/resource_policies/rest.rb +35 -0
  272. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +803 -0
  273. data/lib/google/cloud/compute/v1/resource_policies/rest/grpc_transcoding.rb +143 -0
  274. data/lib/google/cloud/compute/v1/routers.rb +44 -0
  275. data/lib/google/cloud/compute/v1/routers/credentials.rb +52 -0
  276. data/lib/google/cloud/compute/v1/routers/rest.rb +35 -0
  277. data/lib/google/cloud/compute/v1/routers/rest/client.rb +968 -0
  278. data/lib/google/cloud/compute/v1/routers/rest/grpc_transcoding.rb +171 -0
  279. data/lib/google/cloud/compute/v1/routes.rb +44 -0
  280. data/lib/google/cloud/compute/v1/routes/credentials.rb +52 -0
  281. data/lib/google/cloud/compute/v1/routes/rest.rb +35 -0
  282. data/lib/google/cloud/compute/v1/routes/rest/client.rb +503 -0
  283. data/lib/google/cloud/compute/v1/routes/rest/grpc_transcoding.rb +88 -0
  284. data/lib/google/cloud/compute/v1/security_policies.rb +44 -0
  285. data/lib/google/cloud/compute/v1/security_policies/credentials.rb +52 -0
  286. data/lib/google/cloud/compute/v1/security_policies/rest.rb +35 -0
  287. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +929 -0
  288. data/lib/google/cloud/compute/v1/security_policies/rest/grpc_transcoding.rb +167 -0
  289. data/lib/google/cloud/compute/v1/snapshots.rb +44 -0
  290. data/lib/google/cloud/compute/v1/snapshots/credentials.rb +52 -0
  291. data/lib/google/cloud/compute/v1/snapshots/rest.rb +35 -0
  292. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +702 -0
  293. data/lib/google/cloud/compute/v1/snapshots/rest/grpc_transcoding.rb +125 -0
  294. data/lib/google/cloud/compute/v1/ssl_certificates.rb +44 -0
  295. data/lib/google/cloud/compute/v1/ssl_certificates/credentials.rb +52 -0
  296. data/lib/google/cloud/compute/v1/ssl_certificates/rest.rb +35 -0
  297. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +588 -0
  298. data/lib/google/cloud/compute/v1/ssl_certificates/rest/grpc_transcoding.rb +106 -0
  299. data/lib/google/cloud/compute/v1/ssl_policies.rb +44 -0
  300. data/lib/google/cloud/compute/v1/ssl_policies/credentials.rb +52 -0
  301. data/lib/google/cloud/compute/v1/ssl_policies/rest.rb +35 -0
  302. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +659 -0
  303. data/lib/google/cloud/compute/v1/ssl_policies/rest/grpc_transcoding.rb +117 -0
  304. data/lib/google/cloud/compute/v1/subnetworks.rb +44 -0
  305. data/lib/google/cloud/compute/v1/subnetworks/credentials.rb +52 -0
  306. data/lib/google/cloud/compute/v1/subnetworks/rest.rb +35 -0
  307. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +1113 -0
  308. data/lib/google/cloud/compute/v1/subnetworks/rest/grpc_transcoding.rb +196 -0
  309. data/lib/google/cloud/compute/v1/target_grpc_proxies.rb +44 -0
  310. data/lib/google/cloud/compute/v1/target_grpc_proxies/credentials.rb +52 -0
  311. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest.rb +35 -0
  312. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +576 -0
  313. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/grpc_transcoding.rb +100 -0
  314. data/lib/google/cloud/compute/v1/target_http_proxies.rb +44 -0
  315. data/lib/google/cloud/compute/v1/target_http_proxies/credentials.rb +52 -0
  316. data/lib/google/cloud/compute/v1/target_http_proxies/rest.rb +35 -0
  317. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +734 -0
  318. data/lib/google/cloud/compute/v1/target_http_proxies/rest/grpc_transcoding.rb +130 -0
  319. data/lib/google/cloud/compute/v1/target_https_proxies.rb +44 -0
  320. data/lib/google/cloud/compute/v1/target_https_proxies/credentials.rb +52 -0
  321. data/lib/google/cloud/compute/v1/target_https_proxies/rest.rb +35 -0
  322. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +880 -0
  323. data/lib/google/cloud/compute/v1/target_https_proxies/rest/grpc_transcoding.rb +154 -0
  324. data/lib/google/cloud/compute/v1/target_instances.rb +44 -0
  325. data/lib/google/cloud/compute/v1/target_instances/credentials.rb +52 -0
  326. data/lib/google/cloud/compute/v1/target_instances/rest.rb +35 -0
  327. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +596 -0
  328. data/lib/google/cloud/compute/v1/target_instances/rest/grpc_transcoding.rb +106 -0
  329. data/lib/google/cloud/compute/v1/target_pools.rb +44 -0
  330. data/lib/google/cloud/compute/v1/target_pools/credentials.rb +52 -0
  331. data/lib/google/cloud/compute/v1/target_pools/rest.rb +35 -0
  332. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +1042 -0
  333. data/lib/google/cloud/compute/v1/target_pools/rest/grpc_transcoding.rb +178 -0
  334. data/lib/google/cloud/compute/v1/target_ssl_proxies.rb +44 -0
  335. data/lib/google/cloud/compute/v1/target_ssl_proxies/credentials.rb +52 -0
  336. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest.rb +35 -0
  337. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +795 -0
  338. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/grpc_transcoding.rb +136 -0
  339. data/lib/google/cloud/compute/v1/target_tcp_proxies.rb +44 -0
  340. data/lib/google/cloud/compute/v1/target_tcp_proxies/credentials.rb +52 -0
  341. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest.rb +35 -0
  342. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +649 -0
  343. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/grpc_transcoding.rb +112 -0
  344. data/lib/google/cloud/compute/v1/target_vpn_gateways.rb +44 -0
  345. data/lib/google/cloud/compute/v1/target_vpn_gateways/credentials.rb +52 -0
  346. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest.rb +35 -0
  347. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +596 -0
  348. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/grpc_transcoding.rb +106 -0
  349. data/lib/google/cloud/compute/v1/url_maps.rb +44 -0
  350. data/lib/google/cloud/compute/v1/url_maps/credentials.rb +52 -0
  351. data/lib/google/cloud/compute/v1/url_maps/rest.rb +35 -0
  352. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +876 -0
  353. data/lib/google/cloud/compute/v1/url_maps/rest/grpc_transcoding.rb +154 -0
  354. data/lib/google/cloud/compute/v1/version.rb +28 -0
  355. data/lib/google/cloud/compute/v1/vpn_gateways.rb +44 -0
  356. data/lib/google/cloud/compute/v1/vpn_gateways/credentials.rb +52 -0
  357. data/lib/google/cloud/compute/v1/vpn_gateways/rest.rb +35 -0
  358. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +806 -0
  359. data/lib/google/cloud/compute/v1/vpn_gateways/rest/grpc_transcoding.rb +142 -0
  360. data/lib/google/cloud/compute/v1/vpn_tunnels.rb +44 -0
  361. data/lib/google/cloud/compute/v1/vpn_tunnels/credentials.rb +52 -0
  362. data/lib/google/cloud/compute/v1/vpn_tunnels/rest.rb +35 -0
  363. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +596 -0
  364. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/grpc_transcoding.rb +106 -0
  365. data/lib/google/cloud/compute/v1/zone_operations.rb +44 -0
  366. data/lib/google/cloud/compute/v1/zone_operations/credentials.rb +52 -0
  367. data/lib/google/cloud/compute/v1/zone_operations/rest.rb +35 -0
  368. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +501 -0
  369. data/lib/google/cloud/compute/v1/zone_operations/rest/grpc_transcoding.rb +87 -0
  370. data/lib/google/cloud/compute/v1/zones.rb +44 -0
  371. data/lib/google/cloud/compute/v1/zones/credentials.rb +53 -0
  372. data/lib/google/cloud/compute/v1/zones/rest.rb +35 -0
  373. data/lib/google/cloud/compute/v1/zones/rest/client.rb +361 -0
  374. data/lib/google/cloud/compute/v1/zones/rest/grpc_transcoding.rb +63 -0
  375. data/proto_docs/README.md +4 -0
  376. data/proto_docs/google/api/field_behavior.rb +65 -0
  377. data/proto_docs/google/api/resource.rb +283 -0
  378. data/proto_docs/google/cloud/compute/v1/compute.rb +27425 -0
  379. metadata +568 -0
@@ -0,0 +1,117 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Compute
23
+ module V1
24
+ module SslPolicies
25
+ module Rest
26
+ # GRPC transcoding helper methods for the SslPolicies REST API.
27
+ module GrpcTranscoding
28
+ # @param request_pb [::Google::Cloud::Compute::V1::DeleteSslPolicyRequest]
29
+ # A request object representing the call parameters. Required.
30
+ # @return [Array(String, [String, nil], Hash{String => String})]
31
+ # Uri, Body, Query string parameters
32
+ def transcode_delete request_pb
33
+ uri = "/compute/v1/projects/#{request_pb.project}/global/sslPolicies/#{request_pb.ssl_policy}"
34
+ body = nil
35
+ query_string_params = {}
36
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
37
+
38
+ [uri, body, query_string_params]
39
+ end
40
+
41
+ # @param request_pb [::Google::Cloud::Compute::V1::GetSslPolicyRequest]
42
+ # A request object representing the call parameters. Required.
43
+ # @return [Array(String, [String, nil], Hash{String => String})]
44
+ # Uri, Body, Query string parameters
45
+ def transcode_get request_pb
46
+ uri = "/compute/v1/projects/#{request_pb.project}/global/sslPolicies/#{request_pb.ssl_policy}"
47
+ body = nil
48
+ query_string_params = {}
49
+
50
+ [uri, body, query_string_params]
51
+ end
52
+
53
+ # @param request_pb [::Google::Cloud::Compute::V1::InsertSslPolicyRequest]
54
+ # A request object representing the call parameters. Required.
55
+ # @return [Array(String, [String, nil], Hash{String => String})]
56
+ # Uri, Body, Query string parameters
57
+ def transcode_insert request_pb
58
+ uri = "/compute/v1/projects/#{request_pb.project}/global/sslPolicies"
59
+ body = request_pb.ssl_policy_resource.to_json
60
+ query_string_params = {}
61
+
62
+ [uri, body, query_string_params]
63
+ end
64
+
65
+ # @param request_pb [::Google::Cloud::Compute::V1::ListSslPoliciesRequest]
66
+ # A request object representing the call parameters. Required.
67
+ # @return [Array(String, [String, nil], Hash{String => String})]
68
+ # Uri, Body, Query string parameters
69
+ def transcode_list request_pb
70
+ uri = "/compute/v1/projects/#{request_pb.project}/global/sslPolicies"
71
+ body = nil
72
+ query_string_params = {}
73
+ query_string_params["filter"] = request_pb.filter.to_s if request_pb.has_filter?
74
+ query_string_params["maxResults"] = request_pb.max_results.to_s if request_pb.has_max_results?
75
+ query_string_params["orderBy"] = request_pb.order_by.to_s if request_pb.has_order_by?
76
+ query_string_params["pageToken"] = request_pb.page_token.to_s if request_pb.has_page_token?
77
+ query_string_params["returnPartialSuccess"] = request_pb.return_partial_success.to_s if request_pb.has_return_partial_success?
78
+
79
+ [uri, body, query_string_params]
80
+ end
81
+
82
+ # @param request_pb [::Google::Cloud::Compute::V1::ListAvailableFeaturesSslPoliciesRequest]
83
+ # A request object representing the call parameters. Required.
84
+ # @return [Array(String, [String, nil], Hash{String => String})]
85
+ # Uri, Body, Query string parameters
86
+ def transcode_list_available_features request_pb
87
+ uri = "/compute/v1/projects/#{request_pb.project}/global/sslPolicies/listAvailableFeatures"
88
+ body = nil
89
+ query_string_params = {}
90
+ query_string_params["filter"] = request_pb.filter.to_s if request_pb.has_filter?
91
+ query_string_params["maxResults"] = request_pb.max_results.to_s if request_pb.has_max_results?
92
+ query_string_params["orderBy"] = request_pb.order_by.to_s if request_pb.has_order_by?
93
+ query_string_params["pageToken"] = request_pb.page_token.to_s if request_pb.has_page_token?
94
+ query_string_params["returnPartialSuccess"] = request_pb.return_partial_success.to_s if request_pb.has_return_partial_success?
95
+
96
+ [uri, body, query_string_params]
97
+ end
98
+
99
+ # @param request_pb [::Google::Cloud::Compute::V1::PatchSslPolicyRequest]
100
+ # A request object representing the call parameters. Required.
101
+ # @return [Array(String, [String, nil], Hash{String => String})]
102
+ # Uri, Body, Query string parameters
103
+ def transcode_patch request_pb
104
+ uri = "/compute/v1/projects/#{request_pb.project}/global/sslPolicies/#{request_pb.ssl_policy}"
105
+ body = request_pb.ssl_policy_resource.to_json
106
+ query_string_params = {}
107
+
108
+ [uri, body, query_string_params]
109
+ end
110
+ extend self
111
+ end
112
+ end
113
+ end
114
+ end
115
+ end
116
+ end
117
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/config"
20
+ require "gapic/config/method"
21
+
22
+ require "google/cloud/compute/v1/version"
23
+
24
+ require "google/cloud/compute/v1/subnetworks/credentials"
25
+ require "google/cloud/compute/v1/subnetworks/rest"
26
+
27
+ module Google
28
+ module Cloud
29
+ module Compute
30
+ module V1
31
+ # To load this service and instantiate a REST client:
32
+ #
33
+ # require "google/cloud/compute/v1/subnetworks"
34
+ # client = ::Google::Cloud::Compute::V1::Subnetworks::Rest::Client.new
35
+ #
36
+ module Subnetworks
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+
43
+ helper_path = ::File.join __dir__, "subnetworks", "helpers.rb"
44
+ require "google/cloud/compute/v1/subnetworks/helpers" if ::File.file? helper_path
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Compute
24
+ module V1
25
+ module Subnetworks
26
+ # Credentials for the Subnetworks API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/compute",
30
+ "https://www.googleapis.com/auth/cloud-platform"
31
+ ]
32
+ self.env_vars = [
33
+ "COMPUTE_CREDENTIALS",
34
+ "COMPUTE_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS",
36
+ "GOOGLE_CLOUD_KEYFILE",
37
+ "GCLOUD_KEYFILE",
38
+ "COMPUTE_CREDENTIALS_JSON",
39
+ "COMPUTE_KEYFILE_JSON",
40
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
41
+ "GOOGLE_CLOUD_KEYFILE_JSON",
42
+ "GCLOUD_KEYFILE_JSON"
43
+ ]
44
+ self.paths = [
45
+ "~/.config/google_cloud/application_default_credentials.json"
46
+ ]
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/rest"
20
+ require "google/cloud/compute/v1/subnetworks/rest/grpc_transcoding"
21
+ require "google/cloud/compute/v1/subnetworks/rest/client"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Compute
26
+ module V1
27
+ module Subnetworks
28
+ # Client for the REST transport
29
+ module Rest
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,1113 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/compute/v1/compute_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Compute
25
+ module V1
26
+ module Subnetworks
27
+ module Rest
28
+ ##
29
+ # REST client for the Subnetworks service.
30
+ #
31
+ # The Subnetworks API.
32
+ #
33
+ class Client
34
+ include GrpcTranscoding
35
+
36
+ # @private
37
+ attr_reader :subnetworks_stub
38
+
39
+ ##
40
+ # Configure the Subnetworks Client class.
41
+ #
42
+ # See {::Google::Cloud::Compute::V1::Subnetworks::Rest::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # ## Example
46
+ #
47
+ # To modify the configuration for all Subnetworks clients:
48
+ #
49
+ # ::Google::Cloud::Compute::V1::Subnetworks::Rest::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "Compute", "V1"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config
70
+ end
71
+ yield @configure if block_given?
72
+ @configure
73
+ end
74
+
75
+ ##
76
+ # Configure the Subnetworks Client instance.
77
+ #
78
+ # The configuration is set to the derived mode, meaning that values can be changed,
79
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
80
+ # should be made on {Client.configure}.
81
+ #
82
+ # See {::Google::Cloud::Compute::V1::Subnetworks::Rest::Client::Configuration}
83
+ # for a description of the configuration fields.
84
+ #
85
+ # @yield [config] Configure the Client client.
86
+ # @yieldparam config [Client::Configuration]
87
+ #
88
+ # @return [Client::Configuration]
89
+ #
90
+ def configure
91
+ yield @config if block_given?
92
+ @config
93
+ end
94
+
95
+ ##
96
+ # Create a new Subnetworks REST client object.
97
+ #
98
+ # ## Examples
99
+ #
100
+ # To create a new Subnetworks REST client with the default
101
+ # configuration:
102
+ #
103
+ # client = ::Google::Cloud::Compute::V1::Subnetworks::Rest::Client.new
104
+ #
105
+ # To create a new Subnetworks REST client with a custom
106
+ # configuration:
107
+ #
108
+ # client = ::Google::Cloud::Compute::V1::Subnetworks::Rest::Client.new do |config|
109
+ # config.timeout = 10.0
110
+ # end
111
+ #
112
+ # @yield [config] Configure the Subnetworks client.
113
+ # @yieldparam config [Client::Configuration]
114
+ #
115
+ 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
+ # Create the configuration object
121
+ @config = Configuration.new Client.configure
122
+
123
+ # Yield the configuration if needed
124
+ yield @config if block_given?
125
+
126
+ # Create credentials
127
+ credentials = @config.credentials
128
+ credentials ||= Credentials.default scope: @config.scope
129
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
130
+ credentials = Credentials.new credentials, scope: @config.scope
131
+ end
132
+
133
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: @config.endpoint, credentials: credentials
134
+ end
135
+
136
+ # Service calls
137
+
138
+ ##
139
+ # Retrieves an aggregated list of subnetworks.
140
+ #
141
+ # @overload aggregated_list(request, options = nil)
142
+ # Pass arguments to `aggregated_list` via a request object, either of type
143
+ # {::Google::Cloud::Compute::V1::AggregatedListSubnetworksRequest} or an equivalent Hash.
144
+ #
145
+ # @param request [::Google::Cloud::Compute::V1::AggregatedListSubnetworksRequest, ::Hash]
146
+ # A request object representing the call parameters. Required. To specify no
147
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
148
+ # @param options [::Gapic::CallOptions, ::Hash]
149
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
150
+ # Note: currently retry functionality is not implemented. While it is possible
151
+ # to set it using ::Gapic::CallOptions, it will not be applied
152
+ #
153
+ # @overload aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
154
+ # Pass arguments to `aggregated_list` via keyword arguments. Note that at
155
+ # least one keyword argument is required. To specify no parameters, or to keep all
156
+ # the default parameter values, pass an empty Hash as a request object (see above).
157
+ #
158
+ # @param filter [::String]
159
+ # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`.
160
+ #
161
+ # For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
162
+ #
163
+ # You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
164
+ #
165
+ # To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
166
+ # @param include_all_scopes [::Boolean]
167
+ # Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.
168
+ # @param max_results [::Integer]
169
+ # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
170
+ # @param order_by [::String]
171
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
172
+ #
173
+ # You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
174
+ #
175
+ # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
176
+ # @param page_token [::String]
177
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
178
+ # @param project [::String]
179
+ # Project ID for this request.
180
+ # @param return_partial_success [::Boolean]
181
+ # 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.
182
+ # @yield [result, env] Access the result along with the Faraday environment object
183
+ # @yieldparam result [::Google::Cloud::Compute::V1::SubnetworkAggregatedList]
184
+ # @yieldparam response [::Faraday::Response]
185
+ #
186
+ # @return [::Google::Cloud::Compute::V1::SubnetworkAggregatedList]
187
+ #
188
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
189
+ def aggregated_list request, options = nil
190
+ raise ::ArgumentError, "request must be provided" if request.nil?
191
+
192
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AggregatedListSubnetworksRequest
193
+
194
+ # Converts hash and nil to an options object
195
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
196
+
197
+ # Customize the options with defaults
198
+ call_metadata = {}
199
+
200
+ # Set x-goog-api-client header
201
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
202
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
203
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
204
+
205
+ options.apply_defaults timeout: @config.timeout,
206
+ metadata: call_metadata
207
+
208
+ uri, _body, query_string_params = transcode_aggregated_list request
209
+ response = @client_stub.make_get_request(
210
+ uri: uri,
211
+ params: query_string_params,
212
+ options: options
213
+ )
214
+ result = ::Google::Cloud::Compute::V1::SubnetworkAggregatedList.decode_json response.body, ignore_unknown_fields: true
215
+
216
+ yield result, response if block_given?
217
+ result
218
+ rescue ::Faraday::Error => e
219
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
220
+ raise ::Google::Cloud::Error.from_error(gapic_error)
221
+ end
222
+
223
+ ##
224
+ # Deletes the specified subnetwork.
225
+ #
226
+ # @overload delete(request, options = nil)
227
+ # Pass arguments to `delete` via a request object, either of type
228
+ # {::Google::Cloud::Compute::V1::DeleteSubnetworkRequest} or an equivalent Hash.
229
+ #
230
+ # @param request [::Google::Cloud::Compute::V1::DeleteSubnetworkRequest, ::Hash]
231
+ # A request object representing the call parameters. Required. To specify no
232
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
233
+ # @param options [::Gapic::CallOptions, ::Hash]
234
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
235
+ # Note: currently retry functionality is not implemented. While it is possible
236
+ # to set it using ::Gapic::CallOptions, it will not be applied
237
+ #
238
+ # @overload delete(project: nil, region: nil, request_id: nil, subnetwork: nil)
239
+ # Pass arguments to `delete` via keyword arguments. Note that at
240
+ # least one keyword argument is required. To specify no parameters, or to keep all
241
+ # the default parameter values, pass an empty Hash as a request object (see above).
242
+ #
243
+ # @param project [::String]
244
+ # Project ID for this request.
245
+ # @param region [::String]
246
+ # Name of the region scoping this request.
247
+ # @param request_id [::String]
248
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
249
+ #
250
+ # 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.
251
+ #
252
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
253
+ # @param subnetwork [::String]
254
+ # Name of the Subnetwork resource to delete.
255
+ # @yield [result, env] Access the result along with the Faraday environment object
256
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
257
+ # @yieldparam response [::Faraday::Response]
258
+ #
259
+ # @return [::Google::Cloud::Compute::V1::Operation]
260
+ #
261
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
262
+ def delete request, options = nil
263
+ raise ::ArgumentError, "request must be provided" if request.nil?
264
+
265
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteSubnetworkRequest
266
+
267
+ # Converts hash and nil to an options object
268
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
269
+
270
+ # Customize the options with defaults
271
+ call_metadata = {}
272
+
273
+ # Set x-goog-api-client header
274
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
275
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
276
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
277
+
278
+ options.apply_defaults timeout: @config.timeout,
279
+ metadata: call_metadata
280
+
281
+ uri, _body, query_string_params = transcode_delete request
282
+ response = @client_stub.make_delete_request(
283
+ uri: uri,
284
+ params: query_string_params,
285
+ options: options
286
+ )
287
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
288
+
289
+ yield result, response if block_given?
290
+ result
291
+ rescue ::Faraday::Error => e
292
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
293
+ raise ::Google::Cloud::Error.from_error(gapic_error)
294
+ end
295
+
296
+ ##
297
+ # Expands the IP CIDR range of the subnetwork to a specified value.
298
+ #
299
+ # @overload expand_ip_cidr_range(request, options = nil)
300
+ # Pass arguments to `expand_ip_cidr_range` via a request object, either of type
301
+ # {::Google::Cloud::Compute::V1::ExpandIpCidrRangeSubnetworkRequest} or an equivalent Hash.
302
+ #
303
+ # @param request [::Google::Cloud::Compute::V1::ExpandIpCidrRangeSubnetworkRequest, ::Hash]
304
+ # A request object representing the call parameters. Required. To specify no
305
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
306
+ # @param options [::Gapic::CallOptions, ::Hash]
307
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
308
+ # Note: currently retry functionality is not implemented. While it is possible
309
+ # to set it using ::Gapic::CallOptions, it will not be applied
310
+ #
311
+ # @overload expand_ip_cidr_range(project: nil, region: nil, request_id: nil, subnetwork: nil, subnetworks_expand_ip_cidr_range_request_resource: nil)
312
+ # Pass arguments to `expand_ip_cidr_range` via keyword arguments. Note that at
313
+ # least one keyword argument is required. To specify no parameters, or to keep all
314
+ # the default parameter values, pass an empty Hash as a request object (see above).
315
+ #
316
+ # @param project [::String]
317
+ # Project ID for this request.
318
+ # @param region [::String]
319
+ # Name of the region scoping this request.
320
+ # @param request_id [::String]
321
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
322
+ #
323
+ # 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.
324
+ #
325
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
326
+ # @param subnetwork [::String]
327
+ # Name of the Subnetwork resource to update.
328
+ # @param subnetworks_expand_ip_cidr_range_request_resource [::Google::Cloud::Compute::V1::SubnetworksExpandIpCidrRangeRequest, ::Hash]
329
+ # The body resource for this request
330
+ # @yield [result, env] Access the result along with the Faraday environment object
331
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
332
+ # @yieldparam response [::Faraday::Response]
333
+ #
334
+ # @return [::Google::Cloud::Compute::V1::Operation]
335
+ #
336
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
337
+ def expand_ip_cidr_range request, options = nil
338
+ raise ::ArgumentError, "request must be provided" if request.nil?
339
+
340
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ExpandIpCidrRangeSubnetworkRequest
341
+
342
+ # Converts hash and nil to an options object
343
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
344
+
345
+ # Customize the options with defaults
346
+ call_metadata = {}
347
+
348
+ # Set x-goog-api-client header
349
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
350
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
351
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
352
+
353
+ options.apply_defaults timeout: @config.timeout,
354
+ metadata: call_metadata
355
+
356
+ uri, body, _query_string_params = transcode_expand_ip_cidr_range request
357
+ response = @client_stub.make_post_request(
358
+ uri: uri,
359
+ body: body,
360
+ options: options
361
+ )
362
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
363
+
364
+ yield result, response if block_given?
365
+ result
366
+ rescue ::Faraday::Error => e
367
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
368
+ raise ::Google::Cloud::Error.from_error(gapic_error)
369
+ end
370
+
371
+ ##
372
+ # Returns the specified subnetwork. Gets a list of available subnetworks list() request.
373
+ #
374
+ # @overload get(request, options = nil)
375
+ # Pass arguments to `get` via a request object, either of type
376
+ # {::Google::Cloud::Compute::V1::GetSubnetworkRequest} or an equivalent Hash.
377
+ #
378
+ # @param request [::Google::Cloud::Compute::V1::GetSubnetworkRequest, ::Hash]
379
+ # A request object representing the call parameters. Required. To specify no
380
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
381
+ # @param options [::Gapic::CallOptions, ::Hash]
382
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
383
+ # Note: currently retry functionality is not implemented. While it is possible
384
+ # to set it using ::Gapic::CallOptions, it will not be applied
385
+ #
386
+ # @overload get(project: nil, region: nil, subnetwork: nil)
387
+ # Pass arguments to `get` via keyword arguments. Note that at
388
+ # least one keyword argument is required. To specify no parameters, or to keep all
389
+ # the default parameter values, pass an empty Hash as a request object (see above).
390
+ #
391
+ # @param project [::String]
392
+ # Project ID for this request.
393
+ # @param region [::String]
394
+ # Name of the region scoping this request.
395
+ # @param subnetwork [::String]
396
+ # Name of the Subnetwork resource to return.
397
+ # @yield [result, env] Access the result along with the Faraday environment object
398
+ # @yieldparam result [::Google::Cloud::Compute::V1::Subnetwork]
399
+ # @yieldparam response [::Faraday::Response]
400
+ #
401
+ # @return [::Google::Cloud::Compute::V1::Subnetwork]
402
+ #
403
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
404
+ def get request, options = nil
405
+ raise ::ArgumentError, "request must be provided" if request.nil?
406
+
407
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetSubnetworkRequest
408
+
409
+ # Converts hash and nil to an options object
410
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
411
+
412
+ # Customize the options with defaults
413
+ call_metadata = {}
414
+
415
+ # Set x-goog-api-client header
416
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
417
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
418
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
419
+
420
+ options.apply_defaults timeout: @config.timeout,
421
+ metadata: call_metadata
422
+
423
+ uri, _body, _query_string_params = transcode_get request
424
+ response = @client_stub.make_get_request(
425
+ uri: uri,
426
+ options: options
427
+ )
428
+ result = ::Google::Cloud::Compute::V1::Subnetwork.decode_json response.body, ignore_unknown_fields: true
429
+
430
+ yield result, response if block_given?
431
+ result
432
+ rescue ::Faraday::Error => e
433
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
434
+ raise ::Google::Cloud::Error.from_error(gapic_error)
435
+ end
436
+
437
+ ##
438
+ # Gets the access control policy for a resource. May be empty if no such policy or resource exists.
439
+ #
440
+ # @overload get_iam_policy(request, options = nil)
441
+ # Pass arguments to `get_iam_policy` via a request object, either of type
442
+ # {::Google::Cloud::Compute::V1::GetIamPolicySubnetworkRequest} or an equivalent Hash.
443
+ #
444
+ # @param request [::Google::Cloud::Compute::V1::GetIamPolicySubnetworkRequest, ::Hash]
445
+ # A request object representing the call parameters. Required. To specify no
446
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
447
+ # @param options [::Gapic::CallOptions, ::Hash]
448
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
449
+ # Note: currently retry functionality is not implemented. While it is possible
450
+ # to set it using ::Gapic::CallOptions, it will not be applied
451
+ #
452
+ # @overload get_iam_policy(options_requested_policy_version: nil, project: nil, region: nil, resource: nil)
453
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
454
+ # least one keyword argument is required. To specify no parameters, or to keep all
455
+ # the default parameter values, pass an empty Hash as a request object (see above).
456
+ #
457
+ # @param options_requested_policy_version [::Integer]
458
+ # Requested IAM Policy version.
459
+ # @param project [::String]
460
+ # Project ID for this request.
461
+ # @param region [::String]
462
+ # The name of the region for this request.
463
+ # @param resource [::String]
464
+ # Name or id of the resource for this request.
465
+ # @yield [result, env] Access the result along with the Faraday environment object
466
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
467
+ # @yieldparam response [::Faraday::Response]
468
+ #
469
+ # @return [::Google::Cloud::Compute::V1::Policy]
470
+ #
471
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
472
+ def get_iam_policy request, options = nil
473
+ raise ::ArgumentError, "request must be provided" if request.nil?
474
+
475
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetIamPolicySubnetworkRequest
476
+
477
+ # Converts hash and nil to an options object
478
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
479
+
480
+ # Customize the options with defaults
481
+ call_metadata = {}
482
+
483
+ # Set x-goog-api-client header
484
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
485
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
486
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
487
+
488
+ options.apply_defaults timeout: @config.timeout,
489
+ metadata: call_metadata
490
+
491
+ uri, _body, query_string_params = transcode_get_iam_policy request
492
+ response = @client_stub.make_get_request(
493
+ uri: uri,
494
+ params: query_string_params,
495
+ options: options
496
+ )
497
+ result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
498
+
499
+ yield result, response if block_given?
500
+ result
501
+ rescue ::Faraday::Error => e
502
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
503
+ raise ::Google::Cloud::Error.from_error(gapic_error)
504
+ end
505
+
506
+ ##
507
+ # Creates a subnetwork in the specified project using the data included in the request.
508
+ #
509
+ # @overload insert(request, options = nil)
510
+ # Pass arguments to `insert` via a request object, either of type
511
+ # {::Google::Cloud::Compute::V1::InsertSubnetworkRequest} or an equivalent Hash.
512
+ #
513
+ # @param request [::Google::Cloud::Compute::V1::InsertSubnetworkRequest, ::Hash]
514
+ # A request object representing the call parameters. Required. To specify no
515
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
516
+ # @param options [::Gapic::CallOptions, ::Hash]
517
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
518
+ # Note: currently retry functionality is not implemented. While it is possible
519
+ # to set it using ::Gapic::CallOptions, it will not be applied
520
+ #
521
+ # @overload insert(project: nil, region: nil, request_id: nil, subnetwork_resource: nil)
522
+ # Pass arguments to `insert` via keyword arguments. Note that at
523
+ # least one keyword argument is required. To specify no parameters, or to keep all
524
+ # the default parameter values, pass an empty Hash as a request object (see above).
525
+ #
526
+ # @param project [::String]
527
+ # Project ID for this request.
528
+ # @param region [::String]
529
+ # Name of the region scoping this request.
530
+ # @param request_id [::String]
531
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
532
+ #
533
+ # 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.
534
+ #
535
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
536
+ # @param subnetwork_resource [::Google::Cloud::Compute::V1::Subnetwork, ::Hash]
537
+ # The body resource for this request
538
+ # @yield [result, env] Access the result along with the Faraday environment object
539
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
540
+ # @yieldparam response [::Faraday::Response]
541
+ #
542
+ # @return [::Google::Cloud::Compute::V1::Operation]
543
+ #
544
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
545
+ def insert request, options = nil
546
+ raise ::ArgumentError, "request must be provided" if request.nil?
547
+
548
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::InsertSubnetworkRequest
549
+
550
+ # Converts hash and nil to an options object
551
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
552
+
553
+ # Customize the options with defaults
554
+ call_metadata = {}
555
+
556
+ # Set x-goog-api-client header
557
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
558
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
559
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
560
+
561
+ options.apply_defaults timeout: @config.timeout,
562
+ metadata: call_metadata
563
+
564
+ uri, body, _query_string_params = transcode_insert request
565
+ response = @client_stub.make_post_request(
566
+ uri: uri,
567
+ body: body,
568
+ options: options
569
+ )
570
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
571
+
572
+ yield result, response if block_given?
573
+ result
574
+ rescue ::Faraday::Error => e
575
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
576
+ raise ::Google::Cloud::Error.from_error(gapic_error)
577
+ end
578
+
579
+ ##
580
+ # Retrieves a list of subnetworks available to the specified project.
581
+ #
582
+ # @overload list(request, options = nil)
583
+ # Pass arguments to `list` via a request object, either of type
584
+ # {::Google::Cloud::Compute::V1::ListSubnetworksRequest} or an equivalent Hash.
585
+ #
586
+ # @param request [::Google::Cloud::Compute::V1::ListSubnetworksRequest, ::Hash]
587
+ # A request object representing the call parameters. Required. To specify no
588
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
589
+ # @param options [::Gapic::CallOptions, ::Hash]
590
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
591
+ # Note: currently retry functionality is not implemented. While it is possible
592
+ # to set it using ::Gapic::CallOptions, it will not be applied
593
+ #
594
+ # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil)
595
+ # Pass arguments to `list` via keyword arguments. Note that at
596
+ # least one keyword argument is required. To specify no parameters, or to keep all
597
+ # the default parameter values, pass an empty Hash as a request object (see above).
598
+ #
599
+ # @param filter [::String]
600
+ # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`.
601
+ #
602
+ # For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
603
+ #
604
+ # You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
605
+ #
606
+ # To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
607
+ # @param max_results [::Integer]
608
+ # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
609
+ # @param order_by [::String]
610
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
611
+ #
612
+ # You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
613
+ #
614
+ # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
615
+ # @param page_token [::String]
616
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
617
+ # @param project [::String]
618
+ # Project ID for this request.
619
+ # @param region [::String]
620
+ # Name of the region scoping this request.
621
+ # @param return_partial_success [::Boolean]
622
+ # 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.
623
+ # @yield [result, env] Access the result along with the Faraday environment object
624
+ # @yieldparam result [::Google::Cloud::Compute::V1::SubnetworkList]
625
+ # @yieldparam response [::Faraday::Response]
626
+ #
627
+ # @return [::Google::Cloud::Compute::V1::SubnetworkList]
628
+ #
629
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
630
+ def list request, options = nil
631
+ raise ::ArgumentError, "request must be provided" if request.nil?
632
+
633
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListSubnetworksRequest
634
+
635
+ # Converts hash and nil to an options object
636
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
637
+
638
+ # Customize the options with defaults
639
+ call_metadata = {}
640
+
641
+ # Set x-goog-api-client header
642
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
643
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
644
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
645
+
646
+ options.apply_defaults timeout: @config.timeout,
647
+ metadata: call_metadata
648
+
649
+ uri, _body, query_string_params = transcode_list request
650
+ response = @client_stub.make_get_request(
651
+ uri: uri,
652
+ params: query_string_params,
653
+ options: options
654
+ )
655
+ result = ::Google::Cloud::Compute::V1::SubnetworkList.decode_json response.body, ignore_unknown_fields: true
656
+
657
+ yield result, response if block_given?
658
+ result
659
+ rescue ::Faraday::Error => e
660
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
661
+ raise ::Google::Cloud::Error.from_error(gapic_error)
662
+ end
663
+
664
+ ##
665
+ # Retrieves an aggregated list of all usable subnetworks in the project.
666
+ #
667
+ # @overload list_usable(request, options = nil)
668
+ # Pass arguments to `list_usable` via a request object, either of type
669
+ # {::Google::Cloud::Compute::V1::ListUsableSubnetworksRequest} or an equivalent Hash.
670
+ #
671
+ # @param request [::Google::Cloud::Compute::V1::ListUsableSubnetworksRequest, ::Hash]
672
+ # A request object representing the call parameters. Required. To specify no
673
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
674
+ # @param options [::Gapic::CallOptions, ::Hash]
675
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
676
+ # Note: currently retry functionality is not implemented. While it is possible
677
+ # to set it using ::Gapic::CallOptions, it will not be applied
678
+ #
679
+ # @overload list_usable(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
680
+ # Pass arguments to `list_usable` via keyword arguments. Note that at
681
+ # least one keyword argument is required. To specify no parameters, or to keep all
682
+ # the default parameter values, pass an empty Hash as a request object (see above).
683
+ #
684
+ # @param filter [::String]
685
+ # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`.
686
+ #
687
+ # For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
688
+ #
689
+ # You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
690
+ #
691
+ # To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
692
+ # @param max_results [::Integer]
693
+ # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
694
+ # @param order_by [::String]
695
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
696
+ #
697
+ # You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
698
+ #
699
+ # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
700
+ # @param page_token [::String]
701
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
702
+ # @param project [::String]
703
+ # Project ID for this request.
704
+ # @param return_partial_success [::Boolean]
705
+ # 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.
706
+ # @yield [result, env] Access the result along with the Faraday environment object
707
+ # @yieldparam result [::Google::Cloud::Compute::V1::UsableSubnetworksAggregatedList]
708
+ # @yieldparam response [::Faraday::Response]
709
+ #
710
+ # @return [::Google::Cloud::Compute::V1::UsableSubnetworksAggregatedList]
711
+ #
712
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
713
+ def list_usable request, options = nil
714
+ raise ::ArgumentError, "request must be provided" if request.nil?
715
+
716
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListUsableSubnetworksRequest
717
+
718
+ # Converts hash and nil to an options object
719
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
720
+
721
+ # Customize the options with defaults
722
+ call_metadata = {}
723
+
724
+ # Set x-goog-api-client header
725
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
726
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
727
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
728
+
729
+ options.apply_defaults timeout: @config.timeout,
730
+ metadata: call_metadata
731
+
732
+ uri, _body, query_string_params = transcode_list_usable request
733
+ response = @client_stub.make_get_request(
734
+ uri: uri,
735
+ params: query_string_params,
736
+ options: options
737
+ )
738
+ result = ::Google::Cloud::Compute::V1::UsableSubnetworksAggregatedList.decode_json response.body, ignore_unknown_fields: true
739
+
740
+ yield result, response if block_given?
741
+ result
742
+ rescue ::Faraday::Error => e
743
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
744
+ raise ::Google::Cloud::Error.from_error(gapic_error)
745
+ end
746
+
747
+ ##
748
+ # Patches the specified subnetwork with the data included in the request. Only certain fields can be updated with a patch request as indicated in the field descriptions. You must specify the current fingerprint of the subnetwork resource being patched.
749
+ #
750
+ # @overload patch(request, options = nil)
751
+ # Pass arguments to `patch` via a request object, either of type
752
+ # {::Google::Cloud::Compute::V1::PatchSubnetworkRequest} or an equivalent Hash.
753
+ #
754
+ # @param request [::Google::Cloud::Compute::V1::PatchSubnetworkRequest, ::Hash]
755
+ # A request object representing the call parameters. Required. To specify no
756
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
757
+ # @param options [::Gapic::CallOptions, ::Hash]
758
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
759
+ # Note: currently retry functionality is not implemented. While it is possible
760
+ # to set it using ::Gapic::CallOptions, it will not be applied
761
+ #
762
+ # @overload patch(drain_timeout_seconds: nil, project: nil, region: nil, request_id: nil, subnetwork: nil, subnetwork_resource: nil)
763
+ # Pass arguments to `patch` via keyword arguments. Note that at
764
+ # least one keyword argument is required. To specify no parameters, or to keep all
765
+ # the default parameter values, pass an empty Hash as a request object (see above).
766
+ #
767
+ # @param drain_timeout_seconds [::Integer]
768
+ # The drain timeout specifies the upper bound in seconds on the amount of time allowed to drain connections from the current ACTIVE subnetwork to the current BACKUP subnetwork. The drain timeout is only applicable when the following conditions are true: - the subnetwork being patched has purpose = INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork being patched has role = BACKUP - the patch request is setting the role to ACTIVE. Note that after this patch operation the roles of the ACTIVE and BACKUP subnetworks will be swapped.
769
+ # @param project [::String]
770
+ # Project ID for this request.
771
+ # @param region [::String]
772
+ # Name of the region scoping this request.
773
+ # @param request_id [::String]
774
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
775
+ #
776
+ # 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
+ #
778
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
779
+ # @param subnetwork [::String]
780
+ # Name of the Subnetwork resource to patch.
781
+ # @param subnetwork_resource [::Google::Cloud::Compute::V1::Subnetwork, ::Hash]
782
+ # The body resource for this request
783
+ # @yield [result, env] Access the result along with the Faraday environment object
784
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
785
+ # @yieldparam response [::Faraday::Response]
786
+ #
787
+ # @return [::Google::Cloud::Compute::V1::Operation]
788
+ #
789
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
790
+ def patch request, options = nil
791
+ raise ::ArgumentError, "request must be provided" if request.nil?
792
+
793
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchSubnetworkRequest
794
+
795
+ # Converts hash and nil to an options object
796
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
797
+
798
+ # Customize the options with defaults
799
+ call_metadata = {}
800
+
801
+ # Set x-goog-api-client header
802
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
803
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
804
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
805
+
806
+ options.apply_defaults timeout: @config.timeout,
807
+ metadata: call_metadata
808
+
809
+ uri, body, _query_string_params = transcode_patch request
810
+ response = @client_stub.make_patch_request(
811
+ uri: uri,
812
+ body: body,
813
+ options: options
814
+ )
815
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
816
+
817
+ yield result, response if block_given?
818
+ result
819
+ rescue ::Faraday::Error => e
820
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
821
+ raise ::Google::Cloud::Error.from_error(gapic_error)
822
+ end
823
+
824
+ ##
825
+ # Sets the access control policy on the specified resource. Replaces any existing policy.
826
+ #
827
+ # @overload set_iam_policy(request, options = nil)
828
+ # Pass arguments to `set_iam_policy` via a request object, either of type
829
+ # {::Google::Cloud::Compute::V1::SetIamPolicySubnetworkRequest} or an equivalent Hash.
830
+ #
831
+ # @param request [::Google::Cloud::Compute::V1::SetIamPolicySubnetworkRequest, ::Hash]
832
+ # A request object representing the call parameters. Required. To specify no
833
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
834
+ # @param options [::Gapic::CallOptions, ::Hash]
835
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
836
+ # Note: currently retry functionality is not implemented. While it is possible
837
+ # to set it using ::Gapic::CallOptions, it will not be applied
838
+ #
839
+ # @overload set_iam_policy(project: nil, region: nil, region_set_policy_request_resource: nil, resource: nil)
840
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
841
+ # least one keyword argument is required. To specify no parameters, or to keep all
842
+ # the default parameter values, pass an empty Hash as a request object (see above).
843
+ #
844
+ # @param project [::String]
845
+ # Project ID for this request.
846
+ # @param region [::String]
847
+ # The name of the region for this request.
848
+ # @param region_set_policy_request_resource [::Google::Cloud::Compute::V1::RegionSetPolicyRequest, ::Hash]
849
+ # The body resource for this request
850
+ # @param resource [::String]
851
+ # Name or id of the resource for this request.
852
+ # @yield [result, env] Access the result along with the Faraday environment object
853
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
854
+ # @yieldparam response [::Faraday::Response]
855
+ #
856
+ # @return [::Google::Cloud::Compute::V1::Policy]
857
+ #
858
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
859
+ def set_iam_policy request, options = nil
860
+ raise ::ArgumentError, "request must be provided" if request.nil?
861
+
862
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetIamPolicySubnetworkRequest
863
+
864
+ # Converts hash and nil to an options object
865
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
866
+
867
+ # Customize the options with defaults
868
+ call_metadata = {}
869
+
870
+ # Set x-goog-api-client header
871
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
872
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
873
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
874
+
875
+ options.apply_defaults timeout: @config.timeout,
876
+ metadata: call_metadata
877
+
878
+ uri, body, _query_string_params = transcode_set_iam_policy request
879
+ response = @client_stub.make_post_request(
880
+ uri: uri,
881
+ body: body,
882
+ options: options
883
+ )
884
+ result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
885
+
886
+ yield result, response if block_given?
887
+ result
888
+ rescue ::Faraday::Error => e
889
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
890
+ raise ::Google::Cloud::Error.from_error(gapic_error)
891
+ end
892
+
893
+ ##
894
+ # Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.
895
+ #
896
+ # @overload set_private_ip_google_access(request, options = nil)
897
+ # Pass arguments to `set_private_ip_google_access` via a request object, either of type
898
+ # {::Google::Cloud::Compute::V1::SetPrivateIpGoogleAccessSubnetworkRequest} or an equivalent Hash.
899
+ #
900
+ # @param request [::Google::Cloud::Compute::V1::SetPrivateIpGoogleAccessSubnetworkRequest, ::Hash]
901
+ # A request object representing the call parameters. Required. To specify no
902
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
903
+ # @param options [::Gapic::CallOptions, ::Hash]
904
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
905
+ # Note: currently retry functionality is not implemented. While it is possible
906
+ # to set it using ::Gapic::CallOptions, it will not be applied
907
+ #
908
+ # @overload set_private_ip_google_access(project: nil, region: nil, request_id: nil, subnetwork: nil, subnetworks_set_private_ip_google_access_request_resource: nil)
909
+ # Pass arguments to `set_private_ip_google_access` via keyword arguments. Note that at
910
+ # least one keyword argument is required. To specify no parameters, or to keep all
911
+ # the default parameter values, pass an empty Hash as a request object (see above).
912
+ #
913
+ # @param project [::String]
914
+ # Project ID for this request.
915
+ # @param region [::String]
916
+ # Name of the region scoping this request.
917
+ # @param request_id [::String]
918
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
919
+ #
920
+ # 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.
921
+ #
922
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
923
+ # @param subnetwork [::String]
924
+ # Name of the Subnetwork resource.
925
+ # @param subnetworks_set_private_ip_google_access_request_resource [::Google::Cloud::Compute::V1::SubnetworksSetPrivateIpGoogleAccessRequest, ::Hash]
926
+ # The body resource for this request
927
+ # @yield [result, env] Access the result along with the Faraday environment object
928
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
929
+ # @yieldparam response [::Faraday::Response]
930
+ #
931
+ # @return [::Google::Cloud::Compute::V1::Operation]
932
+ #
933
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
934
+ def set_private_ip_google_access request, options = nil
935
+ raise ::ArgumentError, "request must be provided" if request.nil?
936
+
937
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetPrivateIpGoogleAccessSubnetworkRequest
938
+
939
+ # Converts hash and nil to an options object
940
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
941
+
942
+ # Customize the options with defaults
943
+ call_metadata = {}
944
+
945
+ # Set x-goog-api-client header
946
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
947
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
948
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
949
+
950
+ options.apply_defaults timeout: @config.timeout,
951
+ metadata: call_metadata
952
+
953
+ uri, body, _query_string_params = transcode_set_private_ip_google_access request
954
+ response = @client_stub.make_post_request(
955
+ uri: uri,
956
+ body: body,
957
+ options: options
958
+ )
959
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
960
+
961
+ yield result, response if block_given?
962
+ result
963
+ rescue ::Faraday::Error => e
964
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
965
+ raise ::Google::Cloud::Error.from_error(gapic_error)
966
+ end
967
+
968
+ ##
969
+ # Returns permissions that a caller has on the specified resource.
970
+ #
971
+ # @overload test_iam_permissions(request, options = nil)
972
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
973
+ # {::Google::Cloud::Compute::V1::TestIamPermissionsSubnetworkRequest} or an equivalent Hash.
974
+ #
975
+ # @param request [::Google::Cloud::Compute::V1::TestIamPermissionsSubnetworkRequest, ::Hash]
976
+ # A request object representing the call parameters. Required. To specify no
977
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
978
+ # @param options [::Gapic::CallOptions, ::Hash]
979
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
980
+ # Note: currently retry functionality is not implemented. While it is possible
981
+ # to set it using ::Gapic::CallOptions, it will not be applied
982
+ #
983
+ # @overload test_iam_permissions(project: nil, region: nil, resource: nil, test_permissions_request_resource: nil)
984
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
985
+ # least one keyword argument is required. To specify no parameters, or to keep all
986
+ # the default parameter values, pass an empty Hash as a request object (see above).
987
+ #
988
+ # @param project [::String]
989
+ # Project ID for this request.
990
+ # @param region [::String]
991
+ # The name of the region for this request.
992
+ # @param resource [::String]
993
+ # Name or id of the resource for this request.
994
+ # @param test_permissions_request_resource [::Google::Cloud::Compute::V1::TestPermissionsRequest, ::Hash]
995
+ # The body resource for this request
996
+ # @yield [result, env] Access the result along with the Faraday environment object
997
+ # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
998
+ # @yieldparam response [::Faraday::Response]
999
+ #
1000
+ # @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
1001
+ #
1002
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1003
+ def test_iam_permissions request, options = nil
1004
+ raise ::ArgumentError, "request must be provided" if request.nil?
1005
+
1006
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::TestIamPermissionsSubnetworkRequest
1007
+
1008
+ # Converts hash and nil to an options object
1009
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1010
+
1011
+ # Customize the options with defaults
1012
+ call_metadata = {}
1013
+
1014
+ # Set x-goog-api-client header
1015
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1016
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1017
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
1018
+
1019
+ options.apply_defaults timeout: @config.timeout,
1020
+ metadata: call_metadata
1021
+
1022
+ uri, body, _query_string_params = transcode_test_iam_permissions request
1023
+ response = @client_stub.make_post_request(
1024
+ uri: uri,
1025
+ body: body,
1026
+ options: options
1027
+ )
1028
+ result = ::Google::Cloud::Compute::V1::TestPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
1029
+
1030
+ yield result, response if block_given?
1031
+ result
1032
+ rescue ::Faraday::Error => e
1033
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1034
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1035
+ end
1036
+
1037
+ ##
1038
+ # Configuration class for the Subnetworks REST API.
1039
+ #
1040
+ # This class represents the configuration for Subnetworks REST,
1041
+ # providing control over credentials, timeouts, retry behavior, logging.
1042
+ #
1043
+ # Configuration can be applied globally to all clients, or to a single client
1044
+ # on construction.
1045
+ #
1046
+ # # Examples
1047
+ #
1048
+ # To modify the global config, setting the timeout for all calls to 10 seconds:
1049
+ #
1050
+ # ::Google::Cloud::Compute::V1::Subnetworks::Client.configure do |config|
1051
+ # config.timeout = 10.0
1052
+ # end
1053
+ #
1054
+ # To apply the above configuration only to a new client:
1055
+ #
1056
+ # client = ::Google::Cloud::Compute::V1::Subnetworks::Client.new do |config|
1057
+ # config.timeout = 10.0
1058
+ # end
1059
+ #
1060
+ # @!attribute [rw] endpoint
1061
+ # The hostname or hostname:port of the service endpoint.
1062
+ # Defaults to `"compute.googleapis.com"`.
1063
+ # @return [::String]
1064
+ # @!attribute [rw] credentials
1065
+ # Credentials to send with calls. You may provide any of the following types:
1066
+ # * (`String`) The path to a service account key file in JSON format
1067
+ # * (`Hash`) A service account key as a Hash
1068
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1069
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1070
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1071
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1072
+ # * (`nil`) indicating no credentials
1073
+ # @return [::Object]
1074
+ # @!attribute [rw] scope
1075
+ # The OAuth scopes
1076
+ # @return [::Array<::String>]
1077
+ # @!attribute [rw] lib_name
1078
+ # The library name as recorded in instrumentation and logging
1079
+ # @return [::String]
1080
+ # @!attribute [rw] lib_version
1081
+ # The library version as recorded in instrumentation and logging
1082
+ # @return [::String]
1083
+ # @!attribute [rw] timeout
1084
+ # The call timeout in seconds.
1085
+ # @return [::Numeric]
1086
+ #
1087
+ class Configuration
1088
+ extend ::Gapic::Config
1089
+
1090
+ config_attr :endpoint, "compute.googleapis.com", ::String
1091
+ config_attr :credentials, nil do |value|
1092
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1093
+ allowed.any? { |klass| klass === value }
1094
+ end
1095
+ config_attr :scope, nil, ::String, ::Array, nil
1096
+ config_attr :lib_name, nil, ::String, nil
1097
+ config_attr :lib_version, nil, ::String, nil
1098
+ config_attr :timeout, nil, ::Numeric, nil
1099
+
1100
+ # @private
1101
+ def initialize parent_config = nil
1102
+ @parent_config = parent_config unless parent_config.nil?
1103
+
1104
+ yield self if block_given?
1105
+ end
1106
+ end
1107
+ end
1108
+ end
1109
+ end
1110
+ end
1111
+ end
1112
+ end
1113
+ end