google-cloud-compute-v1 2.7.1 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +1 -0
  3. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +1 -0
  4. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +1 -0
  5. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +1 -1
  6. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +1 -0
  7. data/lib/google/cloud/compute/v1/compute_pb.rb +14 -2
  8. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +1 -0
  9. data/lib/google/cloud/compute/v1/disks/rest/client.rb +1 -0
  10. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +1 -0
  11. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +1 -0
  12. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +1 -0
  13. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +2 -1
  14. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +1 -0
  15. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +1 -0
  16. data/lib/google/cloud/compute/v1/instances/rest/client.rb +108 -3
  17. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +61 -0
  18. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +1 -0
  19. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +1 -0
  20. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +1 -0
  21. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +1 -0
  22. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +1 -0
  23. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +1 -0
  24. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +1 -0
  25. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +1 -0
  26. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +1 -0
  27. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +1 -0
  28. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +1 -0
  29. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +1 -1
  30. data/lib/google/cloud/compute/v1/region_zones/credentials.rb +53 -0
  31. data/lib/google/cloud/compute/v1/region_zones/rest/client.rb +404 -0
  32. data/lib/google/cloud/compute/v1/region_zones/rest/service_stub.rb +129 -0
  33. data/lib/google/cloud/compute/v1/region_zones/rest.rb +51 -0
  34. data/lib/google/cloud/compute/v1/region_zones.rb +47 -0
  35. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +1 -0
  36. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +1 -0
  37. data/lib/google/cloud/compute/v1/rest.rb +1 -0
  38. data/lib/google/cloud/compute/v1/routers/rest/client.rb +1 -0
  39. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +1 -0
  40. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +1 -0
  41. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +1 -0
  42. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +1 -0
  43. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +1 -0
  44. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +1 -0
  45. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +1 -0
  46. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +1 -0
  47. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +1 -0
  48. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +1 -1
  49. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +1 -0
  50. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +1 -0
  51. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +1 -0
  52. data/lib/google/cloud/compute/v1/version.rb +1 -1
  53. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +1 -0
  54. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +1 -0
  55. data/lib/google/cloud/compute/v1.rb +1 -0
  56. data/proto_docs/google/cloud/compute/v1/compute.rb +391 -85
  57. data/proto_docs/google/protobuf/any.rb +2 -1
  58. metadata +7 -2
