google-cloud-compute-v1 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/compute_pb.rb +577 -1
  3. data/lib/google/cloud/compute/v1/disks/rest/client.rb +1 -1
  4. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +1 -1
  5. data/lib/google/cloud/compute/v1/instances/rest/client.rb +3 -1
  6. data/lib/google/cloud/compute/v1/network_edge_security_services/credentials.rb +52 -0
  7. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +679 -0
  8. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +279 -0
  9. data/lib/google/cloud/compute/v1/network_edge_security_services/rest.rb +33 -0
  10. data/lib/google/cloud/compute/v1/network_edge_security_services.rb +44 -0
  11. data/lib/google/cloud/compute/v1/network_firewall_policies/credentials.rb +52 -0
  12. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +1552 -0
  13. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +778 -0
  14. data/lib/google/cloud/compute/v1/network_firewall_policies/rest.rb +33 -0
  15. data/lib/google/cloud/compute/v1/network_firewall_policies.rb +44 -0
  16. data/lib/google/cloud/compute/v1/region_network_firewall_policies/credentials.rb +52 -0
  17. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +1670 -0
  18. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +823 -0
  19. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest.rb +33 -0
  20. data/lib/google/cloud/compute/v1/region_network_firewall_policies.rb +44 -0
  21. data/lib/google/cloud/compute/v1/region_security_policies/credentials.rb +52 -0
  22. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +676 -0
  23. data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +276 -0
  24. data/lib/google/cloud/compute/v1/region_security_policies/rest.rb +33 -0
  25. data/lib/google/cloud/compute/v1/region_security_policies.rb +44 -0
  26. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +87 -0
  27. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +46 -0
  28. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +86 -0
  29. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +50 -0
  30. data/lib/google/cloud/compute/v1/version.rb +1 -1
  31. data/lib/google/cloud/compute/v1.rb +4 -0
  32. data/proto_docs/google/cloud/compute/v1/compute.rb +1562 -65
  33. metadata +22 -2
