google-cloud-compute-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (379) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +201 -0
  5. data/README.md +73 -0
  6. data/lib/google-cloud-compute-v1.rb +21 -0
  7. data/lib/google/cloud/compute/v1.rb +110 -0
  8. data/lib/google/cloud/compute/v1/accelerator_types.rb +44 -0
  9. data/lib/google/cloud/compute/v1/accelerator_types/credentials.rb +53 -0
  10. data/lib/google/cloud/compute/v1/accelerator_types/rest.rb +35 -0
  11. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +452 -0
  12. data/lib/google/cloud/compute/v1/accelerator_types/rest/grpc_transcoding.rb +81 -0
  13. data/lib/google/cloud/compute/v1/addresses.rb +44 -0
  14. data/lib/google/cloud/compute/v1/addresses/credentials.rb +52 -0
  15. data/lib/google/cloud/compute/v1/addresses/rest.rb +35 -0
  16. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +596 -0
  17. data/lib/google/cloud/compute/v1/addresses/rest/grpc_transcoding.rb +106 -0
  18. data/lib/google/cloud/compute/v1/autoscalers.rb +44 -0
  19. data/lib/google/cloud/compute/v1/autoscalers/credentials.rb +52 -0
  20. data/lib/google/cloud/compute/v1/autoscalers/rest.rb +35 -0
  21. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +746 -0
  22. data/lib/google/cloud/compute/v1/autoscalers/rest/grpc_transcoding.rb +130 -0
  23. data/lib/google/cloud/compute/v1/backend_buckets.rb +44 -0
  24. data/lib/google/cloud/compute/v1/backend_buckets/credentials.rb +52 -0
  25. data/lib/google/cloud/compute/v1/backend_buckets/rest.rb +35 -0
  26. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +795 -0
  27. data/lib/google/cloud/compute/v1/backend_buckets/rest/grpc_transcoding.rb +138 -0
  28. data/lib/google/cloud/compute/v1/backend_services.rb +44 -0
  29. data/lib/google/cloud/compute/v1/backend_services/credentials.rb +52 -0
  30. data/lib/google/cloud/compute/v1/backend_services/rest.rb +35 -0
  31. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +1023 -0
  32. data/lib/google/cloud/compute/v1/backend_services/rest/grpc_transcoding.rb +180 -0
  33. data/lib/google/cloud/compute/v1/compute_pb.rb +9482 -0
  34. data/lib/google/cloud/compute/v1/disk_types.rb +44 -0
  35. data/lib/google/cloud/compute/v1/disk_types/credentials.rb +53 -0
  36. data/lib/google/cloud/compute/v1/disk_types/rest.rb +35 -0
  37. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +450 -0
  38. data/lib/google/cloud/compute/v1/disk_types/rest/grpc_transcoding.rb +81 -0
  39. data/lib/google/cloud/compute/v1/disks.rb +44 -0
  40. data/lib/google/cloud/compute/v1/disks/credentials.rb +52 -0
  41. data/lib/google/cloud/compute/v1/disks/rest.rb +35 -0
  42. data/lib/google/cloud/compute/v1/disks/rest/client.rb +1182 -0
  43. data/lib/google/cloud/compute/v1/disks/rest/grpc_transcoding.rb +203 -0
  44. data/lib/google/cloud/compute/v1/external_vpn_gateways.rb +44 -0
  45. data/lib/google/cloud/compute/v1/external_vpn_gateways/credentials.rb +52 -0
  46. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest.rb +35 -0
  47. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +637 -0
  48. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/grpc_transcoding.rb +112 -0
  49. data/lib/google/cloud/compute/v1/firewalls.rb +44 -0
  50. data/lib/google/cloud/compute/v1/firewalls/credentials.rb +52 -0
  51. data/lib/google/cloud/compute/v1/firewalls/rest.rb +35 -0
  52. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +649 -0
  53. data/lib/google/cloud/compute/v1/firewalls/rest/grpc_transcoding.rb +112 -0
  54. data/lib/google/cloud/compute/v1/forwarding_rules.rb +44 -0
  55. data/lib/google/cloud/compute/v1/forwarding_rules/credentials.rb +52 -0
  56. data/lib/google/cloud/compute/v1/forwarding_rules/rest.rb +35 -0
  57. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +746 -0
  58. data/lib/google/cloud/compute/v1/forwarding_rules/rest/grpc_transcoding.rb +130 -0
  59. data/lib/google/cloud/compute/v1/global_addresses.rb +44 -0
  60. data/lib/google/cloud/compute/v1/global_addresses/credentials.rb +52 -0
  61. data/lib/google/cloud/compute/v1/global_addresses/rest.rb +35 -0
  62. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +503 -0
  63. data/lib/google/cloud/compute/v1/global_addresses/rest/grpc_transcoding.rb +88 -0
  64. data/lib/google/cloud/compute/v1/global_forwarding_rules.rb +44 -0
  65. data/lib/google/cloud/compute/v1/global_forwarding_rules/credentials.rb +52 -0
  66. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest.rb +35 -0
  67. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +649 -0
  68. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/grpc_transcoding.rb +112 -0
  69. data/lib/google/cloud/compute/v1/global_network_endpoint_groups.rb +44 -0
  70. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/credentials.rb +52 -0
  71. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest.rb +35 -0
  72. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +734 -0
  73. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/grpc_transcoding.rb +129 -0
  74. data/lib/google/cloud/compute/v1/global_operations.rb +44 -0
  75. data/lib/google/cloud/compute/v1/global_operations/credentials.rb +52 -0
  76. data/lib/google/cloud/compute/v1/global_operations/rest.rb +35 -0
  77. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +578 -0
  78. data/lib/google/cloud/compute/v1/global_operations/rest/grpc_transcoding.rb +105 -0
  79. data/lib/google/cloud/compute/v1/global_organization_operations.rb +44 -0
  80. data/lib/google/cloud/compute/v1/global_organization_operations/credentials.rb +52 -0
  81. data/lib/google/cloud/compute/v1/global_organization_operations/rest.rb +35 -0
  82. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +427 -0
  83. data/lib/google/cloud/compute/v1/global_organization_operations/rest/grpc_transcoding.rb +78 -0
  84. data/lib/google/cloud/compute/v1/health_checks.rb +44 -0
  85. data/lib/google/cloud/compute/v1/health_checks/credentials.rb +52 -0
  86. data/lib/google/cloud/compute/v1/health_checks/rest.rb +35 -0
  87. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +734 -0
  88. data/lib/google/cloud/compute/v1/health_checks/rest/grpc_transcoding.rb +130 -0
  89. data/lib/google/cloud/compute/v1/images.rb +44 -0
  90. data/lib/google/cloud/compute/v1/images/credentials.rb +52 -0
  91. data/lib/google/cloud/compute/v1/images/rest.rb +35 -0
  92. data/lib/google/cloud/compute/v1/images/rest/client.rb +985 -0
  93. data/lib/google/cloud/compute/v1/images/rest/grpc_transcoding.rb +173 -0
  94. data/lib/google/cloud/compute/v1/instance_group_managers.rb +44 -0
  95. data/lib/google/cloud/compute/v1/instance_group_managers/credentials.rb +52 -0
  96. data/lib/google/cloud/compute/v1/instance_group_managers/rest.rb +35 -0
  97. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +1767 -0
  98. data/lib/google/cloud/compute/v1/instance_group_managers/rest/grpc_transcoding.rb +303 -0
  99. data/lib/google/cloud/compute/v1/instance_groups.rb +44 -0
  100. data/lib/google/cloud/compute/v1/instance_groups/credentials.rb +52 -0
  101. data/lib/google/cloud/compute/v1/instance_groups/rest.rb +35 -0
  102. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +916 -0
  103. data/lib/google/cloud/compute/v1/instance_groups/rest/grpc_transcoding.rb +154 -0
  104. data/lib/google/cloud/compute/v1/instance_templates.rb +44 -0
  105. data/lib/google/cloud/compute/v1/instance_templates/credentials.rb +52 -0
  106. data/lib/google/cloud/compute/v1/instance_templates/rest.rb +35 -0
  107. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +704 -0
  108. data/lib/google/cloud/compute/v1/instance_templates/rest/grpc_transcoding.rb +125 -0
  109. data/lib/google/cloud/compute/v1/instances.rb +44 -0
  110. data/lib/google/cloud/compute/v1/instances/credentials.rb +52 -0
  111. data/lib/google/cloud/compute/v1/instances/rest.rb +35 -0
  112. data/lib/google/cloud/compute/v1/instances/rest/client.rb +3201 -0
  113. data/lib/google/cloud/compute/v1/instances/rest/grpc_transcoding.rb +549 -0
  114. data/lib/google/cloud/compute/v1/interconnect_attachments.rb +44 -0
  115. data/lib/google/cloud/compute/v1/interconnect_attachments/credentials.rb +52 -0
  116. data/lib/google/cloud/compute/v1/interconnect_attachments/rest.rb +35 -0
  117. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +673 -0
  118. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/grpc_transcoding.rb +118 -0
  119. data/lib/google/cloud/compute/v1/interconnect_locations.rb +44 -0
  120. data/lib/google/cloud/compute/v1/interconnect_locations/credentials.rb +53 -0
  121. data/lib/google/cloud/compute/v1/interconnect_locations/rest.rb +35 -0
  122. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +361 -0
  123. data/lib/google/cloud/compute/v1/interconnect_locations/rest/grpc_transcoding.rb +63 -0
  124. data/lib/google/cloud/compute/v1/interconnects.rb +44 -0
  125. data/lib/google/cloud/compute/v1/interconnects/credentials.rb +52 -0
  126. data/lib/google/cloud/compute/v1/interconnects/rest.rb +35 -0
  127. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +640 -0
  128. data/lib/google/cloud/compute/v1/interconnects/rest/grpc_transcoding.rb +112 -0
  129. data/lib/google/cloud/compute/v1/license_codes.rb +44 -0
  130. data/lib/google/cloud/compute/v1/license_codes/credentials.rb +53 -0
  131. data/lib/google/cloud/compute/v1/license_codes/rest.rb +35 -0
  132. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +345 -0
  133. data/lib/google/cloud/compute/v1/license_codes/rest/grpc_transcoding.rb +58 -0
  134. data/lib/google/cloud/compute/v1/licenses.rb +44 -0
  135. data/lib/google/cloud/compute/v1/licenses/credentials.rb +52 -0
  136. data/lib/google/cloud/compute/v1/licenses/rest.rb +35 -0
  137. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +704 -0
  138. data/lib/google/cloud/compute/v1/licenses/rest/grpc_transcoding.rb +125 -0
  139. data/lib/google/cloud/compute/v1/machine_types.rb +44 -0
  140. data/lib/google/cloud/compute/v1/machine_types/credentials.rb +53 -0
  141. data/lib/google/cloud/compute/v1/machine_types/rest.rb +35 -0
  142. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +450 -0
  143. data/lib/google/cloud/compute/v1/machine_types/rest/grpc_transcoding.rb +81 -0
  144. data/lib/google/cloud/compute/v1/network_endpoint_groups.rb +44 -0
  145. data/lib/google/cloud/compute/v1/network_endpoint_groups/credentials.rb +52 -0
  146. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest.rb +35 -0
  147. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +904 -0
  148. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/grpc_transcoding.rb +154 -0
  149. data/lib/google/cloud/compute/v1/networks.rb +44 -0
  150. data/lib/google/cloud/compute/v1/networks/credentials.rb +52 -0
  151. data/lib/google/cloud/compute/v1/networks/rest.rb +35 -0
  152. data/lib/google/cloud/compute/v1/networks/rest/client.rb +957 -0
  153. data/lib/google/cloud/compute/v1/networks/rest/grpc_transcoding.rb +169 -0
  154. data/lib/google/cloud/compute/v1/node_groups.rb +44 -0
  155. data/lib/google/cloud/compute/v1/node_groups/credentials.rb +52 -0
  156. data/lib/google/cloud/compute/v1/node_groups/rest.rb +35 -0
  157. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +1192 -0
  158. data/lib/google/cloud/compute/v1/node_groups/rest/grpc_transcoding.rb +208 -0
  159. data/lib/google/cloud/compute/v1/node_templates.rb +44 -0
  160. data/lib/google/cloud/compute/v1/node_templates/credentials.rb +52 -0
  161. data/lib/google/cloud/compute/v1/node_templates/rest.rb +35 -0
  162. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +803 -0
  163. data/lib/google/cloud/compute/v1/node_templates/rest/grpc_transcoding.rb +143 -0
  164. data/lib/google/cloud/compute/v1/node_types.rb +44 -0
  165. data/lib/google/cloud/compute/v1/node_types/credentials.rb +53 -0
  166. data/lib/google/cloud/compute/v1/node_types/rest.rb +35 -0
  167. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +450 -0
  168. data/lib/google/cloud/compute/v1/node_types/rest/grpc_transcoding.rb +81 -0
  169. data/lib/google/cloud/compute/v1/packet_mirrorings.rb +44 -0
  170. data/lib/google/cloud/compute/v1/packet_mirrorings/credentials.rb +52 -0
  171. data/lib/google/cloud/compute/v1/packet_mirrorings/rest.rb +35 -0
  172. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +740 -0
  173. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/grpc_transcoding.rb +130 -0
  174. data/lib/google/cloud/compute/v1/projects.rb +44 -0
  175. data/lib/google/cloud/compute/v1/projects/credentials.rb +52 -0
  176. data/lib/google/cloud/compute/v1/projects/rest.rb +35 -0
  177. data/lib/google/cloud/compute/v1/projects/rest/client.rb +1141 -0
  178. data/lib/google/cloud/compute/v1/projects/rest/grpc_transcoding.rb +197 -0
  179. data/lib/google/cloud/compute/v1/region_autoscalers.rb +44 -0
  180. data/lib/google/cloud/compute/v1/region_autoscalers/credentials.rb +52 -0
  181. data/lib/google/cloud/compute/v1/region_autoscalers/rest.rb +35 -0
  182. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +661 -0
  183. data/lib/google/cloud/compute/v1/region_autoscalers/rest/grpc_transcoding.rb +112 -0
  184. data/lib/google/cloud/compute/v1/region_backend_services.rb +44 -0
  185. data/lib/google/cloud/compute/v1/region_backend_services/credentials.rb +52 -0
  186. data/lib/google/cloud/compute/v1/region_backend_services/rest.rb +35 -0
  187. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +729 -0
  188. data/lib/google/cloud/compute/v1/region_backend_services/rest/grpc_transcoding.rb +124 -0
  189. data/lib/google/cloud/compute/v1/region_commitments.rb +44 -0
  190. data/lib/google/cloud/compute/v1/region_commitments/credentials.rb +52 -0
  191. data/lib/google/cloud/compute/v1/region_commitments/rest.rb +35 -0
  192. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +523 -0
  193. data/lib/google/cloud/compute/v1/region_commitments/rest/grpc_transcoding.rb +93 -0
  194. data/lib/google/cloud/compute/v1/region_disk_types.rb +44 -0
  195. data/lib/google/cloud/compute/v1/region_disk_types/credentials.rb +53 -0
  196. data/lib/google/cloud/compute/v1/region_disk_types/rest.rb +35 -0
  197. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +365 -0
  198. data/lib/google/cloud/compute/v1/region_disk_types/rest/grpc_transcoding.rb +63 -0
  199. data/lib/google/cloud/compute/v1/region_disks.rb +44 -0
  200. data/lib/google/cloud/compute/v1/region_disks/credentials.rb +52 -0
  201. data/lib/google/cloud/compute/v1/region_disks/rest.rb +35 -0
  202. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +1095 -0
  203. data/lib/google/cloud/compute/v1/region_disks/rest/grpc_transcoding.rb +185 -0
  204. data/lib/google/cloud/compute/v1/region_health_check_services.rb +44 -0
  205. data/lib/google/cloud/compute/v1/region_health_check_services/credentials.rb +52 -0
  206. data/lib/google/cloud/compute/v1/region_health_check_services/rest.rb +35 -0
  207. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +586 -0
  208. data/lib/google/cloud/compute/v1/region_health_check_services/rest/grpc_transcoding.rb +100 -0
  209. data/lib/google/cloud/compute/v1/region_health_checks.rb +44 -0
  210. data/lib/google/cloud/compute/v1/region_health_checks/credentials.rb +52 -0
  211. data/lib/google/cloud/compute/v1/region_health_checks/rest.rb +35 -0
  212. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +661 -0
  213. data/lib/google/cloud/compute/v1/region_health_checks/rest/grpc_transcoding.rb +112 -0
  214. data/lib/google/cloud/compute/v1/region_instance_group_managers.rb +44 -0
  215. data/lib/google/cloud/compute/v1/region_instance_group_managers/credentials.rb +52 -0
  216. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest.rb +35 -0
  217. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +1678 -0
  218. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/grpc_transcoding.rb +285 -0
  219. data/lib/google/cloud/compute/v1/region_instance_groups.rb +44 -0
  220. data/lib/google/cloud/compute/v1/region_instance_groups/credentials.rb +52 -0
  221. data/lib/google/cloud/compute/v1/region_instance_groups/rest.rb +35 -0
  222. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +529 -0
  223. data/lib/google/cloud/compute/v1/region_instance_groups/rest/grpc_transcoding.rb +87 -0
  224. data/lib/google/cloud/compute/v1/region_network_endpoint_groups.rb +44 -0
  225. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/credentials.rb +52 -0
  226. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest.rb +35 -0
  227. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +511 -0
  228. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/grpc_transcoding.rb +88 -0
  229. data/lib/google/cloud/compute/v1/region_notification_endpoints.rb +44 -0
  230. data/lib/google/cloud/compute/v1/region_notification_endpoints/credentials.rb +52 -0
  231. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest.rb +35 -0
  232. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +511 -0
  233. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/grpc_transcoding.rb +88 -0
  234. data/lib/google/cloud/compute/v1/region_operations.rb +44 -0
  235. data/lib/google/cloud/compute/v1/region_operations/credentials.rb +52 -0
  236. data/lib/google/cloud/compute/v1/region_operations/rest.rb +35 -0
  237. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +501 -0
  238. data/lib/google/cloud/compute/v1/region_operations/rest/grpc_transcoding.rb +87 -0
  239. data/lib/google/cloud/compute/v1/region_ssl_certificates.rb +44 -0
  240. data/lib/google/cloud/compute/v1/region_ssl_certificates/credentials.rb +52 -0
  241. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest.rb +35 -0
  242. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +511 -0
  243. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/grpc_transcoding.rb +88 -0
  244. data/lib/google/cloud/compute/v1/region_target_http_proxies.rb +44 -0
  245. data/lib/google/cloud/compute/v1/region_target_http_proxies/credentials.rb +52 -0
  246. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest.rb +35 -0
  247. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +586 -0
  248. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/grpc_transcoding.rb +100 -0
  249. data/lib/google/cloud/compute/v1/region_target_https_proxies.rb +44 -0
  250. data/lib/google/cloud/compute/v1/region_target_https_proxies/credentials.rb +52 -0
  251. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest.rb +35 -0
  252. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +661 -0
  253. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/grpc_transcoding.rb +112 -0
  254. data/lib/google/cloud/compute/v1/region_url_maps.rb +44 -0
  255. data/lib/google/cloud/compute/v1/region_url_maps/credentials.rb +52 -0
  256. data/lib/google/cloud/compute/v1/region_url_maps/rest.rb +35 -0
  257. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +714 -0
  258. data/lib/google/cloud/compute/v1/region_url_maps/rest/grpc_transcoding.rb +124 -0
  259. data/lib/google/cloud/compute/v1/regions.rb +44 -0
  260. data/lib/google/cloud/compute/v1/regions/credentials.rb +53 -0
  261. data/lib/google/cloud/compute/v1/regions/rest.rb +35 -0
  262. data/lib/google/cloud/compute/v1/regions/rest/client.rb +361 -0
  263. data/lib/google/cloud/compute/v1/regions/rest/grpc_transcoding.rb +63 -0
  264. data/lib/google/cloud/compute/v1/reservations.rb +44 -0
  265. data/lib/google/cloud/compute/v1/reservations/credentials.rb +52 -0
  266. data/lib/google/cloud/compute/v1/reservations/rest.rb +35 -0
  267. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +878 -0
  268. data/lib/google/cloud/compute/v1/reservations/rest/grpc_transcoding.rb +155 -0
  269. data/lib/google/cloud/compute/v1/resource_policies.rb +44 -0
  270. data/lib/google/cloud/compute/v1/resource_policies/credentials.rb +52 -0
  271. data/lib/google/cloud/compute/v1/resource_policies/rest.rb +35 -0
  272. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +803 -0
  273. data/lib/google/cloud/compute/v1/resource_policies/rest/grpc_transcoding.rb +143 -0
  274. data/lib/google/cloud/compute/v1/routers.rb +44 -0
  275. data/lib/google/cloud/compute/v1/routers/credentials.rb +52 -0
  276. data/lib/google/cloud/compute/v1/routers/rest.rb +35 -0
  277. data/lib/google/cloud/compute/v1/routers/rest/client.rb +968 -0
  278. data/lib/google/cloud/compute/v1/routers/rest/grpc_transcoding.rb +171 -0
  279. data/lib/google/cloud/compute/v1/routes.rb +44 -0
  280. data/lib/google/cloud/compute/v1/routes/credentials.rb +52 -0
  281. data/lib/google/cloud/compute/v1/routes/rest.rb +35 -0
  282. data/lib/google/cloud/compute/v1/routes/rest/client.rb +503 -0
  283. data/lib/google/cloud/compute/v1/routes/rest/grpc_transcoding.rb +88 -0
  284. data/lib/google/cloud/compute/v1/security_policies.rb +44 -0
  285. data/lib/google/cloud/compute/v1/security_policies/credentials.rb +52 -0
  286. data/lib/google/cloud/compute/v1/security_policies/rest.rb +35 -0
  287. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +929 -0
  288. data/lib/google/cloud/compute/v1/security_policies/rest/grpc_transcoding.rb +167 -0
  289. data/lib/google/cloud/compute/v1/snapshots.rb +44 -0
  290. data/lib/google/cloud/compute/v1/snapshots/credentials.rb +52 -0
  291. data/lib/google/cloud/compute/v1/snapshots/rest.rb +35 -0
  292. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +702 -0
  293. data/lib/google/cloud/compute/v1/snapshots/rest/grpc_transcoding.rb +125 -0
  294. data/lib/google/cloud/compute/v1/ssl_certificates.rb +44 -0
  295. data/lib/google/cloud/compute/v1/ssl_certificates/credentials.rb +52 -0
  296. data/lib/google/cloud/compute/v1/ssl_certificates/rest.rb +35 -0
  297. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +588 -0
  298. data/lib/google/cloud/compute/v1/ssl_certificates/rest/grpc_transcoding.rb +106 -0
  299. data/lib/google/cloud/compute/v1/ssl_policies.rb +44 -0
  300. data/lib/google/cloud/compute/v1/ssl_policies/credentials.rb +52 -0
  301. data/lib/google/cloud/compute/v1/ssl_policies/rest.rb +35 -0
  302. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +659 -0
  303. data/lib/google/cloud/compute/v1/ssl_policies/rest/grpc_transcoding.rb +117 -0
  304. data/lib/google/cloud/compute/v1/subnetworks.rb +44 -0
  305. data/lib/google/cloud/compute/v1/subnetworks/credentials.rb +52 -0
  306. data/lib/google/cloud/compute/v1/subnetworks/rest.rb +35 -0
  307. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +1113 -0
  308. data/lib/google/cloud/compute/v1/subnetworks/rest/grpc_transcoding.rb +196 -0
  309. data/lib/google/cloud/compute/v1/target_grpc_proxies.rb +44 -0
  310. data/lib/google/cloud/compute/v1/target_grpc_proxies/credentials.rb +52 -0
  311. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest.rb +35 -0
  312. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +576 -0
  313. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/grpc_transcoding.rb +100 -0
  314. data/lib/google/cloud/compute/v1/target_http_proxies.rb +44 -0
  315. data/lib/google/cloud/compute/v1/target_http_proxies/credentials.rb +52 -0
  316. data/lib/google/cloud/compute/v1/target_http_proxies/rest.rb +35 -0
  317. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +734 -0
  318. data/lib/google/cloud/compute/v1/target_http_proxies/rest/grpc_transcoding.rb +130 -0
  319. data/lib/google/cloud/compute/v1/target_https_proxies.rb +44 -0
  320. data/lib/google/cloud/compute/v1/target_https_proxies/credentials.rb +52 -0
  321. data/lib/google/cloud/compute/v1/target_https_proxies/rest.rb +35 -0
  322. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +880 -0
  323. data/lib/google/cloud/compute/v1/target_https_proxies/rest/grpc_transcoding.rb +154 -0
  324. data/lib/google/cloud/compute/v1/target_instances.rb +44 -0
  325. data/lib/google/cloud/compute/v1/target_instances/credentials.rb +52 -0
  326. data/lib/google/cloud/compute/v1/target_instances/rest.rb +35 -0
  327. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +596 -0
  328. data/lib/google/cloud/compute/v1/target_instances/rest/grpc_transcoding.rb +106 -0
  329. data/lib/google/cloud/compute/v1/target_pools.rb +44 -0
  330. data/lib/google/cloud/compute/v1/target_pools/credentials.rb +52 -0
  331. data/lib/google/cloud/compute/v1/target_pools/rest.rb +35 -0
  332. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +1042 -0
  333. data/lib/google/cloud/compute/v1/target_pools/rest/grpc_transcoding.rb +178 -0
  334. data/lib/google/cloud/compute/v1/target_ssl_proxies.rb +44 -0
  335. data/lib/google/cloud/compute/v1/target_ssl_proxies/credentials.rb +52 -0
  336. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest.rb +35 -0
  337. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +795 -0
  338. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/grpc_transcoding.rb +136 -0
  339. data/lib/google/cloud/compute/v1/target_tcp_proxies.rb +44 -0
  340. data/lib/google/cloud/compute/v1/target_tcp_proxies/credentials.rb +52 -0
  341. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest.rb +35 -0
  342. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +649 -0
  343. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/grpc_transcoding.rb +112 -0
  344. data/lib/google/cloud/compute/v1/target_vpn_gateways.rb +44 -0
  345. data/lib/google/cloud/compute/v1/target_vpn_gateways/credentials.rb +52 -0
  346. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest.rb +35 -0
  347. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +596 -0
  348. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/grpc_transcoding.rb +106 -0
  349. data/lib/google/cloud/compute/v1/url_maps.rb +44 -0
  350. data/lib/google/cloud/compute/v1/url_maps/credentials.rb +52 -0
  351. data/lib/google/cloud/compute/v1/url_maps/rest.rb +35 -0
  352. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +876 -0
  353. data/lib/google/cloud/compute/v1/url_maps/rest/grpc_transcoding.rb +154 -0
  354. data/lib/google/cloud/compute/v1/version.rb +28 -0
  355. data/lib/google/cloud/compute/v1/vpn_gateways.rb +44 -0
  356. data/lib/google/cloud/compute/v1/vpn_gateways/credentials.rb +52 -0
  357. data/lib/google/cloud/compute/v1/vpn_gateways/rest.rb +35 -0
  358. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +806 -0
  359. data/lib/google/cloud/compute/v1/vpn_gateways/rest/grpc_transcoding.rb +142 -0
  360. data/lib/google/cloud/compute/v1/vpn_tunnels.rb +44 -0
  361. data/lib/google/cloud/compute/v1/vpn_tunnels/credentials.rb +52 -0
  362. data/lib/google/cloud/compute/v1/vpn_tunnels/rest.rb +35 -0
  363. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +596 -0
  364. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/grpc_transcoding.rb +106 -0
  365. data/lib/google/cloud/compute/v1/zone_operations.rb +44 -0
  366. data/lib/google/cloud/compute/v1/zone_operations/credentials.rb +52 -0
  367. data/lib/google/cloud/compute/v1/zone_operations/rest.rb +35 -0
  368. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +501 -0
  369. data/lib/google/cloud/compute/v1/zone_operations/rest/grpc_transcoding.rb +87 -0
  370. data/lib/google/cloud/compute/v1/zones.rb +44 -0
  371. data/lib/google/cloud/compute/v1/zones/credentials.rb +53 -0
  372. data/lib/google/cloud/compute/v1/zones/rest.rb +35 -0
  373. data/lib/google/cloud/compute/v1/zones/rest/client.rb +361 -0
  374. data/lib/google/cloud/compute/v1/zones/rest/grpc_transcoding.rb +63 -0
  375. data/proto_docs/README.md +4 -0
  376. data/proto_docs/google/api/field_behavior.rb +65 -0
  377. data/proto_docs/google/api/resource.rb +283 -0
  378. data/proto_docs/google/cloud/compute/v1/compute.rb +27425 -0
  379. metadata +568 -0
