google-cloud-compute-v1 3.4.0 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +181 -14
  3. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +237 -20
  4. data/lib/google/cloud/compute/v1/advice/credentials.rb +52 -0
  5. data/lib/google/cloud/compute/v1/advice/rest/client.rb +431 -0
  6. data/lib/google/cloud/compute/v1/advice/rest/service_stub.rb +144 -0
  7. data/lib/google/cloud/compute/v1/advice/rest.rb +51 -0
  8. data/lib/google/cloud/compute/v1/advice.rb +47 -0
  9. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +334 -21
  10. data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +64 -0
  11. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +573 -23
  12. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +122 -0
  13. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +499 -40
  14. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +62 -0
  15. data/lib/google/cloud/compute/v1/compute_pb.rb +357 -25
  16. data/lib/google/cloud/compute/v1/cross_site_networks/credentials.rb +52 -0
  17. data/lib/google/cloud/compute/v1/cross_site_networks/rest/client.rb +975 -0
  18. data/lib/google/cloud/compute/v1/cross_site_networks/rest/service_stub.rb +391 -0
  19. data/lib/google/cloud/compute/v1/cross_site_networks/rest.rb +51 -0
  20. data/lib/google/cloud/compute/v1/cross_site_networks.rb +47 -0
  21. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +181 -14
  22. data/lib/google/cloud/compute/v1/disks/rest/client.rb +508 -42
  23. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +64 -0
  24. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +118 -11
  25. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +240 -25
  26. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +238 -13
  27. data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +63 -0
  28. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +258 -23
  29. data/lib/google/cloud/compute/v1/future_reservations/credentials.rb +52 -0
  30. data/lib/google/cloud/compute/v1/future_reservations/rest/client.rb +1287 -0
  31. data/lib/google/cloud/compute/v1/future_reservations/rest/service_stub.rb +520 -0
  32. data/lib/google/cloud/compute/v1/future_reservations/rest.rb +51 -0
  33. data/lib/google/cloud/compute/v1/future_reservations.rb +47 -0
  34. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +126 -10
  35. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +151 -15
  36. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +246 -21
  37. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +203 -18
  38. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +91 -9
  39. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +128 -10
  40. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +333 -21
  41. data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +63 -0
  42. data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +2 -1
  43. data/lib/google/cloud/compute/v1/images/rest/client.rb +161 -18
  44. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest/client.rb +159 -24
  45. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +920 -95
  46. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +380 -40
  47. data/lib/google/cloud/compute/v1/instance_settings_service/rest/client.rb +13 -1
  48. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +220 -20
  49. data/lib/google/cloud/compute/v1/instances/rest/client.rb +939 -104
  50. data/lib/google/cloud/compute/v1/instant_snapshot_groups/credentials.rb +52 -0
  51. data/lib/google/cloud/compute/v1/instant_snapshot_groups/rest/client.rb +1145 -0
  52. data/lib/google/cloud/compute/v1/instant_snapshot_groups/rest/service_stub.rb +523 -0
  53. data/lib/google/cloud/compute/v1/instant_snapshot_groups/rest.rb +51 -0
  54. data/lib/google/cloud/compute/v1/instant_snapshot_groups.rb +47 -0
  55. data/lib/google/cloud/compute/v1/instant_snapshots/rest/client.rb +235 -21
  56. data/lib/google/cloud/compute/v1/interconnect_attachment_groups/rest/client.rb +139 -14
  57. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +242 -21
  58. data/lib/google/cloud/compute/v1/interconnect_groups/rest/client.rb +139 -14
  59. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +87 -7
  60. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +87 -7
  61. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +145 -14
  62. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +9 -2
  63. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +161 -16
  64. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +124 -13
  65. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +181 -14
  66. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +232 -20
  67. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +138 -12
  68. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +361 -37
  69. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +354 -33
  70. data/lib/google/cloud/compute/v1/network_profiles/rest/client.rb +85 -6
  71. data/lib/google/cloud/compute/v1/networks/rest/client.rb +281 -23
  72. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +381 -32
  73. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +213 -19
  74. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +181 -14
  75. data/lib/google/cloud/compute/v1/organization_security_policies/credentials.rb +52 -0
  76. data/lib/google/cloud/compute/v1/organization_security_policies/rest/client.rb +2259 -0
  77. data/lib/google/cloud/compute/v1/organization_security_policies/rest/service_stub.rb +1054 -0
  78. data/lib/google/cloud/compute/v1/organization_security_policies/rest.rb +51 -0
  79. data/lib/google/cloud/compute/v1/organization_security_policies.rb +47 -0
  80. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +226 -19
  81. data/lib/google/cloud/compute/v1/preview_features/credentials.rb +52 -0
  82. data/lib/google/cloud/compute/v1/preview_features/rest/client.rb +739 -0
  83. data/lib/google/cloud/compute/v1/preview_features/rest/service_stub.rb +267 -0
  84. data/lib/google/cloud/compute/v1/preview_features/rest.rb +51 -0
  85. data/lib/google/cloud/compute/v1/preview_features.rb +47 -0
  86. data/lib/google/cloud/compute/v1/projects/rest/client.rb +346 -30
  87. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +154 -12
  88. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +255 -22
  89. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +238 -13
  90. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +64 -0
  91. data/lib/google/cloud/compute/v1/region_backend_buckets/credentials.rb +52 -0
  92. data/lib/google/cloud/compute/v1/region_backend_buckets/rest/client.rb +1450 -0
  93. data/lib/google/cloud/compute/v1/region_backend_buckets/rest/service_stub.rb +649 -0
  94. data/lib/google/cloud/compute/v1/region_backend_buckets/rest.rb +51 -0
  95. data/lib/google/cloud/compute/v1/region_backend_buckets.rb +47 -0
  96. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +260 -26
  97. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +212 -18
  98. data/lib/google/cloud/compute/v1/region_composite_health_checks/credentials.rb +52 -0
  99. data/lib/google/cloud/compute/v1/region_composite_health_checks/rest/client.rb +1363 -0
  100. data/lib/google/cloud/compute/v1/region_composite_health_checks/rest/service_stub.rb +584 -0
  101. data/lib/google/cloud/compute/v1/region_composite_health_checks/rest.rb +51 -0
  102. data/lib/google/cloud/compute/v1/region_composite_health_checks.rb +47 -0
  103. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +83 -5
  104. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +387 -29
  105. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +64 -0
  106. data/lib/google/cloud/compute/v1/region_health_aggregation_policies/credentials.rb +52 -0
  107. data/lib/google/cloud/compute/v1/region_health_aggregation_policies/rest/client.rb +1268 -0
  108. data/lib/google/cloud/compute/v1/region_health_aggregation_policies/rest/service_stub.rb +521 -0
  109. data/lib/google/cloud/compute/v1/region_health_aggregation_policies/rest.rb +51 -0
  110. data/lib/google/cloud/compute/v1/region_health_aggregation_policies.rb +47 -0
  111. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +427 -17
  112. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +125 -0
  113. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +238 -13
  114. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +64 -0
  115. data/lib/google/cloud/compute/v1/region_health_sources/credentials.rb +52 -0
  116. data/lib/google/cloud/compute/v1/region_health_sources/rest/client.rb +1363 -0
  117. data/lib/google/cloud/compute/v1/region_health_sources/rest/service_stub.rb +584 -0
  118. data/lib/google/cloud/compute/v1/region_health_sources/rest.rb +51 -0
  119. data/lib/google/cloud/compute/v1/region_health_sources.rb +47 -0
  120. data/lib/google/cloud/compute/v1/region_instance_group_manager_resize_requests/credentials.rb +52 -0
  121. data/lib/google/cloud/compute/v1/region_instance_group_manager_resize_requests/rest/client.rb +1002 -0
  122. data/lib/google/cloud/compute/v1/region_instance_group_manager_resize_requests/rest/service_stub.rb +400 -0
  123. data/lib/google/cloud/compute/v1/region_instance_group_manager_resize_requests/rest.rb +51 -0
  124. data/lib/google/cloud/compute/v1/region_instance_group_manager_resize_requests.rb +47 -0
  125. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +750 -64
  126. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +187 -14
  127. data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +115 -10
  128. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +15 -2
  129. data/lib/google/cloud/compute/v1/region_instant_snapshot_groups/credentials.rb +52 -0
  130. data/lib/google/cloud/compute/v1/region_instant_snapshot_groups/rest/client.rb +1146 -0
  131. data/lib/google/cloud/compute/v1/region_instant_snapshot_groups/rest/service_stub.rb +523 -0
  132. data/lib/google/cloud/compute/v1/region_instant_snapshot_groups/rest.rb +51 -0
  133. data/lib/google/cloud/compute/v1/region_instant_snapshot_groups.rb +47 -0
  134. data/lib/google/cloud/compute/v1/region_instant_snapshots/rest/client.rb +139 -13
  135. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +264 -28
  136. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +213 -20
  137. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +399 -11
  138. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +125 -0
  139. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +107 -10
  140. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +149 -14
  141. data/lib/google/cloud/compute/v1/region_snapshot_settings/credentials.rb +52 -0
  142. data/lib/google/cloud/compute/v1/region_snapshot_settings/rest/client.rb +561 -0
  143. data/lib/google/cloud/compute/v1/region_snapshot_settings/rest/service_stub.rb +206 -0
  144. data/lib/google/cloud/compute/v1/region_snapshot_settings/rest.rb +51 -0
  145. data/lib/google/cloud/compute/v1/region_snapshot_settings.rb +47 -0
  146. data/lib/google/cloud/compute/v1/region_snapshots/credentials.rb +52 -0
  147. data/lib/google/cloud/compute/v1/region_snapshots/rest/client.rb +1388 -0
  148. data/lib/google/cloud/compute/v1/region_snapshots/rest/service_stub.rb +651 -0
  149. data/lib/google/cloud/compute/v1/region_snapshots/rest.rb +51 -0
  150. data/lib/google/cloud/compute/v1/region_snapshots.rb +47 -0
  151. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +116 -10
  152. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +220 -20
  153. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +126 -10
  154. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +158 -14
  155. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +113 -9
  156. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +104 -14
  157. data/lib/google/cloud/compute/v1/region_zones/rest/client.rb +85 -6
  158. data/lib/google/cloud/compute/v1/regions/rest/client.rb +120 -7
  159. data/lib/google/cloud/compute/v1/reservation_blocks/rest/client.rb +396 -11
  160. data/lib/google/cloud/compute/v1/reservation_blocks/rest/service_stub.rb +194 -0
  161. data/lib/google/cloud/compute/v1/reservation_slots/credentials.rb +52 -0
  162. data/lib/google/cloud/compute/v1/reservation_slots/rest/client.rb +863 -0
  163. data/lib/google/cloud/compute/v1/reservation_slots/rest/service_stub.rb +338 -0
  164. data/lib/google/cloud/compute/v1/reservation_slots/rest.rb +51 -0
  165. data/lib/google/cloud/compute/v1/reservation_slots.rb +47 -0
  166. data/lib/google/cloud/compute/v1/reservation_sub_blocks/rest/client.rb +642 -12
  167. data/lib/google/cloud/compute/v1/reservation_sub_blocks/rest/service_stub.rb +327 -3
  168. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +257 -24
  169. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +224 -19
  170. data/lib/google/cloud/compute/v1/rest.rb +17 -0
  171. data/lib/google/cloud/compute/v1/routers/rest/client.rb +555 -50
  172. data/lib/google/cloud/compute/v1/routes/rest/client.rb +202 -8
  173. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +63 -0
  174. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +316 -26
  175. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +231 -21
  176. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/client.rb +13 -1
  177. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +245 -13
  178. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +63 -0
  179. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +210 -17
  180. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +315 -27
  181. data/lib/google/cloud/compute/v1/storage_pool_types/rest/client.rb +181 -14
  182. data/lib/google/cloud/compute/v1/storage_pools/rest/client.rb +321 -28
  183. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +378 -34
  184. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +128 -10
  185. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +240 -20
  186. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +306 -30
  187. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +227 -20
  188. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +294 -26
  189. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +281 -19
  190. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +63 -0
  191. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +329 -20
  192. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +63 -0
  193. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +224 -19
  194. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +354 -24
  195. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +63 -0
  196. data/lib/google/cloud/compute/v1/version.rb +1 -1
  197. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +224 -19
  198. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +224 -19
  199. data/lib/google/cloud/compute/v1/wire_groups/credentials.rb +52 -0
  200. data/lib/google/cloud/compute/v1/wire_groups/rest/client.rb +980 -0
  201. data/lib/google/cloud/compute/v1/wire_groups/rest/service_stub.rb +396 -0
  202. data/lib/google/cloud/compute/v1/wire_groups/rest.rb +51 -0
  203. data/lib/google/cloud/compute/v1/wire_groups.rb +47 -0
  204. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +106 -10
  205. data/lib/google/cloud/compute/v1/zone_vm_extension_policies/credentials.rb +52 -0
  206. data/lib/google/cloud/compute/v1/zone_vm_extension_policies/rest/client.rb +975 -0
  207. data/lib/google/cloud/compute/v1/zone_vm_extension_policies/rest/service_stub.rb +396 -0
  208. data/lib/google/cloud/compute/v1/zone_vm_extension_policies/rest.rb +51 -0
  209. data/lib/google/cloud/compute/v1/zone_vm_extension_policies.rb +47 -0
  210. data/lib/google/cloud/compute/v1/zones/rest/client.rb +83 -5
  211. data/lib/google/cloud/compute/v1.rb +17 -0
  212. data/proto_docs/google/api/client.rb +149 -29
  213. data/proto_docs/google/cloud/compute/v1/compute.rb +47064 -5503
  214. metadata +87 -2
