google-cloud-compute-v1 2.10.0 → 2.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/compute_pb.rb +51 -1
  3. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/credentials.rb +52 -0
  4. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest/client.rb +829 -0
  5. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest/service_stub.rb +378 -0
  6. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest.rb +51 -0
  7. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests.rb +47 -0
  8. data/lib/google/cloud/compute/v1/instance_settings_service/credentials.rb +52 -0
  9. data/lib/google/cloud/compute/v1/instance_settings_service/rest/client.rb +512 -0
  10. data/lib/google/cloud/compute/v1/instance_settings_service/rest/service_stub.rb +190 -0
  11. data/lib/google/cloud/compute/v1/instance_settings_service/rest.rb +51 -0
  12. data/lib/google/cloud/compute/v1/instance_settings_service.rb +47 -0
  13. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +104 -0
  14. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +62 -0
  15. data/lib/google/cloud/compute/v1/rest.rb +4 -0
  16. data/lib/google/cloud/compute/v1/storage_pool_types/credentials.rb +53 -0
  17. data/lib/google/cloud/compute/v1/storage_pool_types/rest/client.rb +603 -0
  18. data/lib/google/cloud/compute/v1/storage_pool_types/rest/service_stub.rb +249 -0
  19. data/lib/google/cloud/compute/v1/storage_pool_types/rest.rb +51 -0
  20. data/lib/google/cloud/compute/v1/storage_pool_types.rb +47 -0
  21. data/lib/google/cloud/compute/v1/storage_pools/credentials.rb +52 -0
  22. data/lib/google/cloud/compute/v1/storage_pools/rest/client.rb +1313 -0
  23. data/lib/google/cloud/compute/v1/storage_pools/rest/service_stub.rb +679 -0
  24. data/lib/google/cloud/compute/v1/storage_pools/rest.rb +51 -0
  25. data/lib/google/cloud/compute/v1/storage_pools.rb +47 -0
  26. data/lib/google/cloud/compute/v1/version.rb +1 -1
  27. data/lib/google/cloud/compute/v1.rb +4 -0
  28. data/proto_docs/google/api/client.rb +4 -0
  29. data/proto_docs/google/cloud/compute/v1/compute.rb +1410 -118
  30. metadata +22 -2
