google-cloud-compute-v1 1.2.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (267) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -5
  3. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +2 -2
  4. data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +90 -52
  5. data/lib/google/cloud/compute/v1/accelerator_types.rb +5 -0
  6. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +2 -2
  7. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +156 -89
  8. data/lib/google/cloud/compute/v1/addresses.rb +3 -0
  9. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +2 -2
  10. data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +222 -129
  11. data/lib/google/cloud/compute/v1/autoscalers.rb +3 -0
  12. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +1 -1
  13. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +285 -161
  14. data/lib/google/cloud/compute/v1/backend_buckets.rb +3 -0
  15. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +2 -2
  16. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +383 -221
  17. data/lib/google/cloud/compute/v1/backend_services.rb +3 -0
  18. data/lib/google/cloud/compute/v1/compute_pb.rb +671 -3
  19. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +2 -2
  20. data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +90 -52
  21. data/lib/google/cloud/compute/v1/disk_types.rb +3 -0
  22. data/lib/google/cloud/compute/v1/disks/rest/client.rb +3 -3
  23. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +429 -240
  24. data/lib/google/cloud/compute/v1/disks.rb +3 -0
  25. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +1 -1
  26. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +189 -102
  27. data/lib/google/cloud/compute/v1/external_vpn_gateways.rb +3 -0
  28. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +1 -1
  29. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +555 -330
  30. data/lib/google/cloud/compute/v1/firewall_policies.rb +3 -0
  31. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +1 -1
  32. data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +187 -104
  33. data/lib/google/cloud/compute/v1/firewalls.rb +3 -0
  34. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +2 -2
  35. data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +258 -146
  36. data/lib/google/cloud/compute/v1/forwarding_rules.rb +3 -0
  37. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +1 -1
  38. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +121 -66
  39. data/lib/google/cloud/compute/v1/global_addresses.rb +3 -0
  40. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +1 -1
  41. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +221 -122
  42. data/lib/google/cloud/compute/v1/global_forwarding_rules.rb +3 -0
  43. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +2 -2
  44. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +219 -126
  45. data/lib/google/cloud/compute/v1/global_network_endpoint_groups.rb +3 -0
  46. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +2 -2
  47. data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +154 -86
  48. data/lib/google/cloud/compute/v1/global_operations.rb +3 -0
  49. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +1 -1
  50. data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +84 -49
  51. data/lib/google/cloud/compute/v1/global_organization_operations.rb +3 -0
  52. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +1 -1
  53. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +154 -85
  54. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes.rb +3 -0
  55. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +2 -2
  56. data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +218 -127
  57. data/lib/google/cloud/compute/v1/health_checks.rb +3 -0
  58. data/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +27 -7
  59. data/lib/google/cloud/compute/v1/image_family_views.rb +3 -0
  60. data/lib/google/cloud/compute/v1/images/rest/client.rb +1 -1
  61. data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +354 -194
  62. data/lib/google/cloud/compute/v1/images.rb +3 -0
  63. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +10 -10
  64. data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +664 -381
  65. data/lib/google/cloud/compute/v1/instance_group_managers.rb +3 -0
  66. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +4 -4
  67. data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +292 -169
  68. data/lib/google/cloud/compute/v1/instance_groups.rb +3 -0
  69. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +1 -1
  70. data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +221 -120
  71. data/lib/google/cloud/compute/v1/instance_templates.rb +3 -0
  72. data/lib/google/cloud/compute/v1/instances/rest/client.rb +7 -5
  73. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +1503 -845
  74. data/lib/google/cloud/compute/v1/instances.rb +3 -0
  75. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +2 -2
  76. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +190 -109
  77. data/lib/google/cloud/compute/v1/interconnect_attachments.rb +3 -0
  78. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +1 -1
  79. data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +57 -29
  80. data/lib/google/cloud/compute/v1/interconnect_locations.rb +3 -0
  81. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +1 -1
  82. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +187 -102
  83. data/lib/google/cloud/compute/v1/interconnects.rb +3 -0
  84. data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +60 -25
  85. data/lib/google/cloud/compute/v1/license_codes.rb +3 -0
  86. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +1 -1
  87. data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +221 -120
  88. data/lib/google/cloud/compute/v1/licenses.rb +3 -0
  89. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +1 -1
  90. data/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +221 -121
  91. data/lib/google/cloud/compute/v1/machine_images.rb +3 -0
  92. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +2 -2
  93. data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +90 -52
  94. data/lib/google/cloud/compute/v1/machine_types.rb +3 -0
  95. data/lib/google/cloud/compute/v1/network_edge_security_services/credentials.rb +52 -0
  96. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +679 -0
  97. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +348 -0
  98. data/lib/google/cloud/compute/v1/network_edge_security_services/rest.rb +33 -0
  99. data/lib/google/cloud/compute/v1/network_edge_security_services.rb +47 -0
  100. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +3 -3
  101. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +293 -168
  102. data/lib/google/cloud/compute/v1/network_endpoint_groups.rb +3 -0
  103. data/lib/google/cloud/compute/v1/network_firewall_policies/credentials.rb +52 -0
  104. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +1552 -0
  105. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +998 -0
  106. data/lib/google/cloud/compute/v1/network_firewall_policies/rest.rb +33 -0
  107. data/lib/google/cloud/compute/v1/network_firewall_policies.rb +47 -0
  108. data/lib/google/cloud/compute/v1/networks/rest/client.rb +2 -2
  109. data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +350 -202
  110. data/lib/google/cloud/compute/v1/networks.rb +3 -0
  111. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +3 -3
  112. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +428 -242
  113. data/lib/google/cloud/compute/v1/node_groups.rb +3 -0
  114. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +2 -2
  115. data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +259 -143
  116. data/lib/google/cloud/compute/v1/node_templates.rb +3 -0
  117. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +2 -2
  118. data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +90 -52
  119. data/lib/google/cloud/compute/v1/node_types.rb +3 -0
  120. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +2 -2
  121. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +225 -126
  122. data/lib/google/cloud/compute/v1/packet_mirrorings.rb +3 -0
  123. data/lib/google/cloud/compute/v1/projects/rest/client.rb +2 -2
  124. data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +406 -238
  125. data/lib/google/cloud/compute/v1/projects.rb +3 -0
  126. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +1 -1
  127. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +154 -85
  128. data/lib/google/cloud/compute/v1/public_advertised_prefixes.rb +3 -0
  129. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +2 -2
  130. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +190 -108
  131. data/lib/google/cloud/compute/v1/public_delegated_prefixes.rb +3 -0
  132. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +1 -1
  133. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +191 -106
  134. data/lib/google/cloud/compute/v1/region_autoscalers.rb +3 -0
  135. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +1 -1
  136. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +228 -122
  137. data/lib/google/cloud/compute/v1/region_backend_services.rb +3 -0
  138. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +2 -2
  139. data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +157 -92
  140. data/lib/google/cloud/compute/v1/region_commitments.rb +3 -0
  141. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +1 -1
  142. data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +59 -29
  143. data/lib/google/cloud/compute/v1/region_disk_types.rb +3 -0
  144. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +1 -1
  145. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +398 -216
  146. data/lib/google/cloud/compute/v1/region_disks.rb +3 -0
  147. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +1 -1
  148. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +159 -85
  149. data/lib/google/cloud/compute/v1/region_health_check_services.rb +3 -0
  150. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +1 -1
  151. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +193 -104
  152. data/lib/google/cloud/compute/v1/region_health_checks.rb +3 -0
  153. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +9 -9
  154. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +633 -358
  155. data/lib/google/cloud/compute/v1/region_instance_group_managers.rb +3 -0
  156. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +2 -2
  157. data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +127 -71
  158. data/lib/google/cloud/compute/v1/region_instance_groups.rb +3 -0
  159. data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +26 -9
  160. data/lib/google/cloud/compute/v1/region_instances.rb +3 -0
  161. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +1 -1
  162. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +125 -66
  163. data/lib/google/cloud/compute/v1/region_network_endpoint_groups.rb +3 -0
  164. data/lib/google/cloud/compute/v1/region_network_firewall_policies/credentials.rb +52 -0
  165. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +1670 -0
  166. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +1073 -0
  167. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest.rb +33 -0
  168. data/lib/google/cloud/compute/v1/region_network_firewall_policies.rb +47 -0
  169. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +1 -1
  170. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +125 -66
  171. data/lib/google/cloud/compute/v1/region_notification_endpoints.rb +3 -0
  172. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +1 -1
  173. data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +127 -63
  174. data/lib/google/cloud/compute/v1/region_operations.rb +3 -0
  175. data/lib/google/cloud/compute/v1/region_security_policies/credentials.rb +52 -0
  176. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +676 -0
  177. data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +349 -0
  178. data/lib/google/cloud/compute/v1/region_security_policies/rest.rb +33 -0
  179. data/lib/google/cloud/compute/v1/region_security_policies.rb +47 -0
  180. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +1 -1
  181. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +125 -66
  182. data/lib/google/cloud/compute/v1/region_ssl_certificates.rb +3 -0
  183. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +1 -1
  184. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +159 -85
  185. data/lib/google/cloud/compute/v1/region_target_http_proxies.rb +3 -0
  186. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +88 -1
  187. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +249 -99
  188. data/lib/google/cloud/compute/v1/region_target_https_proxies.rb +3 -0
  189. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +1 -1
  190. data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +228 -122
  191. data/lib/google/cloud/compute/v1/region_url_maps.rb +3 -0
  192. data/lib/google/cloud/compute/v1/regions/rest/client.rb +1 -1
  193. data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +57 -29
  194. data/lib/google/cloud/compute/v1/regions.rb +3 -0
  195. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +2 -2
  196. data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +327 -183
  197. data/lib/google/cloud/compute/v1/reservations.rb +3 -0
  198. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +2 -2
  199. data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +259 -143
  200. data/lib/google/cloud/compute/v1/resource_policies.rb +3 -0
  201. data/lib/google/cloud/compute/v1/routers/rest/client.rb +3 -3
  202. data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +326 -184
  203. data/lib/google/cloud/compute/v1/routers.rb +3 -0
  204. data/lib/google/cloud/compute/v1/routes/rest/client.rb +1 -1
  205. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +121 -66
  206. data/lib/google/cloud/compute/v1/routes.rb +3 -0
  207. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +97 -5
  208. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +368 -174
  209. data/lib/google/cloud/compute/v1/security_policies.rb +3 -0
  210. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +2 -2
  211. data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +293 -162
  212. data/lib/google/cloud/compute/v1/service_attachments.rb +3 -0
  213. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +1 -1
  214. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +255 -138
  215. data/lib/google/cloud/compute/v1/snapshots.rb +3 -0
  216. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +2 -2
  217. data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +152 -89
  218. data/lib/google/cloud/compute/v1/ssl_certificates.rb +3 -0
  219. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +2 -2
  220. data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +185 -107
  221. data/lib/google/cloud/compute/v1/ssl_policies.rb +3 -0
  222. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +3 -3
  223. data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +392 -223
  224. data/lib/google/cloud/compute/v1/subnetworks.rb +3 -0
  225. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +1 -1
  226. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +154 -85
  227. data/lib/google/cloud/compute/v1/target_grpc_proxies.rb +3 -0
  228. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +2 -2
  229. data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +218 -127
  230. data/lib/google/cloud/compute/v1/target_http_proxies.rb +3 -0
  231. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +86 -2
  232. data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +371 -178
  233. data/lib/google/cloud/compute/v1/target_https_proxies.rb +3 -0
  234. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +2 -2
  235. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +156 -89
  236. data/lib/google/cloud/compute/v1/target_instances.rb +3 -0
  237. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +2 -2
  238. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +361 -203
  239. data/lib/google/cloud/compute/v1/target_pools.rb +3 -0
  240. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +85 -1
  241. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +307 -136
  242. data/lib/google/cloud/compute/v1/target_ssl_proxies.rb +3 -0
  243. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +1 -1
  244. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +187 -104
  245. data/lib/google/cloud/compute/v1/target_tcp_proxies.rb +3 -0
  246. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +2 -2
  247. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +156 -89
  248. data/lib/google/cloud/compute/v1/target_vpn_gateways.rb +3 -0
  249. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +2 -2
  250. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +285 -164
  251. data/lib/google/cloud/compute/v1/url_maps.rb +3 -0
  252. data/lib/google/cloud/compute/v1/version.rb +1 -1
  253. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +2 -2
  254. data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +259 -143
  255. data/lib/google/cloud/compute/v1/vpn_gateways.rb +3 -0
  256. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +2 -2
  257. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +156 -89
  258. data/lib/google/cloud/compute/v1/vpn_tunnels.rb +3 -0
  259. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +1 -1
  260. data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +127 -63
  261. data/lib/google/cloud/compute/v1/zone_operations.rb +3 -0
  262. data/lib/google/cloud/compute/v1/zones/rest/client.rb +1 -1
  263. data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +57 -29
  264. data/lib/google/cloud/compute/v1/zones.rb +3 -0
  265. data/lib/google/cloud/compute/v1.rb +4 -0
  266. data/proto_docs/google/cloud/compute/v1/compute.rb +1946 -229
  267. metadata +32 -12
