google-cloud-compute-v1 0.1.0 → 0.2.0

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