@@ -0,0 +1,88 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Compute
23
+ module V1
24
+ module Routes
25
+ module Rest
26
+ # GRPC transcoding helper methods for the Routes REST API.
27
+ module GrpcTranscoding
28
+ # @param request_pb [::Google::Cloud::Compute::V1::DeleteRouteRequest]
29
+ # A request object representing the call parameters. Required.
30
+ # @return [Array(String, [String, nil], Hash{String => String})]
31
+ # Uri, Body, Query string parameters
32
+ def transcode_delete request_pb
33
+ uri = "/compute/v1/projects/#{request_pb.project}/global/routes/#{request_pb.route}"
34
+ body = nil
35
+ query_string_params = {}
36
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
37
+
38
+ [uri, body, query_string_params]
39
+ end
40
+
41
+ # @param request_pb [::Google::Cloud::Compute::V1::GetRouteRequest]
42
+ # A request object representing the call parameters. Required.
43
+ # @return [Array(String, [String, nil], Hash{String => String})]
44
+ # Uri, Body, Query string parameters
45
+ def transcode_get request_pb
46
+ uri = "/compute/v1/projects/#{request_pb.project}/global/routes/#{request_pb.route}"
47
+ body = nil
48
+ query_string_params = {}
49
+
50
+ [uri, body, query_string_params]
51
+ end
52
+
53
+ # @param request_pb [::Google::Cloud::Compute::V1::InsertRouteRequest]
54
+ # A request object representing the call parameters. Required.
55
+ # @return [Array(String, [String, nil], Hash{String => String})]
56
+ # Uri, Body, Query string parameters
57
+ def transcode_insert request_pb
58
+ uri = "/compute/v1/projects/#{request_pb.project}/global/routes"
59
+ body = request_pb.route_resource.to_json
60
+ query_string_params = {}
61
+
62
+ [uri, body, query_string_params]
63
+ end
64
+
65
+ # @param request_pb [::Google::Cloud::Compute::V1::ListRoutesRequest]
66
+ # A request object representing the call parameters. Required.
67
+ # @return [Array(String, [String, nil], Hash{String => String})]
68
+ # Uri, Body, Query string parameters
69
+ def transcode_list request_pb
70
+ uri = "/compute/v1/projects/#{request_pb.project}/global/routes"
71
+ body = nil
72
+ query_string_params = {}
73
+ query_string_params["filter"] = request_pb.filter.to_s if request_pb.has_filter?
74
+ query_string_params["maxResults"] = request_pb.max_results.to_s if request_pb.has_max_results?
75
+ query_string_params["orderBy"] = request_pb.order_by.to_s if request_pb.has_order_by?
76
+ query_string_params["pageToken"] = request_pb.page_token.to_s if request_pb.has_page_token?
77
+ query_string_params["returnPartialSuccess"] = request_pb.return_partial_success.to_s if request_pb.has_return_partial_success?
78
+
79
+ [uri, body, query_string_params]
80
+ end
81
+ extend self
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/config"
20
+ require "gapic/config/method"
21
+
22
+ require "google/cloud/compute/v1/version"
23
+
24
+ require "google/cloud/compute/v1/security_policies/credentials"
25
+ require "google/cloud/compute/v1/security_policies/rest"
26
+
27
+ module Google
28
+ module Cloud
29
+ module Compute
30
+ module V1
31
+ # To load this service and instantiate a REST client:
32
+ #
33
+ # require "google/cloud/compute/v1/security_policies"
34
+ # client = ::Google::Cloud::Compute::V1::SecurityPolicies::Rest::Client.new
35
+ #
36
+ module SecurityPolicies
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+
43
+ helper_path = ::File.join __dir__, "security_policies", "helpers.rb"
44
+ require "google/cloud/compute/v1/security_policies/helpers" if ::File.file? helper_path
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Compute
24
+ module V1
25
+ module SecurityPolicies
26
+ # Credentials for the SecurityPolicies API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/compute",
30
+ "https://www.googleapis.com/auth/cloud-platform"
31
+ ]
32
+ self.env_vars = [
33
+ "COMPUTE_CREDENTIALS",
34
+ "COMPUTE_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS",
36
+ "GOOGLE_CLOUD_KEYFILE",
37
+ "GCLOUD_KEYFILE",
38
+ "COMPUTE_CREDENTIALS_JSON",
39
+ "COMPUTE_KEYFILE_JSON",
40
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
41
+ "GOOGLE_CLOUD_KEYFILE_JSON",
42
+ "GCLOUD_KEYFILE_JSON"
43
+ ]
44
+ self.paths = [
45
+ "~/.config/google_cloud/application_default_credentials.json"
46
+ ]
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/rest"
20
+ require "google/cloud/compute/v1/security_policies/rest/grpc_transcoding"
21
+ require "google/cloud/compute/v1/security_policies/rest/client"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Compute
26
+ module V1
27
+ module SecurityPolicies
28
+ # Client for the REST transport
29
+ module Rest
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,929 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/compute/v1/compute_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Compute
25
+ module V1
26
+ module SecurityPolicies
27
+ module Rest
28
+ ##
29
+ # REST client for the SecurityPolicies service.
30
+ #
31
+ # The SecurityPolicies API.
32
+ #
33
+ class Client
34
+ include GrpcTranscoding
35
+
36
+ # @private
37
+ attr_reader :security_policies_stub
38
+
39
+ ##
40
+ # Configure the SecurityPolicies Client class.
41
+ #
42
+ # See {::Google::Cloud::Compute::V1::SecurityPolicies::Rest::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # ## Example
46
+ #
47
+ # To modify the configuration for all SecurityPolicies clients:
48
+ #
49
+ # ::Google::Cloud::Compute::V1::SecurityPolicies::Rest::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "Compute", "V1"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config
70
+ end
71
+ yield @configure if block_given?
72
+ @configure
73
+ end
74
+
75
+ ##
76
+ # Configure the SecurityPolicies Client instance.
77
+ #
78
+ # The configuration is set to the derived mode, meaning that values can be changed,
79
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
80
+ # should be made on {Client.configure}.
81
+ #
82
+ # See {::Google::Cloud::Compute::V1::SecurityPolicies::Rest::Client::Configuration}
83
+ # for a description of the configuration fields.
84
+ #
85
+ # @yield [config] Configure the Client client.
86
+ # @yieldparam config [Client::Configuration]
87
+ #
88
+ # @return [Client::Configuration]
89
+ #
90
+ def configure
91
+ yield @config if block_given?
92
+ @config
93
+ end
94
+
95
+ ##
96
+ # Create a new SecurityPolicies REST client object.
97
+ #
98
+ # ## Examples
99
+ #
100
+ # To create a new SecurityPolicies REST client with the default
101
+ # configuration:
102
+ #
103
+ # client = ::Google::Cloud::Compute::V1::SecurityPolicies::Rest::Client.new
104
+ #
105
+ # To create a new SecurityPolicies REST client with a custom
106
+ # configuration:
107
+ #
108
+ # client = ::Google::Cloud::Compute::V1::SecurityPolicies::Rest::Client.new do |config|
109
+ # config.timeout = 10.0
110
+ # end
111
+ #
112
+ # @yield [config] Configure the SecurityPolicies client.
113
+ # @yieldparam config [Client::Configuration]
114
+ #
115
+ def initialize
116
+ # These require statements are intentionally placed here to initialize
117
+ # the REST modules only when it's required.
118
+ require "gapic/rest"
119
+
120
+ # Create the configuration object
121
+ @config = Configuration.new Client.configure
122
+
123
+ # Yield the configuration if needed
124
+ yield @config if block_given?
125
+
126
+ # Create credentials
127
+ credentials = @config.credentials
128
+ credentials ||= Credentials.default scope: @config.scope
129
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
130
+ credentials = Credentials.new credentials, scope: @config.scope
131
+ end
132
+
133
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: @config.endpoint, credentials: credentials
134
+ end
135
+
136
+ # Service calls
137
+
138
+ ##
139
+ # Inserts a rule into a security policy.
140
+ #
141
+ # @overload add_rule(request, options = nil)
142
+ # Pass arguments to `add_rule` via a request object, either of type
143
+ # {::Google::Cloud::Compute::V1::AddRuleSecurityPolicyRequest} or an equivalent Hash.
144
+ #
145
+ # @param request [::Google::Cloud::Compute::V1::AddRuleSecurityPolicyRequest, ::Hash]
146
+ # A request object representing the call parameters. Required. To specify no
147
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
148
+ # @param options [::Gapic::CallOptions, ::Hash]
149
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
150
+ # Note: currently retry functionality is not implemented. While it is possible
151
+ # to set it using ::Gapic::CallOptions, it will not be applied
152
+ #
153
+ # @overload add_rule(project: nil, security_policy: nil, security_policy_rule_resource: nil)
154
+ # Pass arguments to `add_rule` via keyword arguments. Note that at
155
+ # least one keyword argument is required. To specify no parameters, or to keep all
156
+ # the default parameter values, pass an empty Hash as a request object (see above).
157
+ #
158
+ # @param project [::String]
159
+ # Project ID for this request.
160
+ # @param security_policy [::String]
161
+ # Name of the security policy to update.
162
+ # @param security_policy_rule_resource [::Google::Cloud::Compute::V1::SecurityPolicyRule, ::Hash]
163
+ # The body resource for this request
164
+ # @yield [result, env] Access the result along with the Faraday environment object
165
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
166
+ # @yieldparam response [::Faraday::Response]
167
+ #
168
+ # @return [::Google::Cloud::Compute::V1::Operation]
169
+ #
170
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
171
+ def add_rule request, options = nil
172
+ raise ::ArgumentError, "request must be provided" if request.nil?
173
+
174
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AddRuleSecurityPolicyRequest
175
+
176
+ # Converts hash and nil to an options object
177
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
178
+
179
+ # Customize the options with defaults
180
+ call_metadata = {}
181
+
182
+ # Set x-goog-api-client header
183
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
184
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
185
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
186
+
187
+ options.apply_defaults timeout: @config.timeout,
188
+ metadata: call_metadata
189
+
190
+ uri, body, _query_string_params = transcode_add_rule request
191
+ response = @client_stub.make_post_request(
192
+ uri: uri,
193
+ body: body,
194
+ options: options
195
+ )
196
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
197
+
198
+ yield result, response if block_given?
199
+ result
200
+ rescue ::Faraday::Error => e
201
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
202
+ raise ::Google::Cloud::Error.from_error(gapic_error)
203
+ end
204
+
205
+ ##
206
+ # Deletes the specified policy.
207
+ #
208
+ # @overload delete(request, options = nil)
209
+ # Pass arguments to `delete` via a request object, either of type
210
+ # {::Google::Cloud::Compute::V1::DeleteSecurityPolicyRequest} or an equivalent Hash.
211
+ #
212
+ # @param request [::Google::Cloud::Compute::V1::DeleteSecurityPolicyRequest, ::Hash]
213
+ # A request object representing the call parameters. Required. To specify no
214
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
215
+ # @param options [::Gapic::CallOptions, ::Hash]
216
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
217
+ # Note: currently retry functionality is not implemented. While it is possible
218
+ # to set it using ::Gapic::CallOptions, it will not be applied
219
+ #
220
+ # @overload delete(project: nil, request_id: nil, security_policy: nil)
221
+ # Pass arguments to `delete` via keyword arguments. Note that at
222
+ # least one keyword argument is required. To specify no parameters, or to keep all
223
+ # the default parameter values, pass an empty Hash as a request object (see above).
224
+ #
225
+ # @param project [::String]
226
+ # Project ID for this request.
227
+ # @param request_id [::String]
228
+ # 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.
229
+ #
230
+ # 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.
231
+ #
232
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
233
+ # @param security_policy [::String]
234
+ # Name of the security policy to delete.
235
+ # @yield [result, env] Access the result along with the Faraday environment object
236
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
237
+ # @yieldparam response [::Faraday::Response]
238
+ #
239
+ # @return [::Google::Cloud::Compute::V1::Operation]
240
+ #
241
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
242
+ def delete request, options = nil
243
+ raise ::ArgumentError, "request must be provided" if request.nil?
244
+
245
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteSecurityPolicyRequest
246
+
247
+ # Converts hash and nil to an options object
248
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
249
+
250
+ # Customize the options with defaults
251
+ call_metadata = {}
252
+
253
+ # Set x-goog-api-client header
254
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
255
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
256
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
257
+
258
+ options.apply_defaults timeout: @config.timeout,
259
+ metadata: call_metadata
260
+
261
+ uri, _body, query_string_params = transcode_delete request
262
+ response = @client_stub.make_delete_request(
263
+ uri: uri,
264
+ params: query_string_params,
265
+ options: options
266
+ )
267
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
268
+
269
+ yield result, response if block_given?
270
+ result
271
+ rescue ::Faraday::Error => e
272
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
273
+ raise ::Google::Cloud::Error.from_error(gapic_error)
274
+ end
275
+
276
+ ##
277
+ # List all of the ordered rules present in a single specified policy.
278
+ #
279
+ # @overload get(request, options = nil)
280
+ # Pass arguments to `get` via a request object, either of type
281
+ # {::Google::Cloud::Compute::V1::GetSecurityPolicyRequest} or an equivalent Hash.
282
+ #
283
+ # @param request [::Google::Cloud::Compute::V1::GetSecurityPolicyRequest, ::Hash]
284
+ # A request object representing the call parameters. Required. To specify no
285
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
286
+ # @param options [::Gapic::CallOptions, ::Hash]
287
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
288
+ # Note: currently retry functionality is not implemented. While it is possible
289
+ # to set it using ::Gapic::CallOptions, it will not be applied
290
+ #
291
+ # @overload get(project: nil, security_policy: nil)
292
+ # Pass arguments to `get` via keyword arguments. Note that at
293
+ # least one keyword argument is required. To specify no parameters, or to keep all
294
+ # the default parameter values, pass an empty Hash as a request object (see above).
295
+ #
296
+ # @param project [::String]
297
+ # Project ID for this request.
298
+ # @param security_policy [::String]
299
+ # Name of the security policy to get.
300
+ # @yield [result, env] Access the result along with the Faraday environment object
301
+ # @yieldparam result [::Google::Cloud::Compute::V1::SecurityPolicy]
302
+ # @yieldparam response [::Faraday::Response]
303
+ #
304
+ # @return [::Google::Cloud::Compute::V1::SecurityPolicy]
305
+ #
306
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
307
+ def get request, options = nil
308
+ raise ::ArgumentError, "request must be provided" if request.nil?
309
+
310
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetSecurityPolicyRequest
311
+
312
+ # Converts hash and nil to an options object
313
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
314
+
315
+ # Customize the options with defaults
316
+ call_metadata = {}
317
+
318
+ # Set x-goog-api-client header
319
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
320
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
321
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
322
+
323
+ options.apply_defaults timeout: @config.timeout,
324
+ metadata: call_metadata
325
+
326
+ uri, _body, _query_string_params = transcode_get request
327
+ response = @client_stub.make_get_request(
328
+ uri: uri,
329
+ options: options
330
+ )
331
+ result = ::Google::Cloud::Compute::V1::SecurityPolicy.decode_json response.body, ignore_unknown_fields: true
332
+
333
+ yield result, response if block_given?
334
+ result
335
+ rescue ::Faraday::Error => e
336
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
337
+ raise ::Google::Cloud::Error.from_error(gapic_error)
338
+ end
339
+
340
+ ##
341
+ # Gets a rule at the specified priority.
342
+ #
343
+ # @overload get_rule(request, options = nil)
344
+ # Pass arguments to `get_rule` via a request object, either of type
345
+ # {::Google::Cloud::Compute::V1::GetRuleSecurityPolicyRequest} or an equivalent Hash.
346
+ #
347
+ # @param request [::Google::Cloud::Compute::V1::GetRuleSecurityPolicyRequest, ::Hash]
348
+ # A request object representing the call parameters. Required. To specify no
349
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
350
+ # @param options [::Gapic::CallOptions, ::Hash]
351
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
352
+ # Note: currently retry functionality is not implemented. While it is possible
353
+ # to set it using ::Gapic::CallOptions, it will not be applied
354
+ #
355
+ # @overload get_rule(priority: nil, project: nil, security_policy: nil)
356
+ # Pass arguments to `get_rule` via keyword arguments. Note that at
357
+ # least one keyword argument is required. To specify no parameters, or to keep all
358
+ # the default parameter values, pass an empty Hash as a request object (see above).
359
+ #
360
+ # @param priority [::Integer]
361
+ # The priority of the rule to get from the security policy.
362
+ # @param project [::String]
363
+ # Project ID for this request.
364
+ # @param security_policy [::String]
365
+ # Name of the security policy to which the queried rule belongs.
366
+ # @yield [result, env] Access the result along with the Faraday environment object
367
+ # @yieldparam result [::Google::Cloud::Compute::V1::SecurityPolicyRule]
368
+ # @yieldparam response [::Faraday::Response]
369
+ #
370
+ # @return [::Google::Cloud::Compute::V1::SecurityPolicyRule]
371
+ #
372
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
373
+ def get_rule request, options = nil
374
+ raise ::ArgumentError, "request must be provided" if request.nil?
375
+
376
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetRuleSecurityPolicyRequest
377
+
378
+ # Converts hash and nil to an options object
379
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
380
+
381
+ # Customize the options with defaults
382
+ call_metadata = {}
383
+
384
+ # Set x-goog-api-client header
385
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
386
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
387
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
388
+
389
+ options.apply_defaults timeout: @config.timeout,
390
+ metadata: call_metadata
391
+
392
+ uri, _body, query_string_params = transcode_get_rule request
393
+ response = @client_stub.make_get_request(
394
+ uri: uri,
395
+ params: query_string_params,
396
+ options: options
397
+ )
398
+ result = ::Google::Cloud::Compute::V1::SecurityPolicyRule.decode_json response.body, ignore_unknown_fields: true
399
+
400
+ yield result, response if block_given?
401
+ result
402
+ rescue ::Faraday::Error => e
403
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
404
+ raise ::Google::Cloud::Error.from_error(gapic_error)
405
+ end
406
+
407
+ ##
408
+ # Creates a new policy in the specified project using the data included in the request.
409
+ #
410
+ # @overload insert(request, options = nil)
411
+ # Pass arguments to `insert` via a request object, either of type
412
+ # {::Google::Cloud::Compute::V1::InsertSecurityPolicyRequest} or an equivalent Hash.
413
+ #
414
+ # @param request [::Google::Cloud::Compute::V1::InsertSecurityPolicyRequest, ::Hash]
415
+ # A request object representing the call parameters. Required. To specify no
416
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
417
+ # @param options [::Gapic::CallOptions, ::Hash]
418
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
419
+ # Note: currently retry functionality is not implemented. While it is possible
420
+ # to set it using ::Gapic::CallOptions, it will not be applied
421
+ #
422
+ # @overload insert(project: nil, request_id: nil, security_policy_resource: nil)
423
+ # Pass arguments to `insert` via keyword arguments. Note that at
424
+ # least one keyword argument is required. To specify no parameters, or to keep all
425
+ # the default parameter values, pass an empty Hash as a request object (see above).
426
+ #
427
+ # @param project [::String]
428
+ # Project ID for this request.
429
+ # @param request_id [::String]
430
+ # 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.
431
+ #
432
+ # 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.
433
+ #
434
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
435
+ # @param security_policy_resource [::Google::Cloud::Compute::V1::SecurityPolicy, ::Hash]
436
+ # The body resource for this request
437
+ # @yield [result, env] Access the result along with the Faraday environment object
438
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
439
+ # @yieldparam response [::Faraday::Response]
440
+ #
441
+ # @return [::Google::Cloud::Compute::V1::Operation]
442
+ #
443
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
444
+ def insert request, options = nil
445
+ raise ::ArgumentError, "request must be provided" if request.nil?
446
+
447
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::InsertSecurityPolicyRequest
448
+
449
+ # Converts hash and nil to an options object
450
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
451
+
452
+ # Customize the options with defaults
453
+ call_metadata = {}
454
+
455
+ # Set x-goog-api-client header
456
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
457
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
458
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
459
+
460
+ options.apply_defaults timeout: @config.timeout,
461
+ metadata: call_metadata
462
+
463
+ uri, body, _query_string_params = transcode_insert request
464
+ response = @client_stub.make_post_request(
465
+ uri: uri,
466
+ body: body,
467
+ options: options
468
+ )
469
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
470
+
471
+ yield result, response if block_given?
472
+ result
473
+ rescue ::Faraday::Error => e
474
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
475
+ raise ::Google::Cloud::Error.from_error(gapic_error)
476
+ end
477
+
478
+ ##
479
+ # List all the policies that have been configured for the specified project.
480
+ #
481
+ # @overload list(request, options = nil)
482
+ # Pass arguments to `list` via a request object, either of type
483
+ # {::Google::Cloud::Compute::V1::ListSecurityPoliciesRequest} or an equivalent Hash.
484
+ #
485
+ # @param request [::Google::Cloud::Compute::V1::ListSecurityPoliciesRequest, ::Hash]
486
+ # A request object representing the call parameters. Required. To specify no
487
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
488
+ # @param options [::Gapic::CallOptions, ::Hash]
489
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
490
+ # Note: currently retry functionality is not implemented. While it is possible
491
+ # to set it using ::Gapic::CallOptions, it will not be applied
492
+ #
493
+ # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
494
+ # Pass arguments to `list` via keyword arguments. Note that at
495
+ # least one keyword argument is required. To specify no parameters, or to keep all
496
+ # the default parameter values, pass an empty Hash as a request object (see above).
497
+ #
498
+ # @param filter [::String]
499
+ # 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 `<`.
500
+ #
501
+ # For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
502
+ #
503
+ # 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.
504
+ #
505
+ # 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) ```
506
+ # @param max_results [::Integer]
507
+ # 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`)
508
+ # @param order_by [::String]
509
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
510
+ #
511
+ # 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.
512
+ #
513
+ # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
514
+ # @param page_token [::String]
515
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
516
+ # @param project [::String]
517
+ # Project ID for this request.
518
+ # @param return_partial_success [::Boolean]
519
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
520
+ # @yield [result, env] Access the result along with the Faraday environment object
521
+ # @yieldparam result [::Google::Cloud::Compute::V1::SecurityPolicyList]
522
+ # @yieldparam response [::Faraday::Response]
523
+ #
524
+ # @return [::Google::Cloud::Compute::V1::SecurityPolicyList]
525
+ #
526
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
527
+ def list request, options = nil
528
+ raise ::ArgumentError, "request must be provided" if request.nil?
529
+
530
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListSecurityPoliciesRequest
531
+
532
+ # Converts hash and nil to an options object
533
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
534
+
535
+ # Customize the options with defaults
536
+ call_metadata = {}
537
+
538
+ # Set x-goog-api-client header
539
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
540
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
541
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
542
+
543
+ options.apply_defaults timeout: @config.timeout,
544
+ metadata: call_metadata
545
+
546
+ uri, _body, query_string_params = transcode_list request
547
+ response = @client_stub.make_get_request(
548
+ uri: uri,
549
+ params: query_string_params,
550
+ options: options
551
+ )
552
+ result = ::Google::Cloud::Compute::V1::SecurityPolicyList.decode_json response.body, ignore_unknown_fields: true
553
+
554
+ yield result, response if block_given?
555
+ result
556
+ rescue ::Faraday::Error => e
557
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
558
+ raise ::Google::Cloud::Error.from_error(gapic_error)
559
+ end
560
+
561
+ ##
562
+ # Gets the current list of preconfigured Web Application Firewall (WAF) expressions.
563
+ #
564
+ # @overload list_preconfigured_expression_sets(request, options = nil)
565
+ # Pass arguments to `list_preconfigured_expression_sets` via a request object, either of type
566
+ # {::Google::Cloud::Compute::V1::ListPreconfiguredExpressionSetsSecurityPoliciesRequest} or an equivalent Hash.
567
+ #
568
+ # @param request [::Google::Cloud::Compute::V1::ListPreconfiguredExpressionSetsSecurityPoliciesRequest, ::Hash]
569
+ # A request object representing the call parameters. Required. To specify no
570
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
571
+ # @param options [::Gapic::CallOptions, ::Hash]
572
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
573
+ # Note: currently retry functionality is not implemented. While it is possible
574
+ # to set it using ::Gapic::CallOptions, it will not be applied
575
+ #
576
+ # @overload list_preconfigured_expression_sets(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
577
+ # Pass arguments to `list_preconfigured_expression_sets` via keyword arguments. Note that at
578
+ # least one keyword argument is required. To specify no parameters, or to keep all
579
+ # the default parameter values, pass an empty Hash as a request object (see above).
580
+ #
581
+ # @param filter [::String]
582
+ # 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 `<`.
583
+ #
584
+ # For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
585
+ #
586
+ # 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.
587
+ #
588
+ # 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) ```
589
+ # @param max_results [::Integer]
590
+ # 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`)
591
+ # @param order_by [::String]
592
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
593
+ #
594
+ # 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.
595
+ #
596
+ # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
597
+ # @param page_token [::String]
598
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
599
+ # @param project [::String]
600
+ # Project ID for this request.
601
+ # @param return_partial_success [::Boolean]
602
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
603
+ # @yield [result, env] Access the result along with the Faraday environment object
604
+ # @yieldparam result [::Google::Cloud::Compute::V1::SecurityPoliciesListPreconfiguredExpressionSetsResponse]
605
+ # @yieldparam response [::Faraday::Response]
606
+ #
607
+ # @return [::Google::Cloud::Compute::V1::SecurityPoliciesListPreconfiguredExpressionSetsResponse]
608
+ #
609
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
610
+ def list_preconfigured_expression_sets request, options = nil
611
+ raise ::ArgumentError, "request must be provided" if request.nil?
612
+
613
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListPreconfiguredExpressionSetsSecurityPoliciesRequest
614
+
615
+ # Converts hash and nil to an options object
616
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
617
+
618
+ # Customize the options with defaults
619
+ call_metadata = {}
620
+
621
+ # Set x-goog-api-client header
622
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
623
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
624
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
625
+
626
+ options.apply_defaults timeout: @config.timeout,
627
+ metadata: call_metadata
628
+
629
+ uri, _body, query_string_params = transcode_list_preconfigured_expression_sets request
630
+ response = @client_stub.make_get_request(
631
+ uri: uri,
632
+ params: query_string_params,
633
+ options: options
634
+ )
635
+ result = ::Google::Cloud::Compute::V1::SecurityPoliciesListPreconfiguredExpressionSetsResponse.decode_json response.body, ignore_unknown_fields: true
636
+
637
+ yield result, response if block_given?
638
+ result
639
+ rescue ::Faraday::Error => e
640
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
641
+ raise ::Google::Cloud::Error.from_error(gapic_error)
642
+ end
643
+
644
+ ##
645
+ # Patches the specified policy with the data included in the request. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.
646
+ #
647
+ # @overload patch(request, options = nil)
648
+ # Pass arguments to `patch` via a request object, either of type
649
+ # {::Google::Cloud::Compute::V1::PatchSecurityPolicyRequest} or an equivalent Hash.
650
+ #
651
+ # @param request [::Google::Cloud::Compute::V1::PatchSecurityPolicyRequest, ::Hash]
652
+ # A request object representing the call parameters. Required. To specify no
653
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
654
+ # @param options [::Gapic::CallOptions, ::Hash]
655
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
656
+ # Note: currently retry functionality is not implemented. While it is possible
657
+ # to set it using ::Gapic::CallOptions, it will not be applied
658
+ #
659
+ # @overload patch(project: nil, request_id: nil, security_policy: nil, security_policy_resource: nil)
660
+ # Pass arguments to `patch` via keyword arguments. Note that at
661
+ # least one keyword argument is required. To specify no parameters, or to keep all
662
+ # the default parameter values, pass an empty Hash as a request object (see above).
663
+ #
664
+ # @param project [::String]
665
+ # Project ID for this request.
666
+ # @param request_id [::String]
667
+ # 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.
668
+ #
669
+ # 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.
670
+ #
671
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
672
+ # @param security_policy [::String]
673
+ # Name of the security policy to update.
674
+ # @param security_policy_resource [::Google::Cloud::Compute::V1::SecurityPolicy, ::Hash]
675
+ # The body resource for this request
676
+ # @yield [result, env] Access the result along with the Faraday environment object
677
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
678
+ # @yieldparam response [::Faraday::Response]
679
+ #
680
+ # @return [::Google::Cloud::Compute::V1::Operation]
681
+ #
682
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
683
+ def patch request, options = nil
684
+ raise ::ArgumentError, "request must be provided" if request.nil?
685
+
686
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchSecurityPolicyRequest
687
+
688
+ # Converts hash and nil to an options object
689
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
690
+
691
+ # Customize the options with defaults
692
+ call_metadata = {}
693
+
694
+ # Set x-goog-api-client header
695
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
696
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
697
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
698
+
699
+ options.apply_defaults timeout: @config.timeout,
700
+ metadata: call_metadata
701
+
702
+ uri, body, _query_string_params = transcode_patch request
703
+ response = @client_stub.make_patch_request(
704
+ uri: uri,
705
+ body: body,
706
+ options: options
707
+ )
708
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
709
+
710
+ yield result, response if block_given?
711
+ result
712
+ rescue ::Faraday::Error => e
713
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
714
+ raise ::Google::Cloud::Error.from_error(gapic_error)
715
+ end
716
+
717
+ ##
718
+ # Patches a rule at the specified priority.
719
+ #
720
+ # @overload patch_rule(request, options = nil)
721
+ # Pass arguments to `patch_rule` via a request object, either of type
722
+ # {::Google::Cloud::Compute::V1::PatchRuleSecurityPolicyRequest} or an equivalent Hash.
723
+ #
724
+ # @param request [::Google::Cloud::Compute::V1::PatchRuleSecurityPolicyRequest, ::Hash]
725
+ # A request object representing the call parameters. Required. To specify no
726
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
727
+ # @param options [::Gapic::CallOptions, ::Hash]
728
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
729
+ # Note: currently retry functionality is not implemented. While it is possible
730
+ # to set it using ::Gapic::CallOptions, it will not be applied
731
+ #
732
+ # @overload patch_rule(priority: nil, project: nil, security_policy: nil, security_policy_rule_resource: nil)
733
+ # Pass arguments to `patch_rule` via keyword arguments. Note that at
734
+ # least one keyword argument is required. To specify no parameters, or to keep all
735
+ # the default parameter values, pass an empty Hash as a request object (see above).
736
+ #
737
+ # @param priority [::Integer]
738
+ # The priority of the rule to patch.
739
+ # @param project [::String]
740
+ # Project ID for this request.
741
+ # @param security_policy [::String]
742
+ # Name of the security policy to update.
743
+ # @param security_policy_rule_resource [::Google::Cloud::Compute::V1::SecurityPolicyRule, ::Hash]
744
+ # The body resource for this request
745
+ # @yield [result, env] Access the result along with the Faraday environment object
746
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
747
+ # @yieldparam response [::Faraday::Response]
748
+ #
749
+ # @return [::Google::Cloud::Compute::V1::Operation]
750
+ #
751
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
752
+ def patch_rule request, options = nil
753
+ raise ::ArgumentError, "request must be provided" if request.nil?
754
+
755
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchRuleSecurityPolicyRequest
756
+
757
+ # Converts hash and nil to an options object
758
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
759
+
760
+ # Customize the options with defaults
761
+ call_metadata = {}
762
+
763
+ # Set x-goog-api-client header
764
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
765
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
766
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
767
+
768
+ options.apply_defaults timeout: @config.timeout,
769
+ metadata: call_metadata
770
+
771
+ uri, body, _query_string_params = transcode_patch_rule request
772
+ response = @client_stub.make_post_request(
773
+ uri: uri,
774
+ body: body,
775
+ options: options
776
+ )
777
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
778
+
779
+ yield result, response if block_given?
780
+ result
781
+ rescue ::Faraday::Error => e
782
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
783
+ raise ::Google::Cloud::Error.from_error(gapic_error)
784
+ end
785
+
786
+ ##
787
+ # Deletes a rule at the specified priority.
788
+ #
789
+ # @overload remove_rule(request, options = nil)
790
+ # Pass arguments to `remove_rule` via a request object, either of type
791
+ # {::Google::Cloud::Compute::V1::RemoveRuleSecurityPolicyRequest} or an equivalent Hash.
792
+ #
793
+ # @param request [::Google::Cloud::Compute::V1::RemoveRuleSecurityPolicyRequest, ::Hash]
794
+ # A request object representing the call parameters. Required. To specify no
795
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
796
+ # @param options [::Gapic::CallOptions, ::Hash]
797
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
798
+ # Note: currently retry functionality is not implemented. While it is possible
799
+ # to set it using ::Gapic::CallOptions, it will not be applied
800
+ #
801
+ # @overload remove_rule(priority: nil, project: nil, security_policy: nil)
802
+ # Pass arguments to `remove_rule` via keyword arguments. Note that at
803
+ # least one keyword argument is required. To specify no parameters, or to keep all
804
+ # the default parameter values, pass an empty Hash as a request object (see above).
805
+ #
806
+ # @param priority [::Integer]
807
+ # The priority of the rule to remove from the security policy.
808
+ # @param project [::String]
809
+ # Project ID for this request.
810
+ # @param security_policy [::String]
811
+ # Name of the security policy to update.
812
+ # @yield [result, env] Access the result along with the Faraday environment object
813
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
814
+ # @yieldparam response [::Faraday::Response]
815
+ #
816
+ # @return [::Google::Cloud::Compute::V1::Operation]
817
+ #
818
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
819
+ def remove_rule request, options = nil
820
+ raise ::ArgumentError, "request must be provided" if request.nil?
821
+
822
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::RemoveRuleSecurityPolicyRequest
823
+
824
+ # Converts hash and nil to an options object
825
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
826
+
827
+ # Customize the options with defaults
828
+ call_metadata = {}
829
+
830
+ # Set x-goog-api-client header
831
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
832
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
833
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
834
+
835
+ options.apply_defaults timeout: @config.timeout,
836
+ metadata: call_metadata
837
+
838
+ uri, _body, query_string_params = transcode_remove_rule request
839
+ response = @client_stub.make_post_request(
840
+ uri: uri,
841
+ params: query_string_params,
842
+ options: options
843
+ )
844
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
845
+
846
+ yield result, response if block_given?
847
+ result
848
+ rescue ::Faraday::Error => e
849
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
850
+ raise ::Google::Cloud::Error.from_error(gapic_error)
851
+ end
852
+
853
+ ##
854
+ # Configuration class for the SecurityPolicies REST API.
855
+ #
856
+ # This class represents the configuration for SecurityPolicies REST,
857
+ # providing control over credentials, timeouts, retry behavior, logging.
858
+ #
859
+ # Configuration can be applied globally to all clients, or to a single client
860
+ # on construction.
861
+ #
862
+ # # Examples
863
+ #
864
+ # To modify the global config, setting the timeout for all calls to 10 seconds:
865
+ #
866
+ # ::Google::Cloud::Compute::V1::SecurityPolicies::Client.configure do |config|
867
+ # config.timeout = 10.0
868
+ # end
869
+ #
870
+ # To apply the above configuration only to a new client:
871
+ #
872
+ # client = ::Google::Cloud::Compute::V1::SecurityPolicies::Client.new do |config|
873
+ # config.timeout = 10.0
874
+ # end
875
+ #
876
+ # @!attribute [rw] endpoint
877
+ # The hostname or hostname:port of the service endpoint.
878
+ # Defaults to `"compute.googleapis.com"`.
879
+ # @return [::String]
880
+ # @!attribute [rw] credentials
881
+ # Credentials to send with calls. You may provide any of the following types:
882
+ # * (`String`) The path to a service account key file in JSON format
883
+ # * (`Hash`) A service account key as a Hash
884
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
885
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
886
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
887
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
888
+ # * (`nil`) indicating no credentials
889
+ # @return [::Object]
890
+ # @!attribute [rw] scope
891
+ # The OAuth scopes
892
+ # @return [::Array<::String>]
893
+ # @!attribute [rw] lib_name
894
+ # The library name as recorded in instrumentation and logging
895
+ # @return [::String]
896
+ # @!attribute [rw] lib_version
897
+ # The library version as recorded in instrumentation and logging
898
+ # @return [::String]
899
+ # @!attribute [rw] timeout
900
+ # The call timeout in seconds.
901
+ # @return [::Numeric]
902
+ #
903
+ class Configuration
904
+ extend ::Gapic::Config
905
+
906
+ config_attr :endpoint, "compute.googleapis.com", ::String
907
+ config_attr :credentials, nil do |value|
908
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
909
+ allowed.any? { |klass| klass === value }
910
+ end
911
+ config_attr :scope, nil, ::String, ::Array, nil
912
+ config_attr :lib_name, nil, ::String, nil
913
+ config_attr :lib_version, nil, ::String, nil
914
+ config_attr :timeout, nil, ::Numeric, nil
915
+
916
+ # @private
917
+ def initialize parent_config = nil
918
+ @parent_config = parent_config unless parent_config.nil?
919
+
920
+ yield self if block_given?
921
+ end
922
+ end
923
+ end
924
+ end
925
+ end
926
+ end
927
+ end
928
+ end
929
+ end