google-cloud-edge_network-v1 0.a → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +149 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/edge_network/v1/bindings_override.rb +102 -0
  6. data/lib/google/cloud/edge_network/v1/edge_network/client.rb +3153 -0
  7. data/lib/google/cloud/edge_network/v1/edge_network/credentials.rb +47 -0
  8. data/lib/google/cloud/edge_network/v1/edge_network/operations.rb +779 -0
  9. data/lib/google/cloud/edge_network/v1/edge_network/paths.rb +174 -0
  10. data/lib/google/cloud/edge_network/v1/edge_network/rest/client.rb +2944 -0
  11. data/lib/google/cloud/edge_network/v1/edge_network/rest/operations.rb +870 -0
  12. data/lib/google/cloud/edge_network/v1/edge_network/rest/service_stub.rb +1589 -0
  13. data/lib/google/cloud/edge_network/v1/edge_network/rest.rb +57 -0
  14. data/lib/google/cloud/edge_network/v1/edge_network.rb +59 -0
  15. data/lib/google/cloud/edge_network/v1/rest.rb +38 -0
  16. data/lib/google/cloud/edge_network/v1/version.rb +7 -2
  17. data/lib/google/cloud/edge_network/v1.rb +45 -0
  18. data/lib/google/cloud/edgenetwork/v1/resources_pb.rb +69 -0
  19. data/lib/google/cloud/edgenetwork/v1/service_pb.rb +92 -0
  20. data/lib/google/cloud/edgenetwork/v1/service_services_pb.rb +98 -0
  21. data/lib/google-cloud-edge_network-v1.rb +21 -0
  22. data/proto_docs/README.md +4 -0
  23. data/proto_docs/google/api/client.rb +394 -0
  24. data/proto_docs/google/api/field_behavior.rb +85 -0
  25. data/proto_docs/google/api/launch_stage.rb +71 -0
  26. data/proto_docs/google/api/resource.rb +222 -0
  27. data/proto_docs/google/cloud/edgenetwork/v1/resources.rb +637 -0
  28. data/proto_docs/google/cloud/edgenetwork/v1/service.rb +709 -0
  29. data/proto_docs/google/longrunning/operations.rb +164 -0
  30. data/proto_docs/google/protobuf/any.rb +144 -0
  31. data/proto_docs/google/protobuf/duration.rb +98 -0
  32. data/proto_docs/google/protobuf/empty.rb +34 -0
  33. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  34. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  35. data/proto_docs/google/rpc/status.rb +48 -0
  36. metadata +209 -13