@@ -0,0 +1,404 @@
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/region_zones/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Compute
26
+ module V1
27
+ module RegionZones
28
+ module Rest
29
+ ##
30
+ # REST client for the RegionZones service.
31
+ #
32
+ # The RegionZones API.
33
+ #
34
+ class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
37
+
38
+ # @private
39
+ attr_reader :region_zones_stub
40
+
41
+ ##
42
+ # Configure the RegionZones Client class.
43
+ #
44
+ # See {::Google::Cloud::Compute::V1::RegionZones::Rest::Client::Configuration}
45
+ # for a description of the configuration fields.
46
+ #
47
+ # @example
48
+ #
49
+ # # Modify the configuration for all RegionZones clients
50
+ # ::Google::Cloud::Compute::V1::RegionZones::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.list.timeout = 600.0
71
+ default_config.rpcs.list.retry_policy = {
72
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
73
+ }
74
+
75
+ default_config
76
+ end
77
+ yield @configure if block_given?
78
+ @configure
79
+ end
80
+
81
+ ##
82
+ # Configure the RegionZones Client instance.
83
+ #
84
+ # The configuration is set to the derived mode, meaning that values can be changed,
85
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
86
+ # should be made on {Client.configure}.
87
+ #
88
+ # See {::Google::Cloud::Compute::V1::RegionZones::Rest::Client::Configuration}
89
+ # for a description of the configuration fields.
90
+ #
91
+ # @yield [config] Configure the Client client.
92
+ # @yieldparam config [Client::Configuration]
93
+ #
94
+ # @return [Client::Configuration]
95
+ #
96
+ def configure
97
+ yield @config if block_given?
98
+ @config
99
+ end
100
+
101
+ ##
102
+ # The effective universe domain
103
+ #
104
+ # @return [String]
105
+ #
106
+ def universe_domain
107
+ @region_zones_stub.universe_domain
108
+ end
109
+
110
+ ##
111
+ # Create a new RegionZones REST client object.
112
+ #
113
+ # @example
114
+ #
115
+ # # Create a client using the default configuration
116
+ # client = ::Google::Cloud::Compute::V1::RegionZones::Rest::Client.new
117
+ #
118
+ # # Create a client using a custom configuration
119
+ # client = ::Google::Cloud::Compute::V1::RegionZones::Rest::Client.new do |config|
120
+ # config.timeout = 10.0
121
+ # end
122
+ #
123
+ # @yield [config] Configure the RegionZones client.
124
+ # @yieldparam config [Client::Configuration]
125
+ #
126
+ def initialize
127
+ # Create the configuration object
128
+ @config = Configuration.new Client.configure
129
+
130
+ # Yield the configuration if needed
131
+ yield @config if block_given?
132
+
133
+ # Create credentials
134
+ credentials = @config.credentials
135
+ # Use self-signed JWT if the endpoint is unchanged from default,
136
+ # but only if the default endpoint does not have a region prefix.
137
+ enable_self_signed_jwt = @config.endpoint.nil? ||
138
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
139
+ !@config.endpoint.split(".").first.include?("-"))
140
+ credentials ||= Credentials.default scope: @config.scope,
141
+ enable_self_signed_jwt: enable_self_signed_jwt
142
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
143
+ credentials = Credentials.new credentials, scope: @config.scope
144
+ end
145
+
146
+ @quota_project_id = @config.quota_project
147
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
148
+
149
+ @region_zones_stub = ::Google::Cloud::Compute::V1::RegionZones::Rest::ServiceStub.new(
150
+ endpoint: @config.endpoint,
151
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
152
+ universe_domain: @config.universe_domain,
153
+ credentials: credentials
154
+ )
155
+ end
156
+
157
+ # Service calls
158
+
159
+ ##
160
+ # Retrieves the list of Zone resources under the specific region available to the specified project.
161
+ #
162
+ # @overload list(request, options = nil)
163
+ # Pass arguments to `list` via a request object, either of type
164
+ # {::Google::Cloud::Compute::V1::ListRegionZonesRequest} or an equivalent Hash.
165
+ #
166
+ # @param request [::Google::Cloud::Compute::V1::ListRegionZonesRequest, ::Hash]
167
+ # A request object representing the call parameters. Required. To specify no
168
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
169
+ # @param options [::Gapic::CallOptions, ::Hash]
170
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
171
+ #
172
+ # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil)
173
+ # Pass arguments to `list` via keyword arguments. Note that at
174
+ # least one keyword argument is required. To specify no parameters, or to keep all
175
+ # the default parameter values, pass an empty Hash as a request object (see above).
176
+ #
177
+ # @param filter [::String]
178
+ # 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.
179
+ # @param max_results [::Integer]
180
+ # 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`)
181
+ # @param order_by [::String]
182
+ # 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.
183
+ # @param page_token [::String]
184
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
185
+ # @param project [::String]
186
+ # Project ID for this request.
187
+ # @param region [::String]
188
+ # Region for this request.
189
+ # @param return_partial_success [::Boolean]
190
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
191
+ # @yield [result, operation] Access the result along with the TransportOperation object
192
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Zone>]
193
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
194
+ #
195
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Zone>]
196
+ #
197
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
198
+ #
199
+ # @example Basic example
200
+ # require "google/cloud/compute/v1"
201
+ #
202
+ # # Create a client object. The client can be reused for multiple calls.
203
+ # client = Google::Cloud::Compute::V1::RegionZones::Rest::Client.new
204
+ #
205
+ # # Create a request. To set request fields, pass in keyword arguments.
206
+ # request = Google::Cloud::Compute::V1::ListRegionZonesRequest.new
207
+ #
208
+ # # Call the list method.
209
+ # result = client.list request
210
+ #
211
+ # # The returned object is of type Google::Cloud::Compute::V1::ZoneList.
212
+ # p result
213
+ #
214
+ def list request, options = nil
215
+ raise ::ArgumentError, "request must be provided" if request.nil?
216
+
217
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListRegionZonesRequest
218
+
219
+ # Converts hash and nil to an options object
220
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
221
+
222
+ # Customize the options with defaults
223
+ call_metadata = @config.rpcs.list.metadata.to_h
224
+
225
+ # Set x-goog-api-client and x-goog-user-project headers
226
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
227
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
228
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
229
+ transports_version_send: [:rest]
230
+
231
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
232
+
233
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
234
+ metadata: call_metadata,
235
+ retry_policy: @config.rpcs.list.retry_policy
236
+
237
+ options.apply_defaults timeout: @config.timeout,
238
+ metadata: @config.metadata,
239
+ retry_policy: @config.retry_policy
240
+
241
+ @region_zones_stub.list request, options do |result, operation|
242
+ result = ::Gapic::Rest::PagedEnumerable.new @region_zones_stub, :list, "items", request, result, options
243
+ yield result, operation if block_given?
244
+ return result
245
+ end
246
+ rescue ::Gapic::Rest::Error => e
247
+ raise ::Google::Cloud::Error.from_error(e)
248
+ end
249
+
250
+ ##
251
+ # Configuration class for the RegionZones REST API.
252
+ #
253
+ # This class represents the configuration for RegionZones REST,
254
+ # providing control over timeouts, retry behavior, logging, transport
255
+ # parameters, and other low-level controls. Certain parameters can also be
256
+ # applied individually to specific RPCs. See
257
+ # {::Google::Cloud::Compute::V1::RegionZones::Rest::Client::Configuration::Rpcs}
258
+ # for a list of RPCs that can be configured independently.
259
+ #
260
+ # Configuration can be applied globally to all clients, or to a single client
261
+ # on construction.
262
+ #
263
+ # @example
264
+ #
265
+ # # Modify the global config, setting the timeout for
266
+ # # list to 20 seconds,
267
+ # # and all remaining timeouts to 10 seconds.
268
+ # ::Google::Cloud::Compute::V1::RegionZones::Rest::Client.configure do |config|
269
+ # config.timeout = 10.0
270
+ # config.rpcs.list.timeout = 20.0
271
+ # end
272
+ #
273
+ # # Apply the above configuration only to a new client.
274
+ # client = ::Google::Cloud::Compute::V1::RegionZones::Rest::Client.new do |config|
275
+ # config.timeout = 10.0
276
+ # config.rpcs.list.timeout = 20.0
277
+ # end
278
+ #
279
+ # @!attribute [rw] endpoint
280
+ # A custom service endpoint, as a hostname or hostname:port. The default is
281
+ # nil, indicating to use the default endpoint in the current universe domain.
282
+ # @return [::String,nil]
283
+ # @!attribute [rw] credentials
284
+ # Credentials to send with calls. You may provide any of the following types:
285
+ # * (`String`) The path to a service account key file in JSON format
286
+ # * (`Hash`) A service account key as a Hash
287
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
288
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
289
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
290
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
291
+ # * (`nil`) indicating no credentials
292
+ # @return [::Object]
293
+ # @!attribute [rw] scope
294
+ # The OAuth scopes
295
+ # @return [::Array<::String>]
296
+ # @!attribute [rw] lib_name
297
+ # The library name as recorded in instrumentation and logging
298
+ # @return [::String]
299
+ # @!attribute [rw] lib_version
300
+ # The library version as recorded in instrumentation and logging
301
+ # @return [::String]
302
+ # @!attribute [rw] timeout
303
+ # The call timeout in seconds.
304
+ # @return [::Numeric]
305
+ # @!attribute [rw] metadata
306
+ # Additional headers to be sent with the call.
307
+ # @return [::Hash{::Symbol=>::String}]
308
+ # @!attribute [rw] retry_policy
309
+ # The retry policy. The value is a hash with the following keys:
310
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
311
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
312
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
313
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
314
+ # trigger a retry.
315
+ # @return [::Hash]
316
+ # @!attribute [rw] quota_project
317
+ # A separate project against which to charge quota.
318
+ # @return [::String]
319
+ # @!attribute [rw] universe_domain
320
+ # The universe domain within which to make requests. This determines the
321
+ # default endpoint URL. The default value of nil uses the environment
322
+ # universe (usually the default "googleapis.com" universe).
323
+ # @return [::String,nil]
324
+ #
325
+ class Configuration
326
+ extend ::Gapic::Config
327
+
328
+ # @private
329
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
330
+ DEFAULT_ENDPOINT = "compute.googleapis.com"
331
+
332
+ config_attr :endpoint, nil, ::String, nil
333
+ config_attr :credentials, nil do |value|
334
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
335
+ allowed.any? { |klass| klass === value }
336
+ end
337
+ config_attr :scope, nil, ::String, ::Array, nil
338
+ config_attr :lib_name, nil, ::String, nil
339
+ config_attr :lib_version, nil, ::String, nil
340
+ config_attr :timeout, nil, ::Numeric, nil
341
+ config_attr :metadata, nil, ::Hash, nil
342
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
343
+ config_attr :quota_project, nil, ::String, nil
344
+ config_attr :universe_domain, nil, ::String, nil
345
+
346
+ # @private
347
+ def initialize parent_config = nil
348
+ @parent_config = parent_config unless parent_config.nil?
349
+
350
+ yield self if block_given?
351
+ end
352
+
353
+ ##
354
+ # Configurations for individual RPCs
355
+ # @return [Rpcs]
356
+ #
357
+ def rpcs
358
+ @rpcs ||= begin
359
+ parent_rpcs = nil
360
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
361
+ Rpcs.new parent_rpcs
362
+ end
363
+ end
364
+
365
+ ##
366
+ # Configuration RPC class for the RegionZones API.
367
+ #
368
+ # Includes fields providing the configuration for each RPC in this service.
369
+ # Each configuration object is of type `Gapic::Config::Method` and includes
370
+ # the following configuration fields:
371
+ #
372
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
373
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
374
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
375
+ # include the following keys:
376
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
377
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
378
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
379
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
380
+ # trigger a retry.
381
+ #
382
+ class Rpcs
383
+ ##
384
+ # RPC-specific configuration for `list`
385
+ # @return [::Gapic::Config::Method]
386
+ #
387
+ attr_reader :list
388
+
389
+ # @private
390
+ def initialize parent_rpcs = nil
391
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
392
+ @list = ::Gapic::Config::Method.new list_config
393
+
394
+ yield self if block_given?
395
+ end
396
+ end
397
+ end
398
+ end
399
+ end
400
+ end
401
+ end
402
+ end
403
+ end
404
+ end
@@ -0,0 +1,129 @@
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/compute/v1/compute_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Compute
24
+ module V1
25
+ module RegionZones
26
+ module Rest
27
+ ##
28
+ # REST service stub for the RegionZones service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
+ # These require statements are intentionally placed here to initialize
35
+ # the REST modules only when it's required.
36
+ require "gapic/rest"
37
+
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
42
+ numeric_enums: false,
43
+ raise_faraday_errors: false
44
+ end
45
+
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
55
+ ##
56
+ # The effective endpoint
57
+ #
58
+ # @return [String]
59
+ #
60
+ def endpoint
61
+ @client_stub.endpoint
62
+ end
63
+
64
+ ##
65
+ # Baseline implementation for the list REST call
66
+ #
67
+ # @param request_pb [::Google::Cloud::Compute::V1::ListRegionZonesRequest]
68
+ # A request object representing the call parameters. Required.
69
+ # @param options [::Gapic::CallOptions]
70
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
71
+ #
72
+ # @yield [result, operation] Access the result along with the TransportOperation object
73
+ # @yieldparam result [::Google::Cloud::Compute::V1::ZoneList]
74
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
75
+ #
76
+ # @return [::Google::Cloud::Compute::V1::ZoneList]
77
+ # A result object deserialized from the server's reply
78
+ def list request_pb, options = nil
79
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
80
+
81
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_request request_pb
82
+ query_string_params = if query_string_params.any?
83
+ query_string_params.to_h { |p| p.split "=", 2 }
84
+ else
85
+ {}
86
+ end
87
+
88
+ response = @client_stub.make_http_request(
89
+ verb,
90
+ uri: uri,
91
+ body: body || "",
92
+ params: query_string_params,
93
+ options: options
94
+ )
95
+ operation = ::Gapic::Rest::TransportOperation.new response
96
+ result = ::Google::Cloud::Compute::V1::ZoneList.decode_json response.body, ignore_unknown_fields: true
97
+
98
+ yield result, operation if block_given?
99
+ result
100
+ end
101
+
102
+ ##
103
+ # @private
104
+ #
105
+ # GRPC transcoding helper method for the list REST call
106
+ #
107
+ # @param request_pb [::Google::Cloud::Compute::V1::ListRegionZonesRequest]
108
+ # A request object representing the call parameters. Required.
109
+ # @return [Array(String, [String, nil], Hash{String => String})]
110
+ # Uri, Body, Query string parameters
111
+ def self.transcode_list_request request_pb
112
+ transcoder = Gapic::Rest::GrpcTranscoder.new
113
+ .with_bindings(
114
+ uri_method: :get,
115
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/zones",
116
+ matches: [
117
+ ["project", %r{^[^/]+/?$}, false],
118
+ ["region", %r{^[^/]+/?$}, false]
119
+ ]
120
+ )
121
+ transcoder.transcode request_pb
122
+ end
123
+ end
124
+ end
125
+ end
126
+ end
127
+ end
128
+ end
129
+ end
@@ -0,0 +1,51 @@
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 "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/compute/v1/version"
24
+
25
+ require "google/cloud/compute/v1/region_zones/credentials"
26
+ require "google/cloud/compute/v1/region_zones/rest/client"
27
+
28
+ module Google
29
+ module Cloud
30
+ module Compute
31
+ module V1
32
+ ##
33
+ # The RegionZones API.
34
+ #
35
+ # To load this service and instantiate a REST client:
36
+ #
37
+ # require "google/cloud/compute/v1/region_zones/rest"
38
+ # client = ::Google::Cloud::Compute::V1::RegionZones::Rest::Client.new
39
+ #
40
+ module RegionZones
41
+ # Client for the REST transport
42
+ module Rest
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+
50
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
51
+ require "google/cloud/compute/v1/region_zones/rest/helpers" if ::File.file? helper_path
@@ -0,0 +1,47 @@
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 "gapic/config"
20
+ require "gapic/config/method"
21
+
22
+ require "google/cloud/compute/v1/version"
23
+
24
+ require "google/cloud/compute/v1/region_zones/credentials"
25
+ require "google/cloud/compute/v1/region_zones/rest"
26
+
27
+ module Google
28
+ module Cloud
29
+ module Compute
30
+ module V1
31
+ ##
32
+ # The RegionZones API.
33
+ #
34
+ # @example Load this service and instantiate a REST client
35
+ #
36
+ # require "google/cloud/compute/v1/region_zones/rest"
37
+ # client = ::Google::Cloud::Compute::V1::RegionZones::Rest::Client.new
38
+ #
39
+ module RegionZones
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+
46
+ helper_path = ::File.join __dir__, "region_zones", "helpers.rb"
47
+ require "google/cloud/compute/v1/region_zones/helpers" if ::File.file? helper_path
@@ -231,6 +231,7 @@ module Google
231
231
  # @param return_partial_success [::Boolean]
