google-cloud-compute-v1 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +87 -0
  4. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +61 -0
  5. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +151 -0
  6. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +119 -0
  7. data/lib/google/cloud/compute/v1/compute_pb.rb +228 -0
  8. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +82 -0
  9. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +60 -0
  10. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +87 -0
  11. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +61 -0
  12. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +82 -0
  13. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +60 -0
  14. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +155 -0
  15. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +121 -0
  16. data/lib/google/cloud/compute/v1/region_ssl_policies/credentials.rb +52 -0
  17. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +759 -0
  18. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb +408 -0
  19. data/lib/google/cloud/compute/v1/region_ssl_policies/rest.rb +33 -0
  20. data/lib/google/cloud/compute/v1/region_ssl_policies.rb +47 -0
  21. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/credentials.rb +52 -0
  22. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +587 -0
  23. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb +288 -0
  24. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest.rb +33 -0
  25. data/lib/google/cloud/compute/v1/region_target_tcp_proxies.rb +47 -0
  26. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +82 -0
  27. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +60 -0
  28. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +86 -0
  29. data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +58 -0
  30. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +87 -0
  31. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +61 -0
  32. data/lib/google/cloud/compute/v1/version.rb +1 -1
  33. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +87 -0
  34. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +61 -0
  35. data/lib/google/cloud/compute/v1.rb +2 -0
  36. data/proto_docs/google/cloud/compute/v1/compute.rb +637 -26
  37. metadata +12 -2