@@ -0,0 +1,3153 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/edgenetwork/v1/service_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module EdgeNetwork
26
+ module V1
27
+ module EdgeNetwork
28
+ ##
29
+ # Client for the EdgeNetwork service.
30
+ #
31
+ # EdgeNetwork API provides managed, highly available cloud dynamic network
32
+ # configuration service to the GEC customer to enable edge application and
33
+ # network function solutions. This allows the customers to easily define and
34
+ # configure the network setup and property to meet the workload requirement.
35
+ #
36
+ class Client
37
+ include Paths
38
+
39
+ # @private
40
+ attr_reader :edge_network_stub
41
+
42
+ ##
43
+ # Configure the EdgeNetwork Client class.
44
+ #
45
+ # See {::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all EdgeNetwork clients
51
+ # ::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
54
+ #
55
+ # @yield [config] Configure the Client client.
56
+ # @yieldparam config [Client::Configuration]
57
+ #
58
+ # @return [Client::Configuration]
59
+ #
60
+ def self.configure
61
+ @configure ||= begin
62
+ namespace = ["Google", "Cloud", "EdgeNetwork", "V1"]
63
+ parent_config = while namespace.any?
64
+ parent_name = namespace.join "::"
65
+ parent_const = const_get parent_name
66
+ break parent_const.configure if parent_const.respond_to? :configure
67
+ namespace.pop
68
+ end
69
+ default_config = Client::Configuration.new parent_config
70
+
71
+ default_config.rpcs.initialize_zone.timeout = 60.0
72
+
73
+ default_config.rpcs.list_networks.timeout = 60.0
74
+ default_config.rpcs.list_networks.retry_policy = {
75
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
76
+ }
77
+
78
+ default_config.rpcs.get_network.timeout = 60.0
79
+ default_config.rpcs.get_network.retry_policy = {
80
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
81
+ }
82
+
83
+ default_config.rpcs.diagnose_network.timeout = 60.0
84
+ default_config.rpcs.diagnose_network.retry_policy = {
85
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
86
+ }
87
+
88
+ default_config.rpcs.create_network.timeout = 60.0
89
+
90
+ default_config.rpcs.delete_network.timeout = 60.0
91
+
92
+ default_config.rpcs.list_subnets.timeout = 60.0
93
+ default_config.rpcs.list_subnets.retry_policy = {
94
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
95
+ }
96
+
97
+ default_config.rpcs.get_subnet.timeout = 60.0
98
+ default_config.rpcs.get_subnet.retry_policy = {
99
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
100
+ }
101
+
102
+ default_config.rpcs.create_subnet.timeout = 60.0
103
+
104
+ default_config.rpcs.delete_subnet.timeout = 60.0
105
+
106
+ default_config.rpcs.list_interconnects.timeout = 60.0
107
+ default_config.rpcs.list_interconnects.retry_policy = {
108
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
109
+ }
110
+
111
+ default_config.rpcs.get_interconnect.timeout = 60.0
112
+ default_config.rpcs.get_interconnect.retry_policy = {
113
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
114
+ }
115
+
116
+ default_config.rpcs.diagnose_interconnect.timeout = 60.0
117
+ default_config.rpcs.diagnose_interconnect.retry_policy = {
118
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
119
+ }
120
+
121
+ default_config.rpcs.list_interconnect_attachments.timeout = 60.0
122
+ default_config.rpcs.list_interconnect_attachments.retry_policy = {
123
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
124
+ }
125
+
126
+ default_config.rpcs.get_interconnect_attachment.timeout = 60.0
127
+ default_config.rpcs.get_interconnect_attachment.retry_policy = {
128
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
129
+ }
130
+
131
+ default_config.rpcs.create_interconnect_attachment.timeout = 60.0
132
+
133
+ default_config.rpcs.delete_interconnect_attachment.timeout = 60.0
134
+
135
+ default_config.rpcs.list_routers.timeout = 60.0
136
+ default_config.rpcs.list_routers.retry_policy = {
137
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
138
+ }
139
+
140
+ default_config.rpcs.get_router.timeout = 60.0
141
+ default_config.rpcs.get_router.retry_policy = {
142
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
143
+ }
144
+
145
+ default_config.rpcs.diagnose_router.timeout = 60.0
146
+ default_config.rpcs.diagnose_router.retry_policy = {
147
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
148
+ }
149
+
150
+ default_config.rpcs.create_router.timeout = 60.0
151
+
152
+ default_config.rpcs.update_router.timeout = 60.0
153
+
154
+ default_config.rpcs.delete_router.timeout = 60.0
155
+
156
+ default_config
157
+ end
158
+ yield @configure if block_given?
159
+ @configure
160
+ end
161
+
162
+ ##
163
+ # Configure the EdgeNetwork Client instance.
164
+ #
165
+ # The configuration is set to the derived mode, meaning that values can be changed,
166
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
167
+ # should be made on {Client.configure}.
168
+ #
169
+ # See {::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client::Configuration}
170
+ # for a description of the configuration fields.
171
+ #
172
+ # @yield [config] Configure the Client client.
173
+ # @yieldparam config [Client::Configuration]
174
+ #
175
+ # @return [Client::Configuration]
176
+ #
177
+ def configure
178
+ yield @config if block_given?
179
+ @config
180
+ end
181
+
182
+ ##
183
+ # Create a new EdgeNetwork client object.
184
+ #
185
+ # @example
186
+ #
187
+ # # Create a client using the default configuration
188
+ # client = ::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
189
+ #
190
+ # # Create a client using a custom configuration
191
+ # client = ::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new do |config|
192
+ # config.timeout = 10.0
193
+ # end
194
+ #
195
+ # @yield [config] Configure the EdgeNetwork client.
196
+ # @yieldparam config [Client::Configuration]
197
+ #
198
+ def initialize
199
+ # These require statements are intentionally placed here to initialize
200
+ # the gRPC module only when it's required.
201
+ # See https://github.com/googleapis/toolkit/issues/446
202
+ require "gapic/grpc"
203
+ require "google/cloud/edgenetwork/v1/service_services_pb"
204
+
205
+ # Create the configuration object
206
+ @config = Configuration.new Client.configure
207
+
208
+ # Yield the configuration if needed
209
+ yield @config if block_given?
210
+
211
+ # Create credentials
212
+ credentials = @config.credentials
213
+ # Use self-signed JWT if the endpoint is unchanged from default,
214
+ # but only if the default endpoint does not have a region prefix.
215
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
216
+ !@config.endpoint.split(".").first.include?("-")
217
+ credentials ||= Credentials.default scope: @config.scope,
218
+ enable_self_signed_jwt: enable_self_signed_jwt
219
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
220
+ credentials = Credentials.new credentials, scope: @config.scope
221
+ end
222
+ @quota_project_id = @config.quota_project
223
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
224
+
225
+ @operations_client = Operations.new do |config|
226
+ config.credentials = credentials
227
+ config.quota_project = @quota_project_id
228
+ config.endpoint = @config.endpoint
229
+ end
230
+
231
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
232
+ config.credentials = credentials
233
+ config.quota_project = @quota_project_id
234
+ config.endpoint = @config.endpoint
235
+ end
236
+
237
+ @edge_network_stub = ::Gapic::ServiceStub.new(
238
+ ::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Stub,
239
+ credentials: credentials,
240
+ endpoint: @config.endpoint,
241
+ channel_args: @config.channel_args,
242
+ interceptors: @config.interceptors,
243
+ channel_pool_config: @config.channel_pool
244
+ )
245
+ end
246
+
247
+ ##
248
+ # Get the associated client for long-running operations.
249
+ #
250
+ # @return [::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Operations]
251
+ #
252
+ attr_reader :operations_client
253
+
254
+ ##
255
+ # Get the associated client for mix-in of the Locations.
256
+ #
257
+ # @return [Google::Cloud::Location::Locations::Client]
258
+ #
259
+ attr_reader :location_client
260
+
261
+ # Service calls
262
+
263
+ ##
264
+ # InitializeZone will initialize resources for a zone in a project.
265
+ #
266
+ # @overload initialize_zone(request, options = nil)
267
+ # Pass arguments to `initialize_zone` via a request object, either of type
268
+ # {::Google::Cloud::EdgeNetwork::V1::InitializeZoneRequest} or an equivalent Hash.
269
+ #
270
+ # @param request [::Google::Cloud::EdgeNetwork::V1::InitializeZoneRequest, ::Hash]
271
+ # A request object representing the call parameters. Required. To specify no
272
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
273
+ # @param options [::Gapic::CallOptions, ::Hash]
274
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
275
+ #
276
+ # @overload initialize_zone(name: nil)
277
+ # Pass arguments to `initialize_zone` via keyword arguments. Note that at
278
+ # least one keyword argument is required. To specify no parameters, or to keep all
279
+ # the default parameter values, pass an empty Hash as a request object (see above).
280
+ #
281
+ # @param name [::String]
282
+ # Required. The name of the zone resource.
283
+ #
284
+ # @yield [response, operation] Access the result along with the RPC operation
285
+ # @yieldparam response [::Google::Cloud::EdgeNetwork::V1::InitializeZoneResponse]
286
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
287
+ #
288
+ # @return [::Google::Cloud::EdgeNetwork::V1::InitializeZoneResponse]
289
+ #
290
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
291
+ #
292
+ # @example Basic example
293
+ # require "google/cloud/edge_network/v1"
294
+ #
295
+ # # Create a client object. The client can be reused for multiple calls.
296
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
297
+ #
298
+ # # Create a request. To set request fields, pass in keyword arguments.
299
+ # request = Google::Cloud::EdgeNetwork::V1::InitializeZoneRequest.new
300
+ #
301
+ # # Call the initialize_zone method.
302
+ # result = client.initialize_zone request
303
+ #
304
+ # # The returned object is of type Google::Cloud::EdgeNetwork::V1::InitializeZoneResponse.
305
+ # p result
306
+ #
307
+ def initialize_zone request, options = nil
308
+ raise ::ArgumentError, "request must be provided" if request.nil?
309
+
310
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::InitializeZoneRequest
311
+
312
+ # Converts hash and nil to an options object
313
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
314
+
315
+ # Customize the options with defaults
316
+ metadata = @config.rpcs.initialize_zone.metadata.to_h
317
+
318
+ # Set x-goog-api-client and x-goog-user-project headers
319
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
320
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
321
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
322
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
323
+
324
+ header_params = {}
325
+ if request.name
326
+ header_params["name"] = request.name
327
+ end
328
+
329
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
330
+ metadata[:"x-goog-request-params"] ||= request_params_header
331
+
332
+ options.apply_defaults timeout: @config.rpcs.initialize_zone.timeout,
333
+ metadata: metadata,
334
+ retry_policy: @config.rpcs.initialize_zone.retry_policy
335
+
336
+ options.apply_defaults timeout: @config.timeout,
337
+ metadata: @config.metadata,
338
+ retry_policy: @config.retry_policy
339
+
340
+ @edge_network_stub.call_rpc :initialize_zone, request, options: options do |response, operation|
341
+ yield response, operation if block_given?
342
+ return response
343
+ end
344
+ rescue ::GRPC::BadStatus => e
345
+ raise ::Google::Cloud::Error.from_error(e)
346
+ end
347
+
348
+ ##
349
+ # Lists Zones in a given project and location.
350
+ #
351
+ # @overload list_zones(request, options = nil)
352
+ # Pass arguments to `list_zones` via a request object, either of type
353
+ # {::Google::Cloud::EdgeNetwork::V1::ListZonesRequest} or an equivalent Hash.
354
+ #
355
+ # @param request [::Google::Cloud::EdgeNetwork::V1::ListZonesRequest, ::Hash]
356
+ # A request object representing the call parameters. Required. To specify no
357
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
358
+ # @param options [::Gapic::CallOptions, ::Hash]
359
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
360
+ #
361
+ # @overload list_zones(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
362
+ # Pass arguments to `list_zones` via keyword arguments. Note that at
363
+ # least one keyword argument is required. To specify no parameters, or to keep all
364
+ # the default parameter values, pass an empty Hash as a request object (see above).
365
+ #
366
+ # @param parent [::String]
367
+ # Required. Parent value for ListZonesRequest
368
+ # @param page_size [::Integer]
369
+ # Requested page size. Server may return fewer items than requested.
370
+ # If unspecified, server will pick an appropriate default.
371
+ # @param page_token [::String]
372
+ # A token identifying a page of results the server should return.
373
+ # @param filter [::String]
374
+ # Filtering results
375
+ # @param order_by [::String]
376
+ # Hint for how to order the results
377
+ #
378
+ # @yield [response, operation] Access the result along with the RPC operation
379
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::EdgeNetwork::V1::Zone>]
380
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
381
+ #
382
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::EdgeNetwork::V1::Zone>]
383
+ #
384
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
385
+ #
386
+ # @example Basic example
387
+ # require "google/cloud/edge_network/v1"
388
+ #
389
+ # # Create a client object. The client can be reused for multiple calls.
390
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
391
+ #
392
+ # # Create a request. To set request fields, pass in keyword arguments.
393
+ # request = Google::Cloud::EdgeNetwork::V1::ListZonesRequest.new
394
+ #
395
+ # # Call the list_zones method.
396
+ # result = client.list_zones request
397
+ #
398
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
399
+ # # over elements, and API calls will be issued to fetch pages as needed.
400
+ # result.each do |item|
401
+ # # Each element is of type ::Google::Cloud::EdgeNetwork::V1::Zone.
402
+ # p item
403
+ # end
404
+ #
405
+ def list_zones request, options = nil
406
+ raise ::ArgumentError, "request must be provided" if request.nil?
407
+
408
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::ListZonesRequest
409
+
410
+ # Converts hash and nil to an options object
411
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
412
+
413
+ # Customize the options with defaults
414
+ metadata = @config.rpcs.list_zones.metadata.to_h
415
+
416
+ # Set x-goog-api-client and x-goog-user-project headers
417
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
418
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
419
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
420
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
421
+
422
+ header_params = {}
423
+ if request.parent
424
+ header_params["parent"] = request.parent
425
+ end
426
+
427
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
428
+ metadata[:"x-goog-request-params"] ||= request_params_header
429
+
430
+ options.apply_defaults timeout: @config.rpcs.list_zones.timeout,
431
+ metadata: metadata,
432
+ retry_policy: @config.rpcs.list_zones.retry_policy
433
+
434
+ options.apply_defaults timeout: @config.timeout,
435
+ metadata: @config.metadata,
436
+ retry_policy: @config.retry_policy
437
+
438
+ @edge_network_stub.call_rpc :list_zones, request, options: options do |response, operation|
439
+ response = ::Gapic::PagedEnumerable.new @edge_network_stub, :list_zones, request, response, operation, options
440
+ yield response, operation if block_given?
441
+ return response
442
+ end
443
+ rescue ::GRPC::BadStatus => e
444
+ raise ::Google::Cloud::Error.from_error(e)
445
+ end
446
+
447
+ ##
448
+ # Gets details of a single Zone.
449
+ #
450
+ # @overload get_zone(request, options = nil)
451
+ # Pass arguments to `get_zone` via a request object, either of type
452
+ # {::Google::Cloud::EdgeNetwork::V1::GetZoneRequest} or an equivalent Hash.
453
+ #
454
+ # @param request [::Google::Cloud::EdgeNetwork::V1::GetZoneRequest, ::Hash]
455
+ # A request object representing the call parameters. Required. To specify no
456
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
457
+ # @param options [::Gapic::CallOptions, ::Hash]
458
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
459
+ #
460
+ # @overload get_zone(name: nil)
461
+ # Pass arguments to `get_zone` via keyword arguments. Note that at
462
+ # least one keyword argument is required. To specify no parameters, or to keep all
463
+ # the default parameter values, pass an empty Hash as a request object (see above).
464
+ #
465
+ # @param name [::String]
466
+ # Required. Name of the resource
467
+ #
468
+ # @yield [response, operation] Access the result along with the RPC operation
469
+ # @yieldparam response [::Google::Cloud::EdgeNetwork::V1::Zone]
470
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
471
+ #
472
+ # @return [::Google::Cloud::EdgeNetwork::V1::Zone]
473
+ #
474
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
475
+ #
476
+ # @example Basic example
477
+ # require "google/cloud/edge_network/v1"
478
+ #
479
+ # # Create a client object. The client can be reused for multiple calls.
480
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
481
+ #
482
+ # # Create a request. To set request fields, pass in keyword arguments.
483
+ # request = Google::Cloud::EdgeNetwork::V1::GetZoneRequest.new
484
+ #
485
+ # # Call the get_zone method.
486
+ # result = client.get_zone request
487
+ #
488
+ # # The returned object is of type Google::Cloud::EdgeNetwork::V1::Zone.
489
+ # p result
490
+ #
491
+ def get_zone request, options = nil
492
+ raise ::ArgumentError, "request must be provided" if request.nil?
493
+
494
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::GetZoneRequest
495
+
496
+ # Converts hash and nil to an options object
497
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
498
+
499
+ # Customize the options with defaults
500
+ metadata = @config.rpcs.get_zone.metadata.to_h
501
+
502
+ # Set x-goog-api-client and x-goog-user-project headers
503
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
504
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
505
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
506
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
507
+
508
+ header_params = {}
509
+ if request.name
510
+ header_params["name"] = request.name
511
+ end
512
+
513
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
514
+ metadata[:"x-goog-request-params"] ||= request_params_header
515
+
516
+ options.apply_defaults timeout: @config.rpcs.get_zone.timeout,
517
+ metadata: metadata,
518
+ retry_policy: @config.rpcs.get_zone.retry_policy
519
+
520
+ options.apply_defaults timeout: @config.timeout,
521
+ metadata: @config.metadata,
522
+ retry_policy: @config.retry_policy
523
+
524
+ @edge_network_stub.call_rpc :get_zone, request, options: options do |response, operation|
525
+ yield response, operation if block_given?
526
+ return response
527
+ end
528
+ rescue ::GRPC::BadStatus => e
529
+ raise ::Google::Cloud::Error.from_error(e)
530
+ end
531
+
532
+ ##
533
+ # Lists Networks in a given project and location.
534
+ #
535
+ # @overload list_networks(request, options = nil)
536
+ # Pass arguments to `list_networks` via a request object, either of type
537
+ # {::Google::Cloud::EdgeNetwork::V1::ListNetworksRequest} or an equivalent Hash.
538
+ #
539
+ # @param request [::Google::Cloud::EdgeNetwork::V1::ListNetworksRequest, ::Hash]
540
+ # A request object representing the call parameters. Required. To specify no
541
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
542
+ # @param options [::Gapic::CallOptions, ::Hash]
543
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
544
+ #
545
+ # @overload list_networks(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
546
+ # Pass arguments to `list_networks` via keyword arguments. Note that at
547
+ # least one keyword argument is required. To specify no parameters, or to keep all
548
+ # the default parameter values, pass an empty Hash as a request object (see above).
549
+ #
550
+ # @param parent [::String]
551
+ # Required. Parent value for ListNetworksRequest
552
+ # @param page_size [::Integer]
553
+ # Requested page size. Server may return fewer items than requested.
554
+ # If unspecified, server will pick an appropriate default.
555
+ # @param page_token [::String]
556
+ # A token identifying a page of results the server should return.
557
+ # @param filter [::String]
558
+ # Filtering results
559
+ # @param order_by [::String]
560
+ # Hint for how to order the results
561
+ #
562
+ # @yield [response, operation] Access the result along with the RPC operation
563
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::EdgeNetwork::V1::Network>]
564
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
565
+ #
566
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::EdgeNetwork::V1::Network>]
567
+ #
568
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
569
+ #
570
+ # @example Basic example
571
+ # require "google/cloud/edge_network/v1"
572
+ #
573
+ # # Create a client object. The client can be reused for multiple calls.
574
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
575
+ #
576
+ # # Create a request. To set request fields, pass in keyword arguments.
577
+ # request = Google::Cloud::EdgeNetwork::V1::ListNetworksRequest.new
578
+ #
579
+ # # Call the list_networks method.
580
+ # result = client.list_networks request
581
+ #
582
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
583
+ # # over elements, and API calls will be issued to fetch pages as needed.
584
+ # result.each do |item|
585
+ # # Each element is of type ::Google::Cloud::EdgeNetwork::V1::Network.
586
+ # p item
587
+ # end
588
+ #
589
+ def list_networks request, options = nil
590
+ raise ::ArgumentError, "request must be provided" if request.nil?
591
+
592
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::ListNetworksRequest
593
+
594
+ # Converts hash and nil to an options object
595
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
596
+
597
+ # Customize the options with defaults
598
+ metadata = @config.rpcs.list_networks.metadata.to_h
599
+
600
+ # Set x-goog-api-client and x-goog-user-project headers
601
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
602
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
603
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
604
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
605
+
606
+ header_params = {}
607
+ if request.parent
608
+ header_params["parent"] = request.parent
609
+ end
610
+
611
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
612
+ metadata[:"x-goog-request-params"] ||= request_params_header
613
+
614
+ options.apply_defaults timeout: @config.rpcs.list_networks.timeout,
615
+ metadata: metadata,
616
+ retry_policy: @config.rpcs.list_networks.retry_policy
617
+
618
+ options.apply_defaults timeout: @config.timeout,
619
+ metadata: @config.metadata,
620
+ retry_policy: @config.retry_policy
621
+
622
+ @edge_network_stub.call_rpc :list_networks, request, options: options do |response, operation|
623
+ response = ::Gapic::PagedEnumerable.new @edge_network_stub, :list_networks, request, response, operation, options
624
+ yield response, operation if block_given?
625
+ return response
626
+ end
627
+ rescue ::GRPC::BadStatus => e
628
+ raise ::Google::Cloud::Error.from_error(e)
629
+ end
630
+
631
+ ##
632
+ # Gets details of a single Network.
633
+ #
634
+ # @overload get_network(request, options = nil)
635
+ # Pass arguments to `get_network` via a request object, either of type
636
+ # {::Google::Cloud::EdgeNetwork::V1::GetNetworkRequest} or an equivalent Hash.
637
+ #
638
+ # @param request [::Google::Cloud::EdgeNetwork::V1::GetNetworkRequest, ::Hash]
639
+ # A request object representing the call parameters. Required. To specify no
640
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
641
+ # @param options [::Gapic::CallOptions, ::Hash]
642
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
643
+ #
644
+ # @overload get_network(name: nil)
645
+ # Pass arguments to `get_network` via keyword arguments. Note that at
646
+ # least one keyword argument is required. To specify no parameters, or to keep all
647
+ # the default parameter values, pass an empty Hash as a request object (see above).
648
+ #
649
+ # @param name [::String]
650
+ # Required. Name of the resource
651
+ #
652
+ # @yield [response, operation] Access the result along with the RPC operation
653
+ # @yieldparam response [::Google::Cloud::EdgeNetwork::V1::Network]
654
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
655
+ #
656
+ # @return [::Google::Cloud::EdgeNetwork::V1::Network]
657
+ #
658
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
659
+ #
660
+ # @example Basic example
661
+ # require "google/cloud/edge_network/v1"
662
+ #
663
+ # # Create a client object. The client can be reused for multiple calls.
664
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
665
+ #
666
+ # # Create a request. To set request fields, pass in keyword arguments.
667
+ # request = Google::Cloud::EdgeNetwork::V1::GetNetworkRequest.new
668
+ #
669
+ # # Call the get_network method.
670
+ # result = client.get_network request
671
+ #
672
+ # # The returned object is of type Google::Cloud::EdgeNetwork::V1::Network.
673
+ # p result
674
+ #
675
+ def get_network request, options = nil
676
+ raise ::ArgumentError, "request must be provided" if request.nil?
677
+
678
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::GetNetworkRequest
679
+
680
+ # Converts hash and nil to an options object
681
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
682
+
683
+ # Customize the options with defaults
684
+ metadata = @config.rpcs.get_network.metadata.to_h
685
+
686
+ # Set x-goog-api-client and x-goog-user-project headers
687
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
688
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
689
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
690
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
691
+
692
+ header_params = {}
693
+ if request.name
694
+ header_params["name"] = request.name
695
+ end
696
+
697
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
698
+ metadata[:"x-goog-request-params"] ||= request_params_header
699
+
700
+ options.apply_defaults timeout: @config.rpcs.get_network.timeout,
701
+ metadata: metadata,
702
+ retry_policy: @config.rpcs.get_network.retry_policy
703
+
704
+ options.apply_defaults timeout: @config.timeout,
705
+ metadata: @config.metadata,
706
+ retry_policy: @config.retry_policy
707
+
708
+ @edge_network_stub.call_rpc :get_network, request, options: options do |response, operation|
709
+ yield response, operation if block_given?
710
+ return response
711
+ end
712
+ rescue ::GRPC::BadStatus => e
713
+ raise ::Google::Cloud::Error.from_error(e)
714
+ end
715
+
716
+ ##
717
+ # Get the diagnostics of a single network resource.
718
+ #
719
+ # @overload diagnose_network(request, options = nil)
720
+ # Pass arguments to `diagnose_network` via a request object, either of type
721
+ # {::Google::Cloud::EdgeNetwork::V1::DiagnoseNetworkRequest} or an equivalent Hash.
722
+ #
723
+ # @param request [::Google::Cloud::EdgeNetwork::V1::DiagnoseNetworkRequest, ::Hash]
724
+ # A request object representing the call parameters. Required. To specify no
725
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
726
+ # @param options [::Gapic::CallOptions, ::Hash]
727
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
728
+ #
729
+ # @overload diagnose_network(name: nil)
730
+ # Pass arguments to `diagnose_network` via keyword arguments. Note that at
731
+ # least one keyword argument is required. To specify no parameters, or to keep all
732
+ # the default parameter values, pass an empty Hash as a request object (see above).
733
+ #
734
+ # @param name [::String]
735
+ # Required. The name of the network resource.
736
+ #
737
+ # @yield [response, operation] Access the result along with the RPC operation
738
+ # @yieldparam response [::Google::Cloud::EdgeNetwork::V1::DiagnoseNetworkResponse]
739
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
740
+ #
741
+ # @return [::Google::Cloud::EdgeNetwork::V1::DiagnoseNetworkResponse]
742
+ #
743
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
744
+ #
745
+ # @example Basic example
746
+ # require "google/cloud/edge_network/v1"
747
+ #
748
+ # # Create a client object. The client can be reused for multiple calls.
749
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
750
+ #
751
+ # # Create a request. To set request fields, pass in keyword arguments.
752
+ # request = Google::Cloud::EdgeNetwork::V1::DiagnoseNetworkRequest.new
753
+ #
754
+ # # Call the diagnose_network method.
755
+ # result = client.diagnose_network request
756
+ #
757
+ # # The returned object is of type Google::Cloud::EdgeNetwork::V1::DiagnoseNetworkResponse.
758
+ # p result
759
+ #
760
+ def diagnose_network request, options = nil
761
+ raise ::ArgumentError, "request must be provided" if request.nil?
762
+
763
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::DiagnoseNetworkRequest
764
+
765
+ # Converts hash and nil to an options object
766
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
767
+
768
+ # Customize the options with defaults
769
+ metadata = @config.rpcs.diagnose_network.metadata.to_h
770
+
771
+ # Set x-goog-api-client and x-goog-user-project headers
772
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
773
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
774
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
775
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
776
+
777
+ header_params = {}
778
+ if request.name
779
+ header_params["name"] = request.name
780
+ end
781
+
782
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
783
+ metadata[:"x-goog-request-params"] ||= request_params_header
784
+
785
+ options.apply_defaults timeout: @config.rpcs.diagnose_network.timeout,
786
+ metadata: metadata,
787
+ retry_policy: @config.rpcs.diagnose_network.retry_policy
788
+
789
+ options.apply_defaults timeout: @config.timeout,
790
+ metadata: @config.metadata,
791
+ retry_policy: @config.retry_policy
792
+
793
+ @edge_network_stub.call_rpc :diagnose_network, request, options: options do |response, operation|
794
+ yield response, operation if block_given?
795
+ return response
796
+ end
797
+ rescue ::GRPC::BadStatus => e
798
+ raise ::Google::Cloud::Error.from_error(e)
799
+ end
800
+
801
+ ##
802
+ # Creates a new Network in a given project and location.
803
+ #
804
+ # @overload create_network(request, options = nil)
805
+ # Pass arguments to `create_network` via a request object, either of type
806
+ # {::Google::Cloud::EdgeNetwork::V1::CreateNetworkRequest} or an equivalent Hash.
807
+ #
808
+ # @param request [::Google::Cloud::EdgeNetwork::V1::CreateNetworkRequest, ::Hash]
809
+ # A request object representing the call parameters. Required. To specify no
810
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
811
+ # @param options [::Gapic::CallOptions, ::Hash]
812
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
813
+ #
814
+ # @overload create_network(parent: nil, network_id: nil, network: nil, request_id: nil)
815
+ # Pass arguments to `create_network` via keyword arguments. Note that at
816
+ # least one keyword argument is required. To specify no parameters, or to keep all
817
+ # the default parameter values, pass an empty Hash as a request object (see above).
818
+ #
819
+ # @param parent [::String]
820
+ # Required. Value for parent.
821
+ # @param network_id [::String]
822
+ # Required. Id of the requesting object
823
+ # If auto-generating Id server-side, remove this field and
824
+ # network_id from the method_signature of Create RPC
825
+ # @param network [::Google::Cloud::EdgeNetwork::V1::Network, ::Hash]
826
+ # Required. The resource being created
827
+ # @param request_id [::String]
828
+ # Optional. An optional request ID to identify requests. Specify a unique
829
+ # request ID so that if you must retry your request, the server will know to
830
+ # ignore the request if it has already been completed. The server will
831
+ # guarantee that for at least 60 minutes since the first request.
832
+ #
833
+ # For example, consider a situation where you make an initial request and
834
+ # the request times out. If you make the request again with the same request
835
+ # ID, the server can check if original operation with the same request ID
836
+ # was received, and if so, will ignore the second request. This prevents
837
+ # clients from accidentally creating duplicate commitments.
838
+ #
839
+ # The request ID must be a valid UUID with the exception that zero UUID is
840
+ # not supported (00000000-0000-0000-0000-000000000000).
841
+ #
842
+ # @yield [response, operation] Access the result along with the RPC operation
843
+ # @yieldparam response [::Gapic::Operation]
844
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
845
+ #
846
+ # @return [::Gapic::Operation]
847
+ #
848
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
849
+ #
850
+ # @example Basic example
851
+ # require "google/cloud/edge_network/v1"
852
+ #
853
+ # # Create a client object. The client can be reused for multiple calls.
854
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
855
+ #
856
+ # # Create a request. To set request fields, pass in keyword arguments.
857
+ # request = Google::Cloud::EdgeNetwork::V1::CreateNetworkRequest.new
858
+ #
859
+ # # Call the create_network method.
860
+ # result = client.create_network request
861
+ #
862
+ # # The returned object is of type Gapic::Operation. You can use it to
863
+ # # check the status of an operation, cancel it, or wait for results.
864
+ # # Here is how to wait for a response.
865
+ # result.wait_until_done! timeout: 60
866
+ # if result.response?
867
+ # p result.response
868
+ # else
869
+ # puts "No response received."
870
+ # end
871
+ #
872
+ def create_network request, options = nil
873
+ raise ::ArgumentError, "request must be provided" if request.nil?
874
+
875
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::CreateNetworkRequest
876
+
877
+ # Converts hash and nil to an options object
878
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
879
+
880
+ # Customize the options with defaults
881
+ metadata = @config.rpcs.create_network.metadata.to_h
882
+
883
+ # Set x-goog-api-client and x-goog-user-project headers
884
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
885
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
886
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
887
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
888
+
889
+ header_params = {}
890
+ if request.parent
891
+ header_params["parent"] = request.parent
892
+ end
893
+
894
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
895
+ metadata[:"x-goog-request-params"] ||= request_params_header
896
+
897
+ options.apply_defaults timeout: @config.rpcs.create_network.timeout,
898
+ metadata: metadata,
899
+ retry_policy: @config.rpcs.create_network.retry_policy
900
+
901
+ options.apply_defaults timeout: @config.timeout,
902
+ metadata: @config.metadata,
903
+ retry_policy: @config.retry_policy
904
+
905
+ @edge_network_stub.call_rpc :create_network, request, options: options do |response, operation|
906
+ response = ::Gapic::Operation.new response, @operations_client, options: options
907
+ yield response, operation if block_given?
908
+ return response
909
+ end
910
+ rescue ::GRPC::BadStatus => e
911
+ raise ::Google::Cloud::Error.from_error(e)
912
+ end
913
+
914
+ ##
915
+ # Deletes a single Network.
916
+ #
917
+ # @overload delete_network(request, options = nil)
918
+ # Pass arguments to `delete_network` via a request object, either of type
919
+ # {::Google::Cloud::EdgeNetwork::V1::DeleteNetworkRequest} or an equivalent Hash.
920
+ #
921
+ # @param request [::Google::Cloud::EdgeNetwork::V1::DeleteNetworkRequest, ::Hash]
922
+ # A request object representing the call parameters. Required. To specify no
923
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
924
+ # @param options [::Gapic::CallOptions, ::Hash]
925
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
926
+ #
927
+ # @overload delete_network(name: nil, request_id: nil)
928
+ # Pass arguments to `delete_network` via keyword arguments. Note that at
929
+ # least one keyword argument is required. To specify no parameters, or to keep all
930
+ # the default parameter values, pass an empty Hash as a request object (see above).
931
+ #
932
+ # @param name [::String]
933
+ # Required. Name of the resource
934
+ # @param request_id [::String]
935
+ # Optional. An optional request ID to identify requests. Specify a unique
936
+ # request ID so that if you must retry your request, the server will know to
937
+ # ignore the request if it has already been completed. The server will
938
+ # guarantee that for at least 60 minutes after the first request.
939
+ #
940
+ # For example, consider a situation where you make an initial request and
941
+ # the request times out. If you make the request again with the same request
942
+ # ID, the server can check if original operation with the same request ID
943
+ # was received, and if so, will ignore the second request. This prevents
944
+ # clients from accidentally creating duplicate commitments.
945
+ #
946
+ # The request ID must be a valid UUID with the exception that zero UUID is
947
+ # not supported (00000000-0000-0000-0000-000000000000).
948
+ #
949
+ # @yield [response, operation] Access the result along with the RPC operation
950
+ # @yieldparam response [::Gapic::Operation]
951
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
952
+ #
953
+ # @return [::Gapic::Operation]
954
+ #
955
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
956
+ #
957
+ # @example Basic example
958
+ # require "google/cloud/edge_network/v1"
959
+ #
960
+ # # Create a client object. The client can be reused for multiple calls.
961
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
962
+ #
963
+ # # Create a request. To set request fields, pass in keyword arguments.
964
+ # request = Google::Cloud::EdgeNetwork::V1::DeleteNetworkRequest.new
965
+ #
966
+ # # Call the delete_network method.
967
+ # result = client.delete_network request
968
+ #
969
+ # # The returned object is of type Gapic::Operation. You can use it to
970
+ # # check the status of an operation, cancel it, or wait for results.
971
+ # # Here is how to wait for a response.
972
+ # result.wait_until_done! timeout: 60
973
+ # if result.response?
974
+ # p result.response
975
+ # else
976
+ # puts "No response received."
977
+ # end
978
+ #
979
+ def delete_network request, options = nil
980
+ raise ::ArgumentError, "request must be provided" if request.nil?
981
+
982
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::DeleteNetworkRequest
983
+
984
+ # Converts hash and nil to an options object
985
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
986
+
987
+ # Customize the options with defaults
988
+ metadata = @config.rpcs.delete_network.metadata.to_h
989
+
990
+ # Set x-goog-api-client and x-goog-user-project headers
991
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
992
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
993
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
994
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
995
+
996
+ header_params = {}
997
+ if request.name
998
+ header_params["name"] = request.name
999
+ end
1000
+
1001
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1002
+ metadata[:"x-goog-request-params"] ||= request_params_header
1003
+
1004
+ options.apply_defaults timeout: @config.rpcs.delete_network.timeout,
1005
+ metadata: metadata,
1006
+ retry_policy: @config.rpcs.delete_network.retry_policy
1007
+
1008
+ options.apply_defaults timeout: @config.timeout,
1009
+ metadata: @config.metadata,
1010
+ retry_policy: @config.retry_policy
1011
+
1012
+ @edge_network_stub.call_rpc :delete_network, request, options: options do |response, operation|
1013
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1014
+ yield response, operation if block_given?
1015
+ return response
1016
+ end
1017
+ rescue ::GRPC::BadStatus => e
1018
+ raise ::Google::Cloud::Error.from_error(e)
1019
+ end
1020
+
1021
+ ##
1022
+ # Lists Subnets in a given project and location.
1023
+ #
1024
+ # @overload list_subnets(request, options = nil)
1025
+ # Pass arguments to `list_subnets` via a request object, either of type
1026
+ # {::Google::Cloud::EdgeNetwork::V1::ListSubnetsRequest} or an equivalent Hash.
1027
+ #
1028
+ # @param request [::Google::Cloud::EdgeNetwork::V1::ListSubnetsRequest, ::Hash]
1029
+ # A request object representing the call parameters. Required. To specify no
1030
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1031
+ # @param options [::Gapic::CallOptions, ::Hash]
1032
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1033
+ #
1034
+ # @overload list_subnets(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1035
+ # Pass arguments to `list_subnets` via keyword arguments. Note that at
1036
+ # least one keyword argument is required. To specify no parameters, or to keep all
1037
+ # the default parameter values, pass an empty Hash as a request object (see above).
1038
+ #
1039
+ # @param parent [::String]
1040
+ # Required. Parent value for ListSubnetsRequest
1041
+ # @param page_size [::Integer]
1042
+ # Requested page size. Server may return fewer items than requested.
1043
+ # If unspecified, server will pick an appropriate default.
1044
+ # @param page_token [::String]
1045
+ # A token identifying a page of results the server should return.
1046
+ # @param filter [::String]
1047
+ # Filtering results
1048
+ # @param order_by [::String]
1049
+ # Hint for how to order the results
1050
+ #
1051
+ # @yield [response, operation] Access the result along with the RPC operation
1052
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::EdgeNetwork::V1::Subnet>]
1053
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1054
+ #
1055
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::EdgeNetwork::V1::Subnet>]
1056
+ #
1057
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1058
+ #
1059
+ # @example Basic example
1060
+ # require "google/cloud/edge_network/v1"
1061
+ #
1062
+ # # Create a client object. The client can be reused for multiple calls.
1063
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
1064
+ #
1065
+ # # Create a request. To set request fields, pass in keyword arguments.
1066
+ # request = Google::Cloud::EdgeNetwork::V1::ListSubnetsRequest.new
1067
+ #
1068
+ # # Call the list_subnets method.
1069
+ # result = client.list_subnets request
1070
+ #
1071
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1072
+ # # over elements, and API calls will be issued to fetch pages as needed.
1073
+ # result.each do |item|
1074
+ # # Each element is of type ::Google::Cloud::EdgeNetwork::V1::Subnet.
1075
+ # p item
1076
+ # end
1077
+ #
1078
+ def list_subnets request, options = nil
1079
+ raise ::ArgumentError, "request must be provided" if request.nil?
1080
+
1081
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::ListSubnetsRequest
1082
+
1083
+ # Converts hash and nil to an options object
1084
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1085
+
1086
+ # Customize the options with defaults
1087
+ metadata = @config.rpcs.list_subnets.metadata.to_h
1088
+
1089
+ # Set x-goog-api-client and x-goog-user-project headers
1090
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1091
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1092
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
1093
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1094
+
1095
+ header_params = {}
1096
+ if request.parent
1097
+ header_params["parent"] = request.parent
1098
+ end
1099
+
1100
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1101
+ metadata[:"x-goog-request-params"] ||= request_params_header
1102
+
1103
+ options.apply_defaults timeout: @config.rpcs.list_subnets.timeout,
1104
+ metadata: metadata,
1105
+ retry_policy: @config.rpcs.list_subnets.retry_policy
1106
+
1107
+ options.apply_defaults timeout: @config.timeout,
1108
+ metadata: @config.metadata,
1109
+ retry_policy: @config.retry_policy
1110
+
1111
+ @edge_network_stub.call_rpc :list_subnets, request, options: options do |response, operation|
1112
+ response = ::Gapic::PagedEnumerable.new @edge_network_stub, :list_subnets, request, response, operation, options
1113
+ yield response, operation if block_given?
1114
+ return response
1115
+ end
1116
+ rescue ::GRPC::BadStatus => e
1117
+ raise ::Google::Cloud::Error.from_error(e)
1118
+ end
1119
+
1120
+ ##
1121
+ # Gets details of a single Subnet.
1122
+ #
1123
+ # @overload get_subnet(request, options = nil)
1124
+ # Pass arguments to `get_subnet` via a request object, either of type
1125
+ # {::Google::Cloud::EdgeNetwork::V1::GetSubnetRequest} or an equivalent Hash.
1126
+ #
1127
+ # @param request [::Google::Cloud::EdgeNetwork::V1::GetSubnetRequest, ::Hash]
1128
+ # A request object representing the call parameters. Required. To specify no
1129
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1130
+ # @param options [::Gapic::CallOptions, ::Hash]
1131
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1132
+ #
1133
+ # @overload get_subnet(name: nil)
1134
+ # Pass arguments to `get_subnet` via keyword arguments. Note that at
1135
+ # least one keyword argument is required. To specify no parameters, or to keep all
1136
+ # the default parameter values, pass an empty Hash as a request object (see above).
1137
+ #
1138
+ # @param name [::String]
1139
+ # Required. Name of the resource
1140
+ #
1141
+ # @yield [response, operation] Access the result along with the RPC operation
1142
+ # @yieldparam response [::Google::Cloud::EdgeNetwork::V1::Subnet]
1143
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1144
+ #
1145
+ # @return [::Google::Cloud::EdgeNetwork::V1::Subnet]
1146
+ #
1147
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1148
+ #
1149
+ # @example Basic example
1150
+ # require "google/cloud/edge_network/v1"
1151
+ #
1152
+ # # Create a client object. The client can be reused for multiple calls.
1153
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
1154
+ #
1155
+ # # Create a request. To set request fields, pass in keyword arguments.
1156
+ # request = Google::Cloud::EdgeNetwork::V1::GetSubnetRequest.new
1157
+ #
1158
+ # # Call the get_subnet method.
1159
+ # result = client.get_subnet request
1160
+ #
1161
+ # # The returned object is of type Google::Cloud::EdgeNetwork::V1::Subnet.
1162
+ # p result
1163
+ #
1164
+ def get_subnet request, options = nil
1165
+ raise ::ArgumentError, "request must be provided" if request.nil?
1166
+
1167
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::GetSubnetRequest
1168
+
1169
+ # Converts hash and nil to an options object
1170
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1171
+
1172
+ # Customize the options with defaults
1173
+ metadata = @config.rpcs.get_subnet.metadata.to_h
1174
+
1175
+ # Set x-goog-api-client and x-goog-user-project headers
1176
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1177
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1178
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
1179
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1180
+
1181
+ header_params = {}
1182
+ if request.name
1183
+ header_params["name"] = request.name
1184
+ end
1185
+
1186
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1187
+ metadata[:"x-goog-request-params"] ||= request_params_header
1188
+
1189
+ options.apply_defaults timeout: @config.rpcs.get_subnet.timeout,
1190
+ metadata: metadata,
1191
+ retry_policy: @config.rpcs.get_subnet.retry_policy
1192
+
1193
+ options.apply_defaults timeout: @config.timeout,
1194
+ metadata: @config.metadata,
1195
+ retry_policy: @config.retry_policy
1196
+
1197
+ @edge_network_stub.call_rpc :get_subnet, request, options: options do |response, operation|
1198
+ yield response, operation if block_given?
1199
+ return response
1200
+ end
1201
+ rescue ::GRPC::BadStatus => e
1202
+ raise ::Google::Cloud::Error.from_error(e)
1203
+ end
1204
+
1205
+ ##
1206
+ # Creates a new Subnet in a given project and location.
1207
+ #
1208
+ # @overload create_subnet(request, options = nil)
1209
+ # Pass arguments to `create_subnet` via a request object, either of type
1210
+ # {::Google::Cloud::EdgeNetwork::V1::CreateSubnetRequest} or an equivalent Hash.
1211
+ #
1212
+ # @param request [::Google::Cloud::EdgeNetwork::V1::CreateSubnetRequest, ::Hash]
1213
+ # A request object representing the call parameters. Required. To specify no
1214
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1215
+ # @param options [::Gapic::CallOptions, ::Hash]
1216
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1217
+ #
1218
+ # @overload create_subnet(parent: nil, subnet_id: nil, subnet: nil, request_id: nil)
1219
+ # Pass arguments to `create_subnet` via keyword arguments. Note that at
1220
+ # least one keyword argument is required. To specify no parameters, or to keep all
1221
+ # the default parameter values, pass an empty Hash as a request object (see above).
1222
+ #
1223
+ # @param parent [::String]
1224
+ # Required. Value for parent.
1225
+ # @param subnet_id [::String]
1226
+ # Required. Id of the requesting object
1227
+ # If auto-generating Id server-side, remove this field and
1228
+ # subnet_id from the method_signature of Create RPC
1229
+ # @param subnet [::Google::Cloud::EdgeNetwork::V1::Subnet, ::Hash]
1230
+ # Required. The resource being created
1231
+ # @param request_id [::String]
1232
+ # Optional. An optional request ID to identify requests. Specify a unique
1233
+ # request ID so that if you must retry your request, the server will know to
1234
+ # ignore the request if it has already been completed. The server will
1235
+ # guarantee that for at least 60 minutes since the first request.
1236
+ #
1237
+ # For example, consider a situation where you make an initial request and
1238
+ # the request times out. If you make the request again with the same request
1239
+ # ID, the server can check if original operation with the same request ID
1240
+ # was received, and if so, will ignore the second request. This prevents
1241
+ # clients from accidentally creating duplicate commitments.
1242
+ #
1243
+ # The request ID must be a valid UUID with the exception that zero UUID is
1244
+ # not supported (00000000-0000-0000-0000-000000000000).
1245
+ #
1246
+ # @yield [response, operation] Access the result along with the RPC operation
1247
+ # @yieldparam response [::Gapic::Operation]
1248
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1249
+ #
1250
+ # @return [::Gapic::Operation]
1251
+ #
1252
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1253
+ #
1254
+ # @example Basic example
1255
+ # require "google/cloud/edge_network/v1"
1256
+ #
1257
+ # # Create a client object. The client can be reused for multiple calls.
1258
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
1259
+ #
1260
+ # # Create a request. To set request fields, pass in keyword arguments.
1261
+ # request = Google::Cloud::EdgeNetwork::V1::CreateSubnetRequest.new
1262
+ #
1263
+ # # Call the create_subnet method.
1264
+ # result = client.create_subnet request
1265
+ #
1266
+ # # The returned object is of type Gapic::Operation. You can use it to
1267
+ # # check the status of an operation, cancel it, or wait for results.
1268
+ # # Here is how to wait for a response.
1269
+ # result.wait_until_done! timeout: 60
1270
+ # if result.response?
1271
+ # p result.response
1272
+ # else
1273
+ # puts "No response received."
1274
+ # end
1275
+ #
1276
+ def create_subnet request, options = nil
1277
+ raise ::ArgumentError, "request must be provided" if request.nil?
1278
+
1279
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::CreateSubnetRequest
1280
+
1281
+ # Converts hash and nil to an options object
1282
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1283
+
1284
+ # Customize the options with defaults
1285
+ metadata = @config.rpcs.create_subnet.metadata.to_h
1286
+
1287
+ # Set x-goog-api-client and x-goog-user-project headers
1288
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1289
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1290
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
1291
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1292
+
1293
+ header_params = {}
1294
+ if request.parent
1295
+ header_params["parent"] = request.parent
1296
+ end
1297
+
1298
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1299
+ metadata[:"x-goog-request-params"] ||= request_params_header
1300
+
1301
+ options.apply_defaults timeout: @config.rpcs.create_subnet.timeout,
1302
+ metadata: metadata,
1303
+ retry_policy: @config.rpcs.create_subnet.retry_policy
1304
+
1305
+ options.apply_defaults timeout: @config.timeout,
1306
+ metadata: @config.metadata,
1307
+ retry_policy: @config.retry_policy
1308
+
1309
+ @edge_network_stub.call_rpc :create_subnet, request, options: options do |response, operation|
1310
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1311
+ yield response, operation if block_given?
1312
+ return response
1313
+ end
1314
+ rescue ::GRPC::BadStatus => e
1315
+ raise ::Google::Cloud::Error.from_error(e)
1316
+ end
1317
+
1318
+ ##
1319
+ # Updates the parameters of a single Subnet.
1320
+ #
1321
+ # @overload update_subnet(request, options = nil)
1322
+ # Pass arguments to `update_subnet` via a request object, either of type
1323
+ # {::Google::Cloud::EdgeNetwork::V1::UpdateSubnetRequest} or an equivalent Hash.
1324
+ #
1325
+ # @param request [::Google::Cloud::EdgeNetwork::V1::UpdateSubnetRequest, ::Hash]
1326
+ # A request object representing the call parameters. Required. To specify no
1327
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1328
+ # @param options [::Gapic::CallOptions, ::Hash]
1329
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1330
+ #
1331
+ # @overload update_subnet(update_mask: nil, subnet: nil, request_id: nil)
1332
+ # Pass arguments to `update_subnet` via keyword arguments. Note that at
1333
+ # least one keyword argument is required. To specify no parameters, or to keep all
1334
+ # the default parameter values, pass an empty Hash as a request object (see above).
1335
+ #
1336
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1337
+ # Required. Field mask is used to specify the fields to be overwritten in the
1338
+ # Subnet resource by the update.
1339
+ # The fields specified in the update_mask are relative to the resource, not
1340
+ # the full request. A field will be overwritten if it is in the mask. If the
1341
+ # user does not provide a mask then all fields will be overwritten.
1342
+ # @param subnet [::Google::Cloud::EdgeNetwork::V1::Subnet, ::Hash]
1343
+ # Required. The resource being updated
1344
+ # @param request_id [::String]
1345
+ # Optional. An optional request ID to identify requests. Specify a unique
1346
+ # request ID so that if you must retry your request, the server will know to
1347
+ # ignore the request if it has already been completed. The server will
1348
+ # guarantee that for at least 60 minutes since the first request.
1349
+ #
1350
+ # For example, consider a situation where you make an initial request and
1351
+ # the request times out. If you make the request again with the same request
1352
+ # ID, the server can check if original operation with the same request ID
1353
+ # was received, and if so, will ignore the second request. This prevents
1354
+ # clients from accidentally creating duplicate commitments.
1355
+ #
1356
+ # The request ID must be a valid UUID with the exception that zero UUID is
1357
+ # not supported (00000000-0000-0000-0000-000000000000).
1358
+ #
1359
+ # @yield [response, operation] Access the result along with the RPC operation
1360
+ # @yieldparam response [::Gapic::Operation]
1361
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1362
+ #
1363
+ # @return [::Gapic::Operation]
1364
+ #
1365
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1366
+ #
1367
+ # @example Basic example
1368
+ # require "google/cloud/edge_network/v1"
1369
+ #
1370
+ # # Create a client object. The client can be reused for multiple calls.
1371
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
1372
+ #
1373
+ # # Create a request. To set request fields, pass in keyword arguments.
1374
+ # request = Google::Cloud::EdgeNetwork::V1::UpdateSubnetRequest.new
1375
+ #
1376
+ # # Call the update_subnet method.
1377
+ # result = client.update_subnet request
1378
+ #
1379
+ # # The returned object is of type Gapic::Operation. You can use it to
1380
+ # # check the status of an operation, cancel it, or wait for results.
1381
+ # # Here is how to wait for a response.
1382
+ # result.wait_until_done! timeout: 60
1383
+ # if result.response?
1384
+ # p result.response
1385
+ # else
1386
+ # puts "No response received."
1387
+ # end
1388
+ #
1389
+ def update_subnet request, options = nil
1390
+ raise ::ArgumentError, "request must be provided" if request.nil?
1391
+
1392
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::UpdateSubnetRequest
1393
+
1394
+ # Converts hash and nil to an options object
1395
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1396
+
1397
+ # Customize the options with defaults
1398
+ metadata = @config.rpcs.update_subnet.metadata.to_h
1399
+
1400
+ # Set x-goog-api-client and x-goog-user-project headers
1401
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1402
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1403
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
1404
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1405
+
1406
+ header_params = {}
1407
+ if request.subnet&.name
1408
+ header_params["subnet.name"] = request.subnet.name
1409
+ end
1410
+
1411
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1412
+ metadata[:"x-goog-request-params"] ||= request_params_header
1413
+
1414
+ options.apply_defaults timeout: @config.rpcs.update_subnet.timeout,
1415
+ metadata: metadata,
1416
+ retry_policy: @config.rpcs.update_subnet.retry_policy
1417
+
1418
+ options.apply_defaults timeout: @config.timeout,
1419
+ metadata: @config.metadata,
1420
+ retry_policy: @config.retry_policy
1421
+
1422
+ @edge_network_stub.call_rpc :update_subnet, request, options: options do |response, operation|
1423
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1424
+ yield response, operation if block_given?
1425
+ return response
1426
+ end
1427
+ rescue ::GRPC::BadStatus => e
1428
+ raise ::Google::Cloud::Error.from_error(e)
1429
+ end
1430
+
1431
+ ##
1432
+ # Deletes a single Subnet.
1433
+ #
1434
+ # @overload delete_subnet(request, options = nil)
1435
+ # Pass arguments to `delete_subnet` via a request object, either of type
1436
+ # {::Google::Cloud::EdgeNetwork::V1::DeleteSubnetRequest} or an equivalent Hash.
1437
+ #
1438
+ # @param request [::Google::Cloud::EdgeNetwork::V1::DeleteSubnetRequest, ::Hash]
1439
+ # A request object representing the call parameters. Required. To specify no
1440
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1441
+ # @param options [::Gapic::CallOptions, ::Hash]
1442
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1443
+ #
1444
+ # @overload delete_subnet(name: nil, request_id: nil)
1445
+ # Pass arguments to `delete_subnet` via keyword arguments. Note that at
1446
+ # least one keyword argument is required. To specify no parameters, or to keep all
1447
+ # the default parameter values, pass an empty Hash as a request object (see above).
1448
+ #
1449
+ # @param name [::String]
1450
+ # Required. Name of the resource
1451
+ # @param request_id [::String]
1452
+ # Optional. An optional request ID to identify requests. Specify a unique
1453
+ # request ID so that if you must retry your request, the server will know to
1454
+ # ignore the request if it has already been completed. The server will
1455
+ # guarantee that for at least 60 minutes after the first request.
1456
+ #
1457
+ # For example, consider a situation where you make an initial request and
1458
+ # the request times out. If you make the request again with the same request
1459
+ # ID, the server can check if original operation with the same request ID
1460
+ # was received, and if so, will ignore the second request. This prevents
1461
+ # clients from accidentally creating duplicate commitments.
1462
+ #
1463
+ # The request ID must be a valid UUID with the exception that zero UUID is
1464
+ # not supported (00000000-0000-0000-0000-000000000000).
1465
+ #
1466
+ # @yield [response, operation] Access the result along with the RPC operation
1467
+ # @yieldparam response [::Gapic::Operation]
1468
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1469
+ #
1470
+ # @return [::Gapic::Operation]
1471
+ #
1472
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1473
+ #
1474
+ # @example Basic example
1475
+ # require "google/cloud/edge_network/v1"
1476
+ #
1477
+ # # Create a client object. The client can be reused for multiple calls.
1478
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
1479
+ #
1480
+ # # Create a request. To set request fields, pass in keyword arguments.
1481
+ # request = Google::Cloud::EdgeNetwork::V1::DeleteSubnetRequest.new
1482
+ #
1483
+ # # Call the delete_subnet method.
1484
+ # result = client.delete_subnet request
1485
+ #
1486
+ # # The returned object is of type Gapic::Operation. You can use it to
1487
+ # # check the status of an operation, cancel it, or wait for results.
1488
+ # # Here is how to wait for a response.
1489
+ # result.wait_until_done! timeout: 60
1490
+ # if result.response?
1491
+ # p result.response
1492
+ # else
1493
+ # puts "No response received."
1494
+ # end
1495
+ #
1496
+ def delete_subnet request, options = nil
1497
+ raise ::ArgumentError, "request must be provided" if request.nil?
1498
+
1499
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::DeleteSubnetRequest
1500
+
1501
+ # Converts hash and nil to an options object
1502
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1503
+
1504
+ # Customize the options with defaults
1505
+ metadata = @config.rpcs.delete_subnet.metadata.to_h
1506
+
1507
+ # Set x-goog-api-client and x-goog-user-project headers
1508
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1509
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1510
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
1511
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1512
+
1513
+ header_params = {}
1514
+ if request.name
1515
+ header_params["name"] = request.name
1516
+ end
1517
+
1518
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1519
+ metadata[:"x-goog-request-params"] ||= request_params_header
1520
+
1521
+ options.apply_defaults timeout: @config.rpcs.delete_subnet.timeout,
1522
+ metadata: metadata,
1523
+ retry_policy: @config.rpcs.delete_subnet.retry_policy
1524
+
1525
+ options.apply_defaults timeout: @config.timeout,
1526
+ metadata: @config.metadata,
1527
+ retry_policy: @config.retry_policy
1528
+
1529
+ @edge_network_stub.call_rpc :delete_subnet, request, options: options do |response, operation|
1530
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1531
+ yield response, operation if block_given?
1532
+ return response
1533
+ end
1534
+ rescue ::GRPC::BadStatus => e
1535
+ raise ::Google::Cloud::Error.from_error(e)
1536
+ end
1537
+
1538
+ ##
1539
+ # Lists Interconnects in a given project and location.
1540
+ #
1541
+ # @overload list_interconnects(request, options = nil)
1542
+ # Pass arguments to `list_interconnects` via a request object, either of type
1543
+ # {::Google::Cloud::EdgeNetwork::V1::ListInterconnectsRequest} or an equivalent Hash.
1544
+ #
1545
+ # @param request [::Google::Cloud::EdgeNetwork::V1::ListInterconnectsRequest, ::Hash]
1546
+ # A request object representing the call parameters. Required. To specify no
1547
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1548
+ # @param options [::Gapic::CallOptions, ::Hash]
1549
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1550
+ #
1551
+ # @overload list_interconnects(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1552
+ # Pass arguments to `list_interconnects` via keyword arguments. Note that at
1553
+ # least one keyword argument is required. To specify no parameters, or to keep all
1554
+ # the default parameter values, pass an empty Hash as a request object (see above).
1555
+ #
1556
+ # @param parent [::String]
1557
+ # Required. Parent value for ListInterconnectsRequest
1558
+ # @param page_size [::Integer]
1559
+ # Requested page size. Server may return fewer items than requested.
1560
+ # If unspecified, server will pick an appropriate default.
1561
+ # @param page_token [::String]
1562
+ # A token identifying a page of results the server should return.
1563
+ # @param filter [::String]
1564
+ # Filtering results
1565
+ # @param order_by [::String]
1566
+ # Hint for how to order the results
1567
+ #
1568
+ # @yield [response, operation] Access the result along with the RPC operation
1569
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::EdgeNetwork::V1::Interconnect>]
1570
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1571
+ #
1572
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::EdgeNetwork::V1::Interconnect>]
1573
+ #
1574
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1575
+ #
1576
+ # @example Basic example
1577
+ # require "google/cloud/edge_network/v1"
1578
+ #
1579
+ # # Create a client object. The client can be reused for multiple calls.
1580
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
1581
+ #
1582
+ # # Create a request. To set request fields, pass in keyword arguments.
1583
+ # request = Google::Cloud::EdgeNetwork::V1::ListInterconnectsRequest.new
1584
+ #
1585
+ # # Call the list_interconnects method.
1586
+ # result = client.list_interconnects request
1587
+ #
1588
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1589
+ # # over elements, and API calls will be issued to fetch pages as needed.
1590
+ # result.each do |item|
1591
+ # # Each element is of type ::Google::Cloud::EdgeNetwork::V1::Interconnect.
1592
+ # p item
1593
+ # end
1594
+ #
1595
+ def list_interconnects request, options = nil
1596
+ raise ::ArgumentError, "request must be provided" if request.nil?
1597
+
1598
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::ListInterconnectsRequest
1599
+
1600
+ # Converts hash and nil to an options object
1601
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1602
+
1603
+ # Customize the options with defaults
1604
+ metadata = @config.rpcs.list_interconnects.metadata.to_h
1605
+
1606
+ # Set x-goog-api-client and x-goog-user-project headers
1607
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1608
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1609
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
1610
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1611
+
1612
+ header_params = {}
1613
+ if request.parent
1614
+ header_params["parent"] = request.parent
1615
+ end
1616
+
1617
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1618
+ metadata[:"x-goog-request-params"] ||= request_params_header
1619
+
1620
+ options.apply_defaults timeout: @config.rpcs.list_interconnects.timeout,
1621
+ metadata: metadata,
1622
+ retry_policy: @config.rpcs.list_interconnects.retry_policy
1623
+
1624
+ options.apply_defaults timeout: @config.timeout,
1625
+ metadata: @config.metadata,
1626
+ retry_policy: @config.retry_policy
1627
+
1628
+ @edge_network_stub.call_rpc :list_interconnects, request, options: options do |response, operation|
1629
+ response = ::Gapic::PagedEnumerable.new @edge_network_stub, :list_interconnects, request, response, operation, options
1630
+ yield response, operation if block_given?
1631
+ return response
1632
+ end
1633
+ rescue ::GRPC::BadStatus => e
1634
+ raise ::Google::Cloud::Error.from_error(e)
1635
+ end
1636
+
1637
+ ##
1638
+ # Gets details of a single Interconnect.
1639
+ #
1640
+ # @overload get_interconnect(request, options = nil)
1641
+ # Pass arguments to `get_interconnect` via a request object, either of type
1642
+ # {::Google::Cloud::EdgeNetwork::V1::GetInterconnectRequest} or an equivalent Hash.
1643
+ #
1644
+ # @param request [::Google::Cloud::EdgeNetwork::V1::GetInterconnectRequest, ::Hash]
1645
+ # A request object representing the call parameters. Required. To specify no
1646
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1647
+ # @param options [::Gapic::CallOptions, ::Hash]
1648
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1649
+ #
1650
+ # @overload get_interconnect(name: nil)
1651
+ # Pass arguments to `get_interconnect` via keyword arguments. Note that at
1652
+ # least one keyword argument is required. To specify no parameters, or to keep all
1653
+ # the default parameter values, pass an empty Hash as a request object (see above).
1654
+ #
1655
+ # @param name [::String]
1656
+ # Required. Name of the resource
1657
+ #
1658
+ # @yield [response, operation] Access the result along with the RPC operation
1659
+ # @yieldparam response [::Google::Cloud::EdgeNetwork::V1::Interconnect]
1660
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1661
+ #
1662
+ # @return [::Google::Cloud::EdgeNetwork::V1::Interconnect]
1663
+ #
1664
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1665
+ #
1666
+ # @example Basic example
1667
+ # require "google/cloud/edge_network/v1"
1668
+ #
1669
+ # # Create a client object. The client can be reused for multiple calls.
1670
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
1671
+ #
1672
+ # # Create a request. To set request fields, pass in keyword arguments.
1673
+ # request = Google::Cloud::EdgeNetwork::V1::GetInterconnectRequest.new
1674
+ #
1675
+ # # Call the get_interconnect method.
1676
+ # result = client.get_interconnect request
1677
+ #
1678
+ # # The returned object is of type Google::Cloud::EdgeNetwork::V1::Interconnect.
1679
+ # p result
1680
+ #
1681
+ def get_interconnect request, options = nil
1682
+ raise ::ArgumentError, "request must be provided" if request.nil?
1683
+
1684
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::GetInterconnectRequest
1685
+
1686
+ # Converts hash and nil to an options object
1687
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1688
+
1689
+ # Customize the options with defaults
1690
+ metadata = @config.rpcs.get_interconnect.metadata.to_h
1691
+
1692
+ # Set x-goog-api-client and x-goog-user-project headers
1693
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1694
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1695
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
1696
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1697
+
1698
+ header_params = {}
1699
+ if request.name
1700
+ header_params["name"] = request.name
1701
+ end
1702
+
1703
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1704
+ metadata[:"x-goog-request-params"] ||= request_params_header
1705
+
1706
+ options.apply_defaults timeout: @config.rpcs.get_interconnect.timeout,
1707
+ metadata: metadata,
1708
+ retry_policy: @config.rpcs.get_interconnect.retry_policy
1709
+
1710
+ options.apply_defaults timeout: @config.timeout,
1711
+ metadata: @config.metadata,
1712
+ retry_policy: @config.retry_policy
1713
+
1714
+ @edge_network_stub.call_rpc :get_interconnect, request, options: options do |response, operation|
1715
+ yield response, operation if block_given?
1716
+ return response
1717
+ end
1718
+ rescue ::GRPC::BadStatus => e
1719
+ raise ::Google::Cloud::Error.from_error(e)
1720
+ end
1721
+
1722
+ ##
1723
+ # Get the diagnostics of a single interconnect resource.
1724
+ #
1725
+ # @overload diagnose_interconnect(request, options = nil)
1726
+ # Pass arguments to `diagnose_interconnect` via a request object, either of type
1727
+ # {::Google::Cloud::EdgeNetwork::V1::DiagnoseInterconnectRequest} or an equivalent Hash.
1728
+ #
1729
+ # @param request [::Google::Cloud::EdgeNetwork::V1::DiagnoseInterconnectRequest, ::Hash]
1730
+ # A request object representing the call parameters. Required. To specify no
1731
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1732
+ # @param options [::Gapic::CallOptions, ::Hash]
1733
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1734
+ #
1735
+ # @overload diagnose_interconnect(name: nil)
1736
+ # Pass arguments to `diagnose_interconnect` via keyword arguments. Note that at
1737
+ # least one keyword argument is required. To specify no parameters, or to keep all
1738
+ # the default parameter values, pass an empty Hash as a request object (see above).
1739
+ #
1740
+ # @param name [::String]
1741
+ # Required. The name of the interconnect resource.
1742
+ #
1743
+ # @yield [response, operation] Access the result along with the RPC operation
1744
+ # @yieldparam response [::Google::Cloud::EdgeNetwork::V1::DiagnoseInterconnectResponse]
1745
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1746
+ #
1747
+ # @return [::Google::Cloud::EdgeNetwork::V1::DiagnoseInterconnectResponse]
1748
+ #
1749
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1750
+ #
1751
+ # @example Basic example
1752
+ # require "google/cloud/edge_network/v1"
1753
+ #
1754
+ # # Create a client object. The client can be reused for multiple calls.
1755
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
1756
+ #
1757
+ # # Create a request. To set request fields, pass in keyword arguments.
1758
+ # request = Google::Cloud::EdgeNetwork::V1::DiagnoseInterconnectRequest.new
1759
+ #
1760
+ # # Call the diagnose_interconnect method.
1761
+ # result = client.diagnose_interconnect request
1762
+ #
1763
+ # # The returned object is of type Google::Cloud::EdgeNetwork::V1::DiagnoseInterconnectResponse.
1764
+ # p result
1765
+ #
1766
+ def diagnose_interconnect request, options = nil
1767
+ raise ::ArgumentError, "request must be provided" if request.nil?
1768
+
1769
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::DiagnoseInterconnectRequest
1770
+
1771
+ # Converts hash and nil to an options object
1772
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1773
+
1774
+ # Customize the options with defaults
1775
+ metadata = @config.rpcs.diagnose_interconnect.metadata.to_h
1776
+
1777
+ # Set x-goog-api-client and x-goog-user-project headers
1778
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1779
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1780
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
1781
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1782
+
1783
+ header_params = {}
1784
+ if request.name
1785
+ header_params["name"] = request.name
1786
+ end
1787
+
1788
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1789
+ metadata[:"x-goog-request-params"] ||= request_params_header
1790
+
1791
+ options.apply_defaults timeout: @config.rpcs.diagnose_interconnect.timeout,
1792
+ metadata: metadata,
1793
+ retry_policy: @config.rpcs.diagnose_interconnect.retry_policy
1794
+
1795
+ options.apply_defaults timeout: @config.timeout,
1796
+ metadata: @config.metadata,
1797
+ retry_policy: @config.retry_policy
1798
+
1799
+ @edge_network_stub.call_rpc :diagnose_interconnect, request, options: options do |response, operation|
1800
+ yield response, operation if block_given?
1801
+ return response
1802
+ end
1803
+ rescue ::GRPC::BadStatus => e
1804
+ raise ::Google::Cloud::Error.from_error(e)
1805
+ end
1806
+
1807
+ ##
1808
+ # Lists InterconnectAttachments in a given project and location.
1809
+ #
1810
+ # @overload list_interconnect_attachments(request, options = nil)
1811
+ # Pass arguments to `list_interconnect_attachments` via a request object, either of type
1812
+ # {::Google::Cloud::EdgeNetwork::V1::ListInterconnectAttachmentsRequest} or an equivalent Hash.
1813
+ #
1814
+ # @param request [::Google::Cloud::EdgeNetwork::V1::ListInterconnectAttachmentsRequest, ::Hash]
1815
+ # A request object representing the call parameters. Required. To specify no
1816
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1817
+ # @param options [::Gapic::CallOptions, ::Hash]
1818
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1819
+ #
1820
+ # @overload list_interconnect_attachments(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1821
+ # Pass arguments to `list_interconnect_attachments` via keyword arguments. Note that at
1822
+ # least one keyword argument is required. To specify no parameters, or to keep all
1823
+ # the default parameter values, pass an empty Hash as a request object (see above).
1824
+ #
1825
+ # @param parent [::String]
1826
+ # Required. Parent value for ListInterconnectAttachmentsRequest
1827
+ # @param page_size [::Integer]
1828
+ # Requested page size. Server may return fewer items than requested.
1829
+ # If unspecified, server will pick an appropriate default.
1830
+ # @param page_token [::String]
1831
+ # A token identifying a page of results the server should return.
1832
+ # @param filter [::String]
1833
+ # Filtering results
1834
+ # @param order_by [::String]
1835
+ # Hint for how to order the results
1836
+ #
1837
+ # @yield [response, operation] Access the result along with the RPC operation
1838
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::EdgeNetwork::V1::InterconnectAttachment>]
1839
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1840
+ #
1841
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::EdgeNetwork::V1::InterconnectAttachment>]
1842
+ #
1843
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1844
+ #
1845
+ # @example Basic example
1846
+ # require "google/cloud/edge_network/v1"
1847
+ #
1848
+ # # Create a client object. The client can be reused for multiple calls.
1849
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
1850
+ #
1851
+ # # Create a request. To set request fields, pass in keyword arguments.
1852
+ # request = Google::Cloud::EdgeNetwork::V1::ListInterconnectAttachmentsRequest.new
1853
+ #
1854
+ # # Call the list_interconnect_attachments method.
1855
+ # result = client.list_interconnect_attachments request
1856
+ #
1857
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1858
+ # # over elements, and API calls will be issued to fetch pages as needed.
1859
+ # result.each do |item|
1860
+ # # Each element is of type ::Google::Cloud::EdgeNetwork::V1::InterconnectAttachment.
1861
+ # p item
1862
+ # end
1863
+ #
1864
+ def list_interconnect_attachments request, options = nil
1865
+ raise ::ArgumentError, "request must be provided" if request.nil?
1866
+
1867
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::ListInterconnectAttachmentsRequest
1868
+
1869
+ # Converts hash and nil to an options object
1870
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1871
+
1872
+ # Customize the options with defaults
1873
+ metadata = @config.rpcs.list_interconnect_attachments.metadata.to_h
1874
+
1875
+ # Set x-goog-api-client and x-goog-user-project headers
1876
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1877
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1878
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
1879
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1880
+
1881
+ header_params = {}
1882
+ if request.parent
1883
+ header_params["parent"] = request.parent
1884
+ end
1885
+
1886
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1887
+ metadata[:"x-goog-request-params"] ||= request_params_header
1888
+
1889
+ options.apply_defaults timeout: @config.rpcs.list_interconnect_attachments.timeout,
1890
+ metadata: metadata,
1891
+ retry_policy: @config.rpcs.list_interconnect_attachments.retry_policy
1892
+
1893
+ options.apply_defaults timeout: @config.timeout,
1894
+ metadata: @config.metadata,
1895
+ retry_policy: @config.retry_policy
1896
+
1897
+ @edge_network_stub.call_rpc :list_interconnect_attachments, request, options: options do |response, operation|
1898
+ response = ::Gapic::PagedEnumerable.new @edge_network_stub, :list_interconnect_attachments, request, response, operation, options
1899
+ yield response, operation if block_given?
1900
+ return response
1901
+ end
1902
+ rescue ::GRPC::BadStatus => e
1903
+ raise ::Google::Cloud::Error.from_error(e)
1904
+ end
1905
+
1906
+ ##
1907
+ # Gets details of a single InterconnectAttachment.
1908
+ #
1909
+ # @overload get_interconnect_attachment(request, options = nil)
1910
+ # Pass arguments to `get_interconnect_attachment` via a request object, either of type
1911
+ # {::Google::Cloud::EdgeNetwork::V1::GetInterconnectAttachmentRequest} or an equivalent Hash.
1912
+ #
1913
+ # @param request [::Google::Cloud::EdgeNetwork::V1::GetInterconnectAttachmentRequest, ::Hash]
1914
+ # A request object representing the call parameters. Required. To specify no
1915
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1916
+ # @param options [::Gapic::CallOptions, ::Hash]
1917
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1918
+ #
1919
+ # @overload get_interconnect_attachment(name: nil)
1920
+ # Pass arguments to `get_interconnect_attachment` via keyword arguments. Note that at
1921
+ # least one keyword argument is required. To specify no parameters, or to keep all
1922
+ # the default parameter values, pass an empty Hash as a request object (see above).
1923
+ #
1924
+ # @param name [::String]
1925
+ # Required. Name of the resource
1926
+ #
1927
+ # @yield [response, operation] Access the result along with the RPC operation
1928
+ # @yieldparam response [::Google::Cloud::EdgeNetwork::V1::InterconnectAttachment]
1929
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1930
+ #
1931
+ # @return [::Google::Cloud::EdgeNetwork::V1::InterconnectAttachment]
1932
+ #
1933
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1934
+ #
1935
+ # @example Basic example
1936
+ # require "google/cloud/edge_network/v1"
1937
+ #
1938
+ # # Create a client object. The client can be reused for multiple calls.
1939
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
1940
+ #
1941
+ # # Create a request. To set request fields, pass in keyword arguments.
1942
+ # request = Google::Cloud::EdgeNetwork::V1::GetInterconnectAttachmentRequest.new
1943
+ #
1944
+ # # Call the get_interconnect_attachment method.
1945
+ # result = client.get_interconnect_attachment request
1946
+ #
1947
+ # # The returned object is of type Google::Cloud::EdgeNetwork::V1::InterconnectAttachment.
1948
+ # p result
1949
+ #
1950
+ def get_interconnect_attachment request, options = nil
1951
+ raise ::ArgumentError, "request must be provided" if request.nil?
1952
+
1953
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::GetInterconnectAttachmentRequest
1954
+
1955
+ # Converts hash and nil to an options object
1956
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1957
+
1958
+ # Customize the options with defaults
1959
+ metadata = @config.rpcs.get_interconnect_attachment.metadata.to_h
1960
+
1961
+ # Set x-goog-api-client and x-goog-user-project headers
1962
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1963
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1964
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
1965
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1966
+
1967
+ header_params = {}
1968
+ if request.name
1969
+ header_params["name"] = request.name
1970
+ end
1971
+
1972
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1973
+ metadata[:"x-goog-request-params"] ||= request_params_header
1974
+
1975
+ options.apply_defaults timeout: @config.rpcs.get_interconnect_attachment.timeout,
1976
+ metadata: metadata,
1977
+ retry_policy: @config.rpcs.get_interconnect_attachment.retry_policy
1978
+
1979
+ options.apply_defaults timeout: @config.timeout,
1980
+ metadata: @config.metadata,
1981
+ retry_policy: @config.retry_policy
1982
+
1983
+ @edge_network_stub.call_rpc :get_interconnect_attachment, request, options: options do |response, operation|
1984
+ yield response, operation if block_given?
1985
+ return response
1986
+ end
1987
+ rescue ::GRPC::BadStatus => e
1988
+ raise ::Google::Cloud::Error.from_error(e)
1989
+ end
1990
+
1991
+ ##
1992
+ # Creates a new InterconnectAttachment in a given project and location.
1993
+ #
1994
+ # @overload create_interconnect_attachment(request, options = nil)
1995
+ # Pass arguments to `create_interconnect_attachment` via a request object, either of type
1996
+ # {::Google::Cloud::EdgeNetwork::V1::CreateInterconnectAttachmentRequest} or an equivalent Hash.
1997
+ #
1998
+ # @param request [::Google::Cloud::EdgeNetwork::V1::CreateInterconnectAttachmentRequest, ::Hash]
1999
+ # A request object representing the call parameters. Required. To specify no
2000
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2001
+ # @param options [::Gapic::CallOptions, ::Hash]
2002
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2003
+ #
2004
+ # @overload create_interconnect_attachment(parent: nil, interconnect_attachment_id: nil, interconnect_attachment: nil, request_id: nil)
2005
+ # Pass arguments to `create_interconnect_attachment` via keyword arguments. Note that at
2006
+ # least one keyword argument is required. To specify no parameters, or to keep all
2007
+ # the default parameter values, pass an empty Hash as a request object (see above).
2008
+ #
2009
+ # @param parent [::String]
2010
+ # Required. Value for parent.
2011
+ # @param interconnect_attachment_id [::String]
2012
+ # Required. Id of the requesting object
2013
+ # If auto-generating Id server-side, remove this field and
2014
+ # interconnect_attachment_id from the method_signature of Create RPC
2015
+ # @param interconnect_attachment [::Google::Cloud::EdgeNetwork::V1::InterconnectAttachment, ::Hash]
2016
+ # Required. The resource being created
2017
+ # @param request_id [::String]
2018
+ # Optional. An optional request ID to identify requests. Specify a unique
2019
+ # request ID so that if you must retry your request, the server will know to
2020
+ # ignore the request if it has already been completed. The server will
2021
+ # guarantee that for at least 60 minutes since the first request.
2022
+ #
2023
+ # For example, consider a situation where you make an initial request and
2024
+ # the request times out. If you make the request again with the same request
2025
+ # ID, the server can check if original operation with the same request ID
2026
+ # was received, and if so, will ignore the second request. This prevents
2027
+ # clients from accidentally creating duplicate commitments.
2028
+ #
2029
+ # The request ID must be a valid UUID with the exception that zero UUID is
2030
+ # not supported (00000000-0000-0000-0000-000000000000).
2031
+ #
2032
+ # @yield [response, operation] Access the result along with the RPC operation
2033
+ # @yieldparam response [::Gapic::Operation]
2034
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2035
+ #
2036
+ # @return [::Gapic::Operation]
2037
+ #
2038
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2039
+ #
2040
+ # @example Basic example
2041
+ # require "google/cloud/edge_network/v1"
2042
+ #
2043
+ # # Create a client object. The client can be reused for multiple calls.
2044
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
2045
+ #
2046
+ # # Create a request. To set request fields, pass in keyword arguments.
2047
+ # request = Google::Cloud::EdgeNetwork::V1::CreateInterconnectAttachmentRequest.new
2048
+ #
2049
+ # # Call the create_interconnect_attachment method.
2050
+ # result = client.create_interconnect_attachment request
2051
+ #
2052
+ # # The returned object is of type Gapic::Operation. You can use it to
2053
+ # # check the status of an operation, cancel it, or wait for results.
2054
+ # # Here is how to wait for a response.
2055
+ # result.wait_until_done! timeout: 60
2056
+ # if result.response?
2057
+ # p result.response
2058
+ # else
2059
+ # puts "No response received."
2060
+ # end
2061
+ #
2062
+ def create_interconnect_attachment request, options = nil
2063
+ raise ::ArgumentError, "request must be provided" if request.nil?
2064
+
2065
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::CreateInterconnectAttachmentRequest
2066
+
2067
+ # Converts hash and nil to an options object
2068
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2069
+
2070
+ # Customize the options with defaults
2071
+ metadata = @config.rpcs.create_interconnect_attachment.metadata.to_h
2072
+
2073
+ # Set x-goog-api-client and x-goog-user-project headers
2074
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2075
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2076
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
2077
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2078
+
2079
+ header_params = {}
2080
+ if request.parent
2081
+ header_params["parent"] = request.parent
2082
+ end
2083
+
2084
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2085
+ metadata[:"x-goog-request-params"] ||= request_params_header
2086
+
2087
+ options.apply_defaults timeout: @config.rpcs.create_interconnect_attachment.timeout,
2088
+ metadata: metadata,
2089
+ retry_policy: @config.rpcs.create_interconnect_attachment.retry_policy
2090
+
2091
+ options.apply_defaults timeout: @config.timeout,
2092
+ metadata: @config.metadata,
2093
+ retry_policy: @config.retry_policy
2094
+
2095
+ @edge_network_stub.call_rpc :create_interconnect_attachment, request, options: options do |response, operation|
2096
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2097
+ yield response, operation if block_given?
2098
+ return response
2099
+ end
2100
+ rescue ::GRPC::BadStatus => e
2101
+ raise ::Google::Cloud::Error.from_error(e)
2102
+ end
2103
+
2104
+ ##
2105
+ # Deletes a single InterconnectAttachment.
2106
+ #
2107
+ # @overload delete_interconnect_attachment(request, options = nil)
2108
+ # Pass arguments to `delete_interconnect_attachment` via a request object, either of type
2109
+ # {::Google::Cloud::EdgeNetwork::V1::DeleteInterconnectAttachmentRequest} or an equivalent Hash.
2110
+ #
2111
+ # @param request [::Google::Cloud::EdgeNetwork::V1::DeleteInterconnectAttachmentRequest, ::Hash]
2112
+ # A request object representing the call parameters. Required. To specify no
2113
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2114
+ # @param options [::Gapic::CallOptions, ::Hash]
2115
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2116
+ #
2117
+ # @overload delete_interconnect_attachment(name: nil, request_id: nil)
2118
+ # Pass arguments to `delete_interconnect_attachment` via keyword arguments. Note that at
2119
+ # least one keyword argument is required. To specify no parameters, or to keep all
2120
+ # the default parameter values, pass an empty Hash as a request object (see above).
2121
+ #
2122
+ # @param name [::String]
2123
+ # Required. Name of the resource
2124
+ # @param request_id [::String]
2125
+ # Optional. An optional request ID to identify requests. Specify a unique
2126
+ # request ID so that if you must retry your request, the server will know to
2127
+ # ignore the request if it has already been completed. The server will
2128
+ # guarantee that for at least 60 minutes after the first request.
2129
+ #
2130
+ # For example, consider a situation where you make an initial request and
2131
+ # the request times out. If you make the request again with the same request
2132
+ # ID, the server can check if original operation with the same request ID
2133
+ # was received, and if so, will ignore the second request. This prevents
2134
+ # clients from accidentally creating duplicate commitments.
2135
+ #
2136
+ # The request ID must be a valid UUID with the exception that zero UUID is
2137
+ # not supported (00000000-0000-0000-0000-000000000000).
2138
+ #
2139
+ # @yield [response, operation] Access the result along with the RPC operation
2140
+ # @yieldparam response [::Gapic::Operation]
2141
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2142
+ #
2143
+ # @return [::Gapic::Operation]
2144
+ #
2145
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2146
+ #
2147
+ # @example Basic example
2148
+ # require "google/cloud/edge_network/v1"
2149
+ #
2150
+ # # Create a client object. The client can be reused for multiple calls.
2151
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
2152
+ #
2153
+ # # Create a request. To set request fields, pass in keyword arguments.
2154
+ # request = Google::Cloud::EdgeNetwork::V1::DeleteInterconnectAttachmentRequest.new
2155
+ #
2156
+ # # Call the delete_interconnect_attachment method.
2157
+ # result = client.delete_interconnect_attachment request
2158
+ #
2159
+ # # The returned object is of type Gapic::Operation. You can use it to
2160
+ # # check the status of an operation, cancel it, or wait for results.
2161
+ # # Here is how to wait for a response.
2162
+ # result.wait_until_done! timeout: 60
2163
+ # if result.response?
2164
+ # p result.response
2165
+ # else
2166
+ # puts "No response received."
2167
+ # end
2168
+ #
2169
+ def delete_interconnect_attachment request, options = nil
2170
+ raise ::ArgumentError, "request must be provided" if request.nil?
2171
+
2172
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::DeleteInterconnectAttachmentRequest
2173
+
2174
+ # Converts hash and nil to an options object
2175
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2176
+
2177
+ # Customize the options with defaults
2178
+ metadata = @config.rpcs.delete_interconnect_attachment.metadata.to_h
2179
+
2180
+ # Set x-goog-api-client and x-goog-user-project headers
2181
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2182
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2183
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
2184
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2185
+
2186
+ header_params = {}
2187
+ if request.name
2188
+ header_params["name"] = request.name
2189
+ end
2190
+
2191
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2192
+ metadata[:"x-goog-request-params"] ||= request_params_header
2193
+
2194
+ options.apply_defaults timeout: @config.rpcs.delete_interconnect_attachment.timeout,
2195
+ metadata: metadata,
2196
+ retry_policy: @config.rpcs.delete_interconnect_attachment.retry_policy
2197
+
2198
+ options.apply_defaults timeout: @config.timeout,
2199
+ metadata: @config.metadata,
2200
+ retry_policy: @config.retry_policy
2201
+
2202
+ @edge_network_stub.call_rpc :delete_interconnect_attachment, request, options: options do |response, operation|
2203
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2204
+ yield response, operation if block_given?
2205
+ return response
2206
+ end
2207
+ rescue ::GRPC::BadStatus => e
2208
+ raise ::Google::Cloud::Error.from_error(e)
2209
+ end
2210
+
2211
+ ##
2212
+ # Lists Routers in a given project and location.
2213
+ #
2214
+ # @overload list_routers(request, options = nil)
2215
+ # Pass arguments to `list_routers` via a request object, either of type
2216
+ # {::Google::Cloud::EdgeNetwork::V1::ListRoutersRequest} or an equivalent Hash.
2217
+ #
2218
+ # @param request [::Google::Cloud::EdgeNetwork::V1::ListRoutersRequest, ::Hash]
2219
+ # A request object representing the call parameters. Required. To specify no
2220
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2221
+ # @param options [::Gapic::CallOptions, ::Hash]
2222
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2223
+ #
2224
+ # @overload list_routers(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
2225
+ # Pass arguments to `list_routers` via keyword arguments. Note that at
2226
+ # least one keyword argument is required. To specify no parameters, or to keep all
2227
+ # the default parameter values, pass an empty Hash as a request object (see above).
2228
+ #
2229
+ # @param parent [::String]
2230
+ # Required. Parent value for ListRoutersRequest
2231
+ # @param page_size [::Integer]
2232
+ # Requested page size. Server may return fewer items than requested.
2233
+ # If unspecified, server will pick an appropriate default.
2234
+ # @param page_token [::String]
2235
+ # A token identifying a page of results the server should return.
2236
+ # @param filter [::String]
2237
+ # Filtering results
2238
+ # @param order_by [::String]
2239
+ # Hint for how to order the results
2240
+ #
2241
+ # @yield [response, operation] Access the result along with the RPC operation
2242
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::EdgeNetwork::V1::Router>]
2243
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2244
+ #
2245
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::EdgeNetwork::V1::Router>]
2246
+ #
2247
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2248
+ #
2249
+ # @example Basic example
2250
+ # require "google/cloud/edge_network/v1"
2251
+ #
2252
+ # # Create a client object. The client can be reused for multiple calls.
2253
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
2254
+ #
2255
+ # # Create a request. To set request fields, pass in keyword arguments.
2256
+ # request = Google::Cloud::EdgeNetwork::V1::ListRoutersRequest.new
2257
+ #
2258
+ # # Call the list_routers method.
2259
+ # result = client.list_routers request
2260
+ #
2261
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2262
+ # # over elements, and API calls will be issued to fetch pages as needed.
2263
+ # result.each do |item|
2264
+ # # Each element is of type ::Google::Cloud::EdgeNetwork::V1::Router.
2265
+ # p item
2266
+ # end
2267
+ #
2268
+ def list_routers request, options = nil
2269
+ raise ::ArgumentError, "request must be provided" if request.nil?
2270
+
2271
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::ListRoutersRequest
2272
+
2273
+ # Converts hash and nil to an options object
2274
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2275
+
2276
+ # Customize the options with defaults
2277
+ metadata = @config.rpcs.list_routers.metadata.to_h
2278
+
2279
+ # Set x-goog-api-client and x-goog-user-project headers
2280
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2281
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2282
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
2283
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2284
+
2285
+ header_params = {}
2286
+ if request.parent
2287
+ header_params["parent"] = request.parent
2288
+ end
2289
+
2290
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2291
+ metadata[:"x-goog-request-params"] ||= request_params_header
2292
+
2293
+ options.apply_defaults timeout: @config.rpcs.list_routers.timeout,
2294
+ metadata: metadata,
2295
+ retry_policy: @config.rpcs.list_routers.retry_policy
2296
+
2297
+ options.apply_defaults timeout: @config.timeout,
2298
+ metadata: @config.metadata,
2299
+ retry_policy: @config.retry_policy
2300
+
2301
+ @edge_network_stub.call_rpc :list_routers, request, options: options do |response, operation|
2302
+ response = ::Gapic::PagedEnumerable.new @edge_network_stub, :list_routers, request, response, operation, options
2303
+ yield response, operation if block_given?
2304
+ return response
2305
+ end
2306
+ rescue ::GRPC::BadStatus => e
2307
+ raise ::Google::Cloud::Error.from_error(e)
2308
+ end
2309
+
2310
+ ##
2311
+ # Gets details of a single Router.
2312
+ #
2313
+ # @overload get_router(request, options = nil)
2314
+ # Pass arguments to `get_router` via a request object, either of type
2315
+ # {::Google::Cloud::EdgeNetwork::V1::GetRouterRequest} or an equivalent Hash.
2316
+ #
2317
+ # @param request [::Google::Cloud::EdgeNetwork::V1::GetRouterRequest, ::Hash]
2318
+ # A request object representing the call parameters. Required. To specify no
2319
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2320
+ # @param options [::Gapic::CallOptions, ::Hash]
2321
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2322
+ #
2323
+ # @overload get_router(name: nil)
2324
+ # Pass arguments to `get_router` via keyword arguments. Note that at
2325
+ # least one keyword argument is required. To specify no parameters, or to keep all
2326
+ # the default parameter values, pass an empty Hash as a request object (see above).
2327
+ #
2328
+ # @param name [::String]
2329
+ # Required. Name of the resource
2330
+ #
2331
+ # @yield [response, operation] Access the result along with the RPC operation
2332
+ # @yieldparam response [::Google::Cloud::EdgeNetwork::V1::Router]
2333
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2334
+ #
2335
+ # @return [::Google::Cloud::EdgeNetwork::V1::Router]
2336
+ #
2337
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2338
+ #
2339
+ # @example Basic example
2340
+ # require "google/cloud/edge_network/v1"
2341
+ #
2342
+ # # Create a client object. The client can be reused for multiple calls.
2343
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
2344
+ #
2345
+ # # Create a request. To set request fields, pass in keyword arguments.
2346
+ # request = Google::Cloud::EdgeNetwork::V1::GetRouterRequest.new
2347
+ #
2348
+ # # Call the get_router method.
2349
+ # result = client.get_router request
2350
+ #
2351
+ # # The returned object is of type Google::Cloud::EdgeNetwork::V1::Router.
2352
+ # p result
2353
+ #
2354
+ def get_router request, options = nil
2355
+ raise ::ArgumentError, "request must be provided" if request.nil?
2356
+
2357
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::GetRouterRequest
2358
+
2359
+ # Converts hash and nil to an options object
2360
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2361
+
2362
+ # Customize the options with defaults
2363
+ metadata = @config.rpcs.get_router.metadata.to_h
2364
+
2365
+ # Set x-goog-api-client and x-goog-user-project headers
2366
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2367
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2368
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
2369
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2370
+
2371
+ header_params = {}
2372
+ if request.name
2373
+ header_params["name"] = request.name
2374
+ end
2375
+
2376
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2377
+ metadata[:"x-goog-request-params"] ||= request_params_header
2378
+
2379
+ options.apply_defaults timeout: @config.rpcs.get_router.timeout,
2380
+ metadata: metadata,
2381
+ retry_policy: @config.rpcs.get_router.retry_policy
2382
+
2383
+ options.apply_defaults timeout: @config.timeout,
2384
+ metadata: @config.metadata,
2385
+ retry_policy: @config.retry_policy
2386
+
2387
+ @edge_network_stub.call_rpc :get_router, request, options: options do |response, operation|
2388
+ yield response, operation if block_given?
2389
+ return response
2390
+ end
2391
+ rescue ::GRPC::BadStatus => e
2392
+ raise ::Google::Cloud::Error.from_error(e)
2393
+ end
2394
+
2395
+ ##
2396
+ # Get the diagnostics of a single router resource.
2397
+ #
2398
+ # @overload diagnose_router(request, options = nil)
2399
+ # Pass arguments to `diagnose_router` via a request object, either of type
2400
+ # {::Google::Cloud::EdgeNetwork::V1::DiagnoseRouterRequest} or an equivalent Hash.
2401
+ #
2402
+ # @param request [::Google::Cloud::EdgeNetwork::V1::DiagnoseRouterRequest, ::Hash]
2403
+ # A request object representing the call parameters. Required. To specify no
2404
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2405
+ # @param options [::Gapic::CallOptions, ::Hash]
2406
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2407
+ #
2408
+ # @overload diagnose_router(name: nil)
2409
+ # Pass arguments to `diagnose_router` via keyword arguments. Note that at
2410
+ # least one keyword argument is required. To specify no parameters, or to keep all
2411
+ # the default parameter values, pass an empty Hash as a request object (see above).
2412
+ #
2413
+ # @param name [::String]
2414
+ # Required. The name of the router resource.
2415
+ #
2416
+ # @yield [response, operation] Access the result along with the RPC operation
2417
+ # @yieldparam response [::Google::Cloud::EdgeNetwork::V1::DiagnoseRouterResponse]
2418
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2419
+ #
2420
+ # @return [::Google::Cloud::EdgeNetwork::V1::DiagnoseRouterResponse]
2421
+ #
2422
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2423
+ #
2424
+ # @example Basic example
2425
+ # require "google/cloud/edge_network/v1"
2426
+ #
2427
+ # # Create a client object. The client can be reused for multiple calls.
2428
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
2429
+ #
2430
+ # # Create a request. To set request fields, pass in keyword arguments.
2431
+ # request = Google::Cloud::EdgeNetwork::V1::DiagnoseRouterRequest.new
2432
+ #
2433
+ # # Call the diagnose_router method.
2434
+ # result = client.diagnose_router request
2435
+ #
2436
+ # # The returned object is of type Google::Cloud::EdgeNetwork::V1::DiagnoseRouterResponse.
2437
+ # p result
2438
+ #
2439
+ def diagnose_router request, options = nil
2440
+ raise ::ArgumentError, "request must be provided" if request.nil?
2441
+
2442
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::DiagnoseRouterRequest
2443
+
2444
+ # Converts hash and nil to an options object
2445
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2446
+
2447
+ # Customize the options with defaults
2448
+ metadata = @config.rpcs.diagnose_router.metadata.to_h
2449
+
2450
+ # Set x-goog-api-client and x-goog-user-project headers
2451
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2452
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2453
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
2454
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2455
+
2456
+ header_params = {}
2457
+ if request.name
2458
+ header_params["name"] = request.name
2459
+ end
2460
+
2461
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2462
+ metadata[:"x-goog-request-params"] ||= request_params_header
2463
+
2464
+ options.apply_defaults timeout: @config.rpcs.diagnose_router.timeout,
2465
+ metadata: metadata,
2466
+ retry_policy: @config.rpcs.diagnose_router.retry_policy
2467
+
2468
+ options.apply_defaults timeout: @config.timeout,
2469
+ metadata: @config.metadata,
2470
+ retry_policy: @config.retry_policy
2471
+
2472
+ @edge_network_stub.call_rpc :diagnose_router, request, options: options do |response, operation|
2473
+ yield response, operation if block_given?
2474
+ return response
2475
+ end
2476
+ rescue ::GRPC::BadStatus => e
2477
+ raise ::Google::Cloud::Error.from_error(e)
2478
+ end
2479
+
2480
+ ##
2481
+ # Creates a new Router in a given project and location.
2482
+ #
2483
+ # @overload create_router(request, options = nil)
2484
+ # Pass arguments to `create_router` via a request object, either of type
2485
+ # {::Google::Cloud::EdgeNetwork::V1::CreateRouterRequest} or an equivalent Hash.
2486
+ #
2487
+ # @param request [::Google::Cloud::EdgeNetwork::V1::CreateRouterRequest, ::Hash]
2488
+ # A request object representing the call parameters. Required. To specify no
2489
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2490
+ # @param options [::Gapic::CallOptions, ::Hash]
2491
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2492
+ #
2493
+ # @overload create_router(parent: nil, router_id: nil, router: nil, request_id: nil)
2494
+ # Pass arguments to `create_router` via keyword arguments. Note that at
2495
+ # least one keyword argument is required. To specify no parameters, or to keep all
2496
+ # the default parameter values, pass an empty Hash as a request object (see above).
2497
+ #
2498
+ # @param parent [::String]
2499
+ # Required. Value for parent.
2500
+ # @param router_id [::String]
2501
+ # Required. Id of the requesting object
2502
+ # If auto-generating Id server-side, remove this field and
2503
+ # router_id from the method_signature of Create RPC
2504
+ # @param router [::Google::Cloud::EdgeNetwork::V1::Router, ::Hash]
2505
+ # Required. The resource being created
2506
+ # @param request_id [::String]
2507
+ # Optional. An optional request ID to identify requests. Specify a unique
2508
+ # request ID so that if you must retry your request, the server will know to
2509
+ # ignore the request if it has already been completed. The server will
2510
+ # guarantee that for at least 60 minutes since the first request.
2511
+ #
2512
+ # For example, consider a situation where you make an initial request and
2513
+ # the request times out. If you make the request again with the same request
2514
+ # ID, the server can check if original operation with the same request ID
2515
+ # was received, and if so, will ignore the second request. This prevents
2516
+ # clients from accidentally creating duplicate commitments.
2517
+ #
2518
+ # The request ID must be a valid UUID with the exception that zero UUID is
2519
+ # not supported (00000000-0000-0000-0000-000000000000).
2520
+ #
2521
+ # @yield [response, operation] Access the result along with the RPC operation
2522
+ # @yieldparam response [::Gapic::Operation]
2523
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2524
+ #
2525
+ # @return [::Gapic::Operation]
2526
+ #
2527
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2528
+ #
2529
+ # @example Basic example
2530
+ # require "google/cloud/edge_network/v1"
2531
+ #
2532
+ # # Create a client object. The client can be reused for multiple calls.
2533
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
2534
+ #
2535
+ # # Create a request. To set request fields, pass in keyword arguments.
2536
+ # request = Google::Cloud::EdgeNetwork::V1::CreateRouterRequest.new
2537
+ #
2538
+ # # Call the create_router method.
2539
+ # result = client.create_router request
2540
+ #
2541
+ # # The returned object is of type Gapic::Operation. You can use it to
2542
+ # # check the status of an operation, cancel it, or wait for results.
2543
+ # # Here is how to wait for a response.
2544
+ # result.wait_until_done! timeout: 60
2545
+ # if result.response?
2546
+ # p result.response
2547
+ # else
2548
+ # puts "No response received."
2549
+ # end
2550
+ #
2551
+ def create_router request, options = nil
2552
+ raise ::ArgumentError, "request must be provided" if request.nil?
2553
+
2554
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::CreateRouterRequest
2555
+
2556
+ # Converts hash and nil to an options object
2557
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2558
+
2559
+ # Customize the options with defaults
2560
+ metadata = @config.rpcs.create_router.metadata.to_h
2561
+
2562
+ # Set x-goog-api-client and x-goog-user-project headers
2563
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2564
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2565
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
2566
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2567
+
2568
+ header_params = {}
2569
+ if request.parent
2570
+ header_params["parent"] = request.parent
2571
+ end
2572
+
2573
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2574
+ metadata[:"x-goog-request-params"] ||= request_params_header
2575
+
2576
+ options.apply_defaults timeout: @config.rpcs.create_router.timeout,
2577
+ metadata: metadata,
2578
+ retry_policy: @config.rpcs.create_router.retry_policy
2579
+
2580
+ options.apply_defaults timeout: @config.timeout,
2581
+ metadata: @config.metadata,
2582
+ retry_policy: @config.retry_policy
2583
+
2584
+ @edge_network_stub.call_rpc :create_router, request, options: options do |response, operation|
2585
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2586
+ yield response, operation if block_given?
2587
+ return response
2588
+ end
2589
+ rescue ::GRPC::BadStatus => e
2590
+ raise ::Google::Cloud::Error.from_error(e)
2591
+ end
2592
+
2593
+ ##
2594
+ # Updates the parameters of a single Router.
2595
+ #
2596
+ # @overload update_router(request, options = nil)
2597
+ # Pass arguments to `update_router` via a request object, either of type
2598
+ # {::Google::Cloud::EdgeNetwork::V1::UpdateRouterRequest} or an equivalent Hash.
2599
+ #
2600
+ # @param request [::Google::Cloud::EdgeNetwork::V1::UpdateRouterRequest, ::Hash]
2601
+ # A request object representing the call parameters. Required. To specify no
2602
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2603
+ # @param options [::Gapic::CallOptions, ::Hash]
2604
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2605
+ #
2606
+ # @overload update_router(update_mask: nil, router: nil, request_id: nil)
2607
+ # Pass arguments to `update_router` via keyword arguments. Note that at
2608
+ # least one keyword argument is required. To specify no parameters, or to keep all
2609
+ # the default parameter values, pass an empty Hash as a request object (see above).
2610
+ #
2611
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2612
+ # Required. Field mask is used to specify the fields to be overwritten in the
2613
+ # Router resource by the update.
2614
+ # The fields specified in the update_mask are relative to the resource, not
2615
+ # the full request. A field will be overwritten if it is in the mask. If the
2616
+ # user does not provide a mask then all fields will be overwritten.
2617
+ # @param router [::Google::Cloud::EdgeNetwork::V1::Router, ::Hash]
2618
+ # Required. The resource being updated
2619
+ # @param request_id [::String]
2620
+ # Optional. An optional request ID to identify requests. Specify a unique
2621
+ # request ID so that if you must retry your request, the server will know to
2622
+ # ignore the request if it has already been completed. The server will
2623
+ # guarantee that for at least 60 minutes since the first request.
2624
+ #
2625
+ # For example, consider a situation where you make an initial request and
2626
+ # the request times out. If you make the request again with the same request
2627
+ # ID, the server can check if original operation with the same request ID
2628
+ # was received, and if so, will ignore the second request. This prevents
2629
+ # clients from accidentally creating duplicate commitments.
2630
+ #
2631
+ # The request ID must be a valid UUID with the exception that zero UUID is
2632
+ # not supported (00000000-0000-0000-0000-000000000000).
2633
+ #
2634
+ # @yield [response, operation] Access the result along with the RPC operation
2635
+ # @yieldparam response [::Gapic::Operation]
2636
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2637
+ #
2638
+ # @return [::Gapic::Operation]
2639
+ #
2640
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2641
+ #
2642
+ # @example Basic example
2643
+ # require "google/cloud/edge_network/v1"
2644
+ #
2645
+ # # Create a client object. The client can be reused for multiple calls.
2646
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
2647
+ #
2648
+ # # Create a request. To set request fields, pass in keyword arguments.
2649
+ # request = Google::Cloud::EdgeNetwork::V1::UpdateRouterRequest.new
2650
+ #
2651
+ # # Call the update_router method.
2652
+ # result = client.update_router request
2653
+ #
2654
+ # # The returned object is of type Gapic::Operation. You can use it to
2655
+ # # check the status of an operation, cancel it, or wait for results.
2656
+ # # Here is how to wait for a response.
2657
+ # result.wait_until_done! timeout: 60
2658
+ # if result.response?
2659
+ # p result.response
2660
+ # else
2661
+ # puts "No response received."
2662
+ # end
2663
+ #
2664
+ def update_router request, options = nil
2665
+ raise ::ArgumentError, "request must be provided" if request.nil?
2666
+
2667
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::UpdateRouterRequest
2668
+
2669
+ # Converts hash and nil to an options object
2670
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2671
+
2672
+ # Customize the options with defaults
2673
+ metadata = @config.rpcs.update_router.metadata.to_h
2674
+
2675
+ # Set x-goog-api-client and x-goog-user-project headers
2676
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2677
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2678
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
2679
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2680
+
2681
+ header_params = {}
2682
+ if request.router&.name
2683
+ header_params["router.name"] = request.router.name
2684
+ end
2685
+
2686
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2687
+ metadata[:"x-goog-request-params"] ||= request_params_header
2688
+
2689
+ options.apply_defaults timeout: @config.rpcs.update_router.timeout,
2690
+ metadata: metadata,
2691
+ retry_policy: @config.rpcs.update_router.retry_policy
2692
+
2693
+ options.apply_defaults timeout: @config.timeout,
2694
+ metadata: @config.metadata,
2695
+ retry_policy: @config.retry_policy
2696
+
2697
+ @edge_network_stub.call_rpc :update_router, request, options: options do |response, operation|
2698
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2699
+ yield response, operation if block_given?
2700
+ return response
2701
+ end
2702
+ rescue ::GRPC::BadStatus => e
2703
+ raise ::Google::Cloud::Error.from_error(e)
2704
+ end
2705
+
2706
+ ##
2707
+ # Deletes a single Router.
2708
+ #
2709
+ # @overload delete_router(request, options = nil)
2710
+ # Pass arguments to `delete_router` via a request object, either of type
2711
+ # {::Google::Cloud::EdgeNetwork::V1::DeleteRouterRequest} or an equivalent Hash.
2712
+ #
2713
+ # @param request [::Google::Cloud::EdgeNetwork::V1::DeleteRouterRequest, ::Hash]
2714
+ # A request object representing the call parameters. Required. To specify no
2715
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2716
+ # @param options [::Gapic::CallOptions, ::Hash]
2717
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2718
+ #
2719
+ # @overload delete_router(name: nil, request_id: nil)
2720
+ # Pass arguments to `delete_router` via keyword arguments. Note that at
2721
+ # least one keyword argument is required. To specify no parameters, or to keep all
2722
+ # the default parameter values, pass an empty Hash as a request object (see above).
2723
+ #
2724
+ # @param name [::String]
2725
+ # Required. Name of the resource
2726
+ # @param request_id [::String]
2727
+ # Optional. An optional request ID to identify requests. Specify a unique
2728
+ # request ID so that if you must retry your request, the server will know to
2729
+ # ignore the request if it has already been completed. The server will
2730
+ # guarantee that for at least 60 minutes after the first request.
2731
+ #
2732
+ # For example, consider a situation where you make an initial request and
2733
+ # the request times out. If you make the request again with the same request
2734
+ # ID, the server can check if original operation with the same request ID
2735
+ # was received, and if so, will ignore the second request. This prevents
2736
+ # clients from accidentally creating duplicate commitments.
2737
+ #
2738
+ # The request ID must be a valid UUID with the exception that zero UUID is
2739
+ # not supported (00000000-0000-0000-0000-000000000000).
2740
+ #
2741
+ # @yield [response, operation] Access the result along with the RPC operation
2742
+ # @yieldparam response [::Gapic::Operation]
2743
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2744
+ #
2745
+ # @return [::Gapic::Operation]
2746
+ #
2747
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2748
+ #
2749
+ # @example Basic example
2750
+ # require "google/cloud/edge_network/v1"
2751
+ #
2752
+ # # Create a client object. The client can be reused for multiple calls.
2753
+ # client = Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new
2754
+ #
2755
+ # # Create a request. To set request fields, pass in keyword arguments.
2756
+ # request = Google::Cloud::EdgeNetwork::V1::DeleteRouterRequest.new
2757
+ #
2758
+ # # Call the delete_router method.
2759
+ # result = client.delete_router request
2760
+ #
2761
+ # # The returned object is of type Gapic::Operation. You can use it to
2762
+ # # check the status of an operation, cancel it, or wait for results.
2763
+ # # Here is how to wait for a response.
2764
+ # result.wait_until_done! timeout: 60
2765
+ # if result.response?
2766
+ # p result.response
2767
+ # else
2768
+ # puts "No response received."
2769
+ # end
2770
+ #
2771
+ def delete_router request, options = nil
2772
+ raise ::ArgumentError, "request must be provided" if request.nil?
2773
+
2774
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeNetwork::V1::DeleteRouterRequest
2775
+
2776
+ # Converts hash and nil to an options object
2777
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2778
+
2779
+ # Customize the options with defaults
2780
+ metadata = @config.rpcs.delete_router.metadata.to_h
2781
+
2782
+ # Set x-goog-api-client and x-goog-user-project headers
2783
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2784
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2785
+ gapic_version: ::Google::Cloud::EdgeNetwork::V1::VERSION
2786
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2787
+
2788
+ header_params = {}
2789
+ if request.name
2790
+ header_params["name"] = request.name
2791
+ end
2792
+
2793
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2794
+ metadata[:"x-goog-request-params"] ||= request_params_header
2795
+
2796
+ options.apply_defaults timeout: @config.rpcs.delete_router.timeout,
2797
+ metadata: metadata,
2798
+ retry_policy: @config.rpcs.delete_router.retry_policy
2799
+
2800
+ options.apply_defaults timeout: @config.timeout,
2801
+ metadata: @config.metadata,
2802
+ retry_policy: @config.retry_policy
2803
+
2804
+ @edge_network_stub.call_rpc :delete_router, request, options: options do |response, operation|
2805
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2806
+ yield response, operation if block_given?
2807
+ return response
2808
+ end
2809
+ rescue ::GRPC::BadStatus => e
2810
+ raise ::Google::Cloud::Error.from_error(e)
2811
+ end
2812
+
2813
+ ##
2814
+ # Configuration class for the EdgeNetwork API.
2815
+ #
2816
+ # This class represents the configuration for EdgeNetwork,
2817
+ # providing control over timeouts, retry behavior, logging, transport
2818
+ # parameters, and other low-level controls. Certain parameters can also be
2819
+ # applied individually to specific RPCs. See
2820
+ # {::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client::Configuration::Rpcs}
2821
+ # for a list of RPCs that can be configured independently.
2822
+ #
2823
+ # Configuration can be applied globally to all clients, or to a single client
2824
+ # on construction.
2825
+ #
2826
+ # @example
2827
+ #
2828
+ # # Modify the global config, setting the timeout for
2829
+ # # initialize_zone to 20 seconds,
2830
+ # # and all remaining timeouts to 10 seconds.
2831
+ # ::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.configure do |config|
2832
+ # config.timeout = 10.0
2833
+ # config.rpcs.initialize_zone.timeout = 20.0
2834
+ # end
2835
+ #
2836
+ # # Apply the above configuration only to a new client.
2837
+ # client = ::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new do |config|
2838
+ # config.timeout = 10.0
2839
+ # config.rpcs.initialize_zone.timeout = 20.0
2840
+ # end
2841
+ #
2842
+ # @!attribute [rw] endpoint
2843
+ # The hostname or hostname:port of the service endpoint.
2844
+ # Defaults to `"edgenetwork.googleapis.com"`.
2845
+ # @return [::String]
2846
+ # @!attribute [rw] credentials
2847
+ # Credentials to send with calls. You may provide any of the following types:
2848
+ # * (`String`) The path to a service account key file in JSON format
2849
+ # * (`Hash`) A service account key as a Hash
2850
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
2851
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
2852
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2853
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
2854
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
2855
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
2856
+ # * (`nil`) indicating no credentials
2857
+ # @return [::Object]
2858
+ # @!attribute [rw] scope
2859
+ # The OAuth scopes
2860
+ # @return [::Array<::String>]
2861
+ # @!attribute [rw] lib_name
2862
+ # The library name as recorded in instrumentation and logging
2863
+ # @return [::String]
2864
+ # @!attribute [rw] lib_version
2865
+ # The library version as recorded in instrumentation and logging
2866
+ # @return [::String]
2867
+ # @!attribute [rw] channel_args
2868
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
2869
+ # `GRPC::Core::Channel` object is provided as the credential.
2870
+ # @return [::Hash]
2871
+ # @!attribute [rw] interceptors
2872
+ # An array of interceptors that are run before calls are executed.
2873
+ # @return [::Array<::GRPC::ClientInterceptor>]
2874
+ # @!attribute [rw] timeout
2875
+ # The call timeout in seconds.
2876
+ # @return [::Numeric]
2877
+ # @!attribute [rw] metadata
2878
+ # Additional gRPC headers to be sent with the call.
2879
+ # @return [::Hash{::Symbol=>::String}]
2880
+ # @!attribute [rw] retry_policy
2881
+ # The retry policy. The value is a hash with the following keys:
2882
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2883
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2884
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2885
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2886
+ # trigger a retry.
2887
+ # @return [::Hash]
2888
+ # @!attribute [rw] quota_project
2889
+ # A separate project against which to charge quota.
2890
+ # @return [::String]
2891
+ #
2892
+ class Configuration
2893
+ extend ::Gapic::Config
2894
+
2895
+ DEFAULT_ENDPOINT = "edgenetwork.googleapis.com"
2896
+
2897
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
2898
+ config_attr :credentials, nil do |value|
2899
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2900
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
2901
+ allowed.any? { |klass| klass === value }
2902
+ end
2903
+ config_attr :scope, nil, ::String, ::Array, nil
2904
+ config_attr :lib_name, nil, ::String, nil
2905
+ config_attr :lib_version, nil, ::String, nil
2906
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
2907
+ config_attr :interceptors, nil, ::Array, nil
2908
+ config_attr :timeout, nil, ::Numeric, nil
2909
+ config_attr :metadata, nil, ::Hash, nil
2910
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2911
+ config_attr :quota_project, nil, ::String, nil
2912
+
2913
+ # @private
2914
+ def initialize parent_config = nil
2915
+ @parent_config = parent_config unless parent_config.nil?
2916
+
2917
+ yield self if block_given?
2918
+ end
2919
+
2920
+ ##
2921
+ # Configurations for individual RPCs
2922
+ # @return [Rpcs]
2923
+ #
2924
+ def rpcs
2925
+ @rpcs ||= begin
2926
+ parent_rpcs = nil
2927
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
2928
+ Rpcs.new parent_rpcs
2929
+ end
2930
+ end
2931
+
2932
+ ##
2933
+ # Configuration for the channel pool
2934
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
2935
+ #
2936
+ def channel_pool
2937
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
2938
+ end
2939
+
2940
+ ##
2941
+ # Configuration RPC class for the EdgeNetwork API.
2942
+ #
2943
+ # Includes fields providing the configuration for each RPC in this service.
2944
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2945
+ # the following configuration fields:
2946
+ #
2947
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
2948
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
2949
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2950
+ # include the following keys:
2951
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2952
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2953
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2954
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2955
+ # trigger a retry.
2956
+ #
2957
+ class Rpcs
2958
+ ##
2959
+ # RPC-specific configuration for `initialize_zone`
2960
+ # @return [::Gapic::Config::Method]
2961
+ #
2962
+ attr_reader :initialize_zone
2963
+ ##
2964
+ # RPC-specific configuration for `list_zones`
2965
+ # @return [::Gapic::Config::Method]
2966
+ #
2967
+ attr_reader :list_zones
2968
+ ##
2969
+ # RPC-specific configuration for `get_zone`
2970
+ # @return [::Gapic::Config::Method]
2971
+ #
2972
+ attr_reader :get_zone
2973
+ ##
2974
+ # RPC-specific configuration for `list_networks`
2975
+ # @return [::Gapic::Config::Method]
2976
+ #
2977
+ attr_reader :list_networks
2978
+ ##
2979
+ # RPC-specific configuration for `get_network`
2980
+ # @return [::Gapic::Config::Method]
2981
+ #
2982
+ attr_reader :get_network
2983
+ ##
2984
+ # RPC-specific configuration for `diagnose_network`
2985
+ # @return [::Gapic::Config::Method]
2986
+ #
2987
+ attr_reader :diagnose_network
2988
+ ##
2989
+ # RPC-specific configuration for `create_network`
2990
+ # @return [::Gapic::Config::Method]
2991
+ #
2992
+ attr_reader :create_network
2993
+ ##
2994
+ # RPC-specific configuration for `delete_network`
2995
+ # @return [::Gapic::Config::Method]
2996
+ #
2997
+ attr_reader :delete_network
2998
+ ##
2999
+ # RPC-specific configuration for `list_subnets`
3000
+ # @return [::Gapic::Config::Method]
3001
+ #
3002
+ attr_reader :list_subnets
3003
+ ##
3004
+ # RPC-specific configuration for `get_subnet`
3005
+ # @return [::Gapic::Config::Method]
3006
+ #
3007
+ attr_reader :get_subnet
3008
+ ##
3009
+ # RPC-specific configuration for `create_subnet`
3010
+ # @return [::Gapic::Config::Method]
3011
+ #
3012
+ attr_reader :create_subnet
3013
+ ##
3014
+ # RPC-specific configuration for `update_subnet`
3015
+ # @return [::Gapic::Config::Method]
3016
+ #
3017
+ attr_reader :update_subnet
3018
+ ##
3019
+ # RPC-specific configuration for `delete_subnet`
3020
+ # @return [::Gapic::Config::Method]
3021
+ #
3022
+ attr_reader :delete_subnet
3023
+ ##
3024
+ # RPC-specific configuration for `list_interconnects`
3025
+ # @return [::Gapic::Config::Method]
3026
+ #
3027
+ attr_reader :list_interconnects
3028
+ ##
3029
+ # RPC-specific configuration for `get_interconnect`
3030
+ # @return [::Gapic::Config::Method]
3031
+ #
3032
+ attr_reader :get_interconnect
3033
+ ##
3034
+ # RPC-specific configuration for `diagnose_interconnect`
3035
+ # @return [::Gapic::Config::Method]
3036
+ #
3037
+ attr_reader :diagnose_interconnect
3038
+ ##
3039
+ # RPC-specific configuration for `list_interconnect_attachments`
3040
+ # @return [::Gapic::Config::Method]
3041
+ #
3042
+ attr_reader :list_interconnect_attachments
3043
+ ##
3044
+ # RPC-specific configuration for `get_interconnect_attachment`
3045
+ # @return [::Gapic::Config::Method]
3046
+ #
3047
+ attr_reader :get_interconnect_attachment
3048
+ ##
3049
+ # RPC-specific configuration for `create_interconnect_attachment`
3050
+ # @return [::Gapic::Config::Method]
3051
+ #
3052
+ attr_reader :create_interconnect_attachment
3053
+ ##
3054
+ # RPC-specific configuration for `delete_interconnect_attachment`
3055
+ # @return [::Gapic::Config::Method]
3056
+ #
3057
+ attr_reader :delete_interconnect_attachment
3058
+ ##
3059
+ # RPC-specific configuration for `list_routers`
3060
+ # @return [::Gapic::Config::Method]
3061
+ #
3062
+ attr_reader :list_routers
3063
+ ##
3064
+ # RPC-specific configuration for `get_router`
3065
+ # @return [::Gapic::Config::Method]
3066
+ #
3067
+ attr_reader :get_router
3068
+ ##
3069
+ # RPC-specific configuration for `diagnose_router`
3070
+ # @return [::Gapic::Config::Method]
3071
+ #
3072
+ attr_reader :diagnose_router
3073
+ ##
3074
+ # RPC-specific configuration for `create_router`
3075
+ # @return [::Gapic::Config::Method]
3076
+ #
3077
+ attr_reader :create_router
3078
+ ##
3079
+ # RPC-specific configuration for `update_router`
3080
+ # @return [::Gapic::Config::Method]
3081
+ #
3082
+ attr_reader :update_router
3083
+ ##
3084
+ # RPC-specific configuration for `delete_router`
3085
+ # @return [::Gapic::Config::Method]
3086
+ #
3087
+ attr_reader :delete_router
3088
+
3089
+ # @private
3090
+ def initialize parent_rpcs = nil
3091
+ initialize_zone_config = parent_rpcs.initialize_zone if parent_rpcs.respond_to? :initialize_zone
3092
+ @initialize_zone = ::Gapic::Config::Method.new initialize_zone_config
3093
+ list_zones_config = parent_rpcs.list_zones if parent_rpcs.respond_to? :list_zones
3094
+ @list_zones = ::Gapic::Config::Method.new list_zones_config
3095
+ get_zone_config = parent_rpcs.get_zone if parent_rpcs.respond_to? :get_zone
3096
+ @get_zone = ::Gapic::Config::Method.new get_zone_config
3097
+ list_networks_config = parent_rpcs.list_networks if parent_rpcs.respond_to? :list_networks
3098
+ @list_networks = ::Gapic::Config::Method.new list_networks_config
3099
+ get_network_config = parent_rpcs.get_network if parent_rpcs.respond_to? :get_network
3100
+ @get_network = ::Gapic::Config::Method.new get_network_config
3101
+ diagnose_network_config = parent_rpcs.diagnose_network if parent_rpcs.respond_to? :diagnose_network
3102
+ @diagnose_network = ::Gapic::Config::Method.new diagnose_network_config
3103
+ create_network_config = parent_rpcs.create_network if parent_rpcs.respond_to? :create_network
3104
+ @create_network = ::Gapic::Config::Method.new create_network_config
3105
+ delete_network_config = parent_rpcs.delete_network if parent_rpcs.respond_to? :delete_network
3106
+ @delete_network = ::Gapic::Config::Method.new delete_network_config
3107
+ list_subnets_config = parent_rpcs.list_subnets if parent_rpcs.respond_to? :list_subnets
3108
+ @list_subnets = ::Gapic::Config::Method.new list_subnets_config
3109
+ get_subnet_config = parent_rpcs.get_subnet if parent_rpcs.respond_to? :get_subnet
3110
+ @get_subnet = ::Gapic::Config::Method.new get_subnet_config
3111
+ create_subnet_config = parent_rpcs.create_subnet if parent_rpcs.respond_to? :create_subnet
3112
+ @create_subnet = ::Gapic::Config::Method.new create_subnet_config
3113
+ update_subnet_config = parent_rpcs.update_subnet if parent_rpcs.respond_to? :update_subnet
3114
+ @update_subnet = ::Gapic::Config::Method.new update_subnet_config
3115
+ delete_subnet_config = parent_rpcs.delete_subnet if parent_rpcs.respond_to? :delete_subnet
3116
+ @delete_subnet = ::Gapic::Config::Method.new delete_subnet_config
3117
+ list_interconnects_config = parent_rpcs.list_interconnects if parent_rpcs.respond_to? :list_interconnects
3118
+ @list_interconnects = ::Gapic::Config::Method.new list_interconnects_config
3119
+ get_interconnect_config = parent_rpcs.get_interconnect if parent_rpcs.respond_to? :get_interconnect
3120
+ @get_interconnect = ::Gapic::Config::Method.new get_interconnect_config
3121
+ diagnose_interconnect_config = parent_rpcs.diagnose_interconnect if parent_rpcs.respond_to? :diagnose_interconnect
3122
+ @diagnose_interconnect = ::Gapic::Config::Method.new diagnose_interconnect_config
3123
+ list_interconnect_attachments_config = parent_rpcs.list_interconnect_attachments if parent_rpcs.respond_to? :list_interconnect_attachments
3124
+ @list_interconnect_attachments = ::Gapic::Config::Method.new list_interconnect_attachments_config
3125
+ get_interconnect_attachment_config = parent_rpcs.get_interconnect_attachment if parent_rpcs.respond_to? :get_interconnect_attachment
3126
+ @get_interconnect_attachment = ::Gapic::Config::Method.new get_interconnect_attachment_config
3127
+ create_interconnect_attachment_config = parent_rpcs.create_interconnect_attachment if parent_rpcs.respond_to? :create_interconnect_attachment
3128
+ @create_interconnect_attachment = ::Gapic::Config::Method.new create_interconnect_attachment_config
3129
+ delete_interconnect_attachment_config = parent_rpcs.delete_interconnect_attachment if parent_rpcs.respond_to? :delete_interconnect_attachment
3130
+ @delete_interconnect_attachment = ::Gapic::Config::Method.new delete_interconnect_attachment_config
3131
+ list_routers_config = parent_rpcs.list_routers if parent_rpcs.respond_to? :list_routers
3132
+ @list_routers = ::Gapic::Config::Method.new list_routers_config
3133
+ get_router_config = parent_rpcs.get_router if parent_rpcs.respond_to? :get_router
3134
+ @get_router = ::Gapic::Config::Method.new get_router_config
3135
+ diagnose_router_config = parent_rpcs.diagnose_router if parent_rpcs.respond_to? :diagnose_router
3136
+ @diagnose_router = ::Gapic::Config::Method.new diagnose_router_config
3137
+ create_router_config = parent_rpcs.create_router if parent_rpcs.respond_to? :create_router
3138
+ @create_router = ::Gapic::Config::Method.new create_router_config
3139
+ update_router_config = parent_rpcs.update_router if parent_rpcs.respond_to? :update_router
3140
+ @update_router = ::Gapic::Config::Method.new update_router_config
3141
+ delete_router_config = parent_rpcs.delete_router if parent_rpcs.respond_to? :delete_router
3142
+ @delete_router = ::Gapic::Config::Method.new delete_router_config
3143
+
3144
+ yield self if block_given?
3145
+ end
3146
+ end
3147
+ end
3148
+ end
3149
+ end
3150
+ end
3151
+ end
3152
+ end
3153
+ end