@@ -0,0 +1,679 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/compute/v1/compute_pb"
21
+ require "google/cloud/compute/v1/network_edge_security_services/rest/service_stub"
22
+ require "google/cloud/compute/v1/region_operations/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Compute
27
+ module V1
28
+ module NetworkEdgeSecurityServices
29
+ module Rest
30
+ ##
31
+ # REST client for the NetworkEdgeSecurityServices service.
32
+ #
33
+ # The NetworkEdgeSecurityServices API.
34
+ #
35
+ class Client
36
+ # @private
37
+ attr_reader :network_edge_security_services_stub
38
+
39
+ ##
40
+ # Configure the NetworkEdgeSecurityServices Client class.
41
+ #
42
+ # See {::Google::Cloud::Compute::V1::NetworkEdgeSecurityServices::Rest::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # @example
46
+ #
47
+ # # Modify the configuration for all NetworkEdgeSecurityServices clients
48
+ # ::Google::Cloud::Compute::V1::NetworkEdgeSecurityServices::Rest::Client.configure do |config|
49
+ # config.timeout = 10.0
50
+ # end
51
+ #
52
+ # @yield [config] Configure the Client client.
53
+ # @yieldparam config [Client::Configuration]
54
+ #
55
+ # @return [Client::Configuration]
56
+ #
57
+ def self.configure
58
+ @configure ||= begin
59
+ namespace = ["Google", "Cloud", "Compute", "V1"]
60
+ parent_config = while namespace.any?
61
+ parent_name = namespace.join "::"
62
+ parent_const = const_get parent_name
63
+ break parent_const.configure if parent_const.respond_to? :configure
64
+ namespace.pop
65
+ end
66
+ default_config = Client::Configuration.new parent_config
67
+
68
+ default_config.rpcs.aggregated_list.timeout = 600.0
69
+ default_config.rpcs.aggregated_list.retry_policy = {
70
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
71
+ }
72
+
73
+ default_config.rpcs.delete.timeout = 600.0
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.insert.timeout = 600.0
81
+
82
+ default_config.rpcs.patch.timeout = 600.0
83
+
84
+ default_config
85
+ end
86
+ yield @configure if block_given?
87
+ @configure
88
+ end
89
+
90
+ ##
91
+ # Configure the NetworkEdgeSecurityServices Client instance.
92
+ #
93
+ # The configuration is set to the derived mode, meaning that values can be changed,
94
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
95
+ # should be made on {Client.configure}.
96
+ #
97
+ # See {::Google::Cloud::Compute::V1::NetworkEdgeSecurityServices::Rest::Client::Configuration}
98
+ # for a description of the configuration fields.
99
+ #
100
+ # @yield [config] Configure the Client client.
101
+ # @yieldparam config [Client::Configuration]
102
+ #
103
+ # @return [Client::Configuration]
104
+ #
105
+ def configure
106
+ yield @config if block_given?
107
+ @config
108
+ end
109
+
110
+ ##
111
+ # Create a new NetworkEdgeSecurityServices REST client object.
112
+ #
113
+ # @example
114
+ #
115
+ # # Create a client using the default configuration
116
+ # client = ::Google::Cloud::Compute::V1::NetworkEdgeSecurityServices::Rest::Client.new
117
+ #
118
+ # # Create a client using a custom configuration
119
+ # client = ::Google::Cloud::Compute::V1::NetworkEdgeSecurityServices::Rest::Client.new do |config|
120
+ # config.timeout = 10.0
121
+ # end
122
+ #
123
+ # @yield [config] Configure the NetworkEdgeSecurityServices 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
+ credentials ||= Credentials.default scope: @config.scope
136
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
137
+ credentials = Credentials.new credentials, scope: @config.scope
138
+ end
139
+
140
+ @region_operations = ::Google::Cloud::Compute::V1::RegionOperations::Rest::Client.new do |config|
141
+ config.credentials = credentials
142
+ config.endpoint = @config.endpoint
143
+ end
144
+
145
+ @network_edge_security_services_stub = ::Google::Cloud::Compute::V1::NetworkEdgeSecurityServices::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
146
+ end
147
+
148
+ ##
149
+ # Get the associated client for long-running operations via RegionOperations.
150
+ #
151
+ # @return [::Google::Cloud::Compute::V1::RegionOperations::Rest::Client]
152
+ #
153
+ attr_reader :region_operations
154
+
155
+ # Service calls
156
+
157
+ ##
158
+ # Retrieves the list of all NetworkEdgeSecurityService resources available to the specified project.
159
+ #
160
+ # @overload aggregated_list(request, options = nil)
161
+ # Pass arguments to `aggregated_list` via a request object, either of type
162
+ # {::Google::Cloud::Compute::V1::AggregatedListNetworkEdgeSecurityServicesRequest} or an equivalent Hash.
163
+ #
164
+ # @param request [::Google::Cloud::Compute::V1::AggregatedListNetworkEdgeSecurityServicesRequest, ::Hash]
165
+ # A request object representing the call parameters. Required. To specify no
166
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
167
+ # @param options [::Gapic::CallOptions, ::Hash]
168
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
169
+ # Note: currently retry functionality is not implemented. While it is possible
170
+ # to set it using ::Gapic::CallOptions, it will not be applied
171
+ #
172
+ # @overload aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
173
+ # Pass arguments to `aggregated_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. The expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
179
+ # @param include_all_scopes [::Boolean]
180
+ # 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.
181
+ # @param max_results [::Integer]
182
+ # 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`)
183
+ # @param order_by [::String]
184
+ # 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.
185
+ # @param page_token [::String]
186
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
187
+ # @param project [::String]
188
+ # Name of the project scoping 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, response] Access the result along with the Faraday response object
192
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::NetworkEdgeSecurityServicesScopedList>]
193
+ # @yieldparam response [::Faraday::Response]
194
+ #
195
+ # @return [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::NetworkEdgeSecurityServicesScopedList>]
196
+ #
197
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
198
+ def aggregated_list request, options = nil
199
+ raise ::ArgumentError, "request must be provided" if request.nil?
200
+
201
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AggregatedListNetworkEdgeSecurityServicesRequest
202
+
203
+ # Converts hash and nil to an options object
204
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
205
+
206
+ # Customize the options with defaults
207
+ call_metadata = @config.rpcs.aggregated_list.metadata.to_h
208
+
209
+ # Set x-goog-api-client header
210
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
211
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
212
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
213
+ transports_version_send: [:rest]
214
+
215
+ options.apply_defaults timeout: @config.rpcs.aggregated_list.timeout,
216
+ metadata: call_metadata
217
+
218
+ options.apply_defaults timeout: @config.timeout,
219
+ metadata: @config.metadata
220
+
221
+ @network_edge_security_services_stub.aggregated_list request, options do |result, response|
222
+ result = ::Gapic::Rest::PagedEnumerable.new @network_edge_security_services_stub, :aggregated_list, "items", request, result, options
223
+ yield result, response if block_given?
224
+ return result
225
+ end
226
+ rescue ::Faraday::Error => e
227
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
228
+ raise ::Google::Cloud::Error.from_error(gapic_error)
229
+ end
230
+
231
+ ##
232
+ # Deletes the specified service.
233
+ #
234
+ # @overload delete(request, options = nil)
235
+ # Pass arguments to `delete` via a request object, either of type
236
+ # {::Google::Cloud::Compute::V1::DeleteNetworkEdgeSecurityServiceRequest} or an equivalent Hash.
237
+ #
238
+ # @param request [::Google::Cloud::Compute::V1::DeleteNetworkEdgeSecurityServiceRequest, ::Hash]
239
+ # A request object representing the call parameters. Required. To specify no
240
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
241
+ # @param options [::Gapic::CallOptions, ::Hash]
242
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
243
+ # Note: currently retry functionality is not implemented. While it is possible
244
+ # to set it using ::Gapic::CallOptions, it will not be applied
245
+ #
246
+ # @overload delete(network_edge_security_service: nil, project: nil, region: nil, request_id: nil)
247
+ # Pass arguments to `delete` via keyword arguments. Note that at
248
+ # least one keyword argument is required. To specify no parameters, or to keep all
249
+ # the default parameter values, pass an empty Hash as a request object (see above).
250
+ #
251
+ # @param network_edge_security_service [::String]
252
+ # Name of the network edge security service to delete.
253
+ # @param project [::String]
254
+ # Project ID for this request.
255
+ # @param region [::String]
256
+ # Name of the region scoping this request.
257
+ # @param request_id [::String]
258
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
259
+ # @yield [result, response] Access the result along with the Faraday response object
260
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
261
+ # @yieldparam response [::Faraday::Response]
262
+ #
263
+ # @return [::Gapic::GenericLRO::Operation]
264
+ #
265
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
266
+ def delete request, options = nil
267
+ raise ::ArgumentError, "request must be provided" if request.nil?
268
+
269
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteNetworkEdgeSecurityServiceRequest
270
+
271
+ # Converts hash and nil to an options object
272
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
273
+
274
+ # Customize the options with defaults
275
+ call_metadata = @config.rpcs.delete.metadata.to_h
276
+
277
+ # Set x-goog-api-client header
278
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
279
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
280
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
281
+ transports_version_send: [:rest]
282
+
283
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
284
+ metadata: call_metadata
285
+
286
+ options.apply_defaults timeout: @config.timeout,
287
+ metadata: @config.metadata
288
+
289
+ @network_edge_security_services_stub.delete request, options do |result, response|
290
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
291
+ operation: result,
292
+ client: region_operations,
293
+ request_values: {
294
+ "project" => request.project,
295
+ "region" => request.region
296
+ },
297
+ options: options
298
+ )
299
+ yield result, response if block_given?
300
+ return result
301
+ end
302
+ rescue ::Faraday::Error => e
303
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
304
+ raise ::Google::Cloud::Error.from_error(gapic_error)
305
+ end
306
+
307
+ ##
308
+ # Gets a specified NetworkEdgeSecurityService.
309
+ #
310
+ # @overload get(request, options = nil)
311
+ # Pass arguments to `get` via a request object, either of type
312
+ # {::Google::Cloud::Compute::V1::GetNetworkEdgeSecurityServiceRequest} or an equivalent Hash.
313
+ #
314
+ # @param request [::Google::Cloud::Compute::V1::GetNetworkEdgeSecurityServiceRequest, ::Hash]
315
+ # A request object representing the call parameters. Required. To specify no
316
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
317
+ # @param options [::Gapic::CallOptions, ::Hash]
318
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
319
+ # Note: currently retry functionality is not implemented. While it is possible
320
+ # to set it using ::Gapic::CallOptions, it will not be applied
321
+ #
322
+ # @overload get(network_edge_security_service: nil, project: nil, region: nil)
323
+ # Pass arguments to `get` via keyword arguments. Note that at
324
+ # least one keyword argument is required. To specify no parameters, or to keep all
325
+ # the default parameter values, pass an empty Hash as a request object (see above).
326
+ #
327
+ # @param network_edge_security_service [::String]
328
+ # Name of the network edge security service to get.
329
+ # @param project [::String]
330
+ # Project ID for this request.
331
+ # @param region [::String]
332
+ # Name of the region scoping this request.
333
+ # @yield [result, response] Access the result along with the Faraday response object
334
+ # @yieldparam result [::Google::Cloud::Compute::V1::NetworkEdgeSecurityService]
335
+ # @yieldparam response [::Faraday::Response]
336
+ #
337
+ # @return [::Google::Cloud::Compute::V1::NetworkEdgeSecurityService]
338
+ #
339
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
340
+ def get request, options = nil
341
+ raise ::ArgumentError, "request must be provided" if request.nil?
342
+
343
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetNetworkEdgeSecurityServiceRequest
344
+
345
+ # Converts hash and nil to an options object
346
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
347
+
348
+ # Customize the options with defaults
349
+ call_metadata = @config.rpcs.get.metadata.to_h
350
+
351
+ # Set x-goog-api-client header
352
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
353
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
354
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
355
+ transports_version_send: [:rest]
356
+
357
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
358
+ metadata: call_metadata
359
+
360
+ options.apply_defaults timeout: @config.timeout,
361
+ metadata: @config.metadata
362
+
363
+ @network_edge_security_services_stub.get request, options do |result, response|
364
+ yield result, response if block_given?
365
+ return result
366
+ end
367
+ rescue ::Faraday::Error => e
368
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
369
+ raise ::Google::Cloud::Error.from_error(gapic_error)
370
+ end
371
+
372
+ ##
373
+ # Creates a new service in the specified project using the data included in the request.
374
+ #
375
+ # @overload insert(request, options = nil)
376
+ # Pass arguments to `insert` via a request object, either of type
377
+ # {::Google::Cloud::Compute::V1::InsertNetworkEdgeSecurityServiceRequest} or an equivalent Hash.
378
+ #
379
+ # @param request [::Google::Cloud::Compute::V1::InsertNetworkEdgeSecurityServiceRequest, ::Hash]
380
+ # A request object representing the call parameters. Required. To specify no
381
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
382
+ # @param options [::Gapic::CallOptions, ::Hash]
383
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
384
+ # Note: currently retry functionality is not implemented. While it is possible
385
+ # to set it using ::Gapic::CallOptions, it will not be applied
386
+ #
387
+ # @overload insert(network_edge_security_service_resource: nil, project: nil, region: nil, request_id: nil, validate_only: nil)
388
+ # Pass arguments to `insert` via keyword arguments. Note that at
389
+ # least one keyword argument is required. To specify no parameters, or to keep all
390
+ # the default parameter values, pass an empty Hash as a request object (see above).
391
+ #
392
+ # @param network_edge_security_service_resource [::Google::Cloud::Compute::V1::NetworkEdgeSecurityService, ::Hash]
393
+ # The body resource for this request
394
+ # @param project [::String]
395
+ # Project ID for this request.
396
+ # @param region [::String]
397
+ # Name of the region scoping this request.
398
+ # @param request_id [::String]
399
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
400
+ # @param validate_only [::Boolean]
401
+ # If true, the request will not be committed.
402
+ # @yield [result, response] Access the result along with the Faraday response object
403
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
404
+ # @yieldparam response [::Faraday::Response]
405
+ #
406
+ # @return [::Gapic::GenericLRO::Operation]
407
+ #
408
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
409
+ def insert request, options = nil
410
+ raise ::ArgumentError, "request must be provided" if request.nil?
411
+
412
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::InsertNetworkEdgeSecurityServiceRequest
413
+
414
+ # Converts hash and nil to an options object
415
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
416
+
417
+ # Customize the options with defaults
418
+ call_metadata = @config.rpcs.insert.metadata.to_h
419
+
420
+ # Set x-goog-api-client header
421
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
422
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
423
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
424
+ transports_version_send: [:rest]
425
+
426
+ options.apply_defaults timeout: @config.rpcs.insert.timeout,
427
+ metadata: call_metadata
428
+
429
+ options.apply_defaults timeout: @config.timeout,
430
+ metadata: @config.metadata
431
+
432
+ @network_edge_security_services_stub.insert request, options do |result, response|
433
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
434
+ operation: result,
435
+ client: region_operations,
436
+ request_values: {
437
+ "project" => request.project,
438
+ "region" => request.region
439
+ },
440
+ options: options
441
+ )
442
+ yield result, response if block_given?
443
+ return result
444
+ end
445
+ rescue ::Faraday::Error => e
446
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
447
+ raise ::Google::Cloud::Error.from_error(gapic_error)
448
+ end
449
+
450
+ ##
451
+ # Patches the specified policy with the data included in the request.
452
+ #
453
+ # @overload patch(request, options = nil)
454
+ # Pass arguments to `patch` via a request object, either of type
455
+ # {::Google::Cloud::Compute::V1::PatchNetworkEdgeSecurityServiceRequest} or an equivalent Hash.
456
+ #
457
+ # @param request [::Google::Cloud::Compute::V1::PatchNetworkEdgeSecurityServiceRequest, ::Hash]
458
+ # A request object representing the call parameters. Required. To specify no
459
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
460
+ # @param options [::Gapic::CallOptions, ::Hash]
461
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
462
+ # Note: currently retry functionality is not implemented. While it is possible
463
+ # to set it using ::Gapic::CallOptions, it will not be applied
464
+ #
465
+ # @overload patch(network_edge_security_service: nil, network_edge_security_service_resource: nil, paths: nil, project: nil, region: nil, request_id: nil, update_mask: nil)
466
+ # Pass arguments to `patch` via keyword arguments. Note that at
467
+ # least one keyword argument is required. To specify no parameters, or to keep all
468
+ # the default parameter values, pass an empty Hash as a request object (see above).
469
+ #
470
+ # @param network_edge_security_service [::String]
471
+ # Name of the network edge security service to update.
472
+ # @param network_edge_security_service_resource [::Google::Cloud::Compute::V1::NetworkEdgeSecurityService, ::Hash]
473
+ # The body resource for this request
474
+ # @param paths [::String]
475
+ # @param project [::String]
476
+ # Project ID for this request.
477
+ # @param region [::String]
478
+ # Name of the region scoping this request.
479
+ # @param request_id [::String]
480
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
481
+ # @param update_mask [::String]
482
+ # Indicates fields to be updated as part of this request.
483
+ # @yield [result, response] Access the result along with the Faraday response object
484
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
485
+ # @yieldparam response [::Faraday::Response]
486
+ #
487
+ # @return [::Gapic::GenericLRO::Operation]
488
+ #
489
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
490
+ def patch request, options = nil
491
+ raise ::ArgumentError, "request must be provided" if request.nil?
492
+
493
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchNetworkEdgeSecurityServiceRequest
494
+
495
+ # Converts hash and nil to an options object
496
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
497
+
498
+ # Customize the options with defaults
499
+ call_metadata = @config.rpcs.patch.metadata.to_h
500
+
501
+ # Set x-goog-api-client header
502
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
503
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
504
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
505
+ transports_version_send: [:rest]
506
+
507
+ options.apply_defaults timeout: @config.rpcs.patch.timeout,
508
+ metadata: call_metadata
509
+
510
+ options.apply_defaults timeout: @config.timeout,
511
+ metadata: @config.metadata
512
+
513
+ @network_edge_security_services_stub.patch request, options do |result, response|
514
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
515
+ operation: result,
516
+ client: region_operations,
517
+ request_values: {
518
+ "project" => request.project,
519
+ "region" => request.region
520
+ },
521
+ options: options
522
+ )
523
+ yield result, response if block_given?
524
+ return result
525
+ end
526
+ rescue ::Faraday::Error => e
527
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
528
+ raise ::Google::Cloud::Error.from_error(gapic_error)
529
+ end
530
+
531
+ ##
532
+ # Configuration class for the NetworkEdgeSecurityServices REST API.
533
+ #
534
+ # This class represents the configuration for NetworkEdgeSecurityServices REST,
535
+ # providing control over credentials, timeouts, retry behavior, logging.
536
+ #
537
+ # Configuration can be applied globally to all clients, or to a single client
538
+ # on construction.
539
+ #
540
+ # # Examples
541
+ #
542
+ # To modify the global config, setting the timeout for all calls to 10 seconds:
543
+ #
544
+ # ::Google::Cloud::Compute::V1::NetworkEdgeSecurityServices::Client.configure do |config|
545
+ # config.timeout = 10.0
546
+ # end
547
+ #
548
+ # To apply the above configuration only to a new client:
549
+ #
550
+ # client = ::Google::Cloud::Compute::V1::NetworkEdgeSecurityServices::Client.new do |config|
551
+ # config.timeout = 10.0
552
+ # end
553
+ #
554
+ # @!attribute [rw] endpoint
555
+ # The hostname or hostname:port of the service endpoint.
556
+ # Defaults to `"compute.googleapis.com"`.
557
+ # @return [::String]
558
+ # @!attribute [rw] credentials
559
+ # Credentials to send with calls. You may provide any of the following types:
560
+ # * (`String`) The path to a service account key file in JSON format
561
+ # * (`Hash`) A service account key as a Hash
562
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
563
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
564
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
565
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
566
+ # * (`nil`) indicating no credentials
567
+ # @return [::Object]
568
+ # @!attribute [rw] scope
569
+ # The OAuth scopes
570
+ # @return [::Array<::String>]
571
+ # @!attribute [rw] lib_name
572
+ # The library name as recorded in instrumentation and logging
573
+ # @return [::String]
574
+ # @!attribute [rw] lib_version
575
+ # The library version as recorded in instrumentation and logging
576
+ # @return [::String]
577
+ # @!attribute [rw] timeout
578
+ # The call timeout in seconds.
579
+ # @return [::Numeric]
580
+ # @!attribute [rw] metadata
581
+ # Additional REST headers to be sent with the call.
582
+ # @return [::Hash{::Symbol=>::String}]
583
+ #
584
+ class Configuration
585
+ extend ::Gapic::Config
586
+
587
+ config_attr :endpoint, "compute.googleapis.com", ::String
588
+ config_attr :credentials, nil do |value|
589
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
590
+ allowed.any? { |klass| klass === value }
591
+ end
592
+ config_attr :scope, nil, ::String, ::Array, nil
593
+ config_attr :lib_name, nil, ::String, nil
594
+ config_attr :lib_version, nil, ::String, nil
595
+ config_attr :timeout, nil, ::Numeric, nil
596
+ config_attr :metadata, nil, ::Hash, nil
597
+
598
+ # @private
599
+ def initialize parent_config = nil
600
+ @parent_config = parent_config unless parent_config.nil?
601
+
602
+ yield self if block_given?
603
+ end
604
+
605
+ ##
606
+ # Configurations for individual RPCs
607
+ # @return [Rpcs]
608
+ #
609
+ def rpcs
610
+ @rpcs ||= begin
611
+ parent_rpcs = nil
612
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
613
+ Rpcs.new parent_rpcs
614
+ end
615
+ end
616
+
617
+ ##
618
+ # Configuration RPC class for the NetworkEdgeSecurityServices API.
619
+ #
620
+ # Includes fields providing the configuration for each RPC in this service.
621
+ # Each configuration object is of type `Gapic::Config::Method` and includes
622
+ # the following configuration fields:
623
+ #
624
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
625
+ #
626
+ # there is one other field (`retry_policy`) that can be set
627
+ # but is currently not supported for REST Gapic libraries.
628
+ #
629
+ class Rpcs
630
+ ##
631
+ # RPC-specific configuration for `aggregated_list`
632
+ # @return [::Gapic::Config::Method]
633
+ #
634
+ attr_reader :aggregated_list
635
+ ##
636
+ # RPC-specific configuration for `delete`
637
+ # @return [::Gapic::Config::Method]
638
+ #
639
+ attr_reader :delete
640
+ ##
641
+ # RPC-specific configuration for `get`
642
+ # @return [::Gapic::Config::Method]
643
+ #
644
+ attr_reader :get
645
+ ##
646
+ # RPC-specific configuration for `insert`
647
+ # @return [::Gapic::Config::Method]
648
+ #
649
+ attr_reader :insert
650
+ ##
651
+ # RPC-specific configuration for `patch`
652
+ # @return [::Gapic::Config::Method]
653
+ #
654
+ attr_reader :patch
655
+
656
+ # @private
657
+ def initialize parent_rpcs = nil
658
+ aggregated_list_config = parent_rpcs.aggregated_list if parent_rpcs.respond_to? :aggregated_list
659
+ @aggregated_list = ::Gapic::Config::Method.new aggregated_list_config
660
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
661
+ @delete = ::Gapic::Config::Method.new delete_config
662
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
663
+ @get = ::Gapic::Config::Method.new get_config
664
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
665
+ @insert = ::Gapic::Config::Method.new insert_config
666
+ patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
667
+ @patch = ::Gapic::Config::Method.new patch_config
668
+
669
+ yield self if block_given?
670
+ end
671
+ end
672
+ end
673
+ end
674
+ end
675
+ end
676
+ end
677
+ end
678
+ end
679
+ end