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,587 @@
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_target_tcp_proxies/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 RegionTargetTcpProxies
29
+ module Rest
30
+ ##
31
+ # REST client for the RegionTargetTcpProxies service.
32
+ #
33
+ # The RegionTargetTcpProxies API.
34
+ #
35
+ class Client
36
+ # @private
37
+ attr_reader :region_target_tcp_proxies_stub
38
+
39
+ ##
40
+ # Configure the RegionTargetTcpProxies Client class.
41
+ #
42
+ # See {::Google::Cloud::Compute::V1::RegionTargetTcpProxies::Rest::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # @example
46
+ #
47
+ # # Modify the configuration for all RegionTargetTcpProxies clients
48
+ # ::Google::Cloud::Compute::V1::RegionTargetTcpProxies::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
83
+ end
84
+ yield @configure if block_given?
85
+ @configure
86
+ end
87
+
88
+ ##
89
+ # Configure the RegionTargetTcpProxies Client instance.
90
+ #
91
+ # The configuration is set to the derived mode, meaning that values can be changed,
92
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
93
+ # should be made on {Client.configure}.
94
+ #
95
+ # See {::Google::Cloud::Compute::V1::RegionTargetTcpProxies::Rest::Client::Configuration}
96
+ # for a description of the configuration fields.
97
+ #
98
+ # @yield [config] Configure the Client client.
99
+ # @yieldparam config [Client::Configuration]
100
+ #
101
+ # @return [Client::Configuration]
102
+ #
103
+ def configure
104
+ yield @config if block_given?
105
+ @config
106
+ end
107
+
108
+ ##
109
+ # Create a new RegionTargetTcpProxies REST client object.
110
+ #
111
+ # @example
112
+ #
113
+ # # Create a client using the default configuration
114
+ # client = ::Google::Cloud::Compute::V1::RegionTargetTcpProxies::Rest::Client.new
115
+ #
116
+ # # Create a client using a custom configuration
117
+ # client = ::Google::Cloud::Compute::V1::RegionTargetTcpProxies::Rest::Client.new do |config|
118
+ # config.timeout = 10.0
119
+ # end
120
+ #
121
+ # @yield [config] Configure the RegionTargetTcpProxies client.
122
+ # @yieldparam config [Client::Configuration]
123
+ #
124
+ def initialize
125
+ # Create the configuration object
126
+ @config = Configuration.new Client.configure
127
+
128
+ # Yield the configuration if needed
129
+ yield @config if block_given?
130
+
131
+ # Create credentials
132
+ credentials = @config.credentials
133
+ credentials ||= Credentials.default scope: @config.scope
134
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
135
+ credentials = Credentials.new credentials, scope: @config.scope
136
+ end
137
+
138
+ @region_operations = ::Google::Cloud::Compute::V1::RegionOperations::Rest::Client.new do |config|
139
+ config.credentials = credentials
140
+ config.endpoint = @config.endpoint
141
+ end
142
+
143
+ @region_target_tcp_proxies_stub = ::Google::Cloud::Compute::V1::RegionTargetTcpProxies::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
144
+ end
145
+
146
+ ##
147
+ # Get the associated client for long-running operations via RegionOperations.
148
+ #
149
+ # @return [::Google::Cloud::Compute::V1::RegionOperations::Rest::Client]
150
+ #
151
+ attr_reader :region_operations
152
+
153
+ # Service calls
154
+
155
+ ##
156
+ # Deletes the specified TargetTcpProxy resource.
157
+ #
158
+ # @overload delete(request, options = nil)
159
+ # Pass arguments to `delete` via a request object, either of type
160
+ # {::Google::Cloud::Compute::V1::DeleteRegionTargetTcpProxyRequest} or an equivalent Hash.
161
+ #
162
+ # @param request [::Google::Cloud::Compute::V1::DeleteRegionTargetTcpProxyRequest, ::Hash]
163
+ # A request object representing the call parameters. Required. To specify no
164
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
165
+ # @param options [::Gapic::CallOptions, ::Hash]
166
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
167
+ # Note: currently retry functionality is not implemented. While it is possible
168
+ # to set it using ::Gapic::CallOptions, it will not be applied
169
+ #
170
+ # @overload delete(project: nil, region: nil, request_id: nil, target_tcp_proxy: nil)
171
+ # Pass arguments to `delete` via keyword arguments. Note that at
172
+ # least one keyword argument is required. To specify no parameters, or to keep all
173
+ # the default parameter values, pass an empty Hash as a request object (see above).
174
+ #
175
+ # @param project [::String]
176
+ # Project ID for this request.
177
+ # @param region [::String]
178
+ # Name of the region scoping this request.
179
+ # @param request_id [::String]
180
+ # 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).
181
+ # @param target_tcp_proxy [::String]
182
+ # Name of the TargetTcpProxy resource to delete.
183
+ # @yield [result, response] Access the result along with the Faraday response object
184
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
185
+ # @yieldparam response [::Faraday::Response]
186
+ #
187
+ # @return [::Gapic::GenericLRO::Operation]
188
+ #
189
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
190
+ def delete request, options = nil
191
+ raise ::ArgumentError, "request must be provided" if request.nil?
192
+
193
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteRegionTargetTcpProxyRequest
194
+
195
+ # Converts hash and nil to an options object
196
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
197
+
198
+ # Customize the options with defaults
199
+ call_metadata = @config.rpcs.delete.metadata.to_h
200
+
201
+ # Set x-goog-api-client header
202
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
203
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
204
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
205
+ transports_version_send: [:rest]
206
+
207
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
208
+ metadata: call_metadata
209
+
210
+ options.apply_defaults timeout: @config.timeout,
211
+ metadata: @config.metadata
212
+
213
+ @region_target_tcp_proxies_stub.delete request, options do |result, response|
214
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
215
+ operation: result,
216
+ client: region_operations,
217
+ request_values: {
218
+ "project" => request.project,
219
+ "region" => request.region
220
+ },
221
+ options: options
222
+ )
223
+ yield result, response if block_given?
224
+ return result
225
+ end
226
+ rescue ::Faraday::Error => e
227
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
228
+ raise ::Google::Cloud::Error.from_error(gapic_error)
229
+ end
230
+
231
+ ##
232
+ # Returns the specified TargetTcpProxy resource.
233
+ #
234
+ # @overload get(request, options = nil)
235
+ # Pass arguments to `get` via a request object, either of type
236
+ # {::Google::Cloud::Compute::V1::GetRegionTargetTcpProxyRequest} or an equivalent Hash.
237
+ #
238
+ # @param request [::Google::Cloud::Compute::V1::GetRegionTargetTcpProxyRequest, ::Hash]
239
+ # A request object representing the call parameters. Required. To specify no
240
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
241
+ # @param options [::Gapic::CallOptions, ::Hash]
242
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
243
+ # Note: currently retry functionality is not implemented. While it is possible
244
+ # to set it using ::Gapic::CallOptions, it will not be applied
245
+ #
246
+ # @overload get(project: nil, region: nil, target_tcp_proxy: nil)
247
+ # Pass arguments to `get` via keyword arguments. Note that at
248
+ # least one keyword argument is required. To specify no parameters, or to keep all
249
+ # the default parameter values, pass an empty Hash as a request object (see above).
250
+ #
251
+ # @param project [::String]
252
+ # Project ID for this request.
253
+ # @param region [::String]
254
+ # Name of the region scoping this request.
255
+ # @param target_tcp_proxy [::String]
256
+ # Name of the TargetTcpProxy resource to return.
257
+ # @yield [result, response] Access the result along with the Faraday response object
258
+ # @yieldparam result [::Google::Cloud::Compute::V1::TargetTcpProxy]
259
+ # @yieldparam response [::Faraday::Response]
260
+ #
261
+ # @return [::Google::Cloud::Compute::V1::TargetTcpProxy]
262
+ #
263
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
264
+ def get request, options = nil
265
+ raise ::ArgumentError, "request must be provided" if request.nil?
266
+
267
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetRegionTargetTcpProxyRequest
268
+
269
+ # Converts hash and nil to an options object
270
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
271
+
272
+ # Customize the options with defaults
273
+ call_metadata = @config.rpcs.get.metadata.to_h
274
+
275
+ # Set x-goog-api-client header
276
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
277
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
278
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
279
+ transports_version_send: [:rest]
280
+
281
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
282
+ metadata: call_metadata
283
+
284
+ options.apply_defaults timeout: @config.timeout,
285
+ metadata: @config.metadata
286
+
287
+ @region_target_tcp_proxies_stub.get request, options do |result, response|
288
+ yield result, response if block_given?
289
+ return result
290
+ end
291
+ rescue ::Faraday::Error => e
292
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
293
+ raise ::Google::Cloud::Error.from_error(gapic_error)
294
+ end
295
+
296
+ ##
297
+ # Creates a TargetTcpProxy resource in the specified project and region using the data included in the request.
298
+ #
299
+ # @overload insert(request, options = nil)
300
+ # Pass arguments to `insert` via a request object, either of type
301
+ # {::Google::Cloud::Compute::V1::InsertRegionTargetTcpProxyRequest} or an equivalent Hash.
302
+ #
303
+ # @param request [::Google::Cloud::Compute::V1::InsertRegionTargetTcpProxyRequest, ::Hash]
304
+ # A request object representing the call parameters. Required. To specify no
305
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
306
+ # @param options [::Gapic::CallOptions, ::Hash]
307
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
308
+ # Note: currently retry functionality is not implemented. While it is possible
309
+ # to set it using ::Gapic::CallOptions, it will not be applied
310
+ #
311
+ # @overload insert(project: nil, region: nil, request_id: nil, target_tcp_proxy_resource: nil)
312
+ # Pass arguments to `insert` via keyword arguments. Note that at
313
+ # least one keyword argument is required. To specify no parameters, or to keep all
314
+ # the default parameter values, pass an empty Hash as a request object (see above).
315
+ #
316
+ # @param project [::String]
317
+ # Project ID for this request.
318
+ # @param region [::String]
319
+ # Name of the region scoping this request.
320
+ # @param request_id [::String]
321
+ # 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).
322
+ # @param target_tcp_proxy_resource [::Google::Cloud::Compute::V1::TargetTcpProxy, ::Hash]
323
+ # The body resource for this request
324
+ # @yield [result, response] Access the result along with the Faraday response object
325
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
326
+ # @yieldparam response [::Faraday::Response]
327
+ #
328
+ # @return [::Gapic::GenericLRO::Operation]
329
+ #
330
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
331
+ def insert request, options = nil
332
+ raise ::ArgumentError, "request must be provided" if request.nil?
333
+
334
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::InsertRegionTargetTcpProxyRequest
335
+
336
+ # Converts hash and nil to an options object
337
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
338
+
339
+ # Customize the options with defaults
340
+ call_metadata = @config.rpcs.insert.metadata.to_h
341
+
342
+ # Set x-goog-api-client header
343
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
344
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
345
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
346
+ transports_version_send: [:rest]
347
+
348
+ options.apply_defaults timeout: @config.rpcs.insert.timeout,
349
+ metadata: call_metadata
350
+
351
+ options.apply_defaults timeout: @config.timeout,
352
+ metadata: @config.metadata
353
+
354
+ @region_target_tcp_proxies_stub.insert request, options do |result, response|
355
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
356
+ operation: result,
357
+ client: region_operations,
358
+ request_values: {
359
+ "project" => request.project,
360
+ "region" => request.region
361
+ },
362
+ options: options
363
+ )
364
+ yield result, response if block_given?
365
+ return result
366
+ end
367
+ rescue ::Faraday::Error => e
368
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
369
+ raise ::Google::Cloud::Error.from_error(gapic_error)
370
+ end
371
+
372
+ ##
373
+ # Retrieves a list of TargetTcpProxy resources available to the specified project in a given region.
374
+ #
375
+ # @overload list(request, options = nil)
376
+ # Pass arguments to `list` via a request object, either of type
377
+ # {::Google::Cloud::Compute::V1::ListRegionTargetTcpProxiesRequest} or an equivalent Hash.
378
+ #
379
+ # @param request [::Google::Cloud::Compute::V1::ListRegionTargetTcpProxiesRequest, ::Hash]
380
+ # A request object representing the call parameters. Required. To specify no
381
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
382
+ # @param options [::Gapic::CallOptions, ::Hash]
383
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
384
+ # Note: currently retry functionality is not implemented. While it is possible
385
+ # to set it using ::Gapic::CallOptions, it will not be applied
386
+ #
387
+ # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil)
388
+ # Pass arguments to `list` via keyword arguments. Note that at
389
+ # least one keyword argument is required. To specify no parameters, or to keep all
390
+ # the default parameter values, pass an empty Hash as a request object (see above).
391
+ #
392
+ # @param filter [::String]
393
+ # 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`.
394
+ # @param max_results [::Integer]
395
+ # 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`)
396
+ # @param order_by [::String]
397
+ # 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.
398
+ # @param page_token [::String]
399
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
400
+ # @param project [::String]
401
+ # Project ID for this request.
402
+ # @param region [::String]
403
+ # Name of the region scoping this request.
404
+ # @param return_partial_success [::Boolean]
405
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
406
+ # @yield [result, response] Access the result along with the Faraday response object
407
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::TargetTcpProxy>]
408
+ # @yieldparam response [::Faraday::Response]
409
+ #
410
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::TargetTcpProxy>]
411
+ #
412
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
413
+ def list request, options = nil
414
+ raise ::ArgumentError, "request must be provided" if request.nil?
415
+
416
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListRegionTargetTcpProxiesRequest
417
+
418
+ # Converts hash and nil to an options object
419
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
420
+
421
+ # Customize the options with defaults
422
+ call_metadata = @config.rpcs.list.metadata.to_h
423
+
424
+ # Set x-goog-api-client header
425
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
426
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
427
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
428
+ transports_version_send: [:rest]
429
+
430
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
431
+ metadata: call_metadata
432
+
433
+ options.apply_defaults timeout: @config.timeout,
434
+ metadata: @config.metadata
435
+
436
+ @region_target_tcp_proxies_stub.list request, options do |result, response|
437
+ result = ::Gapic::Rest::PagedEnumerable.new @region_target_tcp_proxies_stub, :list, "items", request, result, options
438
+ yield result, response if block_given?
439
+ return result
440
+ end
441
+ rescue ::Faraday::Error => e
442
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
443
+ raise ::Google::Cloud::Error.from_error(gapic_error)
444
+ end
445
+
446
+ ##
447
+ # Configuration class for the RegionTargetTcpProxies REST API.
448
+ #
449
+ # This class represents the configuration for RegionTargetTcpProxies REST,
450
+ # providing control over credentials, timeouts, retry behavior, logging.
451
+ #
452
+ # Configuration can be applied globally to all clients, or to a single client
453
+ # on construction.
454
+ #
455
+ # # Examples
456
+ #
457
+ # To modify the global config, setting the timeout for all calls to 10 seconds:
458
+ #
459
+ # ::Google::Cloud::Compute::V1::RegionTargetTcpProxies::Client.configure do |config|
460
+ # config.timeout = 10.0
461
+ # end
462
+ #
463
+ # To apply the above configuration only to a new client:
464
+ #
465
+ # client = ::Google::Cloud::Compute::V1::RegionTargetTcpProxies::Client.new do |config|
466
+ # config.timeout = 10.0
467
+ # end
468
+ #
469
+ # @!attribute [rw] endpoint
470
+ # The hostname or hostname:port of the service endpoint.
471
+ # Defaults to `"compute.googleapis.com"`.
472
+ # @return [::String]
473
+ # @!attribute [rw] credentials
474
+ # Credentials to send with calls. You may provide any of the following types:
475
+ # * (`String`) The path to a service account key file in JSON format
476
+ # * (`Hash`) A service account key as a Hash
477
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
478
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
479
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
480
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
481
+ # * (`nil`) indicating no credentials
482
+ # @return [::Object]
483
+ # @!attribute [rw] scope
484
+ # The OAuth scopes
485
+ # @return [::Array<::String>]
486
+ # @!attribute [rw] lib_name
487
+ # The library name as recorded in instrumentation and logging
488
+ # @return [::String]
489
+ # @!attribute [rw] lib_version
490
+ # The library version as recorded in instrumentation and logging
491
+ # @return [::String]
492
+ # @!attribute [rw] timeout
493
+ # The call timeout in seconds.
494
+ # @return [::Numeric]
495
+ # @!attribute [rw] metadata
496
+ # Additional REST headers to be sent with the call.
497
+ # @return [::Hash{::Symbol=>::String}]
498
+ #
499
+ class Configuration
500
+ extend ::Gapic::Config
501
+
502
+ config_attr :endpoint, "compute.googleapis.com", ::String
503
+ config_attr :credentials, nil do |value|
504
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
505
+ allowed.any? { |klass| klass === value }
506
+ end
507
+ config_attr :scope, nil, ::String, ::Array, nil
508
+ config_attr :lib_name, nil, ::String, nil
509
+ config_attr :lib_version, nil, ::String, nil
510
+ config_attr :timeout, nil, ::Numeric, nil
511
+ config_attr :metadata, nil, ::Hash, nil
512
+
513
+ # @private
514
+ def initialize parent_config = nil
515
+ @parent_config = parent_config unless parent_config.nil?
516
+
517
+ yield self if block_given?
518
+ end
519
+
520
+ ##
521
+ # Configurations for individual RPCs
522
+ # @return [Rpcs]
523
+ #
524
+ def rpcs
525
+ @rpcs ||= begin
526
+ parent_rpcs = nil
527
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
528
+ Rpcs.new parent_rpcs
529
+ end
530
+ end
531
+
532
+ ##
533
+ # Configuration RPC class for the RegionTargetTcpProxies API.
534
+ #
535
+ # Includes fields providing the configuration for each RPC in this service.
536
+ # Each configuration object is of type `Gapic::Config::Method` and includes
537
+ # the following configuration fields:
538
+ #
539
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
540
+ #
541
+ # there is one other field (`retry_policy`) that can be set
542
+ # but is currently not supported for REST Gapic libraries.
543
+ #
544
+ class Rpcs
545
+ ##
546
+ # RPC-specific configuration for `delete`
547
+ # @return [::Gapic::Config::Method]
548
+ #
549
+ attr_reader :delete
550
+ ##
551
+ # RPC-specific configuration for `get`
552
+ # @return [::Gapic::Config::Method]
553
+ #
554
+ attr_reader :get
555
+ ##
556
+ # RPC-specific configuration for `insert`
557
+ # @return [::Gapic::Config::Method]
558
+ #
559
+ attr_reader :insert
560
+ ##
561
+ # RPC-specific configuration for `list`
562
+ # @return [::Gapic::Config::Method]
563
+ #
564
+ attr_reader :list
565
+
566
+ # @private
567
+ def initialize parent_rpcs = nil
568
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
569
+ @delete = ::Gapic::Config::Method.new delete_config
570
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
571
+ @get = ::Gapic::Config::Method.new get_config
572
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
573
+ @insert = ::Gapic::Config::Method.new insert_config
574
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
575
+ @list = ::Gapic::Config::Method.new list_config
576
+
577
+ yield self if block_given?
578
+ end
579
+ end
580
+ end
581
+ end
582
+ end
583
+ end
584
+ end
585
+ end
586
+ end
587
+ end