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,759 @@
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/errors"
20
+ require "google/cloud/compute/v1/compute_pb"
21
+ require "google/cloud/compute/v1/region_ssl_policies/rest/service_stub"
22
+ require "google/cloud/compute/v1/region_operations/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Compute
27
+ module V1
28
+ module RegionSslPolicies
29
+ module Rest
30
+ ##
31
+ # REST client for the RegionSslPolicies service.
32
+ #
33
+ # The RegionSslPolicies API.
34
+ #
35
+ class Client
36
+ # @private
37
+ attr_reader :region_ssl_policies_stub
38
+
39
+ ##
40
+ # Configure the RegionSslPolicies Client class.
41
+ #
42
+ # See {::Google::Cloud::Compute::V1::RegionSslPolicies::Rest::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # @example
46
+ #
47
+ # # Modify the configuration for all RegionSslPolicies clients
48
+ # ::Google::Cloud::Compute::V1::RegionSslPolicies::Rest::Client.configure do |config|
49
+ # config.timeout = 10.0
50
+ # end
51
+ #
52
+ # @yield [config] Configure the Client client.
53
+ # @yieldparam config [Client::Configuration]
54
+ #
55
+ # @return [Client::Configuration]
56
+ #
57
+ def self.configure
58
+ @configure ||= begin
59
+ namespace = ["Google", "Cloud", "Compute", "V1"]
60
+ parent_config = while namespace.any?
61
+ parent_name = namespace.join "::"
62
+ parent_const = const_get parent_name
63
+ break parent_const.configure if parent_const.respond_to? :configure
64
+ namespace.pop
65
+ end
66
+ default_config = Client::Configuration.new parent_config
67
+
68
+ default_config.rpcs.delete.timeout = 600.0
69
+
70
+ default_config.rpcs.get.timeout = 600.0
71
+ default_config.rpcs.get.retry_policy = {
72
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
73
+ }
74
+
75
+ default_config.rpcs.insert.timeout = 600.0
76
+
77
+ default_config.rpcs.list.timeout = 600.0
78
+ default_config.rpcs.list.retry_policy = {
79
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
80
+ }
81
+
82
+ default_config.rpcs.list_available_features.timeout = 600.0
83
+ default_config.rpcs.list_available_features.retry_policy = {
84
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
85
+ }
86
+
87
+ default_config.rpcs.patch.timeout = 600.0
88
+
89
+ default_config
90
+ end
91
+ yield @configure if block_given?
92
+ @configure
93
+ end
94
+
95
+ ##
96
+ # Configure the RegionSslPolicies Client instance.
97
+ #
98
+ # The configuration is set to the derived mode, meaning that values can be changed,
99
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
100
+ # should be made on {Client.configure}.
101
+ #
102
+ # See {::Google::Cloud::Compute::V1::RegionSslPolicies::Rest::Client::Configuration}
103
+ # for a description of the configuration fields.
104
+ #
105
+ # @yield [config] Configure the Client client.
106
+ # @yieldparam config [Client::Configuration]
107
+ #
108
+ # @return [Client::Configuration]
109
+ #
110
+ def configure
111
+ yield @config if block_given?
112
+ @config
113
+ end
114
+
115
+ ##
116
+ # Create a new RegionSslPolicies REST client object.
117
+ #
118
+ # @example
119
+ #
120
+ # # Create a client using the default configuration
121
+ # client = ::Google::Cloud::Compute::V1::RegionSslPolicies::Rest::Client.new
122
+ #
123
+ # # Create a client using a custom configuration
124
+ # client = ::Google::Cloud::Compute::V1::RegionSslPolicies::Rest::Client.new do |config|
125
+ # config.timeout = 10.0
126
+ # end
127
+ #
128
+ # @yield [config] Configure the RegionSslPolicies client.
129
+ # @yieldparam config [Client::Configuration]
130
+ #
131
+ def initialize
132
+ # Create the configuration object
133
+ @config = Configuration.new Client.configure
134
+
135
+ # Yield the configuration if needed
136
+ yield @config if block_given?
137
+
138
+ # Create credentials
139
+ credentials = @config.credentials
140
+ credentials ||= Credentials.default scope: @config.scope
141
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
142
+ credentials = Credentials.new credentials, scope: @config.scope
143
+ end
144
+
145
+ @region_operations = ::Google::Cloud::Compute::V1::RegionOperations::Rest::Client.new do |config|
146
+ config.credentials = credentials
147
+ config.endpoint = @config.endpoint
148
+ end
149
+
150
+ @region_ssl_policies_stub = ::Google::Cloud::Compute::V1::RegionSslPolicies::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
151
+ end
152
+
153
+ ##
154
+ # Get the associated client for long-running operations via RegionOperations.
155
+ #
156
+ # @return [::Google::Cloud::Compute::V1::RegionOperations::Rest::Client]
157
+ #
158
+ attr_reader :region_operations
159
+
160
+ # Service calls
161
+
162
+ ##
163
+ # 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
+ #
165
+ # @overload delete(request, options = nil)
166
+ # Pass arguments to `delete` via a request object, either of type
167
+ # {::Google::Cloud::Compute::V1::DeleteRegionSslPolicyRequest} or an equivalent Hash.
168
+ #
169
+ # @param request [::Google::Cloud::Compute::V1::DeleteRegionSslPolicyRequest, ::Hash]
170
+ # A request object representing the call parameters. Required. To specify no
171
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
172
+ # @param options [::Gapic::CallOptions, ::Hash]
173
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
174
+ # Note: currently retry functionality is not implemented. While it is possible
175
+ # to set it using ::Gapic::CallOptions, it will not be applied
176
+ #
177
+ # @overload delete(project: nil, region: nil, request_id: nil, ssl_policy: nil)
178
+ # Pass arguments to `delete` via keyword arguments. Note that at
179
+ # least one keyword argument is required. To specify no parameters, or to keep all
180
+ # the default parameter values, pass an empty Hash as a request object (see above).
181
+ #
182
+ # @param project [::String]
183
+ # Project ID for this request.
184
+ # @param region [::String]
185
+ # Name of the region scoping this request.
186
+ # @param request_id [::String]
187
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
188
+ # @param ssl_policy [::String]
189
+ # Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035.
190
+ # @yield [result, response] Access the result along with the Faraday response object
191
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
192
+ # @yieldparam response [::Faraday::Response]
193
+ #
194
+ # @return [::Gapic::GenericLRO::Operation]
195
+ #
196
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
197
+ def delete request, options = nil
198
+ raise ::ArgumentError, "request must be provided" if request.nil?
199
+
200
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteRegionSslPolicyRequest
201
+
202
+ # Converts hash and nil to an options object
203
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
204
+
205
+ # Customize the options with defaults
206
+ call_metadata = @config.rpcs.delete.metadata.to_h
207
+
208
+ # Set x-goog-api-client header
209
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
210
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
211
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
212
+ transports_version_send: [:rest]
213
+
214
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
215
+ metadata: call_metadata
216
+
217
+ options.apply_defaults timeout: @config.timeout,
218
+ metadata: @config.metadata
219
+
220
+ @region_ssl_policies_stub.delete request, options do |result, response|
221
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
222
+ operation: result,
223
+ client: region_operations,
224
+ request_values: {
225
+ "project" => request.project,
226
+ "region" => request.region
227
+ },
228
+ options: options
229
+ )
230
+ yield result, response if block_given?
231
+ return result
232
+ end
233
+ rescue ::Faraday::Error => e
234
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
235
+ raise ::Google::Cloud::Error.from_error(gapic_error)
236
+ end
237
+
238
+ ##
239
+ # Lists all of the ordered rules present in a single specified policy.
240
+ #
241
+ # @overload get(request, options = nil)
242
+ # Pass arguments to `get` via a request object, either of type
243
+ # {::Google::Cloud::Compute::V1::GetRegionSslPolicyRequest} or an equivalent Hash.
244
+ #
245
+ # @param request [::Google::Cloud::Compute::V1::GetRegionSslPolicyRequest, ::Hash]
246
+ # A request object representing the call parameters. Required. To specify no
247
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
248
+ # @param options [::Gapic::CallOptions, ::Hash]
249
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
250
+ # Note: currently retry functionality is not implemented. While it is possible
251
+ # to set it using ::Gapic::CallOptions, it will not be applied
252
+ #
253
+ # @overload get(project: nil, region: nil, ssl_policy: nil)
254
+ # Pass arguments to `get` via keyword arguments. Note that at
255
+ # least one keyword argument is required. To specify no parameters, or to keep all
256
+ # the default parameter values, pass an empty Hash as a request object (see above).
257
+ #
258
+ # @param project [::String]
259
+ # Project ID for this request.
260
+ # @param region [::String]
261
+ # Name of the region scoping this request.
262
+ # @param ssl_policy [::String]
263
+ # Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.
264
+ # @yield [result, response] Access the result along with the Faraday response object
265
+ # @yieldparam result [::Google::Cloud::Compute::V1::SslPolicy]
266
+ # @yieldparam response [::Faraday::Response]
267
+ #
268
+ # @return [::Google::Cloud::Compute::V1::SslPolicy]
269
+ #
270
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
271
+ def get request, options = nil
272
+ raise ::ArgumentError, "request must be provided" if request.nil?
273
+
274
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetRegionSslPolicyRequest
275
+
276
+ # Converts hash and nil to an options object
277
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
278
+
279
+ # Customize the options with defaults
280
+ call_metadata = @config.rpcs.get.metadata.to_h
281
+
282
+ # Set x-goog-api-client header
283
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
284
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
285
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
286
+ transports_version_send: [:rest]
287
+
288
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
289
+ metadata: call_metadata
290
+
291
+ options.apply_defaults timeout: @config.timeout,
292
+ metadata: @config.metadata
293
+
294
+ @region_ssl_policies_stub.get request, options do |result, response|
295
+ yield result, response if block_given?
296
+ return result
297
+ end
298
+ rescue ::Faraday::Error => e
299
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
300
+ raise ::Google::Cloud::Error.from_error(gapic_error)
301
+ end
302
+
303
+ ##
304
+ # Creates a new policy in the specified project and region using the data included in the request.
305
+ #
306
+ # @overload insert(request, options = nil)
307
+ # Pass arguments to `insert` via a request object, either of type
308
+ # {::Google::Cloud::Compute::V1::InsertRegionSslPolicyRequest} or an equivalent Hash.
309
+ #
310
+ # @param request [::Google::Cloud::Compute::V1::InsertRegionSslPolicyRequest, ::Hash]
311
+ # A request object representing the call parameters. Required. To specify no
312
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
313
+ # @param options [::Gapic::CallOptions, ::Hash]
314
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
315
+ # Note: currently retry functionality is not implemented. While it is possible
316
+ # to set it using ::Gapic::CallOptions, it will not be applied
317
+ #
318
+ # @overload insert(project: nil, region: nil, request_id: nil, ssl_policy_resource: nil)
319
+ # Pass arguments to `insert` via keyword arguments. Note that at
320
+ # least one keyword argument is required. To specify no parameters, or to keep all
321
+ # the default parameter values, pass an empty Hash as a request object (see above).
322
+ #
323
+ # @param project [::String]
324
+ # Project ID for this request.
325
+ # @param region [::String]
326
+ # Name of the region scoping this request.
327
+ # @param request_id [::String]
328
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
329
+ # @param ssl_policy_resource [::Google::Cloud::Compute::V1::SslPolicy, ::Hash]
330
+ # The body resource for this request
331
+ # @yield [result, response] Access the result along with the Faraday response object
332
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
333
+ # @yieldparam response [::Faraday::Response]
334
+ #
335
+ # @return [::Gapic::GenericLRO::Operation]
336
+ #
337
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
338
+ def insert request, options = nil
339
+ raise ::ArgumentError, "request must be provided" if request.nil?
340
+
341
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::InsertRegionSslPolicyRequest
342
+
343
+ # Converts hash and nil to an options object
344
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
345
+
346
+ # Customize the options with defaults
347
+ call_metadata = @config.rpcs.insert.metadata.to_h
348
+
349
+ # Set x-goog-api-client header
350
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
351
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
352
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
353
+ transports_version_send: [:rest]
354
+
355
+ options.apply_defaults timeout: @config.rpcs.insert.timeout,
356
+ metadata: call_metadata
357
+
358
+ options.apply_defaults timeout: @config.timeout,
359
+ metadata: @config.metadata
360
+
361
+ @region_ssl_policies_stub.insert request, options do |result, response|
362
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
363
+ operation: result,
364
+ client: region_operations,
365
+ request_values: {
366
+ "project" => request.project,
367
+ "region" => request.region
368
+ },
369
+ options: options
370
+ )
371
+ yield result, response if block_given?
372
+ return result
373
+ end
374
+ rescue ::Faraday::Error => e
375
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
376
+ raise ::Google::Cloud::Error.from_error(gapic_error)
377
+ end
378
+
379
+ ##
380
+ # Lists all the SSL policies that have been configured for the specified project and region.
381
+ #
382
+ # @overload list(request, options = nil)
383
+ # Pass arguments to `list` via a request object, either of type
384
+ # {::Google::Cloud::Compute::V1::ListRegionSslPoliciesRequest} or an equivalent Hash.
385
+ #
386
+ # @param request [::Google::Cloud::Compute::V1::ListRegionSslPoliciesRequest, ::Hash]
387
+ # A request object representing the call parameters. Required. To specify no
388
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
389
+ # @param options [::Gapic::CallOptions, ::Hash]
390
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
391
+ # Note: currently retry functionality is not implemented. While it is possible
392
+ # to set it using ::Gapic::CallOptions, it will not be applied
393
+ #
394
+ # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil)
395
+ # Pass arguments to `list` via keyword arguments. Note that at
396
+ # least one keyword argument is required. To specify no parameters, or to keep all
397
+ # the default parameter values, pass an empty Hash as a request object (see above).
398
+ #
399
+ # @param filter [::String]
400
+ # 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`.
401
+ # @param max_results [::Integer]
402
+ # 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`)
403
+ # @param order_by [::String]
404
+ # 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.
405
+ # @param page_token [::String]
406
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
407
+ # @param project [::String]
408
+ # Project ID for this request.
409
+ # @param region [::String]
410
+ # Name of the region scoping this request.
411
+ # @param return_partial_success [::Boolean]
412
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
413
+ # @yield [result, response] Access the result along with the Faraday response object
414
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::SslPolicy>]
415
+ # @yieldparam response [::Faraday::Response]
416
+ #
417
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::SslPolicy>]
418
+ #
419
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
420
+ def list request, options = nil
421
+ raise ::ArgumentError, "request must be provided" if request.nil?
422
+
423
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListRegionSslPoliciesRequest
424
+
425
+ # Converts hash and nil to an options object
426
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
427
+
428
+ # Customize the options with defaults
429
+ call_metadata = @config.rpcs.list.metadata.to_h
430
+
431
+ # Set x-goog-api-client header
432
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
433
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
434
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
435
+ transports_version_send: [:rest]
436
+
437
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
438
+ metadata: call_metadata
439
+
440
+ options.apply_defaults timeout: @config.timeout,
441
+ metadata: @config.metadata
442
+
443
+ @region_ssl_policies_stub.list request, options do |result, response|
444
+ result = ::Gapic::Rest::PagedEnumerable.new @region_ssl_policies_stub, :list, "items", request, result, options
445
+ yield result, response if block_given?
446
+ return result
447
+ end
448
+ rescue ::Faraday::Error => e
449
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
450
+ raise ::Google::Cloud::Error.from_error(gapic_error)
451
+ end
452
+
453
+ ##
454
+ # Lists all features that can be specified in the SSL policy when using custom profile.
455
+ #
456
+ # @overload list_available_features(request, options = nil)
457
+ # Pass arguments to `list_available_features` via a request object, either of type
458
+ # {::Google::Cloud::Compute::V1::ListAvailableFeaturesRegionSslPoliciesRequest} or an equivalent Hash.
459
+ #
460
+ # @param request [::Google::Cloud::Compute::V1::ListAvailableFeaturesRegionSslPoliciesRequest, ::Hash]
461
+ # A request object representing the call parameters. Required. To specify no
462
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
463
+ # @param options [::Gapic::CallOptions, ::Hash]
464
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
465
+ # Note: currently retry functionality is not implemented. While it is possible
466
+ # to set it using ::Gapic::CallOptions, it will not be applied
467
+ #
468
+ # @overload list_available_features(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil)
469
+ # Pass arguments to `list_available_features` via keyword arguments. Note that at
470
+ # least one keyword argument is required. To specify no parameters, or to keep all
471
+ # the default parameter values, pass an empty Hash as a request object (see above).
472
+ #
473
+ # @param filter [::String]
474
+ # 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`.
475
+ # @param max_results [::Integer]
476
+ # 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`)
477
+ # @param order_by [::String]
478
+ # 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.
479
+ # @param page_token [::String]
480
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
481
+ # @param project [::String]
482
+ # Project ID for this request.
483
+ # @param region [::String]
484
+ # Name of the region scoping this request.
485
+ # @param return_partial_success [::Boolean]
486
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
487
+ # @yield [result, response] Access the result along with the Faraday response object
488
+ # @yieldparam result [::Google::Cloud::Compute::V1::SslPoliciesListAvailableFeaturesResponse]
489
+ # @yieldparam response [::Faraday::Response]
490
+ #
491
+ # @return [::Google::Cloud::Compute::V1::SslPoliciesListAvailableFeaturesResponse]
492
+ #
493
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
494
+ def list_available_features request, options = nil
495
+ raise ::ArgumentError, "request must be provided" if request.nil?
496
+
497
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListAvailableFeaturesRegionSslPoliciesRequest
498
+
499
+ # Converts hash and nil to an options object
500
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
501
+
502
+ # Customize the options with defaults
503
+ call_metadata = @config.rpcs.list_available_features.metadata.to_h
504
+
505
+ # Set x-goog-api-client header
506
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
507
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
508
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
509
+ transports_version_send: [:rest]
510
+
511
+ options.apply_defaults timeout: @config.rpcs.list_available_features.timeout,
512
+ metadata: call_metadata
513
+
514
+ options.apply_defaults timeout: @config.timeout,
515
+ metadata: @config.metadata
516
+
517
+ @region_ssl_policies_stub.list_available_features request, options do |result, response|
518
+ yield result, response if block_given?
519
+ return result
520
+ end
521
+ rescue ::Faraday::Error => e
522
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
523
+ raise ::Google::Cloud::Error.from_error(gapic_error)
524
+ end
525
+
526
+ ##
527
+ # Patches the specified SSL policy with the data included in the request.
528
+ #
529
+ # @overload patch(request, options = nil)
530
+ # Pass arguments to `patch` via a request object, either of type
531
+ # {::Google::Cloud::Compute::V1::PatchRegionSslPolicyRequest} or an equivalent Hash.
532
+ #
533
+ # @param request [::Google::Cloud::Compute::V1::PatchRegionSslPolicyRequest, ::Hash]
534
+ # A request object representing the call parameters. Required. To specify no
535
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
536
+ # @param options [::Gapic::CallOptions, ::Hash]
537
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
538
+ # Note: currently retry functionality is not implemented. While it is possible
539
+ # to set it using ::Gapic::CallOptions, it will not be applied
540
+ #
541
+ # @overload patch(project: nil, region: nil, request_id: nil, ssl_policy: nil, ssl_policy_resource: nil)
542
+ # Pass arguments to `patch` via keyword arguments. Note that at
543
+ # least one keyword argument is required. To specify no parameters, or to keep all
544
+ # the default parameter values, pass an empty Hash as a request object (see above).
545
+ #
546
+ # @param project [::String]
547
+ # Project ID for this request.
548
+ # @param region [::String]
549
+ # Name of the region scoping this request.
550
+ # @param request_id [::String]
551
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
552
+ # @param ssl_policy [::String]
553
+ # Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.
554
+ # @param ssl_policy_resource [::Google::Cloud::Compute::V1::SslPolicy, ::Hash]
555
+ # The body resource for this request
556
+ # @yield [result, response] Access the result along with the Faraday response object
557
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
558
+ # @yieldparam response [::Faraday::Response]
559
+ #
560
+ # @return [::Gapic::GenericLRO::Operation]
561
+ #
562
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
563
+ def patch request, options = nil
564
+ raise ::ArgumentError, "request must be provided" if request.nil?
565
+
566
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchRegionSslPolicyRequest
567
+
568
+ # Converts hash and nil to an options object
569
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
570
+
571
+ # Customize the options with defaults
572
+ call_metadata = @config.rpcs.patch.metadata.to_h
573
+
574
+ # Set x-goog-api-client header
575
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
576
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
577
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
578
+ transports_version_send: [:rest]
579
+
580
+ options.apply_defaults timeout: @config.rpcs.patch.timeout,
581
+ metadata: call_metadata
582
+
583
+ options.apply_defaults timeout: @config.timeout,
584
+ metadata: @config.metadata
585
+
586
+ @region_ssl_policies_stub.patch request, options do |result, response|
587
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
588
+ operation: result,
589
+ client: region_operations,
590
+ request_values: {
591
+ "project" => request.project,
592
+ "region" => request.region
593
+ },
594
+ options: options
595
+ )
596
+ yield result, response if block_given?
597
+ return result
598
+ end
599
+ rescue ::Faraday::Error => e
600
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
601
+ raise ::Google::Cloud::Error.from_error(gapic_error)
602
+ end
603
+
604
+ ##
605
+ # Configuration class for the RegionSslPolicies REST API.
606
+ #
607
+ # This class represents the configuration for RegionSslPolicies REST,
608
+ # providing control over credentials, timeouts, retry behavior, logging.
609
+ #
610
+ # Configuration can be applied globally to all clients, or to a single client
611
+ # on construction.
612
+ #
613
+ # # Examples
614
+ #
615
+ # To modify the global config, setting the timeout for all calls to 10 seconds:
616
+ #
617
+ # ::Google::Cloud::Compute::V1::RegionSslPolicies::Client.configure do |config|
618
+ # config.timeout = 10.0
619
+ # end
620
+ #
621
+ # To apply the above configuration only to a new client:
622
+ #
623
+ # client = ::Google::Cloud::Compute::V1::RegionSslPolicies::Client.new do |config|
624
+ # config.timeout = 10.0
625
+ # end
626
+ #
627
+ # @!attribute [rw] endpoint
628
+ # The hostname or hostname:port of the service endpoint.
629
+ # Defaults to `"compute.googleapis.com"`.
630
+ # @return [::String]
631
+ # @!attribute [rw] credentials
632
+ # Credentials to send with calls. You may provide any of the following types:
633
+ # * (`String`) The path to a service account key file in JSON format
634
+ # * (`Hash`) A service account key as a Hash
635
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
636
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
637
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
638
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
639
+ # * (`nil`) indicating no credentials
640
+ # @return [::Object]
641
+ # @!attribute [rw] scope
642
+ # The OAuth scopes
643
+ # @return [::Array<::String>]
644
+ # @!attribute [rw] lib_name
645
+ # The library name as recorded in instrumentation and logging
646
+ # @return [::String]
647
+ # @!attribute [rw] lib_version
648
+ # The library version as recorded in instrumentation and logging
649
+ # @return [::String]
650
+ # @!attribute [rw] timeout
651
+ # The call timeout in seconds.
652
+ # @return [::Numeric]
653
+ # @!attribute [rw] metadata
654
+ # Additional REST headers to be sent with the call.
655
+ # @return [::Hash{::Symbol=>::String}]
656
+ #
657
+ class Configuration
658
+ extend ::Gapic::Config
659
+
660
+ config_attr :endpoint, "compute.googleapis.com", ::String
661
+ config_attr :credentials, nil do |value|
662
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
663
+ allowed.any? { |klass| klass === value }
664
+ end
665
+ config_attr :scope, nil, ::String, ::Array, nil
666
+ config_attr :lib_name, nil, ::String, nil
667
+ config_attr :lib_version, nil, ::String, nil
668
+ config_attr :timeout, nil, ::Numeric, nil
669
+ config_attr :metadata, nil, ::Hash, nil
670
+
671
+ # @private
672
+ def initialize parent_config = nil
673
+ @parent_config = parent_config unless parent_config.nil?
674
+
675
+ yield self if block_given?
676
+ end
677
+
678
+ ##
679
+ # Configurations for individual RPCs
680
+ # @return [Rpcs]
681
+ #
682
+ def rpcs
683
+ @rpcs ||= begin
684
+ parent_rpcs = nil
685
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
686
+ Rpcs.new parent_rpcs
687
+ end
688
+ end
689
+
690
+ ##
691
+ # Configuration RPC class for the RegionSslPolicies API.
692
+ #
693
+ # Includes fields providing the configuration for each RPC in this service.
694
+ # Each configuration object is of type `Gapic::Config::Method` and includes
695
+ # the following configuration fields:
696
+ #
697
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
698
+ #
699
+ # there is one other field (`retry_policy`) that can be set
700
+ # but is currently not supported for REST Gapic libraries.
701
+ #
702
+ class Rpcs
703
+ ##
704
+ # RPC-specific configuration for `delete`
705
+ # @return [::Gapic::Config::Method]
706
+ #
707
+ attr_reader :delete
708
+ ##
709
+ # RPC-specific configuration for `get`
710
+ # @return [::Gapic::Config::Method]
711
+ #
712
+ attr_reader :get
713
+ ##
714
+ # RPC-specific configuration for `insert`
715
+ # @return [::Gapic::Config::Method]
716
+ #
717
+ attr_reader :insert
718
+ ##
719
+ # RPC-specific configuration for `list`
720
+ # @return [::Gapic::Config::Method]
721
+ #
722
+ attr_reader :list
723
+ ##
724
+ # RPC-specific configuration for `list_available_features`
725
+ # @return [::Gapic::Config::Method]
726
+ #
727
+ attr_reader :list_available_features
728
+ ##
729
+ # RPC-specific configuration for `patch`
730
+ # @return [::Gapic::Config::Method]
731
+ #
732
+ attr_reader :patch
733
+
734
+ # @private
735
+ def initialize parent_rpcs = nil
736
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
737
+ @delete = ::Gapic::Config::Method.new delete_config
738
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
739
+ @get = ::Gapic::Config::Method.new get_config
740
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
741
+ @insert = ::Gapic::Config::Method.new insert_config
742
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
743
+ @list = ::Gapic::Config::Method.new list_config
744
+ list_available_features_config = parent_rpcs.list_available_features if parent_rpcs.respond_to? :list_available_features
745
+ @list_available_features = ::Gapic::Config::Method.new list_available_features_config
746
+ patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
747
+ @patch = ::Gapic::Config::Method.new patch_config
748
+
749
+ yield self if block_given?
750
+ end
751
+ end
752
+ end
753
+ end
754
+ end
755
+ end
756
+ end
757
+ end
758
+ end
759
+ end