@@ -0,0 +1,288 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/compute/v1/compute_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Compute
24
+ module V1
25
+ module RegionTargetTcpProxies
26
+ module Rest
27
+ ##
28
+ # REST service stub for the RegionTargetTcpProxies service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ def initialize endpoint:, credentials:
34
+ # These require statements are intentionally placed here to initialize
35
+ # the REST modules only when it's required.
36
+ require "gapic/rest"
37
+
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials
39
+ end
40
+
41
+ ##
42
+ # Baseline implementation for the delete REST call
43
+ #
44
+ # @param request_pb [::Google::Cloud::Compute::V1::DeleteRegionTargetTcpProxyRequest]
45
+ # A request object representing the call parameters. Required.
46
+ # @param options [::Gapic::CallOptions]
47
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
48
+ #
49
+ # @yield [result, response] Access the result along with the Faraday response object
50
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
51
+ # @yieldparam response [::Faraday::Response]
52
+ #
53
+ # @return [::Google::Cloud::Compute::V1::Operation]
54
+ # A result object deserialized from the server's reply
55
+ def delete request_pb, options = nil
56
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
57
+
58
+ verb, uri, query_string_params, body = transcode_delete_request request_pb
59
+ query_string_params = if query_string_params.any?
60
+ query_string_params.to_h { |p| p.split("=", 2) }
61
+ else
62
+ {}
63
+ end
64
+
65
+ response = @client_stub.make_http_request(
66
+ verb,
67
+ uri: uri,
68
+ body: body || "",
69
+ params: query_string_params,
70
+ options: options
71
+ )
72
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
73
+
74
+ yield result, response if block_given?
75
+ result
76
+ end
77
+
78
+ ##
79
+ # Baseline implementation for the get REST call
80
+ #
81
+ # @param request_pb [::Google::Cloud::Compute::V1::GetRegionTargetTcpProxyRequest]
82
+ # A request object representing the call parameters. Required.
83
+ # @param options [::Gapic::CallOptions]
84
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
85
+ #
86
+ # @yield [result, response] Access the result along with the Faraday response object
87
+ # @yieldparam result [::Google::Cloud::Compute::V1::TargetTcpProxy]
88
+ # @yieldparam response [::Faraday::Response]
89
+ #
90
+ # @return [::Google::Cloud::Compute::V1::TargetTcpProxy]
91
+ # A result object deserialized from the server's reply
92
+ def get request_pb, options = nil
93
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
94
+
95
+ verb, uri, query_string_params, body = transcode_get_request request_pb
96
+ query_string_params = if query_string_params.any?
97
+ query_string_params.to_h { |p| p.split("=", 2) }
98
+ else
99
+ {}
100
+ end
101
+
102
+ response = @client_stub.make_http_request(
103
+ verb,
104
+ uri: uri,
105
+ body: body || "",
106
+ params: query_string_params,
107
+ options: options
108
+ )
109
+ result = ::Google::Cloud::Compute::V1::TargetTcpProxy.decode_json response.body, ignore_unknown_fields: true
110
+
111
+ yield result, response if block_given?
112
+ result
113
+ end
114
+
115
+ ##
116
+ # Baseline implementation for the insert REST call
117
+ #
118
+ # @param request_pb [::Google::Cloud::Compute::V1::InsertRegionTargetTcpProxyRequest]
119
+ # A request object representing the call parameters. Required.
120
+ # @param options [::Gapic::CallOptions]
121
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
122
+ #
123
+ # @yield [result, response] Access the result along with the Faraday response object
124
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
125
+ # @yieldparam response [::Faraday::Response]
126
+ #
127
+ # @return [::Google::Cloud::Compute::V1::Operation]
128
+ # A result object deserialized from the server's reply
129
+ def insert request_pb, options = nil
130
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
131
+
132
+ verb, uri, query_string_params, body = transcode_insert_request request_pb
133
+ query_string_params = if query_string_params.any?
134
+ query_string_params.to_h { |p| p.split("=", 2) }
135
+ else
136
+ {}
137
+ end
138
+
139
+ response = @client_stub.make_http_request(
140
+ verb,
141
+ uri: uri,
142
+ body: body || "",
143
+ params: query_string_params,
144
+ options: options
145
+ )
146
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
147
+
148
+ yield result, response if block_given?
149
+ result
150
+ end
151
+
152
+ ##
153
+ # Baseline implementation for the list REST call
154
+ #
155
+ # @param request_pb [::Google::Cloud::Compute::V1::ListRegionTargetTcpProxiesRequest]
156
+ # A request object representing the call parameters. Required.
157
+ # @param options [::Gapic::CallOptions]
158
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
159
+ #
160
+ # @yield [result, response] Access the result along with the Faraday response object
161
+ # @yieldparam result [::Google::Cloud::Compute::V1::TargetTcpProxyList]
162
+ # @yieldparam response [::Faraday::Response]
163
+ #
164
+ # @return [::Google::Cloud::Compute::V1::TargetTcpProxyList]
165
+ # A result object deserialized from the server's reply
166
+ def list request_pb, options = nil
167
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
168
+
169
+ verb, uri, query_string_params, body = transcode_list_request request_pb
170
+ query_string_params = if query_string_params.any?
171
+ query_string_params.to_h { |p| p.split("=", 2) }
172
+ else
173
+ {}
174
+ end
175
+
176
+ response = @client_stub.make_http_request(
177
+ verb,
178
+ uri: uri,
179
+ body: body || "",
180
+ params: query_string_params,
181
+ options: options
182
+ )
183
+ result = ::Google::Cloud::Compute::V1::TargetTcpProxyList.decode_json response.body, ignore_unknown_fields: true
184
+
185
+ yield result, response if block_given?
186
+ result
187
+ end
188
+
189
+
190
+ private
191
+
192
+ ##
193
+ # @private
194
+ #
195
+ # GRPC transcoding helper method for the delete REST call
196
+ #
197
+ # @param request_pb [::Google::Cloud::Compute::V1::DeleteRegionTargetTcpProxyRequest]
198
+ # A request object representing the call parameters. Required.
199
+ # @return [Array(String, [String, nil], Hash{String => String})]
200
+ # Uri, Body, Query string parameters
201
+ def transcode_delete_request request_pb
202
+ transcoder = Gapic::Rest::GrpcTranscoder.new
203
+ .with_bindings(
204
+ uri_method: :delete,
205
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/targetTcpProxies/{target_tcp_proxy}",
206
+ matches: [
207
+ ["project", %r{^[^/]+/?$}, false],
208
+ ["region", %r{^[^/]+/?$}, false],
209
+ ["target_tcp_proxy", %r{^[^/]+/?$}, false]
210
+ ]
211
+ )
212
+ transcoder.transcode request_pb
213
+ end
214
+
215
+ ##
216
+ # @private
217
+ #
218
+ # GRPC transcoding helper method for the get REST call
219
+ #
220
+ # @param request_pb [::Google::Cloud::Compute::V1::GetRegionTargetTcpProxyRequest]
221
+ # A request object representing the call parameters. Required.
222
+ # @return [Array(String, [String, nil], Hash{String => String})]
223
+ # Uri, Body, Query string parameters
224
+ def transcode_get_request request_pb
225
+ transcoder = Gapic::Rest::GrpcTranscoder.new
226
+ .with_bindings(
227
+ uri_method: :get,
228
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/targetTcpProxies/{target_tcp_proxy}",
229
+ matches: [
230
+ ["project", %r{^[^/]+/?$}, false],
231
+ ["region", %r{^[^/]+/?$}, false],
232
+ ["target_tcp_proxy", %r{^[^/]+/?$}, false]
233
+ ]
234
+ )
235
+ transcoder.transcode request_pb
236
+ end
237
+
238
+ ##
239
+ # @private
240
+ #
241
+ # GRPC transcoding helper method for the insert REST call
242
+ #
243
+ # @param request_pb [::Google::Cloud::Compute::V1::InsertRegionTargetTcpProxyRequest]
244
+ # A request object representing the call parameters. Required.
245
+ # @return [Array(String, [String, nil], Hash{String => String})]
246
+ # Uri, Body, Query string parameters
247
+ def transcode_insert_request request_pb
248
+ transcoder = Gapic::Rest::GrpcTranscoder.new
249
+ .with_bindings(
250
+ uri_method: :post,
251
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/targetTcpProxies",
252
+ body: "target_tcp_proxy_resource",
253
+ matches: [
254
+ ["project", %r{^[^/]+/?$}, false],
255
+ ["region", %r{^[^/]+/?$}, false]
256
+ ]
257
+ )
258
+ transcoder.transcode request_pb
259
+ end
260
+
261
+ ##
262
+ # @private
263
+ #
264
+ # GRPC transcoding helper method for the list REST call
265
+ #
266
+ # @param request_pb [::Google::Cloud::Compute::V1::ListRegionTargetTcpProxiesRequest]
267
+ # A request object representing the call parameters. Required.
268
+ # @return [Array(String, [String, nil], Hash{String => String})]
269
+ # Uri, Body, Query string parameters
270
+ def transcode_list_request request_pb
271
+ transcoder = Gapic::Rest::GrpcTranscoder.new
272
+ .with_bindings(
273
+ uri_method: :get,
274
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/targetTcpProxies",
275
+ matches: [
276
+ ["project", %r{^[^/]+/?$}, false],
277
+ ["region", %r{^[^/]+/?$}, false]
278
+ ]
279
+ )
280
+ transcoder.transcode request_pb
281
+ end
282
+ end
283
+ end
284
+ end
285
+ end
286
+ end
287
+ end
288
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/compute/v1/region_target_tcp_proxies/rest/client"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Compute
24
+ module V1
25
+ module RegionTargetTcpProxies
26
+ # Client for the REST transport
27
+ module Rest
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/config"
20
+ require "gapic/config/method"
21
+
22
+ require "google/cloud/compute/v1/version"
23
+
24
+ require "google/cloud/compute/v1/region_target_tcp_proxies/credentials"
25
+ require "google/cloud/compute/v1/region_target_tcp_proxies/rest"
26
+
27
+ module Google
28
+ module Cloud
29
+ module Compute
30
+ module V1
31
+ ##
32
+ # The RegionTargetTcpProxies API.
33
+ #
34
+ # To load this service and instantiate a REST client:
35
+ #
36
+ # require "google/cloud/compute/v1/region_target_tcp_proxies"
37
+ # client = ::Google::Cloud::Compute::V1::RegionTargetTcpProxies::Rest::Client.new
38
+ #
39
+ module RegionTargetTcpProxies
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+
46
+ helper_path = ::File.join __dir__, "region_target_tcp_proxies", "helpers.rb"
47
+ require "google/cloud/compute/v1/region_target_tcp_proxies/helpers" if ::File.file? helper_path
@@ -102,6 +102,8 @@ module Google
102
102
 