232
232
  # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
233
233
  # @param service_project_number [::Integer]
234
+ # The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.
234
235
  # @yield [result, operation] Access the result along with the TransportOperation object
235
236
  # @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::ReservationsScopedList>]
236
237
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -229,6 +229,7 @@ module Google
229
229
  # @param return_partial_success [::Boolean]
230
230
  # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
231
231
  # @param service_project_number [::Integer]
232
+ # The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.
232
233
  # @yield [result, operation] Access the result along with the TransportOperation object
233
234
  # @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::ResourcePoliciesScopedList>]
234
235
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -82,6 +82,7 @@ require "google/cloud/compute/v1/region_target_http_proxies/rest"
82
82
  require "google/cloud/compute/v1/region_target_https_proxies/rest"
83
83
  require "google/cloud/compute/v1/region_target_tcp_proxies/rest"
84
84
  require "google/cloud/compute/v1/region_url_maps/rest"
85
+ require "google/cloud/compute/v1/region_zones/rest"
85
86
  require "google/cloud/compute/v1/regions/rest"
86
87
  require "google/cloud/compute/v1/reservations/rest"
87
88
  require "google/cloud/compute/v1/resource_policies/rest"
@@ -239,6 +239,7 @@ module Google
239
239
  # @param return_partial_success [::Boolean]
240
240
  # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
241
241
  # @param service_project_number [::Integer]
242
+ # The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.
242
243
  # @yield [result, operation] Access the result along with the TransportOperation object
243
244
  # @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::RoutersScopedList>]
244
245
  # @yieldparam operation [::Gapic::Rest::TransportOperation]