google-cloud-compute-v1 2.10.0 → 2.12.0

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