103
103
  default_config.rpcs.remove_rule.timeout = 600.0
104
104
 
105
+ default_config.rpcs.set_labels.timeout = 600.0
106
+
105
107
  default_config
106
108
  end
107
109
  yield @configure if block_given?
@@ -968,6 +970,79 @@ module Google
968
970
  raise ::Google::Cloud::Error.from_error(gapic_error)
969
971
  end
970
972
 
973
+ ##
974
+ # Sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation.
975
+ #
976
+ # @overload set_labels(request, options = nil)
977
+ # Pass arguments to `set_labels` via a request object, either of type
978
+ # {::Google::Cloud::Compute::V1::SetLabelsSecurityPolicyRequest} or an equivalent Hash.
979
+ #
980
+ # @param request [::Google::Cloud::Compute::V1::SetLabelsSecurityPolicyRequest, ::Hash]
981
+ # A request object representing the call parameters. Required. To specify no
982
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
983
+ # @param options [::Gapic::CallOptions, ::Hash]
984
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
985
+ # Note: currently retry functionality is not implemented. While it is possible
986
+ # to set it using ::Gapic::CallOptions, it will not be applied
987
+ #
988
+ # @overload set_labels(global_set_labels_request_resource: nil, project: nil, resource: nil)
989
+ # Pass arguments to `set_labels` via keyword arguments. Note that at
990
+ # least one keyword argument is required. To specify no parameters, or to keep all
991
+ # the default parameter values, pass an empty Hash as a request object (see above).
992
+ #
993
+ # @param global_set_labels_request_resource [::Google::Cloud::Compute::V1::GlobalSetLabelsRequest, ::Hash]
994
+ # The body resource for this request
995
+ # @param project [::String]
996
+ # Project ID for this request.
997
+ # @param resource [::String]
998
+ # Name or id of the resource for this request.
999
+ # @yield [result, response] Access the result along with the Faraday response object
1000
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
1001
+ # @yieldparam response [::Faraday::Response]
1002
+ #
1003
+ # @return [::Gapic::GenericLRO::Operation]
1004
+ #
1005
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1006
+ def set_labels request, options = nil
1007
+ raise ::ArgumentError, "request must be provided" if request.nil?
1008
+
1009
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetLabelsSecurityPolicyRequest
1010
+
1011
+ # Converts hash and nil to an options object
1012
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1013
+
1014
+ # Customize the options with defaults
1015
+ call_metadata = @config.rpcs.set_labels.metadata.to_h
1016
+
1017
+ # Set x-goog-api-client header
1018
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1019
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1020
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1021
+ transports_version_send: [:rest]
1022
+
1023
+ options.apply_defaults timeout: @config.rpcs.set_labels.timeout,
1024
+ metadata: call_metadata
1025
+
1026
+ options.apply_defaults timeout: @config.timeout,
1027
+ metadata: @config.metadata
1028
+
1029
+ @security_policies_stub.set_labels request, options do |result, response|
1030
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
1031
+ operation: result,
1032
+ client: global_operations,
1033
+ request_values: {
1034
+ "project" => request.project
1035
+ },
1036
+ options: options
1037
+ )
1038
+ yield result, response if block_given?
1039
+ return result
1040
+ end
1041
+ rescue ::Faraday::Error => e
1042
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1043
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1044
+ end
1045
+
971
1046
  ##