@@ -0,0 +1,603 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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/storage_pool_types/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Compute
26
+ module V1
27
+ module StoragePoolTypes
28
+ module Rest
29
+ ##
30
+ # REST client for the StoragePoolTypes service.
31
+ #
32
+ # The StoragePoolTypes API.
33
+ #
34
+ class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
37
+
38
+ # @private
39
+ attr_reader :storage_pool_types_stub
40
+
41
+ ##
42
+ # Configure the StoragePoolTypes Client class.
43
+ #
44
+ # See {::Google::Cloud::Compute::V1::StoragePoolTypes::Rest::Client::Configuration}
45
+ # for a description of the configuration fields.
46
+ #
47
+ # @example
48
+ #
49
+ # # Modify the configuration for all StoragePoolTypes clients
50
+ # ::Google::Cloud::Compute::V1::StoragePoolTypes::Rest::Client.configure do |config|
51
+ # config.timeout = 10.0
52
+ # end
53
+ #
54
+ # @yield [config] Configure the Client client.
55
+ # @yieldparam config [Client::Configuration]
56
+ #
57
+ # @return [Client::Configuration]
58
+ #
59
+ def self.configure
60
+ @configure ||= begin
61
+ namespace = ["Google", "Cloud", "Compute", "V1"]
62
+ parent_config = while namespace.any?
63
+ parent_name = namespace.join "::"
64
+ parent_const = const_get parent_name
65
+ break parent_const.configure if parent_const.respond_to? :configure
66
+ namespace.pop
67
+ end
68
+ default_config = Client::Configuration.new parent_config
69
+
70
+ default_config.rpcs.aggregated_list.timeout = 600.0
71
+ default_config.rpcs.aggregated_list.retry_policy = {
72
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
73
+ }
74
+
75
+ default_config.rpcs.get.timeout = 600.0
76
+ default_config.rpcs.get.retry_policy = {
77
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
78
+ }
79
+
80
+ default_config.rpcs.list.timeout = 600.0
81
+ default_config.rpcs.list.retry_policy = {
82
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
83
+ }
84
+
85
+ default_config
86
+ end
87
+ yield @configure if block_given?
88
+ @configure
89
+ end
90
+
91
+ ##
92
+ # Configure the StoragePoolTypes Client instance.
93
+ #
94
+ # The configuration is set to the derived mode, meaning that values can be changed,
95
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
96
+ # should be made on {Client.configure}.
97
+ #
98
+ # See {::Google::Cloud::Compute::V1::StoragePoolTypes::Rest::Client::Configuration}
99
+ # for a description of the configuration fields.
100
+ #
101
+ # @yield [config] Configure the Client client.
102
+ # @yieldparam config [Client::Configuration]
103
+ #
104
+ # @return [Client::Configuration]
105
+ #
106
+ def configure
107
+ yield @config if block_given?
108
+ @config
109
+ end
110
+
111
+ ##
112
+ # The effective universe domain
113
+ #
114
+ # @return [String]
115
+ #
116
+ def universe_domain
117
+ @storage_pool_types_stub.universe_domain
118
+ end
119
+
120
+ ##
121
+ # Create a new StoragePoolTypes REST client object.
122
+ #
123
+ # @example
124
+ #
125
+ # # Create a client using the default configuration
126
+ # client = ::Google::Cloud::Compute::V1::StoragePoolTypes::Rest::Client.new
127
+ #
128
+ # # Create a client using a custom configuration
129
+ # client = ::Google::Cloud::Compute::V1::StoragePoolTypes::Rest::Client.new do |config|
130
+ # config.timeout = 10.0
131
+ # end
132
+ #
133
+ # @yield [config] Configure the StoragePoolTypes client.
134
+ # @yieldparam config [Client::Configuration]
135
+ #
136
+ def initialize
137
+ # Create the configuration object
138
+ @config = Configuration.new Client.configure
139
+
140
+ # Yield the configuration if needed
141
+ yield @config if block_given?
142
+
143
+ # Create credentials
144
+ credentials = @config.credentials
145
+ # Use self-signed JWT if the endpoint is unchanged from default,
146
+ # but only if the default endpoint does not have a region prefix.
147
+ enable_self_signed_jwt = @config.endpoint.nil? ||
148
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
149
+ !@config.endpoint.split(".").first.include?("-"))
150
+ credentials ||= Credentials.default scope: @config.scope,
151
+ enable_self_signed_jwt: enable_self_signed_jwt
152
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
153
+ credentials = Credentials.new credentials, scope: @config.scope
154
+ end
155
+
156
+ @quota_project_id = @config.quota_project
157
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
158
+
159
+ @storage_pool_types_stub = ::Google::Cloud::Compute::V1::StoragePoolTypes::Rest::ServiceStub.new(
160
+ endpoint: @config.endpoint,
161
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
162
+ universe_domain: @config.universe_domain,
163
+ credentials: credentials
164
+ )
165
+ end
166
+
167
+ # Service calls
168
+
169
+ ##
170
+ # Retrieves an aggregated list of storage pool types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.
171
+ #
172
+ # @overload aggregated_list(request, options = nil)
173
+ # Pass arguments to `aggregated_list` via a request object, either of type
174
+ # {::Google::Cloud::Compute::V1::AggregatedListStoragePoolTypesRequest} or an equivalent Hash.
175
+ #
176
+ # @param request [::Google::Cloud::Compute::V1::AggregatedListStoragePoolTypesRequest, ::Hash]
177
+ # A request object representing the call parameters. Required. To specify no
178
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
179
+ # @param options [::Gapic::CallOptions, ::Hash]
180
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
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, service_project_number: 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions.
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
+ # Project ID for 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.
201
+ # @param service_project_number [::Integer]
202
+ # The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.
203
+ # @yield [result, operation] Access the result along with the TransportOperation object
204
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::StoragePoolTypesScopedList>]
205
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
206
+ #
207
+ # @return [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::StoragePoolTypesScopedList>]
208
+ #
209
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
210
+ #
211
+ # @example Basic example
212
+ # require "google/cloud/compute/v1"
213
+ #
214
+ # # Create a client object. The client can be reused for multiple calls.
215
+ # client = Google::Cloud::Compute::V1::StoragePoolTypes::Rest::Client.new
216
+ #
217
+ # # Create a request. To set request fields, pass in keyword arguments.
218
+ # request = Google::Cloud::Compute::V1::AggregatedListStoragePoolTypesRequest.new
219
+ #
220
+ # # Call the aggregated_list method.
221
+ # result = client.aggregated_list request
222
+ #
223
+ # # The returned object is of type Google::Cloud::Compute::V1::StoragePoolTypeAggregatedList.
224
+ # p result
225
+ #
226
+ def aggregated_list request, options = nil
227
+ raise ::ArgumentError, "request must be provided" if request.nil?
228
+
229
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AggregatedListStoragePoolTypesRequest
230
+
231
+ # Converts hash and nil to an options object
232
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
233
+
234
+ # Customize the options with defaults
235
+ call_metadata = @config.rpcs.aggregated_list.metadata.to_h
236
+
237
+ # Set x-goog-api-client and x-goog-user-project headers
238
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
239
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
240
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
241
+ transports_version_send: [:rest]
242
+
243
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
244
+
245
+ options.apply_defaults timeout: @config.rpcs.aggregated_list.timeout,
246
+ metadata: call_metadata,
247
+ retry_policy: @config.rpcs.aggregated_list.retry_policy
248
+
249
+ options.apply_defaults timeout: @config.timeout,
250
+ metadata: @config.metadata,
251
+ retry_policy: @config.retry_policy
252
+
253
+ @storage_pool_types_stub.aggregated_list request, options do |result, operation|
254
+ result = ::Gapic::Rest::PagedEnumerable.new @storage_pool_types_stub, :aggregated_list, "items", request, result, options
255
+ yield result, operation if block_given?
256
+ return result
257
+ end
258
+ rescue ::Gapic::Rest::Error => e
259
+ raise ::Google::Cloud::Error.from_error(e)
260
+ end
261
+
262
+ ##
263
+ # Returns the specified storage pool type.
264
+ #
265
+ # @overload get(request, options = nil)
266
+ # Pass arguments to `get` via a request object, either of type
267
+ # {::Google::Cloud::Compute::V1::GetStoragePoolTypeRequest} or an equivalent Hash.
268
+ #
269
+ # @param request [::Google::Cloud::Compute::V1::GetStoragePoolTypeRequest, ::Hash]
270
+ # A request object representing the call parameters. Required. To specify no
271
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
272
+ # @param options [::Gapic::CallOptions, ::Hash]
273
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
274
+ #
275
+ # @overload get(project: nil, storage_pool_type: nil, zone: nil)
276
+ # Pass arguments to `get` via keyword arguments. Note that at
277
+ # least one keyword argument is required. To specify no parameters, or to keep all
278
+ # the default parameter values, pass an empty Hash as a request object (see above).
279
+ #
280
+ # @param project [::String]
281
+ # Project ID for this request.
282
+ # @param storage_pool_type [::String]
283
+ # Name of the storage pool type to return.
284
+ # @param zone [::String]
285
+ # The name of the zone for this request.
286
+ # @yield [result, operation] Access the result along with the TransportOperation object
287
+ # @yieldparam result [::Google::Cloud::Compute::V1::StoragePoolType]
288
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
289
+ #
290
+ # @return [::Google::Cloud::Compute::V1::StoragePoolType]
291
+ #
292
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
293
+ #
294
+ # @example Basic example
295
+ # require "google/cloud/compute/v1"
296
+ #
297
+ # # Create a client object. The client can be reused for multiple calls.
298
+ # client = Google::Cloud::Compute::V1::StoragePoolTypes::Rest::Client.new
299
+ #
300
+ # # Create a request. To set request fields, pass in keyword arguments.
301
+ # request = Google::Cloud::Compute::V1::GetStoragePoolTypeRequest.new
302
+ #
303
+ # # Call the get method.
304
+ # result = client.get request
305
+ #
306
+ # # The returned object is of type Google::Cloud::Compute::V1::StoragePoolType.
307
+ # p result
308
+ #
309
+ def get request, options = nil
310
+ raise ::ArgumentError, "request must be provided" if request.nil?
311
+
312
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetStoragePoolTypeRequest
313
+
314
+ # Converts hash and nil to an options object
315
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
316
+
317
+ # Customize the options with defaults
318
+ call_metadata = @config.rpcs.get.metadata.to_h
319
+
320
+ # Set x-goog-api-client and x-goog-user-project headers
321
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
322
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
323
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
324
+ transports_version_send: [:rest]
325
+
326
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
327
+
328
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
329
+ metadata: call_metadata,
330
+ retry_policy: @config.rpcs.get.retry_policy
331
+
332
+ options.apply_defaults timeout: @config.timeout,
333
+ metadata: @config.metadata,
334
+ retry_policy: @config.retry_policy
335
+
336
+ @storage_pool_types_stub.get request, options do |result, operation|
337
+ yield result, operation if block_given?
338
+ return result
339
+ end
340
+ rescue ::Gapic::Rest::Error => e
341
+ raise ::Google::Cloud::Error.from_error(e)
342
+ end
343
+
344
+ ##
345
+ # Retrieves a list of storage pool types available to the specified project.
346
+ #
347
+ # @overload list(request, options = nil)
348
+ # Pass arguments to `list` via a request object, either of type
349
+ # {::Google::Cloud::Compute::V1::ListStoragePoolTypesRequest} or an equivalent Hash.
350
+ #
351
+ # @param request [::Google::Cloud::Compute::V1::ListStoragePoolTypesRequest, ::Hash]
352
+ # A request object representing the call parameters. Required. To specify no
353
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
354
+ # @param options [::Gapic::CallOptions, ::Hash]
355
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
356
+ #
357
+ # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil, zone: nil)
358
+ # Pass arguments to `list` via keyword arguments. Note that at
359
+ # least one keyword argument is required. To specify no parameters, or to keep all
360
+ # the default parameter values, pass an empty Hash as a request object (see above).
361
+ #
362
+ # @param filter [::String]
363
+ # 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions.
364
+ # @param max_results [::Integer]
365
+ # 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`)
366
+ # @param order_by [::String]
367
+ # 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.
368
+ # @param page_token [::String]
369
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
370
+ # @param project [::String]
371
+ # Project ID for this request.
372
+ # @param return_partial_success [::Boolean]
373
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.
374
+ # @param zone [::String]
375
+ # The name of the zone for this request.
376
+ # @yield [result, operation] Access the result along with the TransportOperation object
377
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::StoragePoolType>]
378
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
379
+ #
380
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::StoragePoolType>]
381
+ #
382
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
383
+ #
384
+ # @example Basic example
385
+ # require "google/cloud/compute/v1"
386
+ #
387
+ # # Create a client object. The client can be reused for multiple calls.
388
+ # client = Google::Cloud::Compute::V1::StoragePoolTypes::Rest::Client.new
389
+ #
390
+ # # Create a request. To set request fields, pass in keyword arguments.
391
+ # request = Google::Cloud::Compute::V1::ListStoragePoolTypesRequest.new
392
+ #
393
+ # # Call the list method.
394
+ # result = client.list request
395
+ #
396
+ # # The returned object is of type Google::Cloud::Compute::V1::StoragePoolTypeList.
397
+ # p result
398
+ #
399
+ def list request, options = nil
400
+ raise ::ArgumentError, "request must be provided" if request.nil?
401
+
402
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListStoragePoolTypesRequest
403
+
404
+ # Converts hash and nil to an options object
405
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
406
+
407
+ # Customize the options with defaults
408
+ call_metadata = @config.rpcs.list.metadata.to_h
409
+
410
+ # Set x-goog-api-client and x-goog-user-project headers
411
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
412
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
413
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
414
+ transports_version_send: [:rest]
415
+
416
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
417
+
418
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
419
+ metadata: call_metadata,
420
+ retry_policy: @config.rpcs.list.retry_policy
421
+
422
+ options.apply_defaults timeout: @config.timeout,
423
+ metadata: @config.metadata,
424
+ retry_policy: @config.retry_policy
425
+
426
+ @storage_pool_types_stub.list request, options do |result, operation|
427
+ result = ::Gapic::Rest::PagedEnumerable.new @storage_pool_types_stub, :list, "items", request, result, options
428
+ yield result, operation if block_given?
429
+ return result
430
+ end
431
+ rescue ::Gapic::Rest::Error => e
432
+ raise ::Google::Cloud::Error.from_error(e)
433
+ end
434
+
435
+ ##
436
+ # Configuration class for the StoragePoolTypes REST API.
437
+ #
438
+ # This class represents the configuration for StoragePoolTypes REST,
439
+ # providing control over timeouts, retry behavior, logging, transport
440
+ # parameters, and other low-level controls. Certain parameters can also be
441
+ # applied individually to specific RPCs. See
442
+ # {::Google::Cloud::Compute::V1::StoragePoolTypes::Rest::Client::Configuration::Rpcs}
443
+ # for a list of RPCs that can be configured independently.
444
+ #
445
+ # Configuration can be applied globally to all clients, or to a single client
446
+ # on construction.
447
+ #
448
+ # @example
449
+ #
450
+ # # Modify the global config, setting the timeout for
451
+ # # aggregated_list to 20 seconds,
452
+ # # and all remaining timeouts to 10 seconds.
453
+ # ::Google::Cloud::Compute::V1::StoragePoolTypes::Rest::Client.configure do |config|
454
+ # config.timeout = 10.0
455
+ # config.rpcs.aggregated_list.timeout = 20.0
456
+ # end
457
+ #
458
+ # # Apply the above configuration only to a new client.
459
+ # client = ::Google::Cloud::Compute::V1::StoragePoolTypes::Rest::Client.new do |config|
460
+ # config.timeout = 10.0
461
+ # config.rpcs.aggregated_list.timeout = 20.0
462
+ # end
463
+ #
464
+ # @!attribute [rw] endpoint
465
+ # A custom service endpoint, as a hostname or hostname:port. The default is
466
+ # nil, indicating to use the default endpoint in the current universe domain.
467
+ # @return [::String,nil]
468
+ # @!attribute [rw] credentials
469
+ # Credentials to send with calls. You may provide any of the following types:
470
+ # * (`String`) The path to a service account key file in JSON format
471
+ # * (`Hash`) A service account key as a Hash
472
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
473
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
474
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
475
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
476
+ # * (`nil`) indicating no credentials
477
+ # @return [::Object]
478
+ # @!attribute [rw] scope
479
+ # The OAuth scopes
480
+ # @return [::Array<::String>]
481
+ # @!attribute [rw] lib_name
482
+ # The library name as recorded in instrumentation and logging
483
+ # @return [::String]
484
+ # @!attribute [rw] lib_version
485
+ # The library version as recorded in instrumentation and logging
486
+ # @return [::String]
487
+ # @!attribute [rw] timeout
488
+ # The call timeout in seconds.
489
+ # @return [::Numeric]
490
+ # @!attribute [rw] metadata
491
+ # Additional headers to be sent with the call.
492
+ # @return [::Hash{::Symbol=>::String}]
493
+ # @!attribute [rw] retry_policy
494
+ # The retry policy. The value is a hash with the following keys:
495
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
496
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
497
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
498
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
499
+ # trigger a retry.
500
+ # @return [::Hash]
501
+ # @!attribute [rw] quota_project
502
+ # A separate project against which to charge quota.
503
+ # @return [::String]
504
+ # @!attribute [rw] universe_domain
505
+ # The universe domain within which to make requests. This determines the
506
+ # default endpoint URL. The default value of nil uses the environment
507
+ # universe (usually the default "googleapis.com" universe).
508
+ # @return [::String,nil]
509
+ #
510
+ class Configuration
511
+ extend ::Gapic::Config
512
+
513
+ # @private
514
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
515
+ DEFAULT_ENDPOINT = "compute.googleapis.com"
516
+
517
+ config_attr :endpoint, nil, ::String, nil
518
+ config_attr :credentials, nil do |value|
519
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
520
+ allowed.any? { |klass| klass === value }
521
+ end
522
+ config_attr :scope, nil, ::String, ::Array, nil
523
+ config_attr :lib_name, nil, ::String, nil
524
+ config_attr :lib_version, nil, ::String, nil
525
+ config_attr :timeout, nil, ::Numeric, nil
526
+ config_attr :metadata, nil, ::Hash, nil
527
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
528
+ config_attr :quota_project, nil, ::String, nil
529
+ config_attr :universe_domain, nil, ::String, nil
530
+
531
+ # @private
532
+ def initialize parent_config = nil
533
+ @parent_config = parent_config unless parent_config.nil?
534
+
535
+ yield self if block_given?
536
+ end
537
+
538
+ ##
539
+ # Configurations for individual RPCs
540
+ # @return [Rpcs]
541
+ #
542
+ def rpcs
543
+ @rpcs ||= begin
544
+ parent_rpcs = nil
545
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
546
+ Rpcs.new parent_rpcs
547
+ end
548
+ end
549
+
550
+ ##
551
+ # Configuration RPC class for the StoragePoolTypes API.
552
+ #
553
+ # Includes fields providing the configuration for each RPC in this service.
554
+ # Each configuration object is of type `Gapic::Config::Method` and includes
555
+ # the following configuration fields:
556
+ #
557
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
558
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
559
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
560
+ # include the following keys:
561
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
562
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
563
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
564
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
565
+ # trigger a retry.
566
+ #
567
+ class Rpcs
568
+ ##
569
+ # RPC-specific configuration for `aggregated_list`
570
+ # @return [::Gapic::Config::Method]
571
+ #
572
+ attr_reader :aggregated_list
573
+ ##
574
+ # RPC-specific configuration for `get`
575
+ # @return [::Gapic::Config::Method]
576
+ #
577
+ attr_reader :get
578
+ ##
579
+ # RPC-specific configuration for `list`
580
+ # @return [::Gapic::Config::Method]
581
+ #
582
+ attr_reader :list
583
+
584
+ # @private
585
+ def initialize parent_rpcs = nil
586
+ aggregated_list_config = parent_rpcs.aggregated_list if parent_rpcs.respond_to? :aggregated_list
587
+ @aggregated_list = ::Gapic::Config::Method.new aggregated_list_config
588
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
589
+ @get = ::Gapic::Config::Method.new get_config
590
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
591
+ @list = ::Gapic::Config::Method.new list_config
592
+
593
+ yield self if block_given?
594
+ end
595
+ end
596
+ end
597
+ end
598
+ end
599
+ end
600
+ end
601
+ end
602
+ end
603
+ end