@@ -0,0 +1,1670 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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
+ require "google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub"
22
+ require "google/cloud/compute/v1/region_operations/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Compute
27
+ module V1
28
+ module RegionNetworkFirewallPolicies
29
+ module Rest
30
+ ##
31
+ # REST client for the RegionNetworkFirewallPolicies service.
32
+ #
33
+ # The RegionNetworkFirewallPolicies API.
34
+ #
35
+ class Client
36
+ # @private
37
+ attr_reader :region_network_firewall_policies_stub
38
+
39
+ ##
40
+ # Configure the RegionNetworkFirewallPolicies Client class.
41
+ #
42
+ # See {::Google::Cloud::Compute::V1::RegionNetworkFirewallPolicies::Rest::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # @example
46
+ #
47
+ # # Modify the configuration for all RegionNetworkFirewallPolicies clients
48
+ # ::Google::Cloud::Compute::V1::RegionNetworkFirewallPolicies::Rest::Client.configure do |config|
49
+ # config.timeout = 10.0
50
+ # end
51
+ #
52
+ # @yield [config] Configure the Client client.
53
+ # @yieldparam config [Client::Configuration]
54
+ #
55
+ # @return [Client::Configuration]
56
+ #
57
+ def self.configure
58
+ @configure ||= begin
59
+ namespace = ["Google", "Cloud", "Compute", "V1"]
60
+ parent_config = while namespace.any?
61
+ parent_name = namespace.join "::"
62
+ parent_const = const_get parent_name
63
+ break parent_const.configure if parent_const.respond_to? :configure
64
+ namespace.pop
65
+ end
66
+ default_config = Client::Configuration.new parent_config
67
+
68
+ default_config.rpcs.add_association.timeout = 600.0
69
+
70
+ default_config.rpcs.add_rule.timeout = 600.0
71
+
72
+ default_config.rpcs.clone_rules.timeout = 600.0
73
+
74
+ default_config.rpcs.delete.timeout = 600.0
75
+
76
+ default_config.rpcs.get.timeout = 600.0
77
+ default_config.rpcs.get.retry_policy = {
78
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
79
+ }
80
+
81
+ default_config.rpcs.get_association.timeout = 600.0
82
+ default_config.rpcs.get_association.retry_policy = {
83
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
84
+ }
85
+
86
+ default_config.rpcs.get_effective_firewalls.timeout = 600.0
87
+ default_config.rpcs.get_effective_firewalls.retry_policy = {
88
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
89
+ }
90
+
91
+ default_config.rpcs.get_iam_policy.timeout = 600.0
92
+ default_config.rpcs.get_iam_policy.retry_policy = {
93
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
94
+ }
95
+
96
+ default_config.rpcs.get_rule.timeout = 600.0
97
+ default_config.rpcs.get_rule.retry_policy = {
98
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
99
+ }
100
+
101
+ default_config.rpcs.insert.timeout = 600.0
102
+
103
+ default_config.rpcs.list.timeout = 600.0
104
+ default_config.rpcs.list.retry_policy = {
105
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
106
+ }
107
+
108
+ default_config.rpcs.patch.timeout = 600.0
109
+
110
+ default_config.rpcs.patch_rule.timeout = 600.0
111
+
112
+ default_config.rpcs.remove_association.timeout = 600.0
113
+
114
+ default_config.rpcs.remove_rule.timeout = 600.0
115
+
116
+ default_config.rpcs.set_iam_policy.timeout = 600.0
117
+
118
+ default_config.rpcs.test_iam_permissions.timeout = 600.0
119
+
120
+ default_config
121
+ end
122
+ yield @configure if block_given?
123
+ @configure
124
+ end
125
+
126
+ ##
127
+ # Configure the RegionNetworkFirewallPolicies Client instance.
128
+ #
129
+ # The configuration is set to the derived mode, meaning that values can be changed,
130
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
131
+ # should be made on {Client.configure}.
132
+ #
133
+ # See {::Google::Cloud::Compute::V1::RegionNetworkFirewallPolicies::Rest::Client::Configuration}
134
+ # for a description of the configuration fields.
135
+ #
136
+ # @yield [config] Configure the Client client.
137
+ # @yieldparam config [Client::Configuration]
138
+ #
139
+ # @return [Client::Configuration]
140
+ #
141
+ def configure
142
+ yield @config if block_given?
143
+ @config
144
+ end
145
+
146
+ ##
147
+ # Create a new RegionNetworkFirewallPolicies REST client object.
148
+ #
149
+ # @example
150
+ #
151
+ # # Create a client using the default configuration
152
+ # client = ::Google::Cloud::Compute::V1::RegionNetworkFirewallPolicies::Rest::Client.new
153
+ #
154
+ # # Create a client using a custom configuration
155
+ # client = ::Google::Cloud::Compute::V1::RegionNetworkFirewallPolicies::Rest::Client.new do |config|
156
+ # config.timeout = 10.0
157
+ # end
158
+ #
159
+ # @yield [config] Configure the RegionNetworkFirewallPolicies client.
160
+ # @yieldparam config [Client::Configuration]
161
+ #
162
+ def initialize
163
+ # Create the configuration object
164
+ @config = Configuration.new Client.configure
165
+
166
+ # Yield the configuration if needed
167
+ yield @config if block_given?
168
+
169
+ # Create credentials
170
+ credentials = @config.credentials
171
+ credentials ||= Credentials.default scope: @config.scope
172
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
173
+ credentials = Credentials.new credentials, scope: @config.scope
174
+ end
175
+
176
+ @region_operations = ::Google::Cloud::Compute::V1::RegionOperations::Rest::Client.new do |config|
177
+ config.credentials = credentials
178
+ config.endpoint = @config.endpoint
179
+ end
180
+
181
+ @region_network_firewall_policies_stub = ::Google::Cloud::Compute::V1::RegionNetworkFirewallPolicies::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
182
+ end
183
+
184
+ ##
185
+ # Get the associated client for long-running operations via RegionOperations.
186
+ #
187
+ # @return [::Google::Cloud::Compute::V1::RegionOperations::Rest::Client]
188
+ #
189
+ attr_reader :region_operations
190
+
191
+ # Service calls
192
+
193
+ ##
194
+ # Inserts an association for the specified network firewall policy.
195
+ #
196
+ # @overload add_association(request, options = nil)
197
+ # Pass arguments to `add_association` via a request object, either of type
198
+ # {::Google::Cloud::Compute::V1::AddAssociationRegionNetworkFirewallPolicyRequest} or an equivalent Hash.
199
+ #
200
+ # @param request [::Google::Cloud::Compute::V1::AddAssociationRegionNetworkFirewallPolicyRequest, ::Hash]
201
+ # A request object representing the call parameters. Required. To specify no
202
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
203
+ # @param options [::Gapic::CallOptions, ::Hash]
204
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
205
+ # Note: currently retry functionality is not implemented. While it is possible
206
+ # to set it using ::Gapic::CallOptions, it will not be applied
207
+ #
208
+ # @overload add_association(firewall_policy: nil, firewall_policy_association_resource: nil, project: nil, region: nil, replace_existing_association: nil, request_id: nil)
209
+ # Pass arguments to `add_association` via keyword arguments. Note that at
210
+ # least one keyword argument is required. To specify no parameters, or to keep all
211
+ # the default parameter values, pass an empty Hash as a request object (see above).
212
+ #
213
+ # @param firewall_policy [::String]
214
+ # Name of the firewall policy to update.
215
+ # @param firewall_policy_association_resource [::Google::Cloud::Compute::V1::FirewallPolicyAssociation, ::Hash]
216
+ # The body resource for this request
217
+ # @param project [::String]
218
+ # Project ID for this request.
219
+ # @param region [::String]
220
+ # Name of the region scoping this request.
221
+ # @param replace_existing_association [::Boolean]
222
+ # Indicates whether or not to replace it if an association already exists. This is false by default, in which case an error will be returned if an association already exists.
223
+ # @param request_id [::String]
224
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
225
+ # @yield [result, response] Access the result along with the Faraday response object
226
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
227
+ # @yieldparam response [::Faraday::Response]
228
+ #
229
+ # @return [::Gapic::GenericLRO::Operation]
230
+ #
231
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
232
+ def add_association request, options = nil
233
+ raise ::ArgumentError, "request must be provided" if request.nil?
234
+
235
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AddAssociationRegionNetworkFirewallPolicyRequest
236
+
237
+ # Converts hash and nil to an options object
238
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
239
+
240
+ # Customize the options with defaults
241
+ call_metadata = @config.rpcs.add_association.metadata.to_h
242
+
243
+ # Set x-goog-api-client header
244
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
245
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
246
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
247
+ transports_version_send: [:rest]
248
+
249
+ options.apply_defaults timeout: @config.rpcs.add_association.timeout,
250
+ metadata: call_metadata
251
+
252
+ options.apply_defaults timeout: @config.timeout,
253
+ metadata: @config.metadata
254
+
255
+ @region_network_firewall_policies_stub.add_association request, options do |result, response|
256
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
257
+ operation: result,
258
+ client: region_operations,
259
+ request_values: {
260
+ "project" => request.project,
261
+ "region" => request.region
262
+ },
263
+ options: options
264
+ )
265
+ yield result, response if block_given?
266
+ return result
267
+ end
268
+ rescue ::Faraday::Error => e
269
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
270
+ raise ::Google::Cloud::Error.from_error(gapic_error)
271
+ end
272
+
273
+ ##
274
+ # Inserts a rule into a network firewall policy.
275
+ #
276
+ # @overload add_rule(request, options = nil)
277
+ # Pass arguments to `add_rule` via a request object, either of type
278
+ # {::Google::Cloud::Compute::V1::AddRuleRegionNetworkFirewallPolicyRequest} or an equivalent Hash.
279
+ #
280
+ # @param request [::Google::Cloud::Compute::V1::AddRuleRegionNetworkFirewallPolicyRequest, ::Hash]
281
+ # A request object representing the call parameters. Required. To specify no
282
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
283
+ # @param options [::Gapic::CallOptions, ::Hash]
284
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
285
+ # Note: currently retry functionality is not implemented. While it is possible
286
+ # to set it using ::Gapic::CallOptions, it will not be applied
287
+ #
288
+ # @overload add_rule(firewall_policy: nil, firewall_policy_rule_resource: nil, max_priority: nil, min_priority: nil, project: nil, region: nil, request_id: nil)
289
+ # Pass arguments to `add_rule` via keyword arguments. Note that at
290
+ # least one keyword argument is required. To specify no parameters, or to keep all
291
+ # the default parameter values, pass an empty Hash as a request object (see above).
292
+ #
293
+ # @param firewall_policy [::String]
294
+ # Name of the firewall policy to update.
295
+ # @param firewall_policy_rule_resource [::Google::Cloud::Compute::V1::FirewallPolicyRule, ::Hash]
296
+ # The body resource for this request
297
+ # @param max_priority [::Integer]
298
+ # When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority.
299
+ # @param min_priority [::Integer]
300
+ # When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority.
301
+ # @param project [::String]
302
+ # Project ID for this request.
303
+ # @param region [::String]
304
+ # Name of the region scoping this request.
305
+ # @param request_id [::String]
306
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
307
+ # @yield [result, response] Access the result along with the Faraday response object
308
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
309
+ # @yieldparam response [::Faraday::Response]
310
+ #
311
+ # @return [::Gapic::GenericLRO::Operation]
312
+ #
313
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
314
+ def add_rule request, options = nil
315
+ raise ::ArgumentError, "request must be provided" if request.nil?
316
+
317
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AddRuleRegionNetworkFirewallPolicyRequest
318
+
319
+ # Converts hash and nil to an options object
320
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
321
+
322
+ # Customize the options with defaults
323
+ call_metadata = @config.rpcs.add_rule.metadata.to_h
324
+
325
+ # Set x-goog-api-client header
326
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
327
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
328
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
329
+ transports_version_send: [:rest]
330
+
331
+ options.apply_defaults timeout: @config.rpcs.add_rule.timeout,
332
+ metadata: call_metadata
333
+
334
+ options.apply_defaults timeout: @config.timeout,
335
+ metadata: @config.metadata
336
+
337
+ @region_network_firewall_policies_stub.add_rule request, options do |result, response|
338
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
339
+ operation: result,
340
+ client: region_operations,
341
+ request_values: {
342
+ "project" => request.project,
343
+ "region" => request.region
344
+ },
345
+ options: options
346
+ )
347
+ yield result, response if block_given?
348
+ return result
349
+ end
350
+ rescue ::Faraday::Error => e
351
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
352
+ raise ::Google::Cloud::Error.from_error(gapic_error)
353
+ end
354
+
355
+ ##
356
+ # Copies rules to the specified network firewall policy.
357
+ #
358
+ # @overload clone_rules(request, options = nil)
359
+ # Pass arguments to `clone_rules` via a request object, either of type
360
+ # {::Google::Cloud::Compute::V1::CloneRulesRegionNetworkFirewallPolicyRequest} or an equivalent Hash.
361
+ #
362
+ # @param request [::Google::Cloud::Compute::V1::CloneRulesRegionNetworkFirewallPolicyRequest, ::Hash]
363
+ # A request object representing the call parameters. Required. To specify no
364
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
365
+ # @param options [::Gapic::CallOptions, ::Hash]
366
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
367
+ # Note: currently retry functionality is not implemented. While it is possible
368
+ # to set it using ::Gapic::CallOptions, it will not be applied
369
+ #
370
+ # @overload clone_rules(firewall_policy: nil, project: nil, region: nil, request_id: nil, source_firewall_policy: nil)
371
+ # Pass arguments to `clone_rules` via keyword arguments. Note that at
372
+ # least one keyword argument is required. To specify no parameters, or to keep all
373
+ # the default parameter values, pass an empty Hash as a request object (see above).
374
+ #
375
+ # @param firewall_policy [::String]
376
+ # Name of the firewall policy to update.
377
+ # @param project [::String]
378
+ # Project ID for this request.
379
+ # @param region [::String]
380
+ # Name of the region scoping this request.
381
+ # @param request_id [::String]
382
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
383
+ # @param source_firewall_policy [::String]
384
+ # The firewall policy from which to copy rules.
385
+ # @yield [result, response] Access the result along with the Faraday response object
386
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
387
+ # @yieldparam response [::Faraday::Response]
388
+ #
389
+ # @return [::Gapic::GenericLRO::Operation]
390
+ #
391
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
392
+ def clone_rules request, options = nil
393
+ raise ::ArgumentError, "request must be provided" if request.nil?
394
+
395
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::CloneRulesRegionNetworkFirewallPolicyRequest
396
+
397
+ # Converts hash and nil to an options object
398
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
399
+
400
+ # Customize the options with defaults
401
+ call_metadata = @config.rpcs.clone_rules.metadata.to_h
402
+
403
+ # Set x-goog-api-client header
404
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
405
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
406
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
407
+ transports_version_send: [:rest]
408
+
409
+ options.apply_defaults timeout: @config.rpcs.clone_rules.timeout,
410
+ metadata: call_metadata
411
+
412
+ options.apply_defaults timeout: @config.timeout,
413
+ metadata: @config.metadata
414
+
415
+ @region_network_firewall_policies_stub.clone_rules request, options do |result, response|
416
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
417
+ operation: result,
418
+ client: region_operations,
419
+ request_values: {
420
+ "project" => request.project,
421
+ "region" => request.region
422
+ },
423
+ options: options
424
+ )
425
+ yield result, response if block_given?
426
+ return result
427
+ end
428
+ rescue ::Faraday::Error => e
429
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
430
+ raise ::Google::Cloud::Error.from_error(gapic_error)
431
+ end
432
+
433
+ ##
434
+ # Deletes the specified network firewall policy.
435
+ #
436
+ # @overload delete(request, options = nil)
437
+ # Pass arguments to `delete` via a request object, either of type
438
+ # {::Google::Cloud::Compute::V1::DeleteRegionNetworkFirewallPolicyRequest} or an equivalent Hash.
439
+ #
440
+ # @param request [::Google::Cloud::Compute::V1::DeleteRegionNetworkFirewallPolicyRequest, ::Hash]
441
+ # A request object representing the call parameters. Required. To specify no
442
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
443
+ # @param options [::Gapic::CallOptions, ::Hash]
444
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
445
+ # Note: currently retry functionality is not implemented. While it is possible
446
+ # to set it using ::Gapic::CallOptions, it will not be applied
447
+ #
448
+ # @overload delete(firewall_policy: nil, project: nil, region: nil, request_id: nil)
449
+ # Pass arguments to `delete` via keyword arguments. Note that at
450
+ # least one keyword argument is required. To specify no parameters, or to keep all
451
+ # the default parameter values, pass an empty Hash as a request object (see above).
452
+ #
453
+ # @param firewall_policy [::String]
454
+ # Name of the firewall policy to delete.
455
+ # @param project [::String]
456
+ # Project ID for this request.
457
+ # @param region [::String]
458
+ # Name of the region scoping this request.
459
+ # @param request_id [::String]
460
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
461
+ # @yield [result, response] Access the result along with the Faraday response object
462
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
463
+ # @yieldparam response [::Faraday::Response]
464
+ #
465
+ # @return [::Gapic::GenericLRO::Operation]
466
+ #
467
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
468
+ def delete request, options = nil
469
+ raise ::ArgumentError, "request must be provided" if request.nil?
470
+
471
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteRegionNetworkFirewallPolicyRequest
472
+
473
+ # Converts hash and nil to an options object
474
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
475
+
476
+ # Customize the options with defaults
477
+ call_metadata = @config.rpcs.delete.metadata.to_h
478
+
479
+ # Set x-goog-api-client header
480
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
481
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
482
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
483
+ transports_version_send: [:rest]
484
+
485
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
486
+ metadata: call_metadata
487
+
488
+ options.apply_defaults timeout: @config.timeout,
489
+ metadata: @config.metadata
490
+
491
+ @region_network_firewall_policies_stub.delete request, options do |result, response|
492
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
493
+ operation: result,
494
+ client: region_operations,
495
+ request_values: {
496
+ "project" => request.project,
497
+ "region" => request.region
498
+ },
499
+ options: options
500
+ )
501
+ yield result, response if block_given?
502
+ return result
503
+ end
504
+ rescue ::Faraday::Error => e
505
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
506
+ raise ::Google::Cloud::Error.from_error(gapic_error)
507
+ end
508
+
509
+ ##
510
+ # Returns the specified network firewall policy.
511
+ #
512
+ # @overload get(request, options = nil)
513
+ # Pass arguments to `get` via a request object, either of type
514
+ # {::Google::Cloud::Compute::V1::GetRegionNetworkFirewallPolicyRequest} or an equivalent Hash.
515
+ #
516
+ # @param request [::Google::Cloud::Compute::V1::GetRegionNetworkFirewallPolicyRequest, ::Hash]
517
+ # A request object representing the call parameters. Required. To specify no
518
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
519
+ # @param options [::Gapic::CallOptions, ::Hash]
520
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
521
+ # Note: currently retry functionality is not implemented. While it is possible
522
+ # to set it using ::Gapic::CallOptions, it will not be applied
523
+ #
524
+ # @overload get(firewall_policy: nil, project: nil, region: nil)
525
+ # Pass arguments to `get` via keyword arguments. Note that at
526
+ # least one keyword argument is required. To specify no parameters, or to keep all
527
+ # the default parameter values, pass an empty Hash as a request object (see above).
528
+ #
529
+ # @param firewall_policy [::String]
530
+ # Name of the firewall policy to get.
531
+ # @param project [::String]
532
+ # Project ID for this request.
533
+ # @param region [::String]
534
+ # Name of the region scoping this request.
535
+ # @yield [result, response] Access the result along with the Faraday response object
536
+ # @yieldparam result [::Google::Cloud::Compute::V1::FirewallPolicy]
537
+ # @yieldparam response [::Faraday::Response]
538
+ #
539
+ # @return [::Google::Cloud::Compute::V1::FirewallPolicy]
540
+ #
541
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
542
+ def get request, options = nil
543
+ raise ::ArgumentError, "request must be provided" if request.nil?
544
+
545
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetRegionNetworkFirewallPolicyRequest
546
+
547
+ # Converts hash and nil to an options object
548
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
549
+
550
+ # Customize the options with defaults
551
+ call_metadata = @config.rpcs.get.metadata.to_h
552
+
553
+ # Set x-goog-api-client header
554
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
555
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
556
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
557
+ transports_version_send: [:rest]
558
+
559
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
560
+ metadata: call_metadata
561
+
562
+ options.apply_defaults timeout: @config.timeout,
563
+ metadata: @config.metadata
564
+
565
+ @region_network_firewall_policies_stub.get request, options do |result, response|
566
+ yield result, response if block_given?
567
+ return result
568
+ end
569
+ rescue ::Faraday::Error => e
570
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
571
+ raise ::Google::Cloud::Error.from_error(gapic_error)
572
+ end
573
+
574
+ ##
575
+ # Gets an association with the specified name.
576
+ #
577
+ # @overload get_association(request, options = nil)
578
+ # Pass arguments to `get_association` via a request object, either of type
579
+ # {::Google::Cloud::Compute::V1::GetAssociationRegionNetworkFirewallPolicyRequest} or an equivalent Hash.
580
+ #
581
+ # @param request [::Google::Cloud::Compute::V1::GetAssociationRegionNetworkFirewallPolicyRequest, ::Hash]
582
+ # A request object representing the call parameters. Required. To specify no
583
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
584
+ # @param options [::Gapic::CallOptions, ::Hash]
585
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
586
+ # Note: currently retry functionality is not implemented. While it is possible
587
+ # to set it using ::Gapic::CallOptions, it will not be applied
588
+ #
589
+ # @overload get_association(firewall_policy: nil, name: nil, project: nil, region: nil)
590
+ # Pass arguments to `get_association` via keyword arguments. Note that at
591
+ # least one keyword argument is required. To specify no parameters, or to keep all
592
+ # the default parameter values, pass an empty Hash as a request object (see above).
593
+ #
594
+ # @param firewall_policy [::String]
595
+ # Name of the firewall policy to which the queried association belongs.
596
+ # @param name [::String]
597
+ # The name of the association to get from the firewall policy.
598
+ # @param project [::String]
599
+ # Project ID for this request.
600
+ # @param region [::String]
601
+ # Name of the region scoping this request.
602
+ # @yield [result, response] Access the result along with the Faraday response object
603
+ # @yieldparam result [::Google::Cloud::Compute::V1::FirewallPolicyAssociation]
604
+ # @yieldparam response [::Faraday::Response]
605
+ #
606
+ # @return [::Google::Cloud::Compute::V1::FirewallPolicyAssociation]
607
+ #
608
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
609
+ def get_association request, options = nil
610
+ raise ::ArgumentError, "request must be provided" if request.nil?
611
+
612
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetAssociationRegionNetworkFirewallPolicyRequest
613
+
614
+ # Converts hash and nil to an options object
615
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
616
+
617
+ # Customize the options with defaults
618
+ call_metadata = @config.rpcs.get_association.metadata.to_h
619
+
620
+ # Set x-goog-api-client header
621
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
622
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
623
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
624
+ transports_version_send: [:rest]
625
+
626
+ options.apply_defaults timeout: @config.rpcs.get_association.timeout,
627
+ metadata: call_metadata
628
+
629
+ options.apply_defaults timeout: @config.timeout,
630
+ metadata: @config.metadata
631
+
632
+ @region_network_firewall_policies_stub.get_association request, options do |result, response|
633
+ yield result, response if block_given?
634
+ return result
635
+ end
636
+ rescue ::Faraday::Error => e
637
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
638
+ raise ::Google::Cloud::Error.from_error(gapic_error)
639
+ end
640
+
641
+ ##
642
+ # Returns the effective firewalls on a given network.
643
+ #
644
+ # @overload get_effective_firewalls(request, options = nil)
645
+ # Pass arguments to `get_effective_firewalls` via a request object, either of type
646
+ # {::Google::Cloud::Compute::V1::GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest} or an equivalent Hash.
647
+ #
648
+ # @param request [::Google::Cloud::Compute::V1::GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest, ::Hash]
649
+ # A request object representing the call parameters. Required. To specify no
650
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
651
+ # @param options [::Gapic::CallOptions, ::Hash]
652
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
653
+ # Note: currently retry functionality is not implemented. While it is possible
654
+ # to set it using ::Gapic::CallOptions, it will not be applied
655
+ #
656
+ # @overload get_effective_firewalls(network: nil, project: nil, region: nil)
657
+ # Pass arguments to `get_effective_firewalls` via keyword arguments. Note that at
658
+ # least one keyword argument is required. To specify no parameters, or to keep all
659
+ # the default parameter values, pass an empty Hash as a request object (see above).
660
+ #
661
+ # @param network [::String]
662
+ # Network reference
663
+ # @param project [::String]
664
+ # Project ID for this request.
665
+ # @param region [::String]
666
+ # Name of the region scoping this request.
667
+ # @yield [result, response] Access the result along with the Faraday response object
668
+ # @yieldparam result [::Google::Cloud::Compute::V1::RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse]
669
+ # @yieldparam response [::Faraday::Response]
670
+ #
671
+ # @return [::Google::Cloud::Compute::V1::RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse]
672
+ #
673
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
674
+ def get_effective_firewalls request, options = nil
675
+ raise ::ArgumentError, "request must be provided" if request.nil?
676
+
677
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest
678
+
679
+ # Converts hash and nil to an options object
680
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
681
+
682
+ # Customize the options with defaults
683
+ call_metadata = @config.rpcs.get_effective_firewalls.metadata.to_h
684
+
685
+ # Set x-goog-api-client header
686
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
687
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
688
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
689
+ transports_version_send: [:rest]
690
+
691
+ options.apply_defaults timeout: @config.rpcs.get_effective_firewalls.timeout,
692
+ metadata: call_metadata
693
+
694
+ options.apply_defaults timeout: @config.timeout,
695
+ metadata: @config.metadata
696
+
697
+ @region_network_firewall_policies_stub.get_effective_firewalls request, options do |result, response|
698
+ yield result, response if block_given?
699
+ return result
700
+ end
701
+ rescue ::Faraday::Error => e
702
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
703
+ raise ::Google::Cloud::Error.from_error(gapic_error)
704
+ end
705
+
706
+ ##
707
+ # Gets the access control policy for a resource. May be empty if no such policy or resource exists.
708
+ #
709
+ # @overload get_iam_policy(request, options = nil)
710
+ # Pass arguments to `get_iam_policy` via a request object, either of type
711
+ # {::Google::Cloud::Compute::V1::GetIamPolicyRegionNetworkFirewallPolicyRequest} or an equivalent Hash.
712
+ #
713
+ # @param request [::Google::Cloud::Compute::V1::GetIamPolicyRegionNetworkFirewallPolicyRequest, ::Hash]
714
+ # A request object representing the call parameters. Required. To specify no
715
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
716
+ # @param options [::Gapic::CallOptions, ::Hash]
717
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
718
+ # Note: currently retry functionality is not implemented. While it is possible
719
+ # to set it using ::Gapic::CallOptions, it will not be applied
720
+ #
721
+ # @overload get_iam_policy(options_requested_policy_version: nil, project: nil, region: nil, resource: nil)
722
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
723
+ # least one keyword argument is required. To specify no parameters, or to keep all
724
+ # the default parameter values, pass an empty Hash as a request object (see above).
725
+ #
726
+ # @param options_requested_policy_version [::Integer]
727
+ # Requested IAM Policy version.
728
+ # @param project [::String]
729
+ # Project ID for this request.
730
+ # @param region [::String]
731
+ # The name of the region for this request.
732
+ # @param resource [::String]
733
+ # Name or id of the resource for this request.
734
+ # @yield [result, response] Access the result along with the Faraday response object
735
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
736
+ # @yieldparam response [::Faraday::Response]
737
+ #
738
+ # @return [::Google::Cloud::Compute::V1::Policy]
739
+ #
740
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
741
+ def get_iam_policy request, options = nil
742
+ raise ::ArgumentError, "request must be provided" if request.nil?
743
+
744
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetIamPolicyRegionNetworkFirewallPolicyRequest
745
+
746
+ # Converts hash and nil to an options object
747
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
748
+
749
+ # Customize the options with defaults
750
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
751
+
752
+ # Set x-goog-api-client header
753
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
754
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
755
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
756
+ transports_version_send: [:rest]
757
+
758
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
759
+ metadata: call_metadata
760
+
761
+ options.apply_defaults timeout: @config.timeout,
762
+ metadata: @config.metadata
763
+
764
+ @region_network_firewall_policies_stub.get_iam_policy request, options do |result, response|
765
+ yield result, response if block_given?
766
+ return result
767
+ end
768
+ rescue ::Faraday::Error => e
769
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
770
+ raise ::Google::Cloud::Error.from_error(gapic_error)
771
+ end
772
+
773
+ ##
774
+ # Gets a rule of the specified priority.
775
+ #
776
+ # @overload get_rule(request, options = nil)
777
+ # Pass arguments to `get_rule` via a request object, either of type
778
+ # {::Google::Cloud::Compute::V1::GetRuleRegionNetworkFirewallPolicyRequest} or an equivalent Hash.
779
+ #
780
+ # @param request [::Google::Cloud::Compute::V1::GetRuleRegionNetworkFirewallPolicyRequest, ::Hash]
781
+ # A request object representing the call parameters. Required. To specify no
782
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
783
+ # @param options [::Gapic::CallOptions, ::Hash]
784
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
785
+ # Note: currently retry functionality is not implemented. While it is possible
786
+ # to set it using ::Gapic::CallOptions, it will not be applied
787
+ #
788
+ # @overload get_rule(firewall_policy: nil, priority: nil, project: nil, region: nil)
789
+ # Pass arguments to `get_rule` via keyword arguments. Note that at
790
+ # least one keyword argument is required. To specify no parameters, or to keep all
791
+ # the default parameter values, pass an empty Hash as a request object (see above).
792
+ #
793
+ # @param firewall_policy [::String]
794
+ # Name of the firewall policy to which the queried rule belongs.
795
+ # @param priority [::Integer]
796
+ # The priority of the rule to get from the firewall policy.
797
+ # @param project [::String]
798
+ # Project ID for this request.
799
+ # @param region [::String]
800
+ # Name of the region scoping this request.
801
+ # @yield [result, response] Access the result along with the Faraday response object
802
+ # @yieldparam result [::Google::Cloud::Compute::V1::FirewallPolicyRule]
803
+ # @yieldparam response [::Faraday::Response]
804
+ #
805
+ # @return [::Google::Cloud::Compute::V1::FirewallPolicyRule]
806
+ #
807
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
808
+ def get_rule request, options = nil
809
+ raise ::ArgumentError, "request must be provided" if request.nil?
810
+
811
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetRuleRegionNetworkFirewallPolicyRequest
812
+
813
+ # Converts hash and nil to an options object
814
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
815
+
816
+ # Customize the options with defaults
817
+ call_metadata = @config.rpcs.get_rule.metadata.to_h
818
+
819
+ # Set x-goog-api-client header
820
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
821
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
822
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
823
+ transports_version_send: [:rest]
824
+
825
+ options.apply_defaults timeout: @config.rpcs.get_rule.timeout,
826
+ metadata: call_metadata
827
+
828
+ options.apply_defaults timeout: @config.timeout,
829
+ metadata: @config.metadata
830
+
831
+ @region_network_firewall_policies_stub.get_rule request, options do |result, response|
832
+ yield result, response if block_given?
833
+ return result
834
+ end
835
+ rescue ::Faraday::Error => e
836
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
837
+ raise ::Google::Cloud::Error.from_error(gapic_error)
838
+ end
839
+
840
+ ##
841
+ # Creates a new network firewall policy in the specified project and region.
842
+ #
843
+ # @overload insert(request, options = nil)
844
+ # Pass arguments to `insert` via a request object, either of type
845
+ # {::Google::Cloud::Compute::V1::InsertRegionNetworkFirewallPolicyRequest} or an equivalent Hash.
846
+ #
847
+ # @param request [::Google::Cloud::Compute::V1::InsertRegionNetworkFirewallPolicyRequest, ::Hash]
848
+ # A request object representing the call parameters. Required. To specify no
849
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
850
+ # @param options [::Gapic::CallOptions, ::Hash]
851
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
852
+ # Note: currently retry functionality is not implemented. While it is possible
853
+ # to set it using ::Gapic::CallOptions, it will not be applied
854
+ #
855
+ # @overload insert(firewall_policy_resource: nil, project: nil, region: nil, request_id: nil)
856
+ # Pass arguments to `insert` via keyword arguments. Note that at
857
+ # least one keyword argument is required. To specify no parameters, or to keep all
858
+ # the default parameter values, pass an empty Hash as a request object (see above).
859
+ #
860
+ # @param firewall_policy_resource [::Google::Cloud::Compute::V1::FirewallPolicy, ::Hash]
861
+ # The body resource for this request
862
+ # @param project [::String]
863
+ # Project ID for this request.
864
+ # @param region [::String]
865
+ # Name of the region scoping this request.
866
+ # @param request_id [::String]
867
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
868
+ # @yield [result, response] Access the result along with the Faraday response object
869
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
870
+ # @yieldparam response [::Faraday::Response]
871
+ #
872
+ # @return [::Gapic::GenericLRO::Operation]
873
+ #
874
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
875
+ def insert request, options = nil
876
+ raise ::ArgumentError, "request must be provided" if request.nil?
877
+
878
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::InsertRegionNetworkFirewallPolicyRequest
879
+
880
+ # Converts hash and nil to an options object
881
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
882
+
883
+ # Customize the options with defaults
884
+ call_metadata = @config.rpcs.insert.metadata.to_h
885
+
886
+ # Set x-goog-api-client header
887
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
888
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
889
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
890
+ transports_version_send: [:rest]
891
+
892
+ options.apply_defaults timeout: @config.rpcs.insert.timeout,
893
+ metadata: call_metadata
894
+
895
+ options.apply_defaults timeout: @config.timeout,
896
+ metadata: @config.metadata
897
+
898
+ @region_network_firewall_policies_stub.insert request, options do |result, response|
899
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
900
+ operation: result,
901
+ client: region_operations,
902
+ request_values: {
903
+ "project" => request.project,
904
+ "region" => request.region
905
+ },
906
+ options: options
907
+ )
908
+ yield result, response if block_given?
909
+ return result
910
+ end
911
+ rescue ::Faraday::Error => e
912
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
913
+ raise ::Google::Cloud::Error.from_error(gapic_error)
914
+ end
915
+
916
+ ##
917
+ # Lists all the network firewall policies that have been configured for the specified project in the given region.
918
+ #
919
+ # @overload list(request, options = nil)
920
+ # Pass arguments to `list` via a request object, either of type
921
+ # {::Google::Cloud::Compute::V1::ListRegionNetworkFirewallPoliciesRequest} or an equivalent Hash.
922
+ #
923
+ # @param request [::Google::Cloud::Compute::V1::ListRegionNetworkFirewallPoliciesRequest, ::Hash]
924
+ # A request object representing the call parameters. Required. To specify no
925
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
926
+ # @param options [::Gapic::CallOptions, ::Hash]
927
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
928
+ # Note: currently retry functionality is not implemented. While it is possible
929
+ # to set it using ::Gapic::CallOptions, it will not be applied
930
+ #
931
+ # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil)
932
+ # Pass arguments to `list` via keyword arguments. Note that at
933
+ # least one keyword argument is required. To specify no parameters, or to keep all
934
+ # the default parameter values, pass an empty Hash as a request object (see above).
935
+ #
936
+ # @param filter [::String]
937
+ # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`.
938
+ # @param max_results [::Integer]
939
+ # 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`)
940
+ # @param order_by [::String]
941
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.
942
+ # @param page_token [::String]
943
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
944
+ # @param project [::String]
945
+ # Project ID for this request.
946
+ # @param region [::String]
947
+ # Name of the region scoping this request.
948
+ # @param return_partial_success [::Boolean]
949
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
950
+ # @yield [result, response] Access the result along with the Faraday response object
951
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::FirewallPolicy>]
952
+ # @yieldparam response [::Faraday::Response]
953
+ #
954
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::FirewallPolicy>]
955
+ #
956
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
957
+ def list request, options = nil
958
+ raise ::ArgumentError, "request must be provided" if request.nil?
959
+
960
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListRegionNetworkFirewallPoliciesRequest
961
+
962
+ # Converts hash and nil to an options object
963
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
964
+
965
+ # Customize the options with defaults
966
+ call_metadata = @config.rpcs.list.metadata.to_h
967
+
968
+ # Set x-goog-api-client header
969
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
970
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
971
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
972
+ transports_version_send: [:rest]
973
+
974
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
975
+ metadata: call_metadata
976
+
977
+ options.apply_defaults timeout: @config.timeout,
978
+ metadata: @config.metadata
979
+
980
+ @region_network_firewall_policies_stub.list request, options do |result, response|
981
+ result = ::Gapic::Rest::PagedEnumerable.new @region_network_firewall_policies_stub, :list, "items", request, result, options
982
+ yield result, response if block_given?
983
+ return result
984
+ end
985
+ rescue ::Faraday::Error => e
986
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
987
+ raise ::Google::Cloud::Error.from_error(gapic_error)
988
+ end
989
+
990
+ ##
991
+ # Patches the specified network firewall policy.
992
+ #
993
+ # @overload patch(request, options = nil)
994
+ # Pass arguments to `patch` via a request object, either of type
995
+ # {::Google::Cloud::Compute::V1::PatchRegionNetworkFirewallPolicyRequest} or an equivalent Hash.
996
+ #
997
+ # @param request [::Google::Cloud::Compute::V1::PatchRegionNetworkFirewallPolicyRequest, ::Hash]
998
+ # A request object representing the call parameters. Required. To specify no
999
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1000
+ # @param options [::Gapic::CallOptions, ::Hash]
1001
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1002
+ # Note: currently retry functionality is not implemented. While it is possible
1003
+ # to set it using ::Gapic::CallOptions, it will not be applied
1004
+ #
1005
+ # @overload patch(firewall_policy: nil, firewall_policy_resource: nil, project: nil, region: nil, request_id: nil)
1006
+ # Pass arguments to `patch` via keyword arguments. Note that at
1007
+ # least one keyword argument is required. To specify no parameters, or to keep all
1008
+ # the default parameter values, pass an empty Hash as a request object (see above).
1009
+ #
1010
+ # @param firewall_policy [::String]
1011
+ # Name of the firewall policy to update.
1012
+ # @param firewall_policy_resource [::Google::Cloud::Compute::V1::FirewallPolicy, ::Hash]
1013
+ # The body resource for this request
1014
+ # @param project [::String]
1015
+ # Project ID for this request.
1016
+ # @param region [::String]
1017
+ # Name of the region scoping this request.
1018
+ # @param request_id [::String]
1019
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
1020
+ # @yield [result, response] Access the result along with the Faraday response object
1021
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
1022
+ # @yieldparam response [::Faraday::Response]
1023
+ #
1024
+ # @return [::Gapic::GenericLRO::Operation]
1025
+ #
1026
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1027
+ def patch request, options = nil
1028
+ raise ::ArgumentError, "request must be provided" if request.nil?
1029
+
1030
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchRegionNetworkFirewallPolicyRequest
1031
+
1032
+ # Converts hash and nil to an options object
1033
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1034
+
1035
+ # Customize the options with defaults
1036
+ call_metadata = @config.rpcs.patch.metadata.to_h
1037
+
1038
+ # Set x-goog-api-client header
1039
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1040
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1041
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1042
+ transports_version_send: [:rest]
1043
+
1044
+ options.apply_defaults timeout: @config.rpcs.patch.timeout,
1045
+ metadata: call_metadata
1046
+
1047
+ options.apply_defaults timeout: @config.timeout,
1048
+ metadata: @config.metadata
1049
+
1050
+ @region_network_firewall_policies_stub.patch request, options do |result, response|
1051
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
1052
+ operation: result,
1053
+ client: region_operations,
1054
+ request_values: {
1055
+ "project" => request.project,
1056
+ "region" => request.region
1057
+ },
1058
+ options: options
1059
+ )
1060
+ yield result, response if block_given?
1061
+ return result
1062
+ end
1063
+ rescue ::Faraday::Error => e
1064
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1065
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1066
+ end
1067
+
1068
+ ##
1069
+ # Patches a rule of the specified priority.
1070
+ #
1071
+ # @overload patch_rule(request, options = nil)
1072
+ # Pass arguments to `patch_rule` via a request object, either of type
1073
+ # {::Google::Cloud::Compute::V1::PatchRuleRegionNetworkFirewallPolicyRequest} or an equivalent Hash.
1074
+ #
1075
+ # @param request [::Google::Cloud::Compute::V1::PatchRuleRegionNetworkFirewallPolicyRequest, ::Hash]
1076
+ # A request object representing the call parameters. Required. To specify no
1077
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1078
+ # @param options [::Gapic::CallOptions, ::Hash]
1079
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1080
+ # Note: currently retry functionality is not implemented. While it is possible
1081
+ # to set it using ::Gapic::CallOptions, it will not be applied
1082
+ #
1083
+ # @overload patch_rule(firewall_policy: nil, firewall_policy_rule_resource: nil, priority: nil, project: nil, region: nil, request_id: nil)
1084
+ # Pass arguments to `patch_rule` via keyword arguments. Note that at
1085
+ # least one keyword argument is required. To specify no parameters, or to keep all
1086
+ # the default parameter values, pass an empty Hash as a request object (see above).
1087
+ #
1088
+ # @param firewall_policy [::String]
1089
+ # Name of the firewall policy to update.
1090
+ # @param firewall_policy_rule_resource [::Google::Cloud::Compute::V1::FirewallPolicyRule, ::Hash]
1091
+ # The body resource for this request
1092
+ # @param priority [::Integer]
1093
+ # The priority of the rule to patch.
1094
+ # @param project [::String]
1095
+ # Project ID for this request.
1096
+ # @param region [::String]
1097
+ # Name of the region scoping this request.
1098
+ # @param request_id [::String]
1099
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
1100
+ # @yield [result, response] Access the result along with the Faraday response object
1101
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
1102
+ # @yieldparam response [::Faraday::Response]
1103
+ #
1104
+ # @return [::Gapic::GenericLRO::Operation]
1105
+ #
1106
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1107
+ def patch_rule request, options = nil
1108
+ raise ::ArgumentError, "request must be provided" if request.nil?
1109
+
1110
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchRuleRegionNetworkFirewallPolicyRequest
1111
+
1112
+ # Converts hash and nil to an options object
1113
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1114
+
1115
+ # Customize the options with defaults
1116
+ call_metadata = @config.rpcs.patch_rule.metadata.to_h
1117
+
1118
+ # Set x-goog-api-client header
1119
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1120
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1121
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1122
+ transports_version_send: [:rest]
1123
+
1124
+ options.apply_defaults timeout: @config.rpcs.patch_rule.timeout,
1125
+ metadata: call_metadata
1126
+
1127
+ options.apply_defaults timeout: @config.timeout,
1128
+ metadata: @config.metadata
1129
+
1130
+ @region_network_firewall_policies_stub.patch_rule request, options do |result, response|
1131
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
1132
+ operation: result,
1133
+ client: region_operations,
1134
+ request_values: {
1135
+ "project" => request.project,
1136
+ "region" => request.region
1137
+ },
1138
+ options: options
1139
+ )
1140
+ yield result, response if block_given?
1141
+ return result
1142
+ end
1143
+ rescue ::Faraday::Error => e
1144
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1145
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1146
+ end
1147
+
1148
+ ##
1149
+ # Removes an association for the specified network firewall policy.
1150
+ #
1151
+ # @overload remove_association(request, options = nil)
1152
+ # Pass arguments to `remove_association` via a request object, either of type
1153
+ # {::Google::Cloud::Compute::V1::RemoveAssociationRegionNetworkFirewallPolicyRequest} or an equivalent Hash.
1154
+ #
1155
+ # @param request [::Google::Cloud::Compute::V1::RemoveAssociationRegionNetworkFirewallPolicyRequest, ::Hash]
1156
+ # A request object representing the call parameters. Required. To specify no
1157
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1158
+ # @param options [::Gapic::CallOptions, ::Hash]
1159
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1160
+ # Note: currently retry functionality is not implemented. While it is possible
1161
+ # to set it using ::Gapic::CallOptions, it will not be applied
1162
+ #
1163
+ # @overload remove_association(firewall_policy: nil, name: nil, project: nil, region: nil, request_id: nil)
1164
+ # Pass arguments to `remove_association` via keyword arguments. Note that at
1165
+ # least one keyword argument is required. To specify no parameters, or to keep all
1166
+ # the default parameter values, pass an empty Hash as a request object (see above).
1167
+ #
1168
+ # @param firewall_policy [::String]
1169
+ # Name of the firewall policy to update.
1170
+ # @param name [::String]
1171
+ # Name for the association that will be removed.
1172
+ # @param project [::String]
1173
+ # Project ID for this request.
1174
+ # @param region [::String]
1175
+ # Name of the region scoping this request.
1176
+ # @param request_id [::String]
1177
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
1178
+ # @yield [result, response] Access the result along with the Faraday response object
1179
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
1180
+ # @yieldparam response [::Faraday::Response]
1181
+ #
1182
+ # @return [::Gapic::GenericLRO::Operation]
1183
+ #
1184
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1185
+ def remove_association request, options = nil
1186
+ raise ::ArgumentError, "request must be provided" if request.nil?
1187
+
1188
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::RemoveAssociationRegionNetworkFirewallPolicyRequest
1189
+
1190
+ # Converts hash and nil to an options object
1191
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1192
+
1193
+ # Customize the options with defaults
1194
+ call_metadata = @config.rpcs.remove_association.metadata.to_h
1195
+
1196
+ # Set x-goog-api-client header
1197
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1198
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1199
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1200
+ transports_version_send: [:rest]
1201
+
1202
+ options.apply_defaults timeout: @config.rpcs.remove_association.timeout,
1203
+ metadata: call_metadata
1204
+
1205
+ options.apply_defaults timeout: @config.timeout,
1206
+ metadata: @config.metadata
1207
+
1208
+ @region_network_firewall_policies_stub.remove_association request, options do |result, response|
1209
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
1210
+ operation: result,
1211
+ client: region_operations,
1212
+ request_values: {
1213
+ "project" => request.project,
1214
+ "region" => request.region
1215
+ },
1216
+ options: options
1217
+ )
1218
+ yield result, response if block_given?
1219
+ return result
1220
+ end
1221
+ rescue ::Faraday::Error => e
1222
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1223
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1224
+ end
1225
+
1226
+ ##
1227
+ # Deletes a rule of the specified priority.
1228
+ #
1229
+ # @overload remove_rule(request, options = nil)
1230
+ # Pass arguments to `remove_rule` via a request object, either of type
1231
+ # {::Google::Cloud::Compute::V1::RemoveRuleRegionNetworkFirewallPolicyRequest} or an equivalent Hash.
1232
+ #
1233
+ # @param request [::Google::Cloud::Compute::V1::RemoveRuleRegionNetworkFirewallPolicyRequest, ::Hash]
1234
+ # A request object representing the call parameters. Required. To specify no
1235
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1236
+ # @param options [::Gapic::CallOptions, ::Hash]
1237
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1238
+ # Note: currently retry functionality is not implemented. While it is possible
1239
+ # to set it using ::Gapic::CallOptions, it will not be applied
1240
+ #
1241
+ # @overload remove_rule(firewall_policy: nil, priority: nil, project: nil, region: nil, request_id: nil)
1242
+ # Pass arguments to `remove_rule` via keyword arguments. Note that at
1243
+ # least one keyword argument is required. To specify no parameters, or to keep all
1244
+ # the default parameter values, pass an empty Hash as a request object (see above).
1245
+ #
1246
+ # @param firewall_policy [::String]
1247
+ # Name of the firewall policy to update.
1248
+ # @param priority [::Integer]
1249
+ # The priority of the rule to remove from the firewall policy.
1250
+ # @param project [::String]
1251
+ # Project ID for this request.
1252
+ # @param region [::String]
1253
+ # Name of the region scoping this request.
1254
+ # @param request_id [::String]
1255
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
1256
+ # @yield [result, response] Access the result along with the Faraday response object
1257
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
1258
+ # @yieldparam response [::Faraday::Response]
1259
+ #
1260
+ # @return [::Gapic::GenericLRO::Operation]
1261
+ #
1262
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1263
+ def remove_rule request, options = nil
1264
+ raise ::ArgumentError, "request must be provided" if request.nil?
1265
+
1266
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::RemoveRuleRegionNetworkFirewallPolicyRequest
1267
+
1268
+ # Converts hash and nil to an options object
1269
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1270
+
1271
+ # Customize the options with defaults
1272
+ call_metadata = @config.rpcs.remove_rule.metadata.to_h
1273
+
1274
+ # Set x-goog-api-client header
1275
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1276
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1277
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1278
+ transports_version_send: [:rest]
1279
+
1280
+ options.apply_defaults timeout: @config.rpcs.remove_rule.timeout,
1281
+ metadata: call_metadata
1282
+
1283
+ options.apply_defaults timeout: @config.timeout,
1284
+ metadata: @config.metadata
1285
+
1286
+ @region_network_firewall_policies_stub.remove_rule request, options do |result, response|
1287
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
1288
+ operation: result,
1289
+ client: region_operations,
1290
+ request_values: {
1291
+ "project" => request.project,
1292
+ "region" => request.region
1293
+ },
1294
+ options: options
1295
+ )
1296
+ yield result, response if block_given?
1297
+ return result
1298
+ end
1299
+ rescue ::Faraday::Error => e
1300
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1301
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1302
+ end
1303
+
1304
+ ##
1305
+ # Sets the access control policy on the specified resource. Replaces any existing policy.
1306
+ #
1307
+ # @overload set_iam_policy(request, options = nil)
1308
+ # Pass arguments to `set_iam_policy` via a request object, either of type
1309
+ # {::Google::Cloud::Compute::V1::SetIamPolicyRegionNetworkFirewallPolicyRequest} or an equivalent Hash.
1310
+ #
1311
+ # @param request [::Google::Cloud::Compute::V1::SetIamPolicyRegionNetworkFirewallPolicyRequest, ::Hash]
1312
+ # A request object representing the call parameters. Required. To specify no
1313
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1314
+ # @param options [::Gapic::CallOptions, ::Hash]
1315
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1316
+ # Note: currently retry functionality is not implemented. While it is possible
1317
+ # to set it using ::Gapic::CallOptions, it will not be applied
1318
+ #
1319
+ # @overload set_iam_policy(project: nil, region: nil, region_set_policy_request_resource: nil, resource: nil)
1320
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
1321
+ # least one keyword argument is required. To specify no parameters, or to keep all
1322
+ # the default parameter values, pass an empty Hash as a request object (see above).
1323
+ #
1324
+ # @param project [::String]
1325
+ # Project ID for this request.
1326
+ # @param region [::String]
1327
+ # The name of the region for this request.
1328
+ # @param region_set_policy_request_resource [::Google::Cloud::Compute::V1::RegionSetPolicyRequest, ::Hash]
1329
+ # The body resource for this request
1330
+ # @param resource [::String]
1331
+ # Name or id of the resource for this request.
1332
+ # @yield [result, response] Access the result along with the Faraday response object
1333
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
1334
+ # @yieldparam response [::Faraday::Response]
1335
+ #
1336
+ # @return [::Google::Cloud::Compute::V1::Policy]
1337
+ #
1338
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1339
+ def set_iam_policy request, options = nil
1340
+ raise ::ArgumentError, "request must be provided" if request.nil?
1341
+
1342
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetIamPolicyRegionNetworkFirewallPolicyRequest
1343
+
1344
+ # Converts hash and nil to an options object
1345
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1346
+
1347
+ # Customize the options with defaults
1348
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
1349
+
1350
+ # Set x-goog-api-client header
1351
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1352
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1353
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1354
+ transports_version_send: [:rest]
1355
+
1356
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
1357
+ metadata: call_metadata
1358
+
1359
+ options.apply_defaults timeout: @config.timeout,
1360
+ metadata: @config.metadata
1361
+
1362
+ @region_network_firewall_policies_stub.set_iam_policy request, options do |result, response|
1363
+ yield result, response if block_given?
1364
+ return result
1365
+ end
1366
+ rescue ::Faraday::Error => e
1367
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1368
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1369
+ end
1370
+
1371
+ ##
1372
+ # Returns permissions that a caller has on the specified resource.
1373
+ #
1374
+ # @overload test_iam_permissions(request, options = nil)
1375
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
1376
+ # {::Google::Cloud::Compute::V1::TestIamPermissionsRegionNetworkFirewallPolicyRequest} or an equivalent Hash.
1377
+ #
1378
+ # @param request [::Google::Cloud::Compute::V1::TestIamPermissionsRegionNetworkFirewallPolicyRequest, ::Hash]
1379
+ # A request object representing the call parameters. Required. To specify no
1380
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1381
+ # @param options [::Gapic::CallOptions, ::Hash]
1382
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1383
+ # Note: currently retry functionality is not implemented. While it is possible
1384
+ # to set it using ::Gapic::CallOptions, it will not be applied
1385
+ #
1386
+ # @overload test_iam_permissions(project: nil, region: nil, resource: nil, test_permissions_request_resource: nil)
1387
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
1388
+ # least one keyword argument is required. To specify no parameters, or to keep all
1389
+ # the default parameter values, pass an empty Hash as a request object (see above).
1390
+ #
1391
+ # @param project [::String]
1392
+ # Project ID for this request.
1393
+ # @param region [::String]
1394
+ # The name of the region for this request.
1395
+ # @param resource [::String]
1396
+ # Name or id of the resource for this request.
1397
+ # @param test_permissions_request_resource [::Google::Cloud::Compute::V1::TestPermissionsRequest, ::Hash]
1398
+ # The body resource for this request
1399
+ # @yield [result, response] Access the result along with the Faraday response object
1400
+ # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
1401
+ # @yieldparam response [::Faraday::Response]
1402
+ #
1403
+ # @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
1404
+ #
1405
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1406
+ def test_iam_permissions request, options = nil
1407
+ raise ::ArgumentError, "request must be provided" if request.nil?
1408
+
1409
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::TestIamPermissionsRegionNetworkFirewallPolicyRequest
1410
+
1411
+ # Converts hash and nil to an options object
1412
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1413
+
1414
+ # Customize the options with defaults
1415
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
1416
+
1417
+ # Set x-goog-api-client header
1418
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1419
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1420
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1421
+ transports_version_send: [:rest]
1422
+
1423
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
1424
+ metadata: call_metadata
1425
+
1426
+ options.apply_defaults timeout: @config.timeout,
1427
+ metadata: @config.metadata
1428
+
1429
+ @region_network_firewall_policies_stub.test_iam_permissions request, options do |result, response|
1430
+ yield result, response if block_given?
1431
+ return result
1432
+ end
1433
+ rescue ::Faraday::Error => e
1434
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1435
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1436
+ end
1437
+
1438
+ ##
1439
+ # Configuration class for the RegionNetworkFirewallPolicies REST API.
1440
+ #
1441
+ # This class represents the configuration for RegionNetworkFirewallPolicies REST,
1442
+ # providing control over credentials, timeouts, retry behavior, logging.
1443
+ #
1444
+ # Configuration can be applied globally to all clients, or to a single client
1445
+ # on construction.
1446
+ #
1447
+ # # Examples
1448
+ #
1449
+ # To modify the global config, setting the timeout for all calls to 10 seconds:
1450
+ #
1451
+ # ::Google::Cloud::Compute::V1::RegionNetworkFirewallPolicies::Client.configure do |config|
1452
+ # config.timeout = 10.0
1453
+ # end
1454
+ #
1455
+ # To apply the above configuration only to a new client:
1456
+ #
1457
+ # client = ::Google::Cloud::Compute::V1::RegionNetworkFirewallPolicies::Client.new do |config|
1458
+ # config.timeout = 10.0
1459
+ # end
1460
+ #
1461
+ # @!attribute [rw] endpoint
1462
+ # The hostname or hostname:port of the service endpoint.
1463
+ # Defaults to `"compute.googleapis.com"`.
1464
+ # @return [::String]
1465
+ # @!attribute [rw] credentials
1466
+ # Credentials to send with calls. You may provide any of the following types:
1467
+ # * (`String`) The path to a service account key file in JSON format
1468
+ # * (`Hash`) A service account key as a Hash
1469
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1470
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1471
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1472
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1473
+ # * (`nil`) indicating no credentials
1474
+ # @return [::Object]
1475
+ # @!attribute [rw] scope
1476
+ # The OAuth scopes
1477
+ # @return [::Array<::String>]
1478
+ # @!attribute [rw] lib_name
1479
+ # The library name as recorded in instrumentation and logging
1480
+ # @return [::String]
1481
+ # @!attribute [rw] lib_version
1482
+ # The library version as recorded in instrumentation and logging
1483
+ # @return [::String]
1484
+ # @!attribute [rw] timeout
1485
+ # The call timeout in seconds.
1486
+ # @return [::Numeric]
1487
+ # @!attribute [rw] metadata
1488
+ # Additional REST headers to be sent with the call.
1489
+ # @return [::Hash{::Symbol=>::String}]
1490
+ #
1491
+ class Configuration
1492
+ extend ::Gapic::Config
1493
+
1494
+ config_attr :endpoint, "compute.googleapis.com", ::String
1495
+ config_attr :credentials, nil do |value|
1496
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1497
+ allowed.any? { |klass| klass === value }
1498
+ end
1499
+ config_attr :scope, nil, ::String, ::Array, nil
1500
+ config_attr :lib_name, nil, ::String, nil
1501
+ config_attr :lib_version, nil, ::String, nil
1502
+ config_attr :timeout, nil, ::Numeric, nil
1503
+ config_attr :metadata, nil, ::Hash, nil
1504
+
1505
+ # @private
1506
+ def initialize parent_config = nil
1507
+ @parent_config = parent_config unless parent_config.nil?
1508
+
1509
+ yield self if block_given?
1510
+ end
1511
+
1512
+ ##
1513
+ # Configurations for individual RPCs
1514
+ # @return [Rpcs]
1515
+ #
1516
+ def rpcs
1517
+ @rpcs ||= begin
1518
+ parent_rpcs = nil
1519
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1520
+ Rpcs.new parent_rpcs
1521
+ end
1522
+ end
1523
+
1524
+ ##
1525
+ # Configuration RPC class for the RegionNetworkFirewallPolicies API.
1526
+ #
1527
+ # Includes fields providing the configuration for each RPC in this service.
1528
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1529
+ # the following configuration fields:
1530
+ #
1531
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1532
+ #
1533
+ # there is one other field (`retry_policy`) that can be set
1534
+ # but is currently not supported for REST Gapic libraries.
1535
+ #
1536
+ class Rpcs
1537
+ ##
1538
+ # RPC-specific configuration for `add_association`
1539
+ # @return [::Gapic::Config::Method]
1540
+ #
1541
+ attr_reader :add_association
1542
+ ##
1543
+ # RPC-specific configuration for `add_rule`
1544
+ # @return [::Gapic::Config::Method]
1545
+ #
1546
+ attr_reader :add_rule
1547
+ ##
1548
+ # RPC-specific configuration for `clone_rules`
1549
+ # @return [::Gapic::Config::Method]
1550
+ #
1551
+ attr_reader :clone_rules
1552
+ ##
1553
+ # RPC-specific configuration for `delete`
1554
+ # @return [::Gapic::Config::Method]
1555
+ #
1556
+ attr_reader :delete
1557
+ ##
1558
+ # RPC-specific configuration for `get`
1559
+ # @return [::Gapic::Config::Method]
1560
+ #
1561
+ attr_reader :get
1562
+ ##
1563
+ # RPC-specific configuration for `get_association`
1564
+ # @return [::Gapic::Config::Method]
1565
+ #
1566
+ attr_reader :get_association
1567
+ ##
1568
+ # RPC-specific configuration for `get_effective_firewalls`
1569
+ # @return [::Gapic::Config::Method]
1570
+ #
1571
+ attr_reader :get_effective_firewalls
1572
+ ##
1573
+ # RPC-specific configuration for `get_iam_policy`
1574
+ # @return [::Gapic::Config::Method]
1575
+ #
1576
+ attr_reader :get_iam_policy
1577
+ ##
1578
+ # RPC-specific configuration for `get_rule`
1579
+ # @return [::Gapic::Config::Method]
1580
+ #
1581
+ attr_reader :get_rule
1582
+ ##
1583
+ # RPC-specific configuration for `insert`
1584
+ # @return [::Gapic::Config::Method]
1585
+ #
1586
+ attr_reader :insert
1587
+ ##
1588
+ # RPC-specific configuration for `list`
1589
+ # @return [::Gapic::Config::Method]
1590
+ #
1591
+ attr_reader :list
1592
+ ##
1593
+ # RPC-specific configuration for `patch`
1594
+ # @return [::Gapic::Config::Method]
1595
+ #
1596
+ attr_reader :patch
1597
+ ##
1598
+ # RPC-specific configuration for `patch_rule`
1599
+ # @return [::Gapic::Config::Method]
1600
+ #
1601
+ attr_reader :patch_rule
1602
+ ##
1603
+ # RPC-specific configuration for `remove_association`
1604
+ # @return [::Gapic::Config::Method]
1605
+ #
1606
+ attr_reader :remove_association
1607
+ ##
1608
+ # RPC-specific configuration for `remove_rule`
1609
+ # @return [::Gapic::Config::Method]
1610
+ #
1611
+ attr_reader :remove_rule
1612
+ ##
1613
+ # RPC-specific configuration for `set_iam_policy`
1614
+ # @return [::Gapic::Config::Method]
1615
+ #
1616
+ attr_reader :set_iam_policy
1617
+ ##
1618
+ # RPC-specific configuration for `test_iam_permissions`
1619
+ # @return [::Gapic::Config::Method]
1620
+ #
1621
+ attr_reader :test_iam_permissions
1622
+
1623
+ # @private
1624
+ def initialize parent_rpcs = nil
1625
+ add_association_config = parent_rpcs.add_association if parent_rpcs.respond_to? :add_association
1626
+ @add_association = ::Gapic::Config::Method.new add_association_config
1627
+ add_rule_config = parent_rpcs.add_rule if parent_rpcs.respond_to? :add_rule
1628
+ @add_rule = ::Gapic::Config::Method.new add_rule_config
1629
+ clone_rules_config = parent_rpcs.clone_rules if parent_rpcs.respond_to? :clone_rules
1630
+ @clone_rules = ::Gapic::Config::Method.new clone_rules_config
1631
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
1632
+ @delete = ::Gapic::Config::Method.new delete_config
1633
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
1634
+ @get = ::Gapic::Config::Method.new get_config
1635
+ get_association_config = parent_rpcs.get_association if parent_rpcs.respond_to? :get_association
1636
+ @get_association = ::Gapic::Config::Method.new get_association_config
1637
+ get_effective_firewalls_config = parent_rpcs.get_effective_firewalls if parent_rpcs.respond_to? :get_effective_firewalls
1638
+ @get_effective_firewalls = ::Gapic::Config::Method.new get_effective_firewalls_config
1639
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1640
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1641
+ get_rule_config = parent_rpcs.get_rule if parent_rpcs.respond_to? :get_rule
1642
+ @get_rule = ::Gapic::Config::Method.new get_rule_config
1643
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
1644
+ @insert = ::Gapic::Config::Method.new insert_config
1645
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
1646
+ @list = ::Gapic::Config::Method.new list_config
1647
+ patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
1648
+ @patch = ::Gapic::Config::Method.new patch_config
1649
+ patch_rule_config = parent_rpcs.patch_rule if parent_rpcs.respond_to? :patch_rule
1650
+ @patch_rule = ::Gapic::Config::Method.new patch_rule_config
1651
+ remove_association_config = parent_rpcs.remove_association if parent_rpcs.respond_to? :remove_association
1652
+ @remove_association = ::Gapic::Config::Method.new remove_association_config
1653
+ remove_rule_config = parent_rpcs.remove_rule if parent_rpcs.respond_to? :remove_rule
1654
+ @remove_rule = ::Gapic::Config::Method.new remove_rule_config
1655
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1656
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1657
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1658
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
1659
+
1660
+ yield self if block_given?
1661
+ end
1662
+ end
1663
+ end
1664
+ end
1665
+ end
1666
+ end
1667
+ end
1668
+ end
1669
+ end
1670
+ end