972
1047
  # Configuration class for the SecurityPolicies REST API.
973
1048
  #
@@ -1122,6 +1197,11 @@ module Google
1122
1197
  # @return [::Gapic::Config::Method]
1123
1198
  #
1124
1199
  attr_reader :remove_rule
1200
+ ##
1201
+ # RPC-specific configuration for `set_labels`
1202
+ # @return [::Gapic::Config::Method]
1203
+ #
1204
+ attr_reader :set_labels
1125
1205
 
1126
1206
  # @private
1127
1207
  def initialize parent_rpcs = nil
@@ -1147,6 +1227,8 @@ module Google
1147
1227
  @patch_rule = ::Gapic::Config::Method.new patch_rule_config
1148
1228
  remove_rule_config = parent_rpcs.remove_rule if parent_rpcs.respond_to? :remove_rule
1149
1229
  @remove_rule = ::Gapic::Config::Method.new remove_rule_config
1230
+ set_labels_config = parent_rpcs.set_labels if parent_rpcs.respond_to? :set_labels
1231
+ @set_labels = ::Gapic::Config::Method.new set_labels_config
1150
1232
 
1151
1233
  yield self if block_given?
1152
1234
  end
@@ -445,6 +445,43 @@ module Google
445
445
  result
446
446
  end