@@ -0,0 +1,2259 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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/organization_security_policies/rest/service_stub"
22
+ require "google/cloud/compute/v1/global_organization_operations/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Compute
27
+ module V1
28
+ module OrganizationSecurityPolicies
29
+ module Rest
30
+ ##
31
+ # REST client for the OrganizationSecurityPolicies service.
32
+ #
33
+ # The OrganizationSecurityPolicies API.
34
+ #
35
+ class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
39
+ # @private
40
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
41
+
42
+ # @private
43
+ attr_reader :organization_security_policies_stub
44
+
45
+ ##
46
+ # Configure the OrganizationSecurityPolicies Client class.
47
+ #
48
+ # See {::Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all OrganizationSecurityPolicies clients
54
+ # ::Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Cloud", "Compute", "V1"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config.rpcs.add_association.timeout = 600.0
75
+
76
+ default_config.rpcs.add_rule.timeout = 600.0
77
+
78
+ default_config.rpcs.copy_rules.timeout = 600.0
79
+
80
+ default_config.rpcs.delete.timeout = 600.0
81
+
82
+ default_config.rpcs.get.timeout = 600.0
83
+ default_config.rpcs.get.retry_policy = {
84
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
85
+ }
86
+
87
+ default_config.rpcs.get_association.timeout = 600.0
88
+ default_config.rpcs.get_association.retry_policy = {
89
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
90
+ }
91
+
92
+ default_config.rpcs.get_rule.timeout = 600.0
93
+ default_config.rpcs.get_rule.retry_policy = {
94
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
95
+ }
96
+
97
+ default_config.rpcs.insert.timeout = 600.0
98
+
99
+ default_config.rpcs.list.timeout = 600.0
100
+ default_config.rpcs.list.retry_policy = {
101
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
102
+ }
103
+
104
+ default_config.rpcs.list_associations.timeout = 600.0
105
+ default_config.rpcs.list_associations.retry_policy = {
106
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
107
+ }
108
+
109
+ default_config.rpcs.list_preconfigured_expression_sets.timeout = 600.0
110
+ default_config.rpcs.list_preconfigured_expression_sets.retry_policy = {
111
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
112
+ }
113
+
114
+ default_config.rpcs.move.timeout = 600.0
115
+
116
+ default_config.rpcs.patch.timeout = 600.0
117
+
118
+ default_config.rpcs.patch_rule.timeout = 600.0
119
+
120
+ default_config.rpcs.remove_association.timeout = 600.0
121
+
122
+ default_config.rpcs.remove_rule.timeout = 600.0
123
+
124
+ default_config
125
+ end
126
+ yield @configure if block_given?
127
+ @configure
128
+ end
129
+
130
+ ##
131
+ # Configure the OrganizationSecurityPolicies Client instance.
132
+ #
133
+ # The configuration is set to the derived mode, meaning that values can be changed,
134
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
135
+ # should be made on {Client.configure}.
136
+ #
137
+ # See {::Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client::Configuration}
138
+ # for a description of the configuration fields.
139
+ #
140
+ # @yield [config] Configure the Client client.
141
+ # @yieldparam config [Client::Configuration]
142
+ #
143
+ # @return [Client::Configuration]
144
+ #
145
+ def configure
146
+ yield @config if block_given?
147
+ @config
148
+ end
149
+
150
+ ##
151
+ # The effective universe domain
152
+ #
153
+ # @return [String]
154
+ #
155
+ def universe_domain
156
+ @organization_security_policies_stub.universe_domain
157
+ end
158
+
159
+ ##
160
+ # Create a new OrganizationSecurityPolicies REST client object.
161
+ #
162
+ # @example
163
+ #
164
+ # # Create a client using the default configuration
165
+ # client = ::Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client.new
166
+ #
167
+ # # Create a client using a custom configuration
168
+ # client = ::Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client.new do |config|
169
+ # config.timeout = 10.0
170
+ # end
171
+ #
172
+ # @yield [config] Configure the OrganizationSecurityPolicies client.
173
+ # @yieldparam config [Client::Configuration]
174
+ #
175
+ def initialize
176
+ # Create the configuration object
177
+ @config = Configuration.new Client.configure
178
+
179
+ # Yield the configuration if needed
180
+ yield @config if block_given?
181
+
182
+ # Create credentials
183
+ credentials = @config.credentials
184
+ # Use self-signed JWT if the endpoint is unchanged from default,
185
+ # but only if the default endpoint does not have a region prefix.
186
+ enable_self_signed_jwt = @config.endpoint.nil? ||
187
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
188
+ !@config.endpoint.split(".").first.include?("-"))
189
+ credentials ||= Credentials.default scope: @config.scope,
190
+ enable_self_signed_jwt: enable_self_signed_jwt
191
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
192
+ credentials = Credentials.new credentials, scope: @config.scope
193
+ end
194
+
195
+ @quota_project_id = @config.quota_project
196
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
197
+
198
+ @global_organization_operations = ::Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::Client.new do |config|
199
+ config.credentials = credentials
200
+ config.quota_project = @quota_project_id
201
+ config.endpoint = @config.endpoint
202
+ config.universe_domain = @config.universe_domain
203
+ end
204
+
205
+ @organization_security_policies_stub = ::Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::ServiceStub.new(
206
+ endpoint: @config.endpoint,
207
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
208
+ universe_domain: @config.universe_domain,
209
+ credentials: credentials,
210
+ logger: @config.logger
211
+ )
212
+
213
+ @organization_security_policies_stub.logger(stub: true)&.info do |entry|
214
+ entry.set_system_name
215
+ entry.set_service
216
+ entry.message = "Created client for #{entry.service}"
217
+ entry.set_credentials_fields credentials
218
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
219
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
220
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
221
+ end
222
+ end
223
+
224
+ ##
225
+ # Get the associated client for long-running operations via GlobalOrganizationOperations.
226
+ #
227
+ # @return [::Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::Client]
228
+ #
229
+ attr_reader :global_organization_operations
230
+
231
+ ##
232
+ # The logger used for request/response debug logging.
233
+ #
234
+ # @return [Logger]
235
+ #
236
+ def logger
237
+ @organization_security_policies_stub.logger
238
+ end
239
+
240
+ # Service calls
241
+
242
+ ##
243
+ # Inserts an association for the specified security policy.
244
+ #
245
+ # This has billing implications. Projects in the hierarchy with effective
246
+ # hierarchical security policies will be automatically enrolled into Cloud
247
+ # Armor Enterprise if not already enrolled.
248
+ #
249
+ # Use this API to modify Cloud Armor policies. Previously, alpha and beta
250
+ # versions of this API were used to modify firewall policies. This usage is
251
+ # now disabled for most organizations. Use firewallPolicies.addAssociation
252
+ # instead.
253
+ #
254
+ # @overload add_association(request, options = nil)
255
+ # Pass arguments to `add_association` via a request object, either of type
256
+ # {::Google::Cloud::Compute::V1::AddAssociationOrganizationSecurityPolicyRequest} or an equivalent Hash.
257
+ #
258
+ # @param request [::Google::Cloud::Compute::V1::AddAssociationOrganizationSecurityPolicyRequest, ::Hash]
259
+ # A request object representing the call parameters. Required. To specify no
260
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
261
+ # @param options [::Gapic::CallOptions, ::Hash]
262
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
263
+ #
264
+ # @overload add_association(replace_existing_association: nil, request_id: nil, security_policy: nil, security_policy_association_resource: nil)
265
+ # Pass arguments to `add_association` via keyword arguments. Note that at
266
+ # least one keyword argument is required. To specify no parameters, or to keep all
267
+ # the default parameter values, pass an empty Hash as a request object (see above).
268
+ #
269
+ # @param replace_existing_association [::Boolean]
270
+ # Indicates whether or not to replace it if an association of the attachment
271
+ # already exists. This is false by default, in which case an error will be
272
+ # returned if an association already exists.
273
+ # @param request_id [::String]
274
+ # An optional request ID to identify requests. Specify a unique request ID so
275
+ # that if you must retry your request, the server will know to ignore the
276
+ # request if it has already been completed.
277
+ #
278
+ # For example, consider a situation where you make an initial request and
279
+ # the request times out. If you make the request again with the same
280
+ # request ID, the server can check if original operation with the same
281
+ # request ID was received, and if so, will ignore the second request. This
282
+ # prevents clients from accidentally creating duplicate commitments.
283
+ #
284
+ # The request ID must be
285
+ # a valid UUID with the exception that zero UUID is not supported
286
+ # (00000000-0000-0000-0000-000000000000).
287
+ # @param security_policy [::String]
288
+ # Name of the security policy to update.
289
+ # @param security_policy_association_resource [::Google::Cloud::Compute::V1::SecurityPolicyAssociation, ::Hash]
290
+ # The body resource for this request
291
+ # @yield [result, operation] Access the result along with the TransportOperation object
292
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
293
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
294
+ #
295
+ # @return [::Gapic::GenericLRO::Operation]
296
+ #
297
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
298
+ #
299
+ # @example Basic example
300
+ # require "google/cloud/compute/v1"
301
+ #
302
+ # # Create a client object. The client can be reused for multiple calls.
303
+ # client = Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client.new
304
+ #
305
+ # # Create a request. To set request fields, pass in keyword arguments.
306
+ # request = Google::Cloud::Compute::V1::AddAssociationOrganizationSecurityPolicyRequest.new
307
+ #
308
+ # # Call the add_association method.
309
+ # result = client.add_association request
310
+ #
311
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
312
+ # p result
313
+ #
314
+ def add_association request, options = nil
315
+ raise ::ArgumentError, "request must be provided" if request.nil?
316
+
317
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AddAssociationOrganizationSecurityPolicyRequest
318
+
319
+ # Converts hash and nil to an options object
320
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
321
+
322
+ # Customize the options with defaults
323
+ call_metadata = @config.rpcs.add_association.metadata.to_h
324
+
325
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
326
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
327
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
328
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
329
+ transports_version_send: [:rest]
330
+
331
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
332
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
333
+
334
+ options.apply_defaults timeout: @config.rpcs.add_association.timeout,
335
+ metadata: call_metadata,
336
+ retry_policy: @config.rpcs.add_association.retry_policy
337
+
338
+ options.apply_defaults timeout: @config.timeout,
339
+ metadata: @config.metadata,
340
+ retry_policy: @config.retry_policy
341
+
342
+ @organization_security_policies_stub.add_association request, options do |result, response|
343
+ result = ::Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::NonstandardLro.create_operation(
344
+ operation: result,
345
+ client: global_organization_operations,
346
+ request_values: {},
347
+ options: options
348
+ )
349
+ yield result, response if block_given?
350
+ throw :response, result
351
+ end
352
+ rescue ::Gapic::Rest::Error => e
353
+ raise ::Google::Cloud::Error.from_error(e)
354
+ end
355
+
356
+ ##
357
+ # Inserts a rule into a security policy.
358
+ #
359
+ # Use this API to modify Cloud Armor policies. Previously, alpha and beta
360
+ # versions of this API were used to modify firewall policies. This usage is
361
+ # now disabled for most organizations. Use firewallPolicies.addRule instead.
362
+ #
363
+ # @overload add_rule(request, options = nil)
364
+ # Pass arguments to `add_rule` via a request object, either of type
365
+ # {::Google::Cloud::Compute::V1::AddRuleOrganizationSecurityPolicyRequest} or an equivalent Hash.
366
+ #
367
+ # @param request [::Google::Cloud::Compute::V1::AddRuleOrganizationSecurityPolicyRequest, ::Hash]
368
+ # A request object representing the call parameters. Required. To specify no
369
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
370
+ # @param options [::Gapic::CallOptions, ::Hash]
371
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
372
+ #
373
+ # @overload add_rule(request_id: nil, security_policy: nil, security_policy_rule_resource: nil)
374
+ # Pass arguments to `add_rule` via keyword arguments. Note that at
375
+ # least one keyword argument is required. To specify no parameters, or to keep all
376
+ # the default parameter values, pass an empty Hash as a request object (see above).
377
+ #
378
+ # @param request_id [::String]
379
+ # An optional request ID to identify requests. Specify a unique request ID so
380
+ # that if you must retry your request, the server will know to ignore the
381
+ # request if it has already been completed.
382
+ #
383
+ # For example, consider a situation where you make an initial request and
384
+ # the request times out. If you make the request again with the same
385
+ # request ID, the server can check if original operation with the same
386
+ # request ID was received, and if so, will ignore the second request. This
387
+ # prevents clients from accidentally creating duplicate commitments.
388
+ #
389
+ # The request ID must be
390
+ # a valid UUID with the exception that zero UUID is not supported
391
+ # (00000000-0000-0000-0000-000000000000).
392
+ # @param security_policy [::String]
393
+ # Name of the security policy to update.
394
+ # @param security_policy_rule_resource [::Google::Cloud::Compute::V1::SecurityPolicyRule, ::Hash]
395
+ # The body resource for this request
396
+ # @yield [result, operation] Access the result along with the TransportOperation object
397
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
398
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
399
+ #
400
+ # @return [::Gapic::GenericLRO::Operation]
401
+ #
402
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
403
+ #
404
+ # @example Basic example
405
+ # require "google/cloud/compute/v1"
406
+ #
407
+ # # Create a client object. The client can be reused for multiple calls.
408
+ # client = Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client.new
409
+ #
410
+ # # Create a request. To set request fields, pass in keyword arguments.
411
+ # request = Google::Cloud::Compute::V1::AddRuleOrganizationSecurityPolicyRequest.new
412
+ #
413
+ # # Call the add_rule method.
414
+ # result = client.add_rule request
415
+ #
416
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
417
+ # p result
418
+ #
419
+ def add_rule request, options = nil
420
+ raise ::ArgumentError, "request must be provided" if request.nil?
421
+
422
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AddRuleOrganizationSecurityPolicyRequest
423
+
424
+ # Converts hash and nil to an options object
425
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
426
+
427
+ # Customize the options with defaults
428
+ call_metadata = @config.rpcs.add_rule.metadata.to_h
429
+
430
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
431
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
432
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
433
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
434
+ transports_version_send: [:rest]
435
+
436
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
437
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
438
+
439
+ options.apply_defaults timeout: @config.rpcs.add_rule.timeout,
440
+ metadata: call_metadata,
441
+ retry_policy: @config.rpcs.add_rule.retry_policy
442
+
443
+ options.apply_defaults timeout: @config.timeout,
444
+ metadata: @config.metadata,
445
+ retry_policy: @config.retry_policy
446
+
447
+ @organization_security_policies_stub.add_rule request, options do |result, response|
448
+ result = ::Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::NonstandardLro.create_operation(
449
+ operation: result,
450
+ client: global_organization_operations,
451
+ request_values: {},
452
+ options: options
453
+ )
454
+ yield result, response if block_given?
455
+ throw :response, result
456
+ end
457
+ rescue ::Gapic::Rest::Error => e
458
+ raise ::Google::Cloud::Error.from_error(e)
459
+ end
460
+
461
+ ##
462
+ # Copies rules to the specified security policy.
463
+ #
464
+ # Use this API to modify Cloud Armor policies. Previously, alpha and beta
465
+ # versions of this API were used to modify firewall policies. This usage is
466
+ # now disabled for most organizations. Use firewallPolicies.cloneRules
467
+ # instead.
468
+ #
469
+ # @overload copy_rules(request, options = nil)
470
+ # Pass arguments to `copy_rules` via a request object, either of type
471
+ # {::Google::Cloud::Compute::V1::CopyRulesOrganizationSecurityPolicyRequest} or an equivalent Hash.
472
+ #
473
+ # @param request [::Google::Cloud::Compute::V1::CopyRulesOrganizationSecurityPolicyRequest, ::Hash]
474
+ # A request object representing the call parameters. Required. To specify no
475
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
476
+ # @param options [::Gapic::CallOptions, ::Hash]
477
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
478
+ #
479
+ # @overload copy_rules(request_id: nil, security_policy: nil, source_security_policy: nil)
480
+ # Pass arguments to `copy_rules` via keyword arguments. Note that at
481
+ # least one keyword argument is required. To specify no parameters, or to keep all
482
+ # the default parameter values, pass an empty Hash as a request object (see above).
483
+ #
484
+ # @param request_id [::String]
485
+ # An optional request ID to identify requests. Specify a unique request ID so
486
+ # that if you must retry your request, the server will know to ignore the
487
+ # request if it has already been completed.
488
+ #
489
+ # For example, consider a situation where you make an initial request and
490
+ # the request times out. If you make the request again with the same
491
+ # request ID, the server can check if original operation with the same
492
+ # request ID was received, and if so, will ignore the second request. This
493
+ # prevents clients from accidentally creating duplicate commitments.
494
+ #
495
+ # The request ID must be
496
+ # a valid UUID with the exception that zero UUID is not supported
497
+ # (00000000-0000-0000-0000-000000000000).
498
+ # @param security_policy [::String]
499
+ # Name of the security policy to update.
500
+ # @param source_security_policy [::String]
501
+ # The security policy from which to copy rules.
502
+ # @yield [result, operation] Access the result along with the TransportOperation object
503
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
504
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
505
+ #
506
+ # @return [::Gapic::GenericLRO::Operation]
507
+ #
508
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
509
+ #
510
+ # @example Basic example
511
+ # require "google/cloud/compute/v1"
512
+ #
513
+ # # Create a client object. The client can be reused for multiple calls.
514
+ # client = Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client.new
515
+ #
516
+ # # Create a request. To set request fields, pass in keyword arguments.
517
+ # request = Google::Cloud::Compute::V1::CopyRulesOrganizationSecurityPolicyRequest.new
518
+ #
519
+ # # Call the copy_rules method.
520
+ # result = client.copy_rules request
521
+ #
522
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
523
+ # p result
524
+ #
525
+ def copy_rules request, options = nil
526
+ raise ::ArgumentError, "request must be provided" if request.nil?
527
+
528
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::CopyRulesOrganizationSecurityPolicyRequest
529
+
530
+ # Converts hash and nil to an options object
531
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
532
+
533
+ # Customize the options with defaults
534
+ call_metadata = @config.rpcs.copy_rules.metadata.to_h
535
+
536
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
537
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
538
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
539
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
540
+ transports_version_send: [:rest]
541
+
542
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
543
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
544
+
545
+ options.apply_defaults timeout: @config.rpcs.copy_rules.timeout,
546
+ metadata: call_metadata,
547
+ retry_policy: @config.rpcs.copy_rules.retry_policy
548
+
549
+ options.apply_defaults timeout: @config.timeout,
550
+ metadata: @config.metadata,
551
+ retry_policy: @config.retry_policy
552
+
553
+ @organization_security_policies_stub.copy_rules request, options do |result, response|
554
+ result = ::Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::NonstandardLro.create_operation(
555
+ operation: result,
556
+ client: global_organization_operations,
557
+ request_values: {},
558
+ options: options
559
+ )
560
+ yield result, response if block_given?
561
+ throw :response, result
562
+ end
563
+ rescue ::Gapic::Rest::Error => e
564
+ raise ::Google::Cloud::Error.from_error(e)
565
+ end
566
+
567
+ ##
568
+ # Deletes the specified policy.
569
+ #
570
+ # Use this API to remove Cloud Armor policies. Previously, alpha and beta
571
+ # versions of this API were used to remove firewall policies. This usage is
572
+ # now disabled for most organizations. Use firewallPolicies.delete instead.
573
+ #
574
+ # @overload delete(request, options = nil)
575
+ # Pass arguments to `delete` via a request object, either of type
576
+ # {::Google::Cloud::Compute::V1::DeleteOrganizationSecurityPolicyRequest} or an equivalent Hash.
577
+ #
578
+ # @param request [::Google::Cloud::Compute::V1::DeleteOrganizationSecurityPolicyRequest, ::Hash]
579
+ # A request object representing the call parameters. Required. To specify no
580
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
581
+ # @param options [::Gapic::CallOptions, ::Hash]
582
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
583
+ #
584
+ # @overload delete(request_id: nil, security_policy: nil)
585
+ # Pass arguments to `delete` via keyword arguments. Note that at
586
+ # least one keyword argument is required. To specify no parameters, or to keep all
587
+ # the default parameter values, pass an empty Hash as a request object (see above).
588
+ #
589
+ # @param request_id [::String]
590
+ # An optional request ID to identify requests. Specify a unique request ID so
591
+ # that if you must retry your request, the server will know to ignore the
592
+ # request if it has already been completed.
593
+ #
594
+ # For example, consider a situation where you make an initial request and
595
+ # the request times out. If you make the request again with the same
596
+ # request ID, the server can check if original operation with the same
597
+ # request ID was received, and if so, will ignore the second request. This
598
+ # prevents clients from accidentally creating duplicate commitments.
599
+ #
600
+ # The request ID must be
601
+ # a valid UUID with the exception that zero UUID is not supported
602
+ # (00000000-0000-0000-0000-000000000000).
603
+ # @param security_policy [::String]
604
+ # Name of the security policy to delete.
605
+ # @yield [result, operation] Access the result along with the TransportOperation object
606
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
607
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
608
+ #
609
+ # @return [::Gapic::GenericLRO::Operation]
610
+ #
611
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
612
+ #
613
+ # @example Basic example
614
+ # require "google/cloud/compute/v1"
615
+ #
616
+ # # Create a client object. The client can be reused for multiple calls.
617
+ # client = Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client.new
618
+ #
619
+ # # Create a request. To set request fields, pass in keyword arguments.
620
+ # request = Google::Cloud::Compute::V1::DeleteOrganizationSecurityPolicyRequest.new
621
+ #
622
+ # # Call the delete method.
623
+ # result = client.delete request
624
+ #
625
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
626
+ # p result
627
+ #
628
+ def delete request, options = nil
629
+ raise ::ArgumentError, "request must be provided" if request.nil?
630
+
631
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteOrganizationSecurityPolicyRequest
632
+
633
+ # Converts hash and nil to an options object
634
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
635
+
636
+ # Customize the options with defaults
637
+ call_metadata = @config.rpcs.delete.metadata.to_h
638
+
639
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
640
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
641
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
642
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
643
+ transports_version_send: [:rest]
644
+
645
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
646
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
647
+
648
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
649
+ metadata: call_metadata,
650
+ retry_policy: @config.rpcs.delete.retry_policy
651
+
652
+ options.apply_defaults timeout: @config.timeout,
653
+ metadata: @config.metadata,
654
+ retry_policy: @config.retry_policy
655
+
656
+ @organization_security_policies_stub.delete request, options do |result, response|
657
+ result = ::Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::NonstandardLro.create_operation(
658
+ operation: result,
659
+ client: global_organization_operations,
660
+ request_values: {},
661
+ options: options
662
+ )
663
+ yield result, response if block_given?
664
+ throw :response, result
665
+ end
666
+ rescue ::Gapic::Rest::Error => e
667
+ raise ::Google::Cloud::Error.from_error(e)
668
+ end
669
+
670
+ ##
671
+ # List all of the ordered rules present in a single specified policy.
672
+ #
673
+ # Use this API to read Cloud Armor policies. Previously, alpha and beta
674
+ # versions of this API were used to read firewall policies. This usage is now
675
+ # disabled for most organizations. Use firewallPolicies.get instead.
676
+ #
677
+ # @overload get(request, options = nil)
678
+ # Pass arguments to `get` via a request object, either of type
679
+ # {::Google::Cloud::Compute::V1::GetOrganizationSecurityPolicyRequest} or an equivalent Hash.
680
+ #
681
+ # @param request [::Google::Cloud::Compute::V1::GetOrganizationSecurityPolicyRequest, ::Hash]
682
+ # A request object representing the call parameters. Required. To specify no
683
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
684
+ # @param options [::Gapic::CallOptions, ::Hash]
685
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
686
+ #
687
+ # @overload get(security_policy: nil)
688
+ # Pass arguments to `get` via keyword arguments. Note that at
689
+ # least one keyword argument is required. To specify no parameters, or to keep all
690
+ # the default parameter values, pass an empty Hash as a request object (see above).
691
+ #
692
+ # @param security_policy [::String]
693
+ # Name of the security policy to get.
694
+ # @yield [result, operation] Access the result along with the TransportOperation object
695
+ # @yieldparam result [::Google::Cloud::Compute::V1::SecurityPolicy]
696
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
697
+ #
698
+ # @return [::Google::Cloud::Compute::V1::SecurityPolicy]
699
+ #
700
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
701
+ #
702
+ # @example Basic example
703
+ # require "google/cloud/compute/v1"
704
+ #
705
+ # # Create a client object. The client can be reused for multiple calls.
706
+ # client = Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client.new
707
+ #
708
+ # # Create a request. To set request fields, pass in keyword arguments.
709
+ # request = Google::Cloud::Compute::V1::GetOrganizationSecurityPolicyRequest.new
710
+ #
711
+ # # Call the get method.
712
+ # result = client.get request
713
+ #
714
+ # # The returned object is of type Google::Cloud::Compute::V1::SecurityPolicy.
715
+ # p result
716
+ #
717
+ def get request, options = nil
718
+ raise ::ArgumentError, "request must be provided" if request.nil?
719
+
720
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetOrganizationSecurityPolicyRequest
721
+
722
+ # Converts hash and nil to an options object
723
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
724
+
725
+ # Customize the options with defaults
726
+ call_metadata = @config.rpcs.get.metadata.to_h
727
+
728
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
729
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
730
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
731
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
732
+ transports_version_send: [:rest]
733
+
734
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
735
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
736
+
737
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
738
+ metadata: call_metadata,
739
+ retry_policy: @config.rpcs.get.retry_policy
740
+
741
+ options.apply_defaults timeout: @config.timeout,
742
+ metadata: @config.metadata,
743
+ retry_policy: @config.retry_policy
744
+
745
+ @organization_security_policies_stub.get request, options do |result, operation|
746
+ yield result, operation if block_given?
747
+ end
748
+ rescue ::Gapic::Rest::Error => e
749
+ raise ::Google::Cloud::Error.from_error(e)
750
+ end
751
+
752
+ ##
753
+ # Gets an association with the specified name.
754
+ #
755
+ # Use this API to read Cloud Armor policies. Previously, alpha and beta
756
+ # versions of this API were used to read firewall policies. This usage is
757
+ # now disabled for most organizations. Use firewallPolicies.getAssociation
758
+ # instead.
759
+ #
760
+ # @overload get_association(request, options = nil)
761
+ # Pass arguments to `get_association` via a request object, either of type
762
+ # {::Google::Cloud::Compute::V1::GetAssociationOrganizationSecurityPolicyRequest} or an equivalent Hash.
763
+ #
764
+ # @param request [::Google::Cloud::Compute::V1::GetAssociationOrganizationSecurityPolicyRequest, ::Hash]
765
+ # A request object representing the call parameters. Required. To specify no
766
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
767
+ # @param options [::Gapic::CallOptions, ::Hash]
768
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
769
+ #
770
+ # @overload get_association(name: nil, security_policy: nil)
771
+ # Pass arguments to `get_association` via keyword arguments. Note that at
772
+ # least one keyword argument is required. To specify no parameters, or to keep all
773
+ # the default parameter values, pass an empty Hash as a request object (see above).
774
+ #
775
+ # @param name [::String]
776
+ # The name of the association to get from the security policy.
777
+ # @param security_policy [::String]
778
+ # Name of the security policy to which the queried rule belongs.
779
+ # @yield [result, operation] Access the result along with the TransportOperation object
780
+ # @yieldparam result [::Google::Cloud::Compute::V1::SecurityPolicyAssociation]
781
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
782
+ #
783
+ # @return [::Google::Cloud::Compute::V1::SecurityPolicyAssociation]
784
+ #
785
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
786
+ #
787
+ # @example Basic example
788
+ # require "google/cloud/compute/v1"
789
+ #
790
+ # # Create a client object. The client can be reused for multiple calls.
791
+ # client = Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client.new
792
+ #
793
+ # # Create a request. To set request fields, pass in keyword arguments.
794
+ # request = Google::Cloud::Compute::V1::GetAssociationOrganizationSecurityPolicyRequest.new
795
+ #
796
+ # # Call the get_association method.
797
+ # result = client.get_association request
798
+ #
799
+ # # The returned object is of type Google::Cloud::Compute::V1::SecurityPolicyAssociation.
800
+ # p result
801
+ #
802
+ def get_association request, options = nil
803
+ raise ::ArgumentError, "request must be provided" if request.nil?
804
+
805
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetAssociationOrganizationSecurityPolicyRequest
806
+
807
+ # Converts hash and nil to an options object
808
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
809
+
810
+ # Customize the options with defaults
811
+ call_metadata = @config.rpcs.get_association.metadata.to_h
812
+
813
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
814
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
815
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
816
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
817
+ transports_version_send: [:rest]
818
+
819
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
820
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
821
+
822
+ options.apply_defaults timeout: @config.rpcs.get_association.timeout,
823
+ metadata: call_metadata,
824
+ retry_policy: @config.rpcs.get_association.retry_policy
825
+
826
+ options.apply_defaults timeout: @config.timeout,
827
+ metadata: @config.metadata,
828
+ retry_policy: @config.retry_policy
829
+
830
+ @organization_security_policies_stub.get_association request, options do |result, operation|
831
+ yield result, operation if block_given?
832
+ end
833
+ rescue ::Gapic::Rest::Error => e
834
+ raise ::Google::Cloud::Error.from_error(e)
835
+ end
836
+
837
+ ##
838
+ # Gets a rule at the specified priority.
839
+ #
840
+ # Use this API to read Cloud Armor policies. Previously, alpha and beta
841
+ # versions of this API were used to read firewall policies. This usage is now
842
+ # disabled for most organizations. Use firewallPolicies.getRule instead.
843
+ #
844
+ # @overload get_rule(request, options = nil)
845
+ # Pass arguments to `get_rule` via a request object, either of type
846
+ # {::Google::Cloud::Compute::V1::GetRuleOrganizationSecurityPolicyRequest} or an equivalent Hash.
847
+ #
848
+ # @param request [::Google::Cloud::Compute::V1::GetRuleOrganizationSecurityPolicyRequest, ::Hash]
849
+ # A request object representing the call parameters. Required. To specify no
850
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
851
+ # @param options [::Gapic::CallOptions, ::Hash]
852
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
853
+ #
854
+ # @overload get_rule(priority: nil, security_policy: nil)
855
+ # Pass arguments to `get_rule` via keyword arguments. Note that at
856
+ # least one keyword argument is required. To specify no parameters, or to keep all
857
+ # the default parameter values, pass an empty Hash as a request object (see above).
858
+ #
859
+ # @param priority [::Integer]
860
+ # The priority of the rule to get from the security policy.
861
+ # @param security_policy [::String]
862
+ # Name of the security policy to which the queried rule belongs.
863
+ # @yield [result, operation] Access the result along with the TransportOperation object
864
+ # @yieldparam result [::Google::Cloud::Compute::V1::SecurityPolicyRule]
865
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
866
+ #
867
+ # @return [::Google::Cloud::Compute::V1::SecurityPolicyRule]
868
+ #
869
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
870
+ #
871
+ # @example Basic example
872
+ # require "google/cloud/compute/v1"
873
+ #
874
+ # # Create a client object. The client can be reused for multiple calls.
875
+ # client = Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client.new
876
+ #
877
+ # # Create a request. To set request fields, pass in keyword arguments.
878
+ # request = Google::Cloud::Compute::V1::GetRuleOrganizationSecurityPolicyRequest.new
879
+ #
880
+ # # Call the get_rule method.
881
+ # result = client.get_rule request
882
+ #
883
+ # # The returned object is of type Google::Cloud::Compute::V1::SecurityPolicyRule.
884
+ # p result
885
+ #
886
+ def get_rule request, options = nil
887
+ raise ::ArgumentError, "request must be provided" if request.nil?
888
+
889
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetRuleOrganizationSecurityPolicyRequest
890
+
891
+ # Converts hash and nil to an options object
892
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
893
+
894
+ # Customize the options with defaults
895
+ call_metadata = @config.rpcs.get_rule.metadata.to_h
896
+
897
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
898
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
899
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
900
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
901
+ transports_version_send: [:rest]
902
+
903
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
904
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
905
+
906
+ options.apply_defaults timeout: @config.rpcs.get_rule.timeout,
907
+ metadata: call_metadata,
908
+ retry_policy: @config.rpcs.get_rule.retry_policy
909
+
910
+ options.apply_defaults timeout: @config.timeout,
911
+ metadata: @config.metadata,
912
+ retry_policy: @config.retry_policy
913
+
914
+ @organization_security_policies_stub.get_rule request, options do |result, operation|
915
+ yield result, operation if block_given?
916
+ end
917
+ rescue ::Gapic::Rest::Error => e
918
+ raise ::Google::Cloud::Error.from_error(e)
919
+ end
920
+
921
+ ##
922
+ # Creates a new policy in the specified organization using the data included
923
+ # in the request.
924
+ #
925
+ # Use this API to add Cloud Armor policies. Previously, alpha and beta
926
+ # versions of this API were used to add firewall policies. This usage is now
927
+ # disabled for most organizations. Use firewallPolicies.insert instead.
928
+ #
929
+ # @overload insert(request, options = nil)
930
+ # Pass arguments to `insert` via a request object, either of type
931
+ # {::Google::Cloud::Compute::V1::InsertOrganizationSecurityPolicyRequest} or an equivalent Hash.
932
+ #
933
+ # @param request [::Google::Cloud::Compute::V1::InsertOrganizationSecurityPolicyRequest, ::Hash]
934
+ # A request object representing the call parameters. Required. To specify no
935
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
936
+ # @param options [::Gapic::CallOptions, ::Hash]
937
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
938
+ #
939
+ # @overload insert(parent_id: nil, request_id: nil, security_policy_resource: nil)
940
+ # Pass arguments to `insert` via keyword arguments. Note that at
941
+ # least one keyword argument is required. To specify no parameters, or to keep all
942
+ # the default parameter values, pass an empty Hash as a request object (see above).
943
+ #
944
+ # @param parent_id [::String]
945
+ # Parent ID for this request. The ID can be either be "folders/[FOLDER_ID]"
946
+ # if the parent is a folder or "organizations/[ORGANIZATION_ID]" if the
947
+ # parent is an organization.
948
+ # @param request_id [::String]
949
+ # An optional request ID to identify requests. Specify a unique request ID so
950
+ # that if you must retry your request, the server will know to ignore the
951
+ # request if it has already been completed.
952
+ #
953
+ # For example, consider a situation where you make an initial request and
954
+ # the request times out. If you make the request again with the same
955
+ # request ID, the server can check if original operation with the same
956
+ # request ID was received, and if so, will ignore the second request. This
957
+ # prevents clients from accidentally creating duplicate commitments.
958
+ #
959
+ # The request ID must be
960
+ # a valid UUID with the exception that zero UUID is not supported
961
+ # (00000000-0000-0000-0000-000000000000).
962
+ # @param security_policy_resource [::Google::Cloud::Compute::V1::SecurityPolicy, ::Hash]
963
+ # The body resource for this request
964
+ # @yield [result, operation] Access the result along with the TransportOperation object
965
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
966
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
967
+ #
968
+ # @return [::Gapic::GenericLRO::Operation]
969
+ #
970
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
971
+ #
972
+ # @example Basic example
973
+ # require "google/cloud/compute/v1"
974
+ #
975
+ # # Create a client object. The client can be reused for multiple calls.
976
+ # client = Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client.new
977
+ #
978
+ # # Create a request. To set request fields, pass in keyword arguments.
979
+ # request = Google::Cloud::Compute::V1::InsertOrganizationSecurityPolicyRequest.new
980
+ #
981
+ # # Call the insert method.
982
+ # result = client.insert request
983
+ #
984
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
985
+ # p result
986
+ #
987
+ def insert request, options = nil
988
+ raise ::ArgumentError, "request must be provided" if request.nil?
989
+
990
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::InsertOrganizationSecurityPolicyRequest
991
+
992
+ # Converts hash and nil to an options object
993
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
994
+
995
+ # Customize the options with defaults
996
+ call_metadata = @config.rpcs.insert.metadata.to_h
997
+
998
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
999
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1000
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1001
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1002
+ transports_version_send: [:rest]
1003
+
1004
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1005
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1006
+
1007
+ options.apply_defaults timeout: @config.rpcs.insert.timeout,
1008
+ metadata: call_metadata,
1009
+ retry_policy: @config.rpcs.insert.retry_policy
1010
+
1011
+ options.apply_defaults timeout: @config.timeout,
1012
+ metadata: @config.metadata,
1013
+ retry_policy: @config.retry_policy
1014
+
1015
+ @organization_security_policies_stub.insert request, options do |result, response|
1016
+ result = ::Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::NonstandardLro.create_operation(
1017
+ operation: result,
1018
+ client: global_organization_operations,
1019
+ request_values: {
1020
+ "parent_id" => request.parent_id
1021
+ },
1022
+ options: options
1023
+ )
1024
+ yield result, response if block_given?
1025
+ throw :response, result
1026
+ end
1027
+ rescue ::Gapic::Rest::Error => e
1028
+ raise ::Google::Cloud::Error.from_error(e)
1029
+ end
1030
+
1031
+ ##
1032
+ # List all the policies that have been configured for the specified
1033
+ # organization.
1034
+ #
1035
+ # Use this API to read Cloud Armor policies. Previously, alpha and beta
1036
+ # versions of this API were used to read firewall policies. This usage is now
1037
+ # disabled for most organizations. Use firewallPolicies.list instead.
1038
+ #
1039
+ # @overload list(request, options = nil)
1040
+ # Pass arguments to `list` via a request object, either of type
1041
+ # {::Google::Cloud::Compute::V1::ListOrganizationSecurityPoliciesRequest} or an equivalent Hash.
1042
+ #
1043
+ # @param request [::Google::Cloud::Compute::V1::ListOrganizationSecurityPoliciesRequest, ::Hash]
1044
+ # A request object representing the call parameters. Required. To specify no
1045
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1046
+ # @param options [::Gapic::CallOptions, ::Hash]
1047
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1048
+ #
1049
+ # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, parent_id: nil, return_partial_success: nil)
1050
+ # Pass arguments to `list` via keyword arguments. Note that at
1051
+ # least one keyword argument is required. To specify no parameters, or to keep all
1052
+ # the default parameter values, pass an empty Hash as a request object (see above).
1053
+ #
1054
+ # @param filter [::String]
1055
+ # A filter expression that filters resources listed in the response. Most
1056
+ # Compute resources support two types of filter expressions:
1057
+ # expressions that support regular expressions and expressions that follow
1058
+ # API improvement proposal AIP-160.
1059
+ # These two types of filter expressions cannot be mixed in one request.
1060
+ #
1061
+ # If you want to use AIP-160, your expression must specify the field name, an
1062
+ # operator, and the value that you want to use for filtering. The value
1063
+ # must be a string, a number, or a boolean. The operator
1064
+ # must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`.
1065
+ #
1066
+ # For example, if you are filtering Compute Engine instances, you can
1067
+ # exclude instances named `example-instance` by specifying
1068
+ # `name != example-instance`.
1069
+ #
1070
+ # The `:*` comparison can be used to test whether a key has been defined.
1071
+ # For example, to find all objects with `owner` label use:
1072
+ # ```
1073
+ # labels.owner:*
1074
+ # ```
1075
+ #
1076
+ # You can also filter nested fields. For example, you could specify
1077
+ # `scheduling.automaticRestart = false` to include instances only
1078
+ # if they are not scheduled for automatic restarts. You can use filtering
1079
+ # on nested fields to filter based onresource labels.
1080
+ #
1081
+ # To filter on multiple expressions, provide each separate expression within
1082
+ # parentheses. For example:
1083
+ # ```
1084
+ # (scheduling.automaticRestart = true)
1085
+ # (cpuPlatform = "Intel Skylake")
1086
+ # ```
1087
+ # By default, each expression is an `AND` expression. However, you
1088
+ # can include `AND` and `OR` expressions explicitly.
1089
+ # For example:
1090
+ # ```
1091
+ # (cpuPlatform = "Intel Skylake") OR
1092
+ # (cpuPlatform = "Intel Broadwell") AND
1093
+ # (scheduling.automaticRestart = true)
1094
+ # ```
1095
+ #
1096
+ # If you want to use a regular expression, use the `eq` (equal) or `ne`
1097
+ # (not equal) operator against a single un-parenthesized expression with or
1098
+ # without quotes or against multiple parenthesized expressions. Examples:
1099
+ #
1100
+ # `fieldname eq unquoted literal`
1101
+ # `fieldname eq 'single quoted literal'`
1102
+ # `fieldname eq "double quoted literal"`
1103
+ # `(fieldname1 eq literal) (fieldname2 ne "literal")`
1104
+ #
1105
+ # The literal value is interpreted as a regular expression using GoogleRE2 library syntax.
1106
+ # The literal value must match the entire field.
1107
+ #
1108
+ # For example, to filter for instances that do not end with name "instance",
1109
+ # you would use `name ne .*instance`.
1110
+ #
1111
+ # You cannot combine constraints on multiple fields using regular
1112
+ # expressions.
1113
+ # @param max_results [::Integer]
1114
+ # The maximum number of results per page that should be returned.
1115
+ # If the number of available results is larger than `maxResults`,
1116
+ # Compute Engine returns a `nextPageToken` that can be used to get
1117
+ # the next page of results in subsequent list requests. Acceptable values are
1118
+ # `0` to `500`, inclusive. (Default: `500`)
1119
+ # @param order_by [::String]
1120
+ # Sorts list results by a certain order. By default, results
1121
+ # are returned in alphanumerical order based on the resource name.
1122
+ #
1123
+ # You can also sort results in descending order based on the creation
1124
+ # timestamp using `orderBy="creationTimestamp desc"`. This sorts
1125
+ # results based on the `creationTimestamp` field in
1126
+ # reverse chronological order (newest result first). Use this to sort
1127
+ # resources like operations so that the newest operation is returned first.
1128
+ #
1129
+ # Currently, only sorting by `name` or
1130
+ # `creationTimestamp desc` is supported.
1131
+ # @param page_token [::String]
1132
+ # Specifies a page token to use. Set `pageToken` to the
1133
+ # `nextPageToken` returned by a previous list request to get
1134
+ # the next page of results.
1135
+ # @param parent_id [::String]
1136
+ # Parent ID for this request.
1137
+ # @param return_partial_success [::Boolean]
1138
+ # Opt-in for partial success behavior which provides partial results in case
1139
+ # of failure. The default value is false.
1140
+ #
1141
+ # For example, when partial success behavior is enabled, aggregatedList for a
1142
+ # single zone scope either returns all resources in the zone or no resources,
1143
+ # with an error code.
1144
+ # @yield [result, operation] Access the result along with the TransportOperation object
1145
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::SecurityPolicy>]
1146
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1147
+ #
1148
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::SecurityPolicy>]
1149
+ #
1150
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1151
+ #
1152
+ # @example Basic example
1153
+ # require "google/cloud/compute/v1"
1154
+ #
1155
+ # # Create a client object. The client can be reused for multiple calls.
1156
+ # client = Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client.new
1157
+ #
1158
+ # # Create a request. To set request fields, pass in keyword arguments.
1159
+ # request = Google::Cloud::Compute::V1::ListOrganizationSecurityPoliciesRequest.new
1160
+ #
1161
+ # # Call the list method.
1162
+ # result = client.list request
1163
+ #
1164
+ # # The returned object is of type Google::Cloud::Compute::V1::SecurityPolicyList.
1165
+ # p result
1166
+ #
1167
+ def list request, options = nil
1168
+ raise ::ArgumentError, "request must be provided" if request.nil?
1169
+
1170
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListOrganizationSecurityPoliciesRequest
1171
+
1172
+ # Converts hash and nil to an options object
1173
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1174
+
1175
+ # Customize the options with defaults
1176
+ call_metadata = @config.rpcs.list.metadata.to_h
1177
+
1178
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1179
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1180
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1181
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1182
+ transports_version_send: [:rest]
1183
+
1184
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1185
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1186
+
1187
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
1188
+ metadata: call_metadata,
1189
+ retry_policy: @config.rpcs.list.retry_policy
1190
+
1191
+ options.apply_defaults timeout: @config.timeout,
1192
+ metadata: @config.metadata,
1193
+ retry_policy: @config.retry_policy
1194
+
1195
+ @organization_security_policies_stub.list request, options do |result, operation|
1196
+ result = ::Gapic::Rest::PagedEnumerable.new @organization_security_policies_stub, :list, "items", request, result, options
1197
+ yield result, operation if block_given?
1198
+ throw :response, result
1199
+ end
1200
+ rescue ::Gapic::Rest::Error => e
1201
+ raise ::Google::Cloud::Error.from_error(e)
1202
+ end
1203
+
1204
+ ##
1205
+ # Lists associations of a specified target, i.e., organization or folder.
1206
+ #
1207
+ # Use this API to read Cloud Armor policies. Previously, alpha and beta
1208
+ # versions of this API were used to read firewall policies. This usage is
1209
+ # now disabled for most organizations. Use firewallPolicies.listAssociations
1210
+ # instead.
1211
+ #
1212
+ # @overload list_associations(request, options = nil)
1213
+ # Pass arguments to `list_associations` via a request object, either of type
1214
+ # {::Google::Cloud::Compute::V1::ListAssociationsOrganizationSecurityPolicyRequest} or an equivalent Hash.
1215
+ #
1216
+ # @param request [::Google::Cloud::Compute::V1::ListAssociationsOrganizationSecurityPolicyRequest, ::Hash]
1217
+ # A request object representing the call parameters. Required. To specify no
1218
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1219
+ # @param options [::Gapic::CallOptions, ::Hash]
1220
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1221
+ #
1222
+ # @overload list_associations(target_resource: nil)
1223
+ # Pass arguments to `list_associations` via keyword arguments. Note that at
1224
+ # least one keyword argument is required. To specify no parameters, or to keep all
1225
+ # the default parameter values, pass an empty Hash as a request object (see above).
1226
+ #
1227
+ # @param target_resource [::String]
1228
+ # The target resource to list associations. It is an organization, or a
1229
+ # folder.
1230
+ # @yield [result, operation] Access the result along with the TransportOperation object
1231
+ # @yieldparam result [::Google::Cloud::Compute::V1::OrganizationSecurityPoliciesListAssociationsResponse]
1232
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1233
+ #
1234
+ # @return [::Google::Cloud::Compute::V1::OrganizationSecurityPoliciesListAssociationsResponse]
1235
+ #
1236
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1237
+ #
1238
+ # @example Basic example
1239
+ # require "google/cloud/compute/v1"
1240
+ #
1241
+ # # Create a client object. The client can be reused for multiple calls.
1242
+ # client = Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client.new
1243
+ #
1244
+ # # Create a request. To set request fields, pass in keyword arguments.
1245
+ # request = Google::Cloud::Compute::V1::ListAssociationsOrganizationSecurityPolicyRequest.new
1246
+ #
1247
+ # # Call the list_associations method.
1248
+ # result = client.list_associations request
1249
+ #
1250
+ # # The returned object is of type Google::Cloud::Compute::V1::OrganizationSecurityPoliciesListAssociationsResponse.
1251
+ # p result
1252
+ #
1253
+ def list_associations request, options = nil
1254
+ raise ::ArgumentError, "request must be provided" if request.nil?
1255
+
1256
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListAssociationsOrganizationSecurityPolicyRequest
1257
+
1258
+ # Converts hash and nil to an options object
1259
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1260
+
1261
+ # Customize the options with defaults
1262
+ call_metadata = @config.rpcs.list_associations.metadata.to_h
1263
+
1264
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1265
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1266
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1267
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1268
+ transports_version_send: [:rest]
1269
+
1270
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1271
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1272
+
1273
+ options.apply_defaults timeout: @config.rpcs.list_associations.timeout,
1274
+ metadata: call_metadata,
1275
+ retry_policy: @config.rpcs.list_associations.retry_policy
1276
+
1277
+ options.apply_defaults timeout: @config.timeout,
1278
+ metadata: @config.metadata,
1279
+ retry_policy: @config.retry_policy
1280
+
1281
+ @organization_security_policies_stub.list_associations request, options do |result, operation|
1282
+ yield result, operation if block_given?
1283
+ end
1284
+ rescue ::Gapic::Rest::Error => e
1285
+ raise ::Google::Cloud::Error.from_error(e)
1286
+ end
1287
+
1288
+ ##
1289
+ # Gets the current list of preconfigured Web Application Firewall (WAF)
1290
+ # expressions.
1291
+ #
1292
+ # @overload list_preconfigured_expression_sets(request, options = nil)
1293
+ # Pass arguments to `list_preconfigured_expression_sets` via a request object, either of type
1294
+ # {::Google::Cloud::Compute::V1::ListPreconfiguredExpressionSetsOrganizationSecurityPoliciesRequest} or an equivalent Hash.
1295
+ #
1296
+ # @param request [::Google::Cloud::Compute::V1::ListPreconfiguredExpressionSetsOrganizationSecurityPoliciesRequest, ::Hash]
1297
+ # A request object representing the call parameters. Required. To specify no
1298
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1299
+ # @param options [::Gapic::CallOptions, ::Hash]
1300
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1301
+ #
1302
+ # @overload list_preconfigured_expression_sets(filter: nil, max_results: nil, order_by: nil, page_token: nil, parent_id: nil, return_partial_success: nil)
1303
+ # Pass arguments to `list_preconfigured_expression_sets` via keyword arguments. Note that at
1304
+ # least one keyword argument is required. To specify no parameters, or to keep all
1305
+ # the default parameter values, pass an empty Hash as a request object (see above).
1306
+ #
1307
+ # @param filter [::String]
1308
+ # A filter expression that filters resources listed in the response. Most
1309
+ # Compute resources support two types of filter expressions:
1310
+ # expressions that support regular expressions and expressions that follow
1311
+ # API improvement proposal AIP-160.
1312
+ # These two types of filter expressions cannot be mixed in one request.
1313
+ #
1314
+ # If you want to use AIP-160, your expression must specify the field name, an
1315
+ # operator, and the value that you want to use for filtering. The value
1316
+ # must be a string, a number, or a boolean. The operator
1317
+ # must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`.
1318
+ #
1319
+ # For example, if you are filtering Compute Engine instances, you can
1320
+ # exclude instances named `example-instance` by specifying
1321
+ # `name != example-instance`.
1322
+ #
1323
+ # The `:*` comparison can be used to test whether a key has been defined.
1324
+ # For example, to find all objects with `owner` label use:
1325
+ # ```
1326
+ # labels.owner:*
1327
+ # ```
1328
+ #
1329
+ # You can also filter nested fields. For example, you could specify
1330
+ # `scheduling.automaticRestart = false` to include instances only
1331
+ # if they are not scheduled for automatic restarts. You can use filtering
1332
+ # on nested fields to filter based onresource labels.
1333
+ #
1334
+ # To filter on multiple expressions, provide each separate expression within
1335
+ # parentheses. For example:
1336
+ # ```
1337
+ # (scheduling.automaticRestart = true)
1338
+ # (cpuPlatform = "Intel Skylake")
1339
+ # ```
1340
+ # By default, each expression is an `AND` expression. However, you
1341
+ # can include `AND` and `OR` expressions explicitly.
1342
+ # For example:
1343
+ # ```
1344
+ # (cpuPlatform = "Intel Skylake") OR
1345
+ # (cpuPlatform = "Intel Broadwell") AND
1346
+ # (scheduling.automaticRestart = true)
1347
+ # ```
1348
+ #
1349
+ # If you want to use a regular expression, use the `eq` (equal) or `ne`
1350
+ # (not equal) operator against a single un-parenthesized expression with or
1351
+ # without quotes or against multiple parenthesized expressions. Examples:
1352
+ #
1353
+ # `fieldname eq unquoted literal`
1354
+ # `fieldname eq 'single quoted literal'`
1355
+ # `fieldname eq "double quoted literal"`
1356
+ # `(fieldname1 eq literal) (fieldname2 ne "literal")`
1357
+ #
1358
+ # The literal value is interpreted as a regular expression using GoogleRE2 library syntax.
1359
+ # The literal value must match the entire field.
1360
+ #
1361
+ # For example, to filter for instances that do not end with name "instance",
1362
+ # you would use `name ne .*instance`.
1363
+ #
1364
+ # You cannot combine constraints on multiple fields using regular
1365
+ # expressions.
1366
+ # @param max_results [::Integer]
1367
+ # The maximum number of results per page that should be returned.
1368
+ # If the number of available results is larger than `maxResults`,
1369
+ # Compute Engine returns a `nextPageToken` that can be used to get
1370
+ # the next page of results in subsequent list requests. Acceptable values are
1371
+ # `0` to `500`, inclusive. (Default: `500`)
1372
+ # @param order_by [::String]
1373
+ # Sorts list results by a certain order. By default, results
1374
+ # are returned in alphanumerical order based on the resource name.
1375
+ #
1376
+ # You can also sort results in descending order based on the creation
1377
+ # timestamp using `orderBy="creationTimestamp desc"`. This sorts
1378
+ # results based on the `creationTimestamp` field in
1379
+ # reverse chronological order (newest result first). Use this to sort
1380
+ # resources like operations so that the newest operation is returned first.
1381
+ #
1382
+ # Currently, only sorting by `name` or
1383
+ # `creationTimestamp desc` is supported.
1384
+ # @param page_token [::String]
1385
+ # Specifies a page token to use. Set `pageToken` to the
1386
+ # `nextPageToken` returned by a previous list request to get
1387
+ # the next page of results.
1388
+ # @param parent_id [::String]
1389
+ # Parent ID for this request.
1390
+ # @param return_partial_success [::Boolean]
1391
+ # Opt-in for partial success behavior which provides partial results in case
1392
+ # of failure. The default value is false.
1393
+ #
1394
+ # For example, when partial success behavior is enabled, aggregatedList for a
1395
+ # single zone scope either returns all resources in the zone or no resources,
1396
+ # with an error code.
1397
+ # @yield [result, operation] Access the result along with the TransportOperation object
1398
+ # @yieldparam result [::Google::Cloud::Compute::V1::SecurityPoliciesListPreconfiguredExpressionSetsResponse]
1399
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1400
+ #
1401
+ # @return [::Google::Cloud::Compute::V1::SecurityPoliciesListPreconfiguredExpressionSetsResponse]
1402
+ #
1403
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1404
+ #
1405
+ # @example Basic example
1406
+ # require "google/cloud/compute/v1"
1407
+ #
1408
+ # # Create a client object. The client can be reused for multiple calls.
1409
+ # client = Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client.new
1410
+ #
1411
+ # # Create a request. To set request fields, pass in keyword arguments.
1412
+ # request = Google::Cloud::Compute::V1::ListPreconfiguredExpressionSetsOrganizationSecurityPoliciesRequest.new
1413
+ #
1414
+ # # Call the list_preconfigured_expression_sets method.
1415
+ # result = client.list_preconfigured_expression_sets request
1416
+ #
1417
+ # # The returned object is of type Google::Cloud::Compute::V1::SecurityPoliciesListPreconfiguredExpressionSetsResponse.
1418
+ # p result
1419
+ #
1420
+ def list_preconfigured_expression_sets request, options = nil
1421
+ raise ::ArgumentError, "request must be provided" if request.nil?
1422
+
1423
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListPreconfiguredExpressionSetsOrganizationSecurityPoliciesRequest
1424
+
1425
+ # Converts hash and nil to an options object
1426
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1427
+
1428
+ # Customize the options with defaults
1429
+ call_metadata = @config.rpcs.list_preconfigured_expression_sets.metadata.to_h
1430
+
1431
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1432
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1433
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1434
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1435
+ transports_version_send: [:rest]
1436
+
1437
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1438
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1439
+
1440
+ options.apply_defaults timeout: @config.rpcs.list_preconfigured_expression_sets.timeout,
1441
+ metadata: call_metadata,
1442
+ retry_policy: @config.rpcs.list_preconfigured_expression_sets.retry_policy
1443
+
1444
+ options.apply_defaults timeout: @config.timeout,
1445
+ metadata: @config.metadata,
1446
+ retry_policy: @config.retry_policy
1447
+
1448
+ @organization_security_policies_stub.list_preconfigured_expression_sets request, options do |result, operation|
1449
+ yield result, operation if block_given?
1450
+ end
1451
+ rescue ::Gapic::Rest::Error => e
1452
+ raise ::Google::Cloud::Error.from_error(e)
1453
+ end
1454
+
1455
+ ##
1456
+ # Moves the specified security policy.
1457
+ #
1458
+ # Use this API to modify Cloud Armor policies. Previously, alpha and beta
1459
+ # versions of this API were used to modify firewall policies. This usage is
1460
+ # now disabled for most organizations. Use firewallPolicies.move instead.
1461
+ #
1462
+ # @overload move(request, options = nil)
1463
+ # Pass arguments to `move` via a request object, either of type
1464
+ # {::Google::Cloud::Compute::V1::MoveOrganizationSecurityPolicyRequest} or an equivalent Hash.
1465
+ #
1466
+ # @param request [::Google::Cloud::Compute::V1::MoveOrganizationSecurityPolicyRequest, ::Hash]
1467
+ # A request object representing the call parameters. Required. To specify no
1468
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1469
+ # @param options [::Gapic::CallOptions, ::Hash]
1470
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1471
+ #
1472
+ # @overload move(parent_id: nil, request_id: nil, security_policy: nil)
1473
+ # Pass arguments to `move` via keyword arguments. Note that at
1474
+ # least one keyword argument is required. To specify no parameters, or to keep all
1475
+ # the default parameter values, pass an empty Hash as a request object (see above).
1476
+ #
1477
+ # @param parent_id [::String]
1478
+ # The new parent of the security policy.
1479
+ # @param request_id [::String]
1480
+ # An optional request ID to identify requests. Specify a unique request ID so
1481
+ # that if you must retry your request, the server will know to ignore the
1482
+ # request if it has already been completed.
1483
+ #
1484
+ # For example, consider a situation where you make an initial request and
1485
+ # the request times out. If you make the request again with the same
1486
+ # request ID, the server can check if original operation with the same
1487
+ # request ID was received, and if so, will ignore the second request. This
1488
+ # prevents clients from accidentally creating duplicate commitments.
1489
+ #
1490
+ # The request ID must be
1491
+ # a valid UUID with the exception that zero UUID is not supported
1492
+ # (00000000-0000-0000-0000-000000000000).
1493
+ # @param security_policy [::String]
1494
+ # Name of the security policy to update.
1495
+ # @yield [result, operation] Access the result along with the TransportOperation object
1496
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
1497
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1498
+ #
1499
+ # @return [::Gapic::GenericLRO::Operation]
1500
+ #
1501
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1502
+ #
1503
+ # @example Basic example
1504
+ # require "google/cloud/compute/v1"
1505
+ #
1506
+ # # Create a client object. The client can be reused for multiple calls.
1507
+ # client = Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client.new
1508
+ #
1509
+ # # Create a request. To set request fields, pass in keyword arguments.
1510
+ # request = Google::Cloud::Compute::V1::MoveOrganizationSecurityPolicyRequest.new
1511
+ #
1512
+ # # Call the move method.
1513
+ # result = client.move request
1514
+ #
1515
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
1516
+ # p result
1517
+ #
1518
+ def move request, options = nil
1519
+ raise ::ArgumentError, "request must be provided" if request.nil?
1520
+
1521
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::MoveOrganizationSecurityPolicyRequest
1522
+
1523
+ # Converts hash and nil to an options object
1524
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1525
+
1526
+ # Customize the options with defaults
1527
+ call_metadata = @config.rpcs.move.metadata.to_h
1528
+
1529
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1530
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1531
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1532
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1533
+ transports_version_send: [:rest]
1534
+
1535
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1536
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1537
+
1538
+ options.apply_defaults timeout: @config.rpcs.move.timeout,
1539
+ metadata: call_metadata,
1540
+ retry_policy: @config.rpcs.move.retry_policy
1541
+
1542
+ options.apply_defaults timeout: @config.timeout,
1543
+ metadata: @config.metadata,
1544
+ retry_policy: @config.retry_policy
1545
+
1546
+ @organization_security_policies_stub.move request, options do |result, response|
1547
+ result = ::Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::NonstandardLro.create_operation(
1548
+ operation: result,
1549
+ client: global_organization_operations,
1550
+ request_values: {
1551
+ "parent_id" => request.parent_id
1552
+ },
1553
+ options: options
1554
+ )
1555
+ yield result, response if block_given?
1556
+ throw :response, result
1557
+ end
1558
+ rescue ::Gapic::Rest::Error => e
1559
+ raise ::Google::Cloud::Error.from_error(e)
1560
+ end
1561
+
1562
+ ##
1563
+ # Patches the specified policy with the data included in the request.
1564
+ #
1565
+ # Use this API to modify Cloud Armor policies. Previously, alpha and beta
1566
+ # versions of this API were used to modify firewall policies. This usage is
1567
+ # now disabled for most organizations. Use firewallPolicies.patch instead.
1568
+ #
1569
+ # @overload patch(request, options = nil)
1570
+ # Pass arguments to `patch` via a request object, either of type
1571
+ # {::Google::Cloud::Compute::V1::PatchOrganizationSecurityPolicyRequest} or an equivalent Hash.
1572
+ #
1573
+ # @param request [::Google::Cloud::Compute::V1::PatchOrganizationSecurityPolicyRequest, ::Hash]
1574
+ # A request object representing the call parameters. Required. To specify no
1575
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1576
+ # @param options [::Gapic::CallOptions, ::Hash]
1577
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1578
+ #
1579
+ # @overload patch(request_id: nil, security_policy: nil, security_policy_resource: nil)
1580
+ # Pass arguments to `patch` via keyword arguments. Note that at
1581
+ # least one keyword argument is required. To specify no parameters, or to keep all
1582
+ # the default parameter values, pass an empty Hash as a request object (see above).
1583
+ #
1584
+ # @param request_id [::String]
1585
+ # An optional request ID to identify requests. Specify a unique request ID so
1586
+ # that if you must retry your request, the server will know to ignore the
1587
+ # request if it has already been completed.
1588
+ #
1589
+ # For example, consider a situation where you make an initial request and
1590
+ # the request times out. If you make the request again with the same
1591
+ # request ID, the server can check if original operation with the same
1592
+ # request ID was received, and if so, will ignore the second request. This
1593
+ # prevents clients from accidentally creating duplicate commitments.
1594
+ #
1595
+ # The request ID must be
1596
+ # a valid UUID with the exception that zero UUID is not supported
1597
+ # (00000000-0000-0000-0000-000000000000).
1598
+ # @param security_policy [::String]
1599
+ # Name of the security policy to update.
1600
+ # @param security_policy_resource [::Google::Cloud::Compute::V1::SecurityPolicy, ::Hash]
1601
+ # The body resource for this request
1602
+ # @yield [result, operation] Access the result along with the TransportOperation object
1603
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
1604
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1605
+ #
1606
+ # @return [::Gapic::GenericLRO::Operation]
1607
+ #
1608
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1609
+ #
1610
+ # @example Basic example
1611
+ # require "google/cloud/compute/v1"
1612
+ #
1613
+ # # Create a client object. The client can be reused for multiple calls.
1614
+ # client = Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client.new
1615
+ #
1616
+ # # Create a request. To set request fields, pass in keyword arguments.
1617
+ # request = Google::Cloud::Compute::V1::PatchOrganizationSecurityPolicyRequest.new
1618
+ #
1619
+ # # Call the patch method.
1620
+ # result = client.patch request
1621
+ #
1622
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
1623
+ # p result
1624
+ #
1625
+ def patch request, options = nil
1626
+ raise ::ArgumentError, "request must be provided" if request.nil?
1627
+
1628
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchOrganizationSecurityPolicyRequest
1629
+
1630
+ # Converts hash and nil to an options object
1631
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1632
+
1633
+ # Customize the options with defaults
1634
+ call_metadata = @config.rpcs.patch.metadata.to_h
1635
+
1636
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1637
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1638
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1639
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1640
+ transports_version_send: [:rest]
1641
+
1642
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1643
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1644
+
1645
+ options.apply_defaults timeout: @config.rpcs.patch.timeout,
1646
+ metadata: call_metadata,
1647
+ retry_policy: @config.rpcs.patch.retry_policy
1648
+
1649
+ options.apply_defaults timeout: @config.timeout,
1650
+ metadata: @config.metadata,
1651
+ retry_policy: @config.retry_policy
1652
+
1653
+ @organization_security_policies_stub.patch request, options do |result, response|
1654
+ result = ::Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::NonstandardLro.create_operation(
1655
+ operation: result,
1656
+ client: global_organization_operations,
1657
+ request_values: {},
1658
+ options: options
1659
+ )
1660
+ yield result, response if block_given?
1661
+ throw :response, result
1662
+ end
1663
+ rescue ::Gapic::Rest::Error => e
1664
+ raise ::Google::Cloud::Error.from_error(e)
1665
+ end
1666
+
1667
+ ##
1668
+ # Patches a rule at the specified priority.
1669
+ #
1670
+ # Use this API to modify Cloud Armor policies. Previously, alpha and beta
1671
+ # versions of this API were used to modify firewall policies. This usage is
1672
+ # now disabled for most organizations. Use firewallPolicies.patchRule
1673
+ # instead.
1674
+ #
1675
+ # @overload patch_rule(request, options = nil)
1676
+ # Pass arguments to `patch_rule` via a request object, either of type
1677
+ # {::Google::Cloud::Compute::V1::PatchRuleOrganizationSecurityPolicyRequest} or an equivalent Hash.
1678
+ #
1679
+ # @param request [::Google::Cloud::Compute::V1::PatchRuleOrganizationSecurityPolicyRequest, ::Hash]
1680
+ # A request object representing the call parameters. Required. To specify no
1681
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1682
+ # @param options [::Gapic::CallOptions, ::Hash]
1683
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1684
+ #
1685
+ # @overload patch_rule(priority: nil, request_id: nil, security_policy: nil, security_policy_rule_resource: nil)
1686
+ # Pass arguments to `patch_rule` via keyword arguments. Note that at
1687
+ # least one keyword argument is required. To specify no parameters, or to keep all
1688
+ # the default parameter values, pass an empty Hash as a request object (see above).
1689
+ #
1690
+ # @param priority [::Integer]
1691
+ # The priority of the rule to patch.
1692
+ # @param request_id [::String]
1693
+ # An optional request ID to identify requests. Specify a unique request ID so
1694
+ # that if you must retry your request, the server will know to ignore the
1695
+ # request if it has already been completed.
1696
+ #
1697
+ # For example, consider a situation where you make an initial request and
1698
+ # the request times out. If you make the request again with the same
1699
+ # request ID, the server can check if original operation with the same
1700
+ # request ID was received, and if so, will ignore the second request. This
1701
+ # prevents clients from accidentally creating duplicate commitments.
1702
+ #
1703
+ # The request ID must be
1704
+ # a valid UUID with the exception that zero UUID is not supported
1705
+ # (00000000-0000-0000-0000-000000000000).
1706
+ # @param security_policy [::String]
1707
+ # Name of the security policy to update.
1708
+ # @param security_policy_rule_resource [::Google::Cloud::Compute::V1::SecurityPolicyRule, ::Hash]
1709
+ # The body resource for this request
1710
+ # @yield [result, operation] Access the result along with the TransportOperation object
1711
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
1712
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1713
+ #
1714
+ # @return [::Gapic::GenericLRO::Operation]
1715
+ #
1716
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1717
+ #
1718
+ # @example Basic example
1719
+ # require "google/cloud/compute/v1"
1720
+ #
1721
+ # # Create a client object. The client can be reused for multiple calls.
1722
+ # client = Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client.new
1723
+ #
1724
+ # # Create a request. To set request fields, pass in keyword arguments.
1725
+ # request = Google::Cloud::Compute::V1::PatchRuleOrganizationSecurityPolicyRequest.new
1726
+ #
1727
+ # # Call the patch_rule method.
1728
+ # result = client.patch_rule request
1729
+ #
1730
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
1731
+ # p result
1732
+ #
1733
+ def patch_rule request, options = nil
1734
+ raise ::ArgumentError, "request must be provided" if request.nil?
1735
+
1736
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchRuleOrganizationSecurityPolicyRequest
1737
+
1738
+ # Converts hash and nil to an options object
1739
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1740
+
1741
+ # Customize the options with defaults
1742
+ call_metadata = @config.rpcs.patch_rule.metadata.to_h
1743
+
1744
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1745
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1746
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1747
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1748
+ transports_version_send: [:rest]
1749
+
1750
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1751
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1752
+
1753
+ options.apply_defaults timeout: @config.rpcs.patch_rule.timeout,
1754
+ metadata: call_metadata,
1755
+ retry_policy: @config.rpcs.patch_rule.retry_policy
1756
+
1757
+ options.apply_defaults timeout: @config.timeout,
1758
+ metadata: @config.metadata,
1759
+ retry_policy: @config.retry_policy
1760
+
1761
+ @organization_security_policies_stub.patch_rule request, options do |result, response|
1762
+ result = ::Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::NonstandardLro.create_operation(
1763
+ operation: result,
1764
+ client: global_organization_operations,
1765
+ request_values: {},
1766
+ options: options
1767
+ )
1768
+ yield result, response if block_given?
1769
+ throw :response, result
1770
+ end
1771
+ rescue ::Gapic::Rest::Error => e
1772
+ raise ::Google::Cloud::Error.from_error(e)
1773
+ end
1774
+
1775
+ ##
1776
+ # Removes an association for the specified security policy.
1777
+ #
1778
+ # Use this API to modify Cloud Armor policies. Previously, alpha and beta
1779
+ # versions of this API were used to modify firewall policies. This usage is
1780
+ # now disabled for most organizations. Use firewallPolicies.removeAssociation
1781
+ # instead.
1782
+ #
1783
+ # @overload remove_association(request, options = nil)
1784
+ # Pass arguments to `remove_association` via a request object, either of type
1785
+ # {::Google::Cloud::Compute::V1::RemoveAssociationOrganizationSecurityPolicyRequest} or an equivalent Hash.
1786
+ #
1787
+ # @param request [::Google::Cloud::Compute::V1::RemoveAssociationOrganizationSecurityPolicyRequest, ::Hash]
1788
+ # A request object representing the call parameters. Required. To specify no
1789
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1790
+ # @param options [::Gapic::CallOptions, ::Hash]
1791
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1792
+ #
1793
+ # @overload remove_association(name: nil, request_id: nil, security_policy: nil)
1794
+ # Pass arguments to `remove_association` via keyword arguments. Note that at
1795
+ # least one keyword argument is required. To specify no parameters, or to keep all
1796
+ # the default parameter values, pass an empty Hash as a request object (see above).
1797
+ #
1798
+ # @param name [::String]
1799
+ # Name for the attachment that will be removed.
1800
+ # @param request_id [::String]
1801
+ # An optional request ID to identify requests. Specify a unique request ID so
1802
+ # that if you must retry your request, the server will know to ignore the
1803
+ # request if it has already been completed.
1804
+ #
1805
+ # For example, consider a situation where you make an initial request and
1806
+ # the request times out. If you make the request again with the same
1807
+ # request ID, the server can check if original operation with the same
1808
+ # request ID was received, and if so, will ignore the second request. This
1809
+ # prevents clients from accidentally creating duplicate commitments.
1810
+ #
1811
+ # The request ID must be
1812
+ # a valid UUID with the exception that zero UUID is not supported
1813
+ # (00000000-0000-0000-0000-000000000000).
1814
+ # @param security_policy [::String]
1815
+ # Name of the security policy to update.
1816
+ # @yield [result, operation] Access the result along with the TransportOperation object
1817
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
1818
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1819
+ #
1820
+ # @return [::Gapic::GenericLRO::Operation]
1821
+ #
1822
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1823
+ #
1824
+ # @example Basic example
1825
+ # require "google/cloud/compute/v1"
1826
+ #
1827
+ # # Create a client object. The client can be reused for multiple calls.
1828
+ # client = Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client.new
1829
+ #
1830
+ # # Create a request. To set request fields, pass in keyword arguments.
1831
+ # request = Google::Cloud::Compute::V1::RemoveAssociationOrganizationSecurityPolicyRequest.new
1832
+ #
1833
+ # # Call the remove_association method.
1834
+ # result = client.remove_association request
1835
+ #
1836
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
1837
+ # p result
1838
+ #
1839
+ def remove_association request, options = nil
1840
+ raise ::ArgumentError, "request must be provided" if request.nil?
1841
+
1842
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::RemoveAssociationOrganizationSecurityPolicyRequest
1843
+
1844
+ # Converts hash and nil to an options object
1845
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1846
+
1847
+ # Customize the options with defaults
1848
+ call_metadata = @config.rpcs.remove_association.metadata.to_h
1849
+
1850
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1851
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1852
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1853
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1854
+ transports_version_send: [:rest]
1855
+
1856
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1857
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1858
+
1859
+ options.apply_defaults timeout: @config.rpcs.remove_association.timeout,
1860
+ metadata: call_metadata,
1861
+ retry_policy: @config.rpcs.remove_association.retry_policy
1862
+
1863
+ options.apply_defaults timeout: @config.timeout,
1864
+ metadata: @config.metadata,
1865
+ retry_policy: @config.retry_policy
1866
+
1867
+ @organization_security_policies_stub.remove_association request, options do |result, response|
1868
+ result = ::Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::NonstandardLro.create_operation(
1869
+ operation: result,
1870
+ client: global_organization_operations,
1871
+ request_values: {},
1872
+ options: options
1873
+ )
1874
+ yield result, response if block_given?
1875
+ throw :response, result
1876
+ end
1877
+ rescue ::Gapic::Rest::Error => e
1878
+ raise ::Google::Cloud::Error.from_error(e)
1879
+ end
1880
+
1881
+ ##
1882
+ # Deletes a rule at the specified priority.
1883
+ #
1884
+ # Use this API to modify Cloud Armor policies. Previously, alpha and beta
1885
+ # versions of this API were used to modify firewall policies. This usage is
1886
+ # now disabled for most organizations. Use firewallPolicies.removeRule
1887
+ # instead.
1888
+ #
1889
+ # @overload remove_rule(request, options = nil)
1890
+ # Pass arguments to `remove_rule` via a request object, either of type
1891
+ # {::Google::Cloud::Compute::V1::RemoveRuleOrganizationSecurityPolicyRequest} or an equivalent Hash.
1892
+ #
1893
+ # @param request [::Google::Cloud::Compute::V1::RemoveRuleOrganizationSecurityPolicyRequest, ::Hash]
1894
+ # A request object representing the call parameters. Required. To specify no
1895
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1896
+ # @param options [::Gapic::CallOptions, ::Hash]
1897
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1898
+ #
1899
+ # @overload remove_rule(priority: nil, request_id: nil, security_policy: nil)
1900
+ # Pass arguments to `remove_rule` via keyword arguments. Note that at
1901
+ # least one keyword argument is required. To specify no parameters, or to keep all
1902
+ # the default parameter values, pass an empty Hash as a request object (see above).
1903
+ #
1904
+ # @param priority [::Integer]
1905
+ # The priority of the rule to remove from the security policy.
1906
+ # @param request_id [::String]
1907
+ # An optional request ID to identify requests. Specify a unique request ID so
1908
+ # that if you must retry your request, the server will know to ignore the
1909
+ # request if it has already been completed.
1910
+ #
1911
+ # For example, consider a situation where you make an initial request and
1912
+ # the request times out. If you make the request again with the same
1913
+ # request ID, the server can check if original operation with the same
1914
+ # request ID was received, and if so, will ignore the second request. This
1915
+ # prevents clients from accidentally creating duplicate commitments.
1916
+ #
1917
+ # The request ID must be
1918
+ # a valid UUID with the exception that zero UUID is not supported
1919
+ # (00000000-0000-0000-0000-000000000000).
1920
+ # @param security_policy [::String]
1921
+ # Name of the security policy to update.
1922
+ # @yield [result, operation] Access the result along with the TransportOperation object
1923
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
1924
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1925
+ #
1926
+ # @return [::Gapic::GenericLRO::Operation]
1927
+ #
1928
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1929
+ #
1930
+ # @example Basic example
1931
+ # require "google/cloud/compute/v1"
1932
+ #
1933
+ # # Create a client object. The client can be reused for multiple calls.
1934
+ # client = Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client.new
1935
+ #
1936
+ # # Create a request. To set request fields, pass in keyword arguments.
1937
+ # request = Google::Cloud::Compute::V1::RemoveRuleOrganizationSecurityPolicyRequest.new
1938
+ #
1939
+ # # Call the remove_rule method.
1940
+ # result = client.remove_rule request
1941
+ #
1942
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
1943
+ # p result
1944
+ #
1945
+ def remove_rule request, options = nil
1946
+ raise ::ArgumentError, "request must be provided" if request.nil?
1947
+
1948
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::RemoveRuleOrganizationSecurityPolicyRequest
1949
+
1950
+ # Converts hash and nil to an options object
1951
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1952
+
1953
+ # Customize the options with defaults
1954
+ call_metadata = @config.rpcs.remove_rule.metadata.to_h
1955
+
1956
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1957
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1958
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1959
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1960
+ transports_version_send: [:rest]
1961
+
1962
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1963
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1964
+
1965
+ options.apply_defaults timeout: @config.rpcs.remove_rule.timeout,
1966
+ metadata: call_metadata,
1967
+ retry_policy: @config.rpcs.remove_rule.retry_policy
1968
+
1969
+ options.apply_defaults timeout: @config.timeout,
1970
+ metadata: @config.metadata,
1971
+ retry_policy: @config.retry_policy
1972
+
1973
+ @organization_security_policies_stub.remove_rule request, options do |result, response|
1974
+ result = ::Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::NonstandardLro.create_operation(
1975
+ operation: result,
1976
+ client: global_organization_operations,
1977
+ request_values: {},
1978
+ options: options
1979
+ )
1980
+ yield result, response if block_given?
1981
+ throw :response, result
1982
+ end
1983
+ rescue ::Gapic::Rest::Error => e
1984
+ raise ::Google::Cloud::Error.from_error(e)
1985
+ end
1986
+
1987
+ ##
1988
+ # Configuration class for the OrganizationSecurityPolicies REST API.
1989
+ #
1990
+ # This class represents the configuration for OrganizationSecurityPolicies REST,
1991
+ # providing control over timeouts, retry behavior, logging, transport
1992
+ # parameters, and other low-level controls. Certain parameters can also be
1993
+ # applied individually to specific RPCs. See
1994
+ # {::Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client::Configuration::Rpcs}
1995
+ # for a list of RPCs that can be configured independently.
1996
+ #
1997
+ # Configuration can be applied globally to all clients, or to a single client
1998
+ # on construction.
1999
+ #
2000
+ # @example
2001
+ #
2002
+ # # Modify the global config, setting the timeout for
2003
+ # # add_association to 20 seconds,
2004
+ # # and all remaining timeouts to 10 seconds.
2005
+ # ::Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client.configure do |config|
2006
+ # config.timeout = 10.0
2007
+ # config.rpcs.add_association.timeout = 20.0
2008
+ # end
2009
+ #
2010
+ # # Apply the above configuration only to a new client.
2011
+ # client = ::Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client.new do |config|
2012
+ # config.timeout = 10.0
2013
+ # config.rpcs.add_association.timeout = 20.0
2014
+ # end
2015
+ #
2016
+ # @!attribute [rw] endpoint
2017
+ # A custom service endpoint, as a hostname or hostname:port. The default is
2018
+ # nil, indicating to use the default endpoint in the current universe domain.
2019
+ # @return [::String,nil]
2020
+ # @!attribute [rw] credentials
2021
+ # Credentials to send with calls. You may provide any of the following types:
2022
+ # * (`String`) The path to a service account key file in JSON format
2023
+ # * (`Hash`) A service account key as a Hash
2024
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
2025
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
2026
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2027
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
2028
+ # * (`nil`) indicating no credentials
2029
+ #
2030
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
2031
+ # external source for authentication to Google Cloud, you must validate it before
2032
+ # providing it to a Google API client library. Providing an unvalidated credential
2033
+ # configuration to Google APIs can compromise the security of your systems and data.
2034
+ # For more information, refer to [Validate credential configurations from external
2035
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
2036
+ # @return [::Object]
2037
+ # @!attribute [rw] scope
2038
+ # The OAuth scopes
2039
+ # @return [::Array<::String>]
2040
+ # @!attribute [rw] lib_name
2041
+ # The library name as recorded in instrumentation and logging
2042
+ # @return [::String]
2043
+ # @!attribute [rw] lib_version
2044
+ # The library version as recorded in instrumentation and logging
2045
+ # @return [::String]
2046
+ # @!attribute [rw] timeout
2047
+ # The call timeout in seconds.
2048
+ # @return [::Numeric]
2049
+ # @!attribute [rw] metadata
2050
+ # Additional headers to be sent with the call.
2051
+ # @return [::Hash{::Symbol=>::String}]
2052
+ # @!attribute [rw] retry_policy
2053
+ # The retry policy. The value is a hash with the following keys:
2054
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2055
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2056
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2057
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2058
+ # trigger a retry.
2059
+ # @return [::Hash]
2060
+ # @!attribute [rw] quota_project
2061
+ # A separate project against which to charge quota.
2062
+ # @return [::String]
2063
+ # @!attribute [rw] universe_domain
2064
+ # The universe domain within which to make requests. This determines the
2065
+ # default endpoint URL. The default value of nil uses the environment
2066
+ # universe (usually the default "googleapis.com" universe).
2067
+ # @return [::String,nil]
2068
+ # @!attribute [rw] logger
2069
+ # A custom logger to use for request/response debug logging, or the value
2070
+ # `:default` (the default) to construct a default logger, or `nil` to
2071
+ # explicitly disable logging.
2072
+ # @return [::Logger,:default,nil]
2073
+ #
2074
+ class Configuration
2075
+ extend ::Gapic::Config
2076
+
2077
+ # @private
2078
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
2079
+ DEFAULT_ENDPOINT = "compute.googleapis.com"
2080
+
2081
+ config_attr :endpoint, nil, ::String, nil
2082
+ config_attr :credentials, nil do |value|
2083
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
2084
+ allowed.any? { |klass| klass === value }
2085
+ end
2086
+ config_attr :scope, nil, ::String, ::Array, nil
2087
+ config_attr :lib_name, nil, ::String, nil
2088
+ config_attr :lib_version, nil, ::String, nil
2089
+ config_attr :timeout, nil, ::Numeric, nil
2090
+ config_attr :metadata, nil, ::Hash, nil
2091
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2092
+ config_attr :quota_project, nil, ::String, nil
2093
+ config_attr :universe_domain, nil, ::String, nil
2094
+ config_attr :logger, :default, ::Logger, nil, :default
2095
+
2096
+ # @private
2097
+ def initialize parent_config = nil
2098
+ @parent_config = parent_config unless parent_config.nil?
2099
+
2100
+ yield self if block_given?
2101
+ end
2102
+
2103
+ ##
2104
+ # Configurations for individual RPCs
2105
+ # @return [Rpcs]
2106
+ #
2107
+ def rpcs
2108
+ @rpcs ||= begin
2109
+ parent_rpcs = nil
2110
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
2111
+ Rpcs.new parent_rpcs
2112
+ end
2113
+ end
2114
+
2115
+ ##
2116
+ # Configuration RPC class for the OrganizationSecurityPolicies API.
2117
+ #
2118
+ # Includes fields providing the configuration for each RPC in this service.
2119
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2120
+ # the following configuration fields:
2121
+ #
2122
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
2123
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
2124
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2125
+ # include the following keys:
2126
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2127
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2128
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2129
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2130
+ # trigger a retry.
2131
+ #
2132
+ class Rpcs
2133
+ ##
2134
+ # RPC-specific configuration for `add_association`
2135
+ # @return [::Gapic::Config::Method]
2136
+ #
2137
+ attr_reader :add_association
2138
+ ##
2139
+ # RPC-specific configuration for `add_rule`
2140
+ # @return [::Gapic::Config::Method]
2141
+ #
2142
+ attr_reader :add_rule
2143
+ ##
2144
+ # RPC-specific configuration for `copy_rules`
2145
+ # @return [::Gapic::Config::Method]
2146
+ #
2147
+ attr_reader :copy_rules
2148
+ ##
2149
+ # RPC-specific configuration for `delete`
2150
+ # @return [::Gapic::Config::Method]
2151
+ #
2152
+ attr_reader :delete
2153
+ ##
2154
+ # RPC-specific configuration for `get`
2155
+ # @return [::Gapic::Config::Method]
2156
+ #
2157
+ attr_reader :get
2158
+ ##
2159
+ # RPC-specific configuration for `get_association`
2160
+ # @return [::Gapic::Config::Method]
2161
+ #
2162
+ attr_reader :get_association
2163
+ ##
2164
+ # RPC-specific configuration for `get_rule`
2165
+ # @return [::Gapic::Config::Method]
2166
+ #
2167
+ attr_reader :get_rule
2168
+ ##
2169
+ # RPC-specific configuration for `insert`
2170
+ # @return [::Gapic::Config::Method]
2171
+ #
2172
+ attr_reader :insert
2173
+ ##
2174
+ # RPC-specific configuration for `list`
2175
+ # @return [::Gapic::Config::Method]
2176
+ #
2177
+ attr_reader :list
2178
+ ##
2179
+ # RPC-specific configuration for `list_associations`
2180
+ # @return [::Gapic::Config::Method]
2181
+ #
2182
+ attr_reader :list_associations
2183
+ ##
2184
+ # RPC-specific configuration for `list_preconfigured_expression_sets`
2185
+ # @return [::Gapic::Config::Method]
2186
+ #
2187
+ attr_reader :list_preconfigured_expression_sets
2188
+ ##
2189
+ # RPC-specific configuration for `move`
2190
+ # @return [::Gapic::Config::Method]
2191
+ #
2192
+ attr_reader :move
2193
+ ##
2194
+ # RPC-specific configuration for `patch`
2195
+ # @return [::Gapic::Config::Method]
2196
+ #
2197
+ attr_reader :patch
2198
+ ##
2199
+ # RPC-specific configuration for `patch_rule`
2200
+ # @return [::Gapic::Config::Method]
2201
+ #
2202
+ attr_reader :patch_rule
2203
+ ##
2204
+ # RPC-specific configuration for `remove_association`
2205
+ # @return [::Gapic::Config::Method]
2206
+ #
2207
+ attr_reader :remove_association
2208
+ ##
2209
+ # RPC-specific configuration for `remove_rule`
2210
+ # @return [::Gapic::Config::Method]
2211
+ #
2212
+ attr_reader :remove_rule
2213
+
2214
+ # @private
2215
+ def initialize parent_rpcs = nil
2216
+ add_association_config = parent_rpcs.add_association if parent_rpcs.respond_to? :add_association
2217
+ @add_association = ::Gapic::Config::Method.new add_association_config
2218
+ add_rule_config = parent_rpcs.add_rule if parent_rpcs.respond_to? :add_rule
2219
+ @add_rule = ::Gapic::Config::Method.new add_rule_config
2220
+ copy_rules_config = parent_rpcs.copy_rules if parent_rpcs.respond_to? :copy_rules
2221
+ @copy_rules = ::Gapic::Config::Method.new copy_rules_config
2222
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
2223
+ @delete = ::Gapic::Config::Method.new delete_config
2224
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
2225
+ @get = ::Gapic::Config::Method.new get_config
2226
+ get_association_config = parent_rpcs.get_association if parent_rpcs.respond_to? :get_association
2227
+ @get_association = ::Gapic::Config::Method.new get_association_config
2228
+ get_rule_config = parent_rpcs.get_rule if parent_rpcs.respond_to? :get_rule
2229
+ @get_rule = ::Gapic::Config::Method.new get_rule_config
2230
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
2231
+ @insert = ::Gapic::Config::Method.new insert_config
2232
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
2233
+ @list = ::Gapic::Config::Method.new list_config
2234
+ list_associations_config = parent_rpcs.list_associations if parent_rpcs.respond_to? :list_associations
2235
+ @list_associations = ::Gapic::Config::Method.new list_associations_config
2236
+ list_preconfigured_expression_sets_config = parent_rpcs.list_preconfigured_expression_sets if parent_rpcs.respond_to? :list_preconfigured_expression_sets
2237
+ @list_preconfigured_expression_sets = ::Gapic::Config::Method.new list_preconfigured_expression_sets_config
2238
+ move_config = parent_rpcs.move if parent_rpcs.respond_to? :move
2239
+ @move = ::Gapic::Config::Method.new move_config
2240
+ patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
2241
+ @patch = ::Gapic::Config::Method.new patch_config
2242
+ patch_rule_config = parent_rpcs.patch_rule if parent_rpcs.respond_to? :patch_rule
2243
+ @patch_rule = ::Gapic::Config::Method.new patch_rule_config
2244
+ remove_association_config = parent_rpcs.remove_association if parent_rpcs.respond_to? :remove_association
2245
+ @remove_association = ::Gapic::Config::Method.new remove_association_config
2246
+ remove_rule_config = parent_rpcs.remove_rule if parent_rpcs.respond_to? :remove_rule
2247
+ @remove_rule = ::Gapic::Config::Method.new remove_rule_config
2248
+
2249
+ yield self if block_given?
2250
+ end
2251
+ end
2252
+ end
2253
+ end
2254
+ end
2255
+ end
2256
+ end
2257
+ end
2258
+ end
2259
+ end