google-cloud-compute-v1 0.1.0 → 0.5.0

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