447
447
 
448
+ ##
449
+ # Baseline implementation for the set_labels REST call
450
+ #
451
+ # @param request_pb [::Google::Cloud::Compute::V1::SetLabelsSecurityPolicyRequest]
452
+ # A request object representing the call parameters. Required.
453
+ # @param options [::Gapic::CallOptions]
454
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
455
+ #
456
+ # @yield [result, response] Access the result along with the Faraday response object
457
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
458
+ # @yieldparam response [::Faraday::Response]
459
+ #
460
+ # @return [::Google::Cloud::Compute::V1::Operation]
461
+ # A result object deserialized from the server's reply
462
+ def set_labels request_pb, options = nil
463
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
464
+
465
+ verb, uri, query_string_params, body = transcode_set_labels_request request_pb
466
+ query_string_params = if query_string_params.any?
467
+ query_string_params.to_h { |p| p.split("=", 2) }
468
+ else
469
+ {}
470
+ end
471
+
472
+ response = @client_stub.make_http_request(
473
+ verb,
474
+ uri: uri,
475
+ body: body || "",
476
+ params: query_string_params,
477
+ options: options
478
+ )
479
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
480
+
481
+ yield result, response if block_given?
482
+ result
483
+ end
484
+
448
485
 
449
486
  private
450
487
 
@@ -689,6 +726,29 @@ module Google
689
726
  )
690
727
  transcoder.transcode request_pb
691
728
  end
729
+
730
+ ##
731
+ # @private
732
+ #
733
+ # GRPC transcoding helper method for the set_labels REST call
734
+ #
735
+ # @param request_pb [::Google::Cloud::Compute::V1::SetLabelsSecurityPolicyRequest]
736
+ # A request object representing the call parameters. Required.
737
+ # @return [Array(String, [String, nil], Hash{String => String})]
738
+ # Uri, Body, Query string parameters
739
+ def transcode_set_labels_request request_pb
740
+ transcoder = Gapic::Rest::GrpcTranscoder.new
741
+ .with_bindings(
742
+ uri_method: :post,
743
+ uri_template: "/compute/v1/projects/{project}/global/securityPolicies/{resource}/setLabels",
744
+ body: "global_set_labels_request_resource",
745
+ matches: [
746
+ ["project", %r{^[^/]+/?$}, false],
747
+ ["resource", %r{^[^/]+/?$}, false]
748
+ ]
749
+ )
750
+ transcoder.transcode request_pb
751
+ end
692
752
  end
693
753
  end
694
754
  end
@@ -65,6 +65,11 @@ module Google
65
65
  end
66
66
  default_config = Client::Configuration.new parent_config
67
67
 
68
+ default_config.rpcs.aggregated_list.timeout = 600.0
69
+ default_config.rpcs.aggregated_list.retry_policy = {
70
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
71
+ }
72
+
68
73
  default_config.rpcs.delete.timeout = 600.0
69
74
 
70
75
  default_config.rpcs.get.timeout = 600.0
@@ -159,6 +164,80 @@ module Google
159
164
 
160
165
  # Service calls
161
166
 
167
+ ##
168
+ # Retrieves the list of all SslPolicy resources, regional and global, available to the specified project.
169
+ #
170
+ # @overload aggregated_list(request, options = nil)
171
+ # Pass arguments to `aggregated_list` via a request object, either of type
172
+ # {::Google::Cloud::Compute::V1::AggregatedListSslPoliciesRequest} or an equivalent Hash.
173
+ #
174
+ # @param request [::Google::Cloud::Compute::V1::AggregatedListSslPoliciesRequest, ::Hash]
175
+ # A request object representing the call parameters. Required. To specify no
176
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
177
+ # @param options [::Gapic::CallOptions, ::Hash]
178
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
179
+ # Note: currently retry functionality is not implemented. While it is possible
180
+ # to set it using ::Gapic::CallOptions, it will not be applied
181
+ #
182
+ # @overload aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
183
+ # Pass arguments to `aggregated_list` via keyword arguments. Note that at
184
+ # least one keyword argument is required. To specify no parameters, or to keep all
185
+ # the default parameter values, pass an empty Hash as a request object (see above).
186
+ #
187
+ # @param filter [::String]
188
+ # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`.
189
+ # @param include_all_scopes [::Boolean]
190
+ # Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.
191
+ # @param max_results [::Integer]
192
+ # 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`)
193
+ # @param order_by [::String]
194
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.
195
+ # @param page_token [::String]
196
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
197
+ # @param project [::String]
198
+ # Name of the project scoping this request.
199
+ # @param return_partial_success [::Boolean]
200
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
201
+ # @yield [result, response] Access the result along with the Faraday response object
202
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::SslPoliciesScopedList>]
203
+ # @yieldparam response [::Faraday::Response]
204
+ #
205
+ # @return [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::SslPoliciesScopedList>]
206
+ #
207
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
208
+ def aggregated_list request, options = nil
209
+ raise ::ArgumentError, "request must be provided" if request.nil?
210
+
211
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AggregatedListSslPoliciesRequest
212
+
213
+ # Converts hash and nil to an options object
214
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
215
+
216
+ # Customize the options with defaults
217
+ call_metadata = @config.rpcs.aggregated_list.metadata.to_h
218
+
219
+ # Set x-goog-api-client header
220
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
221
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
222
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
223
+ transports_version_send: [:rest]
224
+
225
+ options.apply_defaults timeout: @config.rpcs.aggregated_list.timeout,
226
+ metadata: call_metadata
227
+
228
+ options.apply_defaults timeout: @config.timeout,
229
+ metadata: @config.metadata
230
+
231
+ @ssl_policies_stub.aggregated_list request, options do |result, response|
232
+ result = ::Gapic::Rest::PagedEnumerable.new @ssl_policies_stub, :aggregated_list, "items", request, result, options
233
+ yield result, response if block_given?
234
+ return result
235
+ end
236
+ rescue ::Faraday::Error => e
237
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
238
+ raise ::Google::Cloud::Error.from_error(gapic_error)
239
+ end
240
+
162
241
  ##
163
242
  # Deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources.
164
243
  #
@@ -685,6 +764,11 @@ module Google
685
764
  # but is currently not supported for REST Gapic libraries.
686
765
  #
687
766
  class Rpcs
767
+ ##
768
+ # RPC-specific configuration for `aggregated_list`
769
+ # @return [::Gapic::Config::Method]
770
+ #
771
+ attr_reader :aggregated_list
688
772
  ##
689
773
  # RPC-specific configuration for `delete`
690
774
  # @return [::Gapic::Config::Method]
@@ -718,6 +802,8 @@ module Google
718
802
 
719
803
  # @private
720
804
  def initialize parent_rpcs = nil
805
+ aggregated_list_config = parent_rpcs.aggregated_list if parent_rpcs.respond_to? :aggregated_list
806
+ @aggregated_list = ::Gapic::Config::Method.new aggregated_list_config
721
807
  delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
722
808
  @delete = ::Gapic::Config::Method.new delete_config
723
809
  get_config = parent_rpcs.get if parent_rpcs.respond_to? :get