google-cloud-network_connectivity-v1beta 0.a → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +153 -8
  5. data/lib/google/cloud/network_connectivity/v1beta/data_transfer_service/client.rb +1782 -0
  6. data/lib/google/cloud/network_connectivity/v1beta/data_transfer_service/credentials.rb +47 -0
  7. data/lib/google/cloud/network_connectivity/v1beta/data_transfer_service/operations.rb +841 -0
  8. data/lib/google/cloud/network_connectivity/v1beta/data_transfer_service/paths.rb +109 -0
  9. data/lib/google/cloud/network_connectivity/v1beta/data_transfer_service.rb +50 -0
  10. data/lib/google/cloud/network_connectivity/v1beta/hub_service/client.rb +3581 -0
  11. data/lib/google/cloud/network_connectivity/v1beta/hub_service/credentials.rb +47 -0
  12. data/lib/google/cloud/network_connectivity/v1beta/hub_service/operations.rb +841 -0
  13. data/lib/google/cloud/network_connectivity/v1beta/hub_service/paths.rb +259 -0
  14. data/lib/google/cloud/network_connectivity/v1beta/hub_service.rb +52 -0
  15. data/lib/google/cloud/network_connectivity/v1beta/policy_based_routing_service/client.rb +877 -0
  16. data/lib/google/cloud/network_connectivity/v1beta/policy_based_routing_service/credentials.rb +47 -0
  17. data/lib/google/cloud/network_connectivity/v1beta/policy_based_routing_service/operations.rb +841 -0
  18. data/lib/google/cloud/network_connectivity/v1beta/policy_based_routing_service/paths.rb +84 -0
  19. data/lib/google/cloud/network_connectivity/v1beta/policy_based_routing_service.rb +51 -0
  20. data/lib/google/cloud/network_connectivity/v1beta/transport_manager/client.rb +1285 -0
  21. data/lib/google/cloud/network_connectivity/v1beta/transport_manager/credentials.rb +47 -0
  22. data/lib/google/cloud/network_connectivity/v1beta/transport_manager/operations.rb +841 -0
  23. data/lib/google/cloud/network_connectivity/v1beta/transport_manager/paths.rb +105 -0
  24. data/lib/google/cloud/network_connectivity/v1beta/transport_manager.rb +50 -0
  25. data/lib/google/cloud/network_connectivity/v1beta/version.rb +7 -2
  26. data/lib/google/cloud/network_connectivity/v1beta.rb +43 -0
  27. data/lib/google/cloud/networkconnectivity/v1beta/common_pb.rb +25 -0
  28. data/lib/google/cloud/networkconnectivity/v1beta/data_transfer_pb.rb +56 -0
  29. data/lib/google/cloud/networkconnectivity/v1beta/data_transfer_services_pb.rb +72 -0
  30. data/lib/google/cloud/networkconnectivity/v1beta/hub_pb.rb +111 -0
  31. data/lib/google/cloud/networkconnectivity/v1beta/hub_services_pb.rb +110 -0
  32. data/lib/google/cloud/networkconnectivity/v1beta/policy_based_routing_pb.rb +42 -0
  33. data/lib/google/cloud/networkconnectivity/v1beta/policy_based_routing_services_pb.rb +52 -0
  34. data/lib/google/cloud/networkconnectivity/v1beta/transport_manager_pb.rb +55 -0
  35. data/lib/google/cloud/networkconnectivity/v1beta/transport_manager_services_pb.rb +59 -0
  36. data/lib/google-cloud-network_connectivity-v1beta.rb +21 -0
  37. data/proto_docs/README.md +4 -0
  38. data/proto_docs/google/api/client.rb +593 -0
  39. data/proto_docs/google/api/field_behavior.rb +85 -0
  40. data/proto_docs/google/api/field_info.rb +88 -0
  41. data/proto_docs/google/api/launch_stage.rb +71 -0
  42. data/proto_docs/google/api/resource.rb +227 -0
  43. data/proto_docs/google/cloud/networkconnectivity/v1beta/common.rb +58 -0
  44. data/proto_docs/google/cloud/networkconnectivity/v1beta/data_transfer.rb +635 -0
  45. data/proto_docs/google/cloud/networkconnectivity/v1beta/hub.rb +2024 -0
  46. data/proto_docs/google/cloud/networkconnectivity/v1beta/policy_based_routing.rb +340 -0
  47. data/proto_docs/google/cloud/networkconnectivity/v1beta/transport_manager.rb +621 -0
  48. data/proto_docs/google/longrunning/operations.rb +191 -0
  49. data/proto_docs/google/protobuf/any.rb +145 -0
  50. data/proto_docs/google/protobuf/duration.rb +98 -0
  51. data/proto_docs/google/protobuf/empty.rb +34 -0
  52. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  53. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  54. data/proto_docs/google/rpc/status.rb +48 -0
  55. data/proto_docs/google/type/expr.rb +75 -0
  56. metadata +116 -9
@@ -0,0 +1,3581 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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/networkconnectivity/v1beta/hub_pb"
21
+ require "google/cloud/location"
22
+ require "google/iam/v1"
23
+
24
+ module Google
25
+ module Cloud
26
+ module NetworkConnectivity
27
+ module V1beta
28
+ module HubService
29
+ ##
30
+ # Client for the HubService service.
31
+ #
32
+ # Network Connectivity Center is a hub-and-spoke abstraction for network
33
+ # connectivity management in Google Cloud. It reduces operational complexity
34
+ # through a simple, centralized connectivity management model.
35
+ #
36
+ class Client
37
+ # @private
38
+ API_VERSION = ""
39
+
40
+ # @private
41
+ DEFAULT_ENDPOINT_TEMPLATE = "networkconnectivity.$UNIVERSE_DOMAIN$"
42
+
43
+ include Paths
44
+
45
+ # @private
46
+ attr_reader :hub_service_stub
47
+
48
+ ##
49
+ # Configure the HubService Client class.
50
+ #
51
+ # See {::Google::Cloud::NetworkConnectivity::V1beta::HubService::Client::Configuration}
52
+ # for a description of the configuration fields.
53
+ #
54
+ # @example
55
+ #
56
+ # # Modify the configuration for all HubService clients
57
+ # ::Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.configure do |config|
58
+ # config.timeout = 10.0
59
+ # end
60
+ #
61
+ # @yield [config] Configure the Client client.
62
+ # @yieldparam config [Client::Configuration]
63
+ #
64
+ # @return [Client::Configuration]
65
+ #
66
+ def self.configure
67
+ @configure ||= begin
68
+ namespace = ["Google", "Cloud", "NetworkConnectivity", "V1beta"]
69
+ parent_config = while namespace.any?
70
+ parent_name = namespace.join "::"
71
+ parent_const = const_get parent_name
72
+ break parent_const.configure if parent_const.respond_to? :configure
73
+ namespace.pop
74
+ end
75
+ default_config = Client::Configuration.new parent_config
76
+
77
+ default_config.timeout = 60.0
78
+ default_config.retry_policy = {
79
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
80
+ }
81
+
82
+ default_config.rpcs.create_hub.timeout = 60.0
83
+
84
+ default_config.rpcs.update_hub.timeout = 60.0
85
+
86
+ default_config.rpcs.delete_hub.timeout = 60.0
87
+
88
+ default_config.rpcs.create_spoke.timeout = 60.0
89
+
90
+ default_config.rpcs.update_spoke.timeout = 60.0
91
+
92
+ default_config.rpcs.delete_spoke.timeout = 60.0
93
+
94
+ default_config
95
+ end
96
+ yield @configure if block_given?
97
+ @configure
98
+ end
99
+
100
+ ##
101
+ # Configure the HubService Client instance.
102
+ #
103
+ # The configuration is set to the derived mode, meaning that values can be changed,
104
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
105
+ # should be made on {Client.configure}.
106
+ #
107
+ # See {::Google::Cloud::NetworkConnectivity::V1beta::HubService::Client::Configuration}
108
+ # for a description of the configuration fields.
109
+ #
110
+ # @yield [config] Configure the Client client.
111
+ # @yieldparam config [Client::Configuration]
112
+ #
113
+ # @return [Client::Configuration]
114
+ #
115
+ def configure
116
+ yield @config if block_given?
117
+ @config
118
+ end
119
+
120
+ ##
121
+ # The effective universe domain
122
+ #
123
+ # @return [String]
124
+ #
125
+ def universe_domain
126
+ @hub_service_stub.universe_domain
127
+ end
128
+
129
+ ##
130
+ # Create a new HubService client object.
131
+ #
132
+ # @example
133
+ #
134
+ # # Create a client using the default configuration
135
+ # client = ::Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
136
+ #
137
+ # # Create a client using a custom configuration
138
+ # client = ::Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new do |config|
139
+ # config.timeout = 10.0
140
+ # end
141
+ #
142
+ # @yield [config] Configure the HubService client.
143
+ # @yieldparam config [Client::Configuration]
144
+ #
145
+ def initialize
146
+ # These require statements are intentionally placed here to initialize
147
+ # the gRPC module only when it's required.
148
+ # See https://github.com/googleapis/toolkit/issues/446
149
+ require "gapic/grpc"
150
+ require "google/cloud/networkconnectivity/v1beta/hub_services_pb"
151
+
152
+ # Create the configuration object
153
+ @config = Configuration.new Client.configure
154
+
155
+ # Yield the configuration if needed
156
+ yield @config if block_given?
157
+
158
+ # Create credentials
159
+ credentials = @config.credentials
160
+ # Use self-signed JWT if the endpoint is unchanged from default,
161
+ # but only if the default endpoint does not have a region prefix.
162
+ enable_self_signed_jwt = @config.endpoint.nil? ||
163
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
164
+ !@config.endpoint.split(".").first.include?("-"))
165
+ credentials ||= Credentials.default scope: @config.scope,
166
+ enable_self_signed_jwt: enable_self_signed_jwt
167
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
168
+ credentials = Credentials.new credentials, scope: @config.scope
169
+ end
170
+ @quota_project_id = @config.quota_project
171
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
172
+
173
+ @operations_client = Operations.new do |config|
174
+ config.credentials = credentials
175
+ config.quota_project = @quota_project_id
176
+ config.endpoint = @config.endpoint
177
+ config.universe_domain = @config.universe_domain
178
+ end
179
+
180
+ @hub_service_stub = ::Gapic::ServiceStub.new(
181
+ ::Google::Cloud::NetworkConnectivity::V1beta::HubService::Stub,
182
+ credentials: credentials,
183
+ endpoint: @config.endpoint,
184
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
185
+ universe_domain: @config.universe_domain,
186
+ channel_args: @config.channel_args,
187
+ interceptors: @config.interceptors,
188
+ channel_pool_config: @config.channel_pool,
189
+ logger: @config.logger
190
+ )
191
+
192
+ @hub_service_stub.stub_logger&.info do |entry|
193
+ entry.set_system_name
194
+ entry.set_service
195
+ entry.message = "Created client for #{entry.service}"
196
+ entry.set_credentials_fields credentials
197
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
198
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
199
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
200
+ end
201
+
202
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
203
+ config.credentials = credentials
204
+ config.quota_project = @quota_project_id
205
+ config.endpoint = @hub_service_stub.endpoint
206
+ config.universe_domain = @hub_service_stub.universe_domain
207
+ config.logger = @hub_service_stub.logger if config.respond_to? :logger=
208
+ end
209
+
210
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
211
+ config.credentials = credentials
212
+ config.quota_project = @quota_project_id
213
+ config.endpoint = @hub_service_stub.endpoint
214
+ config.universe_domain = @hub_service_stub.universe_domain
215
+ config.logger = @hub_service_stub.logger if config.respond_to? :logger=
216
+ end
217
+ end
218
+
219
+ ##
220
+ # Get the associated client for long-running operations.
221
+ #
222
+ # @return [::Google::Cloud::NetworkConnectivity::V1beta::HubService::Operations]
223
+ #
224
+ attr_reader :operations_client
225
+
226
+ ##
227
+ # Get the associated client for mix-in of the Locations.
228
+ #
229
+ # @return [Google::Cloud::Location::Locations::Client]
230
+ #
231
+ attr_reader :location_client
232
+
233
+ ##
234
+ # Get the associated client for mix-in of the IAMPolicy.
235
+ #
236
+ # @return [Google::Iam::V1::IAMPolicy::Client]
237
+ #
238
+ attr_reader :iam_policy_client
239
+
240
+ ##
241
+ # The logger used for request/response debug logging.
242
+ #
243
+ # @return [Logger]
244
+ #
245
+ def logger
246
+ @hub_service_stub.logger
247
+ end
248
+
249
+ # Service calls
250
+
251
+ ##
252
+ # Lists the Network Connectivity Center hubs associated with a given project.
253
+ #
254
+ # @overload list_hubs(request, options = nil)
255
+ # Pass arguments to `list_hubs` via a request object, either of type
256
+ # {::Google::Cloud::NetworkConnectivity::V1beta::ListHubsRequest} or an equivalent Hash.
257
+ #
258
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::ListHubsRequest, ::Hash]
259
+ # A request object representing the call parameters. Required. To specify no
260
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
261
+ # @param options [::Gapic::CallOptions, ::Hash]
262
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
263
+ #
264
+ # @overload list_hubs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
265
+ # Pass arguments to `list_hubs` via keyword arguments. Note that at
266
+ # least one keyword argument is required. To specify no parameters, or to keep all
267
+ # the default parameter values, pass an empty Hash as a request object (see above).
268
+ #
269
+ # @param parent [::String]
270
+ # Required. The parent resource's name.
271
+ # @param page_size [::Integer]
272
+ # The maximum number of results per page to return.
273
+ # @param page_token [::String]
274
+ # The page token.
275
+ # @param filter [::String]
276
+ # An expression that filters the list of results.
277
+ # @param order_by [::String]
278
+ # Sort the results by a certain order.
279
+ #
280
+ # @yield [response, operation] Access the result along with the RPC operation
281
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1beta::Hub>]
282
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
283
+ #
284
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1beta::Hub>]
285
+ #
286
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
287
+ #
288
+ # @example Basic example
289
+ # require "google/cloud/network_connectivity/v1beta"
290
+ #
291
+ # # Create a client object. The client can be reused for multiple calls.
292
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
293
+ #
294
+ # # Create a request. To set request fields, pass in keyword arguments.
295
+ # request = Google::Cloud::NetworkConnectivity::V1beta::ListHubsRequest.new
296
+ #
297
+ # # Call the list_hubs method.
298
+ # result = client.list_hubs request
299
+ #
300
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
301
+ # # over elements, and API calls will be issued to fetch pages as needed.
302
+ # result.each do |item|
303
+ # # Each element is of type ::Google::Cloud::NetworkConnectivity::V1beta::Hub.
304
+ # p item
305
+ # end
306
+ #
307
+ def list_hubs request, options = nil
308
+ raise ::ArgumentError, "request must be provided" if request.nil?
309
+
310
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::ListHubsRequest
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.list_hubs.metadata.to_h
317
+
318
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::NetworkConnectivity::V1beta::VERSION
322
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
323
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
324
+
325
+ header_params = {}
326
+ if request.parent
327
+ header_params["parent"] = request.parent
328
+ end
329
+
330
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
331
+ metadata[:"x-goog-request-params"] ||= request_params_header
332
+
333
+ options.apply_defaults timeout: @config.rpcs.list_hubs.timeout,
334
+ metadata: metadata,
335
+ retry_policy: @config.rpcs.list_hubs.retry_policy
336
+
337
+ options.apply_defaults timeout: @config.timeout,
338
+ metadata: @config.metadata,
339
+ retry_policy: @config.retry_policy
340
+
341
+ @hub_service_stub.call_rpc :list_hubs, request, options: options do |response, operation|
342
+ response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_hubs, request, response, operation, options
343
+ yield response, operation if block_given?
344
+ throw :response, response
345
+ end
346
+ rescue ::GRPC::BadStatus => e
347
+ raise ::Google::Cloud::Error.from_error(e)
348
+ end
349
+
350
+ ##
351
+ # Gets details about a Network Connectivity Center hub.
352
+ #
353
+ # @overload get_hub(request, options = nil)
354
+ # Pass arguments to `get_hub` via a request object, either of type
355
+ # {::Google::Cloud::NetworkConnectivity::V1beta::GetHubRequest} or an equivalent Hash.
356
+ #
357
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::GetHubRequest, ::Hash]
358
+ # A request object representing the call parameters. Required. To specify no
359
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
360
+ # @param options [::Gapic::CallOptions, ::Hash]
361
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
362
+ #
363
+ # @overload get_hub(name: nil)
364
+ # Pass arguments to `get_hub` via keyword arguments. Note that at
365
+ # least one keyword argument is required. To specify no parameters, or to keep all
366
+ # the default parameter values, pass an empty Hash as a request object (see above).
367
+ #
368
+ # @param name [::String]
369
+ # Required. The name of the hub resource to get.
370
+ #
371
+ # @yield [response, operation] Access the result along with the RPC operation
372
+ # @yieldparam response [::Google::Cloud::NetworkConnectivity::V1beta::Hub]
373
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
374
+ #
375
+ # @return [::Google::Cloud::NetworkConnectivity::V1beta::Hub]
376
+ #
377
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
378
+ #
379
+ # @example Basic example
380
+ # require "google/cloud/network_connectivity/v1beta"
381
+ #
382
+ # # Create a client object. The client can be reused for multiple calls.
383
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
384
+ #
385
+ # # Create a request. To set request fields, pass in keyword arguments.
386
+ # request = Google::Cloud::NetworkConnectivity::V1beta::GetHubRequest.new
387
+ #
388
+ # # Call the get_hub method.
389
+ # result = client.get_hub request
390
+ #
391
+ # # The returned object is of type Google::Cloud::NetworkConnectivity::V1beta::Hub.
392
+ # p result
393
+ #
394
+ def get_hub request, options = nil
395
+ raise ::ArgumentError, "request must be provided" if request.nil?
396
+
397
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::GetHubRequest
398
+
399
+ # Converts hash and nil to an options object
400
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
401
+
402
+ # Customize the options with defaults
403
+ metadata = @config.rpcs.get_hub.metadata.to_h
404
+
405
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
406
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
407
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
408
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
409
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
410
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
411
+
412
+ header_params = {}
413
+ if request.name
414
+ header_params["name"] = request.name
415
+ end
416
+
417
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
418
+ metadata[:"x-goog-request-params"] ||= request_params_header
419
+
420
+ options.apply_defaults timeout: @config.rpcs.get_hub.timeout,
421
+ metadata: metadata,
422
+ retry_policy: @config.rpcs.get_hub.retry_policy
423
+
424
+ options.apply_defaults timeout: @config.timeout,
425
+ metadata: @config.metadata,
426
+ retry_policy: @config.retry_policy
427
+
428
+ @hub_service_stub.call_rpc :get_hub, request, options: options do |response, operation|
429
+ yield response, operation if block_given?
430
+ end
431
+ rescue ::GRPC::BadStatus => e
432
+ raise ::Google::Cloud::Error.from_error(e)
433
+ end
434
+
435
+ ##
436
+ # Creates a new Network Connectivity Center hub in the specified project.
437
+ #
438
+ # @overload create_hub(request, options = nil)
439
+ # Pass arguments to `create_hub` via a request object, either of type
440
+ # {::Google::Cloud::NetworkConnectivity::V1beta::CreateHubRequest} or an equivalent Hash.
441
+ #
442
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::CreateHubRequest, ::Hash]
443
+ # A request object representing the call parameters. Required. To specify no
444
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
445
+ # @param options [::Gapic::CallOptions, ::Hash]
446
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
447
+ #
448
+ # @overload create_hub(parent: nil, hub_id: nil, hub: nil, request_id: nil)
449
+ # Pass arguments to `create_hub` via keyword arguments. Note that at
450
+ # least one keyword argument is required. To specify no parameters, or to keep all
451
+ # the default parameter values, pass an empty Hash as a request object (see above).
452
+ #
453
+ # @param parent [::String]
454
+ # Required. The parent resource.
455
+ # @param hub_id [::String]
456
+ # Required. A unique identifier for the hub.
457
+ # @param hub [::Google::Cloud::NetworkConnectivity::V1beta::Hub, ::Hash]
458
+ # Required. The initial values for a new hub.
459
+ # @param request_id [::String]
460
+ # Optional. A request ID to identify requests. Specify a unique request ID so
461
+ # that if you must retry your request, the server knows to ignore the request
462
+ # if it has already been completed. The server guarantees that a request
463
+ # doesn't result in creation of duplicate commitments for at least 60
464
+ # minutes.
465
+ #
466
+ # For example, consider a situation where you make an initial request and
467
+ # the request times out. If you make the request again with the same request
468
+ # ID, the server can check to see whether the original operation
469
+ # was received. If it was, the server ignores the second request. This
470
+ # behavior prevents clients from mistakenly creating duplicate commitments.
471
+ #
472
+ # The request ID must be a valid UUID, with the exception that zero UUID is
473
+ # not supported (00000000-0000-0000-0000-000000000000).
474
+ #
475
+ # @yield [response, operation] Access the result along with the RPC operation
476
+ # @yieldparam response [::Gapic::Operation]
477
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
478
+ #
479
+ # @return [::Gapic::Operation]
480
+ #
481
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
482
+ #
483
+ # @example Basic example
484
+ # require "google/cloud/network_connectivity/v1beta"
485
+ #
486
+ # # Create a client object. The client can be reused for multiple calls.
487
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
488
+ #
489
+ # # Create a request. To set request fields, pass in keyword arguments.
490
+ # request = Google::Cloud::NetworkConnectivity::V1beta::CreateHubRequest.new
491
+ #
492
+ # # Call the create_hub method.
493
+ # result = client.create_hub request
494
+ #
495
+ # # The returned object is of type Gapic::Operation. You can use it to
496
+ # # check the status of an operation, cancel it, or wait for results.
497
+ # # Here is how to wait for a response.
498
+ # result.wait_until_done! timeout: 60
499
+ # if result.response?
500
+ # p result.response
501
+ # else
502
+ # puts "No response received."
503
+ # end
504
+ #
505
+ def create_hub request, options = nil
506
+ raise ::ArgumentError, "request must be provided" if request.nil?
507
+
508
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::CreateHubRequest
509
+
510
+ # Converts hash and nil to an options object
511
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
512
+
513
+ # Customize the options with defaults
514
+ metadata = @config.rpcs.create_hub.metadata.to_h
515
+
516
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
517
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
518
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
519
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
520
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
521
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
522
+
523
+ header_params = {}
524
+ if request.parent
525
+ header_params["parent"] = request.parent
526
+ end
527
+
528
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
529
+ metadata[:"x-goog-request-params"] ||= request_params_header
530
+
531
+ options.apply_defaults timeout: @config.rpcs.create_hub.timeout,
532
+ metadata: metadata,
533
+ retry_policy: @config.rpcs.create_hub.retry_policy
534
+
535
+ options.apply_defaults timeout: @config.timeout,
536
+ metadata: @config.metadata,
537
+ retry_policy: @config.retry_policy
538
+
539
+ @hub_service_stub.call_rpc :create_hub, request, options: options do |response, operation|
540
+ response = ::Gapic::Operation.new response, @operations_client, options: options
541
+ yield response, operation if block_given?
542
+ throw :response, response
543
+ end
544
+ rescue ::GRPC::BadStatus => e
545
+ raise ::Google::Cloud::Error.from_error(e)
546
+ end
547
+
548
+ ##
549
+ # Updates the description and/or labels of a Network Connectivity Center
550
+ # hub.
551
+ #
552
+ # @overload update_hub(request, options = nil)
553
+ # Pass arguments to `update_hub` via a request object, either of type
554
+ # {::Google::Cloud::NetworkConnectivity::V1beta::UpdateHubRequest} or an equivalent Hash.
555
+ #
556
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::UpdateHubRequest, ::Hash]
557
+ # A request object representing the call parameters. Required. To specify no
558
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
559
+ # @param options [::Gapic::CallOptions, ::Hash]
560
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
561
+ #
562
+ # @overload update_hub(update_mask: nil, hub: nil, request_id: nil)
563
+ # Pass arguments to `update_hub` via keyword arguments. Note that at
564
+ # least one keyword argument is required. To specify no parameters, or to keep all
565
+ # the default parameter values, pass an empty Hash as a request object (see above).
566
+ #
567
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
568
+ # Optional. In the case of an update to an existing hub, field mask is used
569
+ # to specify the fields to be overwritten. The fields specified in the
570
+ # update_mask are relative to the resource, not the full request. A field is
571
+ # overwritten if it is in the mask. If the user does not provide a mask, then
572
+ # all fields are overwritten.
573
+ # @param hub [::Google::Cloud::NetworkConnectivity::V1beta::Hub, ::Hash]
574
+ # Required. The state that the hub should be in after the update.
575
+ # @param request_id [::String]
576
+ # Optional. A request ID to identify requests. Specify a unique request ID so
577
+ # that if you must retry your request, the server knows to ignore the request
578
+ # if it has already been completed. The server guarantees that a request
579
+ # doesn't result in creation of duplicate commitments for at least 60
580
+ # minutes.
581
+ #
582
+ # For example, consider a situation where you make an initial request and
583
+ # the request times out. If you make the request again with the same request
584
+ # ID, the server can check to see whether the original operation
585
+ # was received. If it was, the server ignores the second request. This
586
+ # behavior prevents clients from mistakenly creating duplicate commitments.
587
+ #
588
+ # The request ID must be a valid UUID, with the exception that zero UUID is
589
+ # not supported (00000000-0000-0000-0000-000000000000).
590
+ #
591
+ # @yield [response, operation] Access the result along with the RPC operation
592
+ # @yieldparam response [::Gapic::Operation]
593
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
594
+ #
595
+ # @return [::Gapic::Operation]
596
+ #
597
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
598
+ #
599
+ # @example Basic example
600
+ # require "google/cloud/network_connectivity/v1beta"
601
+ #
602
+ # # Create a client object. The client can be reused for multiple calls.
603
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
604
+ #
605
+ # # Create a request. To set request fields, pass in keyword arguments.
606
+ # request = Google::Cloud::NetworkConnectivity::V1beta::UpdateHubRequest.new
607
+ #
608
+ # # Call the update_hub method.
609
+ # result = client.update_hub request
610
+ #
611
+ # # The returned object is of type Gapic::Operation. You can use it to
612
+ # # check the status of an operation, cancel it, or wait for results.
613
+ # # Here is how to wait for a response.
614
+ # result.wait_until_done! timeout: 60
615
+ # if result.response?
616
+ # p result.response
617
+ # else
618
+ # puts "No response received."
619
+ # end
620
+ #
621
+ def update_hub request, options = nil
622
+ raise ::ArgumentError, "request must be provided" if request.nil?
623
+
624
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::UpdateHubRequest
625
+
626
+ # Converts hash and nil to an options object
627
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
628
+
629
+ # Customize the options with defaults
630
+ metadata = @config.rpcs.update_hub.metadata.to_h
631
+
632
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
633
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
634
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
635
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
636
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
637
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
638
+
639
+ header_params = {}
640
+ if request.hub&.name
641
+ header_params["hub.name"] = request.hub.name
642
+ end
643
+
644
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
645
+ metadata[:"x-goog-request-params"] ||= request_params_header
646
+
647
+ options.apply_defaults timeout: @config.rpcs.update_hub.timeout,
648
+ metadata: metadata,
649
+ retry_policy: @config.rpcs.update_hub.retry_policy
650
+
651
+ options.apply_defaults timeout: @config.timeout,
652
+ metadata: @config.metadata,
653
+ retry_policy: @config.retry_policy
654
+
655
+ @hub_service_stub.call_rpc :update_hub, request, options: options do |response, operation|
656
+ response = ::Gapic::Operation.new response, @operations_client, options: options
657
+ yield response, operation if block_given?
658
+ throw :response, response
659
+ end
660
+ rescue ::GRPC::BadStatus => e
661
+ raise ::Google::Cloud::Error.from_error(e)
662
+ end
663
+
664
+ ##
665
+ # Deletes a Network Connectivity Center hub.
666
+ #
667
+ # @overload delete_hub(request, options = nil)
668
+ # Pass arguments to `delete_hub` via a request object, either of type
669
+ # {::Google::Cloud::NetworkConnectivity::V1beta::DeleteHubRequest} or an equivalent Hash.
670
+ #
671
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::DeleteHubRequest, ::Hash]
672
+ # A request object representing the call parameters. Required. To specify no
673
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
674
+ # @param options [::Gapic::CallOptions, ::Hash]
675
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
676
+ #
677
+ # @overload delete_hub(name: nil, request_id: nil)
678
+ # Pass arguments to `delete_hub` via keyword arguments. Note that at
679
+ # least one keyword argument is required. To specify no parameters, or to keep all
680
+ # the default parameter values, pass an empty Hash as a request object (see above).
681
+ #
682
+ # @param name [::String]
683
+ # Required. The name of the hub to delete.
684
+ # @param request_id [::String]
685
+ # Optional. A request ID to identify requests. Specify a unique request ID so
686
+ # that if you must retry your request, the server knows to ignore the request
687
+ # if it has already been completed. The server guarantees that a request
688
+ # doesn't result in creation of duplicate commitments for at least 60
689
+ # minutes.
690
+ #
691
+ # For example, consider a situation where you make an initial request and
692
+ # the request times out. If you make the request again with the same request
693
+ # ID, the server can check to see whether the original operation
694
+ # was received. If it was, the server ignores the second request. This
695
+ # behavior prevents clients from mistakenly creating duplicate commitments.
696
+ #
697
+ # The request ID must be a valid UUID, with the exception that zero UUID is
698
+ # not supported (00000000-0000-0000-0000-000000000000).
699
+ #
700
+ # @yield [response, operation] Access the result along with the RPC operation
701
+ # @yieldparam response [::Gapic::Operation]
702
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
703
+ #
704
+ # @return [::Gapic::Operation]
705
+ #
706
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
707
+ #
708
+ # @example Basic example
709
+ # require "google/cloud/network_connectivity/v1beta"
710
+ #
711
+ # # Create a client object. The client can be reused for multiple calls.
712
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
713
+ #
714
+ # # Create a request. To set request fields, pass in keyword arguments.
715
+ # request = Google::Cloud::NetworkConnectivity::V1beta::DeleteHubRequest.new
716
+ #
717
+ # # Call the delete_hub method.
718
+ # result = client.delete_hub request
719
+ #
720
+ # # The returned object is of type Gapic::Operation. You can use it to
721
+ # # check the status of an operation, cancel it, or wait for results.
722
+ # # Here is how to wait for a response.
723
+ # result.wait_until_done! timeout: 60
724
+ # if result.response?
725
+ # p result.response
726
+ # else
727
+ # puts "No response received."
728
+ # end
729
+ #
730
+ def delete_hub request, options = nil
731
+ raise ::ArgumentError, "request must be provided" if request.nil?
732
+
733
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::DeleteHubRequest
734
+
735
+ # Converts hash and nil to an options object
736
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
737
+
738
+ # Customize the options with defaults
739
+ metadata = @config.rpcs.delete_hub.metadata.to_h
740
+
741
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
742
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
743
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
744
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
745
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
746
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
747
+
748
+ header_params = {}
749
+ if request.name
750
+ header_params["name"] = request.name
751
+ end
752
+
753
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
754
+ metadata[:"x-goog-request-params"] ||= request_params_header
755
+
756
+ options.apply_defaults timeout: @config.rpcs.delete_hub.timeout,
757
+ metadata: metadata,
758
+ retry_policy: @config.rpcs.delete_hub.retry_policy
759
+
760
+ options.apply_defaults timeout: @config.timeout,
761
+ metadata: @config.metadata,
762
+ retry_policy: @config.retry_policy
763
+
764
+ @hub_service_stub.call_rpc :delete_hub, request, options: options do |response, operation|
765
+ response = ::Gapic::Operation.new response, @operations_client, options: options
766
+ yield response, operation if block_given?
767
+ throw :response, response
768
+ end
769
+ rescue ::GRPC::BadStatus => e
770
+ raise ::Google::Cloud::Error.from_error(e)
771
+ end
772
+
773
+ ##
774
+ # Lists the Network Connectivity Center spokes associated with a
775
+ # specified hub and location. The list includes both spokes that are attached
776
+ # to the hub and spokes that have been proposed but not yet accepted.
777
+ #
778
+ # @overload list_hub_spokes(request, options = nil)
779
+ # Pass arguments to `list_hub_spokes` via a request object, either of type
780
+ # {::Google::Cloud::NetworkConnectivity::V1beta::ListHubSpokesRequest} or an equivalent Hash.
781
+ #
782
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::ListHubSpokesRequest, ::Hash]
783
+ # A request object representing the call parameters. Required. To specify no
784
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
785
+ # @param options [::Gapic::CallOptions, ::Hash]
786
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
787
+ #
788
+ # @overload list_hub_spokes(name: nil, spoke_locations: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil)
789
+ # Pass arguments to `list_hub_spokes` via keyword arguments. Note that at
790
+ # least one keyword argument is required. To specify no parameters, or to keep all
791
+ # the default parameter values, pass an empty Hash as a request object (see above).
792
+ #
793
+ # @param name [::String]
794
+ # Required. The name of the hub.
795
+ # @param spoke_locations [::Array<::String>]
796
+ # A list of locations.
797
+ # Specify one of the following: `[global]`, a single region (for
798
+ # example, `[us-central1]`), or a combination of
799
+ # values (for example, `[global, us-central1, us-west1]`).
800
+ # If the spoke_locations field is populated, the list of results
801
+ # includes only spokes in the specified location.
802
+ # If the spoke_locations field is not populated, the list of results
803
+ # includes spokes in all locations.
804
+ # @param page_size [::Integer]
805
+ # The maximum number of results to return per page.
806
+ # @param page_token [::String]
807
+ # The page token.
808
+ # @param filter [::String]
809
+ # An expression that filters the list of results.
810
+ # @param order_by [::String]
811
+ # Sort the results by name or create_time.
812
+ # @param view [::Google::Cloud::NetworkConnectivity::V1beta::ListHubSpokesRequest::SpokeView]
813
+ # The view of the spoke to return.
814
+ # The view that you use determines which spoke fields are included in the
815
+ # response.
816
+ #
817
+ # @yield [response, operation] Access the result along with the RPC operation
818
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1beta::Spoke>]
819
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
820
+ #
821
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1beta::Spoke>]
822
+ #
823
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
824
+ #
825
+ # @example Basic example
826
+ # require "google/cloud/network_connectivity/v1beta"
827
+ #
828
+ # # Create a client object. The client can be reused for multiple calls.
829
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
830
+ #
831
+ # # Create a request. To set request fields, pass in keyword arguments.
832
+ # request = Google::Cloud::NetworkConnectivity::V1beta::ListHubSpokesRequest.new
833
+ #
834
+ # # Call the list_hub_spokes method.
835
+ # result = client.list_hub_spokes request
836
+ #
837
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
838
+ # # over elements, and API calls will be issued to fetch pages as needed.
839
+ # result.each do |item|
840
+ # # Each element is of type ::Google::Cloud::NetworkConnectivity::V1beta::Spoke.
841
+ # p item
842
+ # end
843
+ #
844
+ def list_hub_spokes request, options = nil
845
+ raise ::ArgumentError, "request must be provided" if request.nil?
846
+
847
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::ListHubSpokesRequest
848
+
849
+ # Converts hash and nil to an options object
850
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
851
+
852
+ # Customize the options with defaults
853
+ metadata = @config.rpcs.list_hub_spokes.metadata.to_h
854
+
855
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
856
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
857
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
858
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
859
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
860
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
861
+
862
+ header_params = {}
863
+ if request.name
864
+ header_params["name"] = request.name
865
+ end
866
+
867
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
868
+ metadata[:"x-goog-request-params"] ||= request_params_header
869
+
870
+ options.apply_defaults timeout: @config.rpcs.list_hub_spokes.timeout,
871
+ metadata: metadata,
872
+ retry_policy: @config.rpcs.list_hub_spokes.retry_policy
873
+
874
+ options.apply_defaults timeout: @config.timeout,
875
+ metadata: @config.metadata,
876
+ retry_policy: @config.retry_policy
877
+
878
+ @hub_service_stub.call_rpc :list_hub_spokes, request, options: options do |response, operation|
879
+ response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_hub_spokes, request, response, operation, options
880
+ yield response, operation if block_given?
881
+ throw :response, response
882
+ end
883
+ rescue ::GRPC::BadStatus => e
884
+ raise ::Google::Cloud::Error.from_error(e)
885
+ end
886
+
887
+ ##
888
+ # Query the Private Service Connect propagation status of a Network
889
+ # Connectivity Center hub.
890
+ #
891
+ # @overload query_hub_status(request, options = nil)
892
+ # Pass arguments to `query_hub_status` via a request object, either of type
893
+ # {::Google::Cloud::NetworkConnectivity::V1beta::QueryHubStatusRequest} or an equivalent Hash.
894
+ #
895
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::QueryHubStatusRequest, ::Hash]
896
+ # A request object representing the call parameters. Required. To specify no
897
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
898
+ # @param options [::Gapic::CallOptions, ::Hash]
899
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
900
+ #
901
+ # @overload query_hub_status(name: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, group_by: nil)
902
+ # Pass arguments to `query_hub_status` via keyword arguments. Note that at
903
+ # least one keyword argument is required. To specify no parameters, or to keep all
904
+ # the default parameter values, pass an empty Hash as a request object (see above).
905
+ #
906
+ # @param name [::String]
907
+ # Required. The name of the hub.
908
+ # @param page_size [::Integer]
909
+ # Optional. The maximum number of results to return per page.
910
+ # @param page_token [::String]
911
+ # Optional. The page token.
912
+ # @param filter [::String]
913
+ # Optional. An expression that filters the list of results.
914
+ # The filter can be used to filter the results by the following fields:
915
+ # * `psc_propagation_status.source_spoke`
916
+ # * `psc_propagation_status.source_group`
917
+ # * `psc_propagation_status.source_forwarding_rule`
918
+ # * `psc_propagation_status.target_spoke`
919
+ # * `psc_propagation_status.target_group`
920
+ # * `psc_propagation_status.code`
921
+ # * `psc_propagation_status.message`
922
+ # @param order_by [::String]
923
+ # Optional. Sort the results in ascending order by the specified fields.
924
+ # A comma-separated list of any of these fields:
925
+ # * `psc_propagation_status.source_spoke`
926
+ # * `psc_propagation_status.source_group`
927
+ # * `psc_propagation_status.source_forwarding_rule`
928
+ # * `psc_propagation_status.target_spoke`
929
+ # * `psc_propagation_status.target_group`
930
+ # * `psc_propagation_status.code`
931
+ # If `group_by` is set, the value of the `order_by` field must be the
932
+ # same as or a subset of the `group_by` field.
933
+ # @param group_by [::String]
934
+ # Optional. Aggregate the results by the specified fields.
935
+ # A comma-separated list of any of these fields:
936
+ # * `psc_propagation_status.source_spoke`
937
+ # * `psc_propagation_status.source_group`
938
+ # * `psc_propagation_status.source_forwarding_rule`
939
+ # * `psc_propagation_status.target_spoke`
940
+ # * `psc_propagation_status.target_group`
941
+ # * `psc_propagation_status.code`
942
+ #
943
+ # @yield [response, operation] Access the result along with the RPC operation
944
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1beta::HubStatusEntry>]
945
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
946
+ #
947
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1beta::HubStatusEntry>]
948
+ #
949
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
950
+ #
951
+ # @example Basic example
952
+ # require "google/cloud/network_connectivity/v1beta"
953
+ #
954
+ # # Create a client object. The client can be reused for multiple calls.
955
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
956
+ #
957
+ # # Create a request. To set request fields, pass in keyword arguments.
958
+ # request = Google::Cloud::NetworkConnectivity::V1beta::QueryHubStatusRequest.new
959
+ #
960
+ # # Call the query_hub_status method.
961
+ # result = client.query_hub_status request
962
+ #
963
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
964
+ # # over elements, and API calls will be issued to fetch pages as needed.
965
+ # result.each do |item|
966
+ # # Each element is of type ::Google::Cloud::NetworkConnectivity::V1beta::HubStatusEntry.
967
+ # p item
968
+ # end
969
+ #
970
+ def query_hub_status request, options = nil
971
+ raise ::ArgumentError, "request must be provided" if request.nil?
972
+
973
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::QueryHubStatusRequest
974
+
975
+ # Converts hash and nil to an options object
976
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
977
+
978
+ # Customize the options with defaults
979
+ metadata = @config.rpcs.query_hub_status.metadata.to_h
980
+
981
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
982
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
983
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
984
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
985
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
986
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
987
+
988
+ header_params = {}
989
+ if request.name
990
+ header_params["name"] = request.name
991
+ end
992
+
993
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
994
+ metadata[:"x-goog-request-params"] ||= request_params_header
995
+
996
+ options.apply_defaults timeout: @config.rpcs.query_hub_status.timeout,
997
+ metadata: metadata,
998
+ retry_policy: @config.rpcs.query_hub_status.retry_policy
999
+
1000
+ options.apply_defaults timeout: @config.timeout,
1001
+ metadata: @config.metadata,
1002
+ retry_policy: @config.retry_policy
1003
+
1004
+ @hub_service_stub.call_rpc :query_hub_status, request, options: options do |response, operation|
1005
+ response = ::Gapic::PagedEnumerable.new @hub_service_stub, :query_hub_status, request, response, operation, options
1006
+ yield response, operation if block_given?
1007
+ throw :response, response
1008
+ end
1009
+ rescue ::GRPC::BadStatus => e
1010
+ raise ::Google::Cloud::Error.from_error(e)
1011
+ end
1012
+
1013
+ ##
1014
+ # Lists the Network Connectivity Center spokes in a specified project and
1015
+ # location.
1016
+ #
1017
+ # @overload list_spokes(request, options = nil)
1018
+ # Pass arguments to `list_spokes` via a request object, either of type
1019
+ # {::Google::Cloud::NetworkConnectivity::V1beta::ListSpokesRequest} or an equivalent Hash.
1020
+ #
1021
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::ListSpokesRequest, ::Hash]
1022
+ # A request object representing the call parameters. Required. To specify no
1023
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1024
+ # @param options [::Gapic::CallOptions, ::Hash]
1025
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1026
+ #
1027
+ # @overload list_spokes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1028
+ # Pass arguments to `list_spokes` via keyword arguments. Note that at
1029
+ # least one keyword argument is required. To specify no parameters, or to keep all
1030
+ # the default parameter values, pass an empty Hash as a request object (see above).
1031
+ #
1032
+ # @param parent [::String]
1033
+ # Required. The parent resource.
1034
+ # @param page_size [::Integer]
1035
+ # The maximum number of results to return per page.
1036
+ # @param page_token [::String]
1037
+ # The page token.
1038
+ # @param filter [::String]
1039
+ # An expression that filters the list of results.
1040
+ # @param order_by [::String]
1041
+ # Sort the results by a certain order.
1042
+ #
1043
+ # @yield [response, operation] Access the result along with the RPC operation
1044
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1beta::Spoke>]
1045
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1046
+ #
1047
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1beta::Spoke>]
1048
+ #
1049
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1050
+ #
1051
+ # @example Basic example
1052
+ # require "google/cloud/network_connectivity/v1beta"
1053
+ #
1054
+ # # Create a client object. The client can be reused for multiple calls.
1055
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
1056
+ #
1057
+ # # Create a request. To set request fields, pass in keyword arguments.
1058
+ # request = Google::Cloud::NetworkConnectivity::V1beta::ListSpokesRequest.new
1059
+ #
1060
+ # # Call the list_spokes method.
1061
+ # result = client.list_spokes request
1062
+ #
1063
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1064
+ # # over elements, and API calls will be issued to fetch pages as needed.
1065
+ # result.each do |item|
1066
+ # # Each element is of type ::Google::Cloud::NetworkConnectivity::V1beta::Spoke.
1067
+ # p item
1068
+ # end
1069
+ #
1070
+ def list_spokes request, options = nil
1071
+ raise ::ArgumentError, "request must be provided" if request.nil?
1072
+
1073
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::ListSpokesRequest
1074
+
1075
+ # Converts hash and nil to an options object
1076
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1077
+
1078
+ # Customize the options with defaults
1079
+ metadata = @config.rpcs.list_spokes.metadata.to_h
1080
+
1081
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1082
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1083
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1084
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
1085
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1086
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1087
+
1088
+ header_params = {}
1089
+ if request.parent
1090
+ header_params["parent"] = request.parent
1091
+ end
1092
+
1093
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1094
+ metadata[:"x-goog-request-params"] ||= request_params_header
1095
+
1096
+ options.apply_defaults timeout: @config.rpcs.list_spokes.timeout,
1097
+ metadata: metadata,
1098
+ retry_policy: @config.rpcs.list_spokes.retry_policy
1099
+
1100
+ options.apply_defaults timeout: @config.timeout,
1101
+ metadata: @config.metadata,
1102
+ retry_policy: @config.retry_policy
1103
+
1104
+ @hub_service_stub.call_rpc :list_spokes, request, options: options do |response, operation|
1105
+ response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_spokes, request, response, operation, options
1106
+ yield response, operation if block_given?
1107
+ throw :response, response
1108
+ end
1109
+ rescue ::GRPC::BadStatus => e
1110
+ raise ::Google::Cloud::Error.from_error(e)
1111
+ end
1112
+
1113
+ ##
1114
+ # Gets details about a Network Connectivity Center spoke.
1115
+ #
1116
+ # @overload get_spoke(request, options = nil)
1117
+ # Pass arguments to `get_spoke` via a request object, either of type
1118
+ # {::Google::Cloud::NetworkConnectivity::V1beta::GetSpokeRequest} or an equivalent Hash.
1119
+ #
1120
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::GetSpokeRequest, ::Hash]
1121
+ # A request object representing the call parameters. Required. To specify no
1122
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1123
+ # @param options [::Gapic::CallOptions, ::Hash]
1124
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1125
+ #
1126
+ # @overload get_spoke(name: nil)
1127
+ # Pass arguments to `get_spoke` via keyword arguments. Note that at
1128
+ # least one keyword argument is required. To specify no parameters, or to keep all
1129
+ # the default parameter values, pass an empty Hash as a request object (see above).
1130
+ #
1131
+ # @param name [::String]
1132
+ # Required. The name of the spoke resource.
1133
+ #
1134
+ # @yield [response, operation] Access the result along with the RPC operation
1135
+ # @yieldparam response [::Google::Cloud::NetworkConnectivity::V1beta::Spoke]
1136
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1137
+ #
1138
+ # @return [::Google::Cloud::NetworkConnectivity::V1beta::Spoke]
1139
+ #
1140
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1141
+ #
1142
+ # @example Basic example
1143
+ # require "google/cloud/network_connectivity/v1beta"
1144
+ #
1145
+ # # Create a client object. The client can be reused for multiple calls.
1146
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
1147
+ #
1148
+ # # Create a request. To set request fields, pass in keyword arguments.
1149
+ # request = Google::Cloud::NetworkConnectivity::V1beta::GetSpokeRequest.new
1150
+ #
1151
+ # # Call the get_spoke method.
1152
+ # result = client.get_spoke request
1153
+ #
1154
+ # # The returned object is of type Google::Cloud::NetworkConnectivity::V1beta::Spoke.
1155
+ # p result
1156
+ #
1157
+ def get_spoke request, options = nil
1158
+ raise ::ArgumentError, "request must be provided" if request.nil?
1159
+
1160
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::GetSpokeRequest
1161
+
1162
+ # Converts hash and nil to an options object
1163
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1164
+
1165
+ # Customize the options with defaults
1166
+ metadata = @config.rpcs.get_spoke.metadata.to_h
1167
+
1168
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1169
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1170
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1171
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
1172
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1173
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1174
+
1175
+ header_params = {}
1176
+ if request.name
1177
+ header_params["name"] = request.name
1178
+ end
1179
+
1180
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1181
+ metadata[:"x-goog-request-params"] ||= request_params_header
1182
+
1183
+ options.apply_defaults timeout: @config.rpcs.get_spoke.timeout,
1184
+ metadata: metadata,
1185
+ retry_policy: @config.rpcs.get_spoke.retry_policy
1186
+
1187
+ options.apply_defaults timeout: @config.timeout,
1188
+ metadata: @config.metadata,
1189
+ retry_policy: @config.retry_policy
1190
+
1191
+ @hub_service_stub.call_rpc :get_spoke, request, options: options do |response, operation|
1192
+ yield response, operation if block_given?
1193
+ end
1194
+ rescue ::GRPC::BadStatus => e
1195
+ raise ::Google::Cloud::Error.from_error(e)
1196
+ end
1197
+
1198
+ ##
1199
+ # Creates a Network Connectivity Center spoke.
1200
+ #
1201
+ # @overload create_spoke(request, options = nil)
1202
+ # Pass arguments to `create_spoke` via a request object, either of type
1203
+ # {::Google::Cloud::NetworkConnectivity::V1beta::CreateSpokeRequest} or an equivalent Hash.
1204
+ #
1205
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::CreateSpokeRequest, ::Hash]
1206
+ # A request object representing the call parameters. Required. To specify no
1207
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1208
+ # @param options [::Gapic::CallOptions, ::Hash]
1209
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1210
+ #
1211
+ # @overload create_spoke(parent: nil, spoke_id: nil, spoke: nil, request_id: nil)
1212
+ # Pass arguments to `create_spoke` via keyword arguments. Note that at
1213
+ # least one keyword argument is required. To specify no parameters, or to keep all
1214
+ # the default parameter values, pass an empty Hash as a request object (see above).
1215
+ #
1216
+ # @param parent [::String]
1217
+ # Required. The parent resource.
1218
+ # @param spoke_id [::String]
1219
+ # Required. Unique id for the spoke to create.
1220
+ # @param spoke [::Google::Cloud::NetworkConnectivity::V1beta::Spoke, ::Hash]
1221
+ # Required. The initial values for a new spoke.
1222
+ # @param request_id [::String]
1223
+ # Optional. A request ID to identify requests. Specify a unique request ID so
1224
+ # that if you must retry your request, the server knows to ignore the request
1225
+ # if it has already been completed. The server guarantees that a request
1226
+ # doesn't result in creation of duplicate commitments for at least 60
1227
+ # minutes.
1228
+ #
1229
+ # For example, consider a situation where you make an initial request and
1230
+ # the request times out. If you make the request again with the same request
1231
+ # ID, the server can check to see whether the original operation
1232
+ # was received. If it was, the server ignores the second request. This
1233
+ # behavior prevents clients from mistakenly creating duplicate commitments.
1234
+ #
1235
+ # The request ID must be a valid UUID, with the exception that zero UUID is
1236
+ # not supported (00000000-0000-0000-0000-000000000000).
1237
+ #
1238
+ # @yield [response, operation] Access the result along with the RPC operation
1239
+ # @yieldparam response [::Gapic::Operation]
1240
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1241
+ #
1242
+ # @return [::Gapic::Operation]
1243
+ #
1244
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1245
+ #
1246
+ # @example Basic example
1247
+ # require "google/cloud/network_connectivity/v1beta"
1248
+ #
1249
+ # # Create a client object. The client can be reused for multiple calls.
1250
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
1251
+ #
1252
+ # # Create a request. To set request fields, pass in keyword arguments.
1253
+ # request = Google::Cloud::NetworkConnectivity::V1beta::CreateSpokeRequest.new
1254
+ #
1255
+ # # Call the create_spoke method.
1256
+ # result = client.create_spoke request
1257
+ #
1258
+ # # The returned object is of type Gapic::Operation. You can use it to
1259
+ # # check the status of an operation, cancel it, or wait for results.
1260
+ # # Here is how to wait for a response.
1261
+ # result.wait_until_done! timeout: 60
1262
+ # if result.response?
1263
+ # p result.response
1264
+ # else
1265
+ # puts "No response received."
1266
+ # end
1267
+ #
1268
+ def create_spoke request, options = nil
1269
+ raise ::ArgumentError, "request must be provided" if request.nil?
1270
+
1271
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::CreateSpokeRequest
1272
+
1273
+ # Converts hash and nil to an options object
1274
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1275
+
1276
+ # Customize the options with defaults
1277
+ metadata = @config.rpcs.create_spoke.metadata.to_h
1278
+
1279
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1280
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1281
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1282
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
1283
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1284
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1285
+
1286
+ header_params = {}
1287
+ if request.parent
1288
+ header_params["parent"] = request.parent
1289
+ end
1290
+
1291
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1292
+ metadata[:"x-goog-request-params"] ||= request_params_header
1293
+
1294
+ options.apply_defaults timeout: @config.rpcs.create_spoke.timeout,
1295
+ metadata: metadata,
1296
+ retry_policy: @config.rpcs.create_spoke.retry_policy
1297
+
1298
+ options.apply_defaults timeout: @config.timeout,
1299
+ metadata: @config.metadata,
1300
+ retry_policy: @config.retry_policy
1301
+
1302
+ @hub_service_stub.call_rpc :create_spoke, request, options: options do |response, operation|
1303
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1304
+ yield response, operation if block_given?
1305
+ throw :response, response
1306
+ end
1307
+ rescue ::GRPC::BadStatus => e
1308
+ raise ::Google::Cloud::Error.from_error(e)
1309
+ end
1310
+
1311
+ ##
1312
+ # Updates the parameters of a Network Connectivity Center spoke.
1313
+ #
1314
+ # @overload update_spoke(request, options = nil)
1315
+ # Pass arguments to `update_spoke` via a request object, either of type
1316
+ # {::Google::Cloud::NetworkConnectivity::V1beta::UpdateSpokeRequest} or an equivalent Hash.
1317
+ #
1318
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::UpdateSpokeRequest, ::Hash]
1319
+ # A request object representing the call parameters. Required. To specify no
1320
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1321
+ # @param options [::Gapic::CallOptions, ::Hash]
1322
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1323
+ #
1324
+ # @overload update_spoke(update_mask: nil, spoke: nil, request_id: nil)
1325
+ # Pass arguments to `update_spoke` via keyword arguments. Note that at
1326
+ # least one keyword argument is required. To specify no parameters, or to keep all
1327
+ # the default parameter values, pass an empty Hash as a request object (see above).
1328
+ #
1329
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1330
+ # Optional. In the case of an update to an existing spoke, field mask is used
1331
+ # to specify the fields to be overwritten. The fields specified in the
1332
+ # update_mask are relative to the resource, not the full request. A field is
1333
+ # overwritten if it is in the mask. If the user does not provide a mask, then
1334
+ # all fields are overwritten.
1335
+ # @param spoke [::Google::Cloud::NetworkConnectivity::V1beta::Spoke, ::Hash]
1336
+ # Required. The state that the spoke should be in after the update.
1337
+ # @param request_id [::String]
1338
+ # Optional. A request ID to identify requests. Specify a unique request ID so
1339
+ # that if you must retry your request, the server knows to ignore the request
1340
+ # if it has already been completed. The server guarantees that a request
1341
+ # doesn't result in creation of duplicate commitments for at least 60
1342
+ # minutes.
1343
+ #
1344
+ # For example, consider a situation where you make an initial request and
1345
+ # the request times out. If you make the request again with the same request
1346
+ # ID, the server can check to see whether the original operation
1347
+ # was received. If it was, the server ignores the second request. This
1348
+ # behavior prevents clients from mistakenly creating duplicate commitments.
1349
+ #
1350
+ # The request ID must be a valid UUID, with the exception that zero UUID is
1351
+ # not supported (00000000-0000-0000-0000-000000000000).
1352
+ #
1353
+ # @yield [response, operation] Access the result along with the RPC operation
1354
+ # @yieldparam response [::Gapic::Operation]
1355
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1356
+ #
1357
+ # @return [::Gapic::Operation]
1358
+ #
1359
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1360
+ #
1361
+ # @example Basic example
1362
+ # require "google/cloud/network_connectivity/v1beta"
1363
+ #
1364
+ # # Create a client object. The client can be reused for multiple calls.
1365
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
1366
+ #
1367
+ # # Create a request. To set request fields, pass in keyword arguments.
1368
+ # request = Google::Cloud::NetworkConnectivity::V1beta::UpdateSpokeRequest.new
1369
+ #
1370
+ # # Call the update_spoke method.
1371
+ # result = client.update_spoke request
1372
+ #
1373
+ # # The returned object is of type Gapic::Operation. You can use it to
1374
+ # # check the status of an operation, cancel it, or wait for results.
1375
+ # # Here is how to wait for a response.
1376
+ # result.wait_until_done! timeout: 60
1377
+ # if result.response?
1378
+ # p result.response
1379
+ # else
1380
+ # puts "No response received."
1381
+ # end
1382
+ #
1383
+ def update_spoke request, options = nil
1384
+ raise ::ArgumentError, "request must be provided" if request.nil?
1385
+
1386
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::UpdateSpokeRequest
1387
+
1388
+ # Converts hash and nil to an options object
1389
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1390
+
1391
+ # Customize the options with defaults
1392
+ metadata = @config.rpcs.update_spoke.metadata.to_h
1393
+
1394
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1395
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1396
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1397
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
1398
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1399
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1400
+
1401
+ header_params = {}
1402
+ if request.spoke&.name
1403
+ header_params["spoke.name"] = request.spoke.name
1404
+ end
1405
+
1406
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1407
+ metadata[:"x-goog-request-params"] ||= request_params_header
1408
+
1409
+ options.apply_defaults timeout: @config.rpcs.update_spoke.timeout,
1410
+ metadata: metadata,
1411
+ retry_policy: @config.rpcs.update_spoke.retry_policy
1412
+
1413
+ options.apply_defaults timeout: @config.timeout,
1414
+ metadata: @config.metadata,
1415
+ retry_policy: @config.retry_policy
1416
+
1417
+ @hub_service_stub.call_rpc :update_spoke, request, options: options do |response, operation|
1418
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1419
+ yield response, operation if block_given?
1420
+ throw :response, response
1421
+ end
1422
+ rescue ::GRPC::BadStatus => e
1423
+ raise ::Google::Cloud::Error.from_error(e)
1424
+ end
1425
+
1426
+ ##
1427
+ # Rejects a Network Connectivity Center spoke from being attached to a hub.
1428
+ # If the spoke was previously in the `ACTIVE` state, it
1429
+ # transitions to the `INACTIVE` state and is no longer able to
1430
+ # connect to other spokes that are attached to the hub.
1431
+ #
1432
+ # @overload reject_hub_spoke(request, options = nil)
1433
+ # Pass arguments to `reject_hub_spoke` via a request object, either of type
1434
+ # {::Google::Cloud::NetworkConnectivity::V1beta::RejectHubSpokeRequest} or an equivalent Hash.
1435
+ #
1436
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::RejectHubSpokeRequest, ::Hash]
1437
+ # A request object representing the call parameters. Required. To specify no
1438
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1439
+ # @param options [::Gapic::CallOptions, ::Hash]
1440
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1441
+ #
1442
+ # @overload reject_hub_spoke(name: nil, spoke_uri: nil, request_id: nil, details: nil)
1443
+ # Pass arguments to `reject_hub_spoke` via keyword arguments. Note that at
1444
+ # least one keyword argument is required. To specify no parameters, or to keep all
1445
+ # the default parameter values, pass an empty Hash as a request object (see above).
1446
+ #
1447
+ # @param name [::String]
1448
+ # Required. The name of the hub from which to reject the spoke.
1449
+ # @param spoke_uri [::String]
1450
+ # Required. The URI of the spoke to reject from the hub.
1451
+ # @param request_id [::String]
1452
+ # Optional. A request ID to identify requests. Specify a unique request ID so
1453
+ # that if you must retry your request, the server knows to ignore the request
1454
+ # if it has already been completed. The server guarantees that a request
1455
+ # doesn't result in creation of duplicate commitments for at least 60
1456
+ # minutes.
1457
+ #
1458
+ # For example, consider a situation where you make an initial request and
1459
+ # the request times out. If you make the request again with the same request
1460
+ # ID, the server can check to see whether the original operation
1461
+ # was received. If it was, the server ignores the second request. This
1462
+ # behavior prevents clients from mistakenly creating duplicate commitments.
1463
+ #
1464
+ # The request ID must be a valid UUID, with the exception that zero UUID is
1465
+ # not supported (00000000-0000-0000-0000-000000000000).
1466
+ # @param details [::String]
1467
+ # Optional. Additional information provided by the hub administrator.
1468
+ #
1469
+ # @yield [response, operation] Access the result along with the RPC operation
1470
+ # @yieldparam response [::Gapic::Operation]
1471
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1472
+ #
1473
+ # @return [::Gapic::Operation]
1474
+ #
1475
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1476
+ #
1477
+ # @example Basic example
1478
+ # require "google/cloud/network_connectivity/v1beta"
1479
+ #
1480
+ # # Create a client object. The client can be reused for multiple calls.
1481
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
1482
+ #
1483
+ # # Create a request. To set request fields, pass in keyword arguments.
1484
+ # request = Google::Cloud::NetworkConnectivity::V1beta::RejectHubSpokeRequest.new
1485
+ #
1486
+ # # Call the reject_hub_spoke method.
1487
+ # result = client.reject_hub_spoke request
1488
+ #
1489
+ # # The returned object is of type Gapic::Operation. You can use it to
1490
+ # # check the status of an operation, cancel it, or wait for results.
1491
+ # # Here is how to wait for a response.
1492
+ # result.wait_until_done! timeout: 60
1493
+ # if result.response?
1494
+ # p result.response
1495
+ # else
1496
+ # puts "No response received."
1497
+ # end
1498
+ #
1499
+ def reject_hub_spoke request, options = nil
1500
+ raise ::ArgumentError, "request must be provided" if request.nil?
1501
+
1502
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::RejectHubSpokeRequest
1503
+
1504
+ # Converts hash and nil to an options object
1505
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1506
+
1507
+ # Customize the options with defaults
1508
+ metadata = @config.rpcs.reject_hub_spoke.metadata.to_h
1509
+
1510
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1511
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1512
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1513
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
1514
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1515
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1516
+
1517
+ header_params = {}
1518
+ if request.name
1519
+ header_params["name"] = request.name
1520
+ end
1521
+
1522
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1523
+ metadata[:"x-goog-request-params"] ||= request_params_header
1524
+
1525
+ options.apply_defaults timeout: @config.rpcs.reject_hub_spoke.timeout,
1526
+ metadata: metadata,
1527
+ retry_policy: @config.rpcs.reject_hub_spoke.retry_policy
1528
+
1529
+ options.apply_defaults timeout: @config.timeout,
1530
+ metadata: @config.metadata,
1531
+ retry_policy: @config.retry_policy
1532
+
1533
+ @hub_service_stub.call_rpc :reject_hub_spoke, request, options: options do |response, operation|
1534
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1535
+ yield response, operation if block_given?
1536
+ throw :response, response
1537
+ end
1538
+ rescue ::GRPC::BadStatus => e
1539
+ raise ::Google::Cloud::Error.from_error(e)
1540
+ end
1541
+
1542
+ ##
1543
+ # Accepts a proposal to attach a Network Connectivity Center spoke
1544
+ # to a hub.
1545
+ #
1546
+ # @overload accept_hub_spoke(request, options = nil)
1547
+ # Pass arguments to `accept_hub_spoke` via a request object, either of type
1548
+ # {::Google::Cloud::NetworkConnectivity::V1beta::AcceptHubSpokeRequest} or an equivalent Hash.
1549
+ #
1550
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::AcceptHubSpokeRequest, ::Hash]
1551
+ # A request object representing the call parameters. Required. To specify no
1552
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1553
+ # @param options [::Gapic::CallOptions, ::Hash]
1554
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1555
+ #
1556
+ # @overload accept_hub_spoke(name: nil, spoke_uri: nil, request_id: nil)
1557
+ # Pass arguments to `accept_hub_spoke` via keyword arguments. Note that at
1558
+ # least one keyword argument is required. To specify no parameters, or to keep all
1559
+ # the default parameter values, pass an empty Hash as a request object (see above).
1560
+ #
1561
+ # @param name [::String]
1562
+ # Required. The name of the hub into which to accept the spoke.
1563
+ # @param spoke_uri [::String]
1564
+ # Required. The URI of the spoke to accept into the hub.
1565
+ # @param request_id [::String]
1566
+ # Optional. A request ID to identify requests. Specify a unique request ID so
1567
+ # that if you must retry your request, the server knows to ignore the request
1568
+ # if it has already been completed. The server guarantees that a request
1569
+ # doesn't result in creation of duplicate commitments for at least 60
1570
+ # minutes.
1571
+ #
1572
+ # For example, consider a situation where you make an initial request and
1573
+ # the request times out. If you make the request again with the same request
1574
+ # ID, the server can check to see whether the original operation
1575
+ # was received. If it was, the server ignores the second request. This
1576
+ # behavior prevents clients from mistakenly creating duplicate commitments.
1577
+ #
1578
+ # The request ID must be a valid UUID, with the exception that zero UUID is
1579
+ # not supported (00000000-0000-0000-0000-000000000000).
1580
+ #
1581
+ # @yield [response, operation] Access the result along with the RPC operation
1582
+ # @yieldparam response [::Gapic::Operation]
1583
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1584
+ #
1585
+ # @return [::Gapic::Operation]
1586
+ #
1587
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1588
+ #
1589
+ # @example Basic example
1590
+ # require "google/cloud/network_connectivity/v1beta"
1591
+ #
1592
+ # # Create a client object. The client can be reused for multiple calls.
1593
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
1594
+ #
1595
+ # # Create a request. To set request fields, pass in keyword arguments.
1596
+ # request = Google::Cloud::NetworkConnectivity::V1beta::AcceptHubSpokeRequest.new
1597
+ #
1598
+ # # Call the accept_hub_spoke method.
1599
+ # result = client.accept_hub_spoke request
1600
+ #
1601
+ # # The returned object is of type Gapic::Operation. You can use it to
1602
+ # # check the status of an operation, cancel it, or wait for results.
1603
+ # # Here is how to wait for a response.
1604
+ # result.wait_until_done! timeout: 60
1605
+ # if result.response?
1606
+ # p result.response
1607
+ # else
1608
+ # puts "No response received."
1609
+ # end
1610
+ #
1611
+ def accept_hub_spoke request, options = nil
1612
+ raise ::ArgumentError, "request must be provided" if request.nil?
1613
+
1614
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::AcceptHubSpokeRequest
1615
+
1616
+ # Converts hash and nil to an options object
1617
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1618
+
1619
+ # Customize the options with defaults
1620
+ metadata = @config.rpcs.accept_hub_spoke.metadata.to_h
1621
+
1622
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1623
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1624
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1625
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
1626
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1627
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1628
+
1629
+ header_params = {}
1630
+ if request.name
1631
+ header_params["name"] = request.name
1632
+ end
1633
+
1634
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1635
+ metadata[:"x-goog-request-params"] ||= request_params_header
1636
+
1637
+ options.apply_defaults timeout: @config.rpcs.accept_hub_spoke.timeout,
1638
+ metadata: metadata,
1639
+ retry_policy: @config.rpcs.accept_hub_spoke.retry_policy
1640
+
1641
+ options.apply_defaults timeout: @config.timeout,
1642
+ metadata: @config.metadata,
1643
+ retry_policy: @config.retry_policy
1644
+
1645
+ @hub_service_stub.call_rpc :accept_hub_spoke, request, options: options do |response, operation|
1646
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1647
+ yield response, operation if block_given?
1648
+ throw :response, response
1649
+ end
1650
+ rescue ::GRPC::BadStatus => e
1651
+ raise ::Google::Cloud::Error.from_error(e)
1652
+ end
1653
+
1654
+ ##
1655
+ # Accepts a proposal to update a Network Connectivity Center spoke in a hub.
1656
+ #
1657
+ # @overload accept_spoke_update(request, options = nil)
1658
+ # Pass arguments to `accept_spoke_update` via a request object, either of type
1659
+ # {::Google::Cloud::NetworkConnectivity::V1beta::AcceptSpokeUpdateRequest} or an equivalent Hash.
1660
+ #
1661
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::AcceptSpokeUpdateRequest, ::Hash]
1662
+ # A request object representing the call parameters. Required. To specify no
1663
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1664
+ # @param options [::Gapic::CallOptions, ::Hash]
1665
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1666
+ #
1667
+ # @overload accept_spoke_update(name: nil, spoke_uri: nil, spoke_etag: nil, request_id: nil)
1668
+ # Pass arguments to `accept_spoke_update` via keyword arguments. Note that at
1669
+ # least one keyword argument is required. To specify no parameters, or to keep all
1670
+ # the default parameter values, pass an empty Hash as a request object (see above).
1671
+ #
1672
+ # @param name [::String]
1673
+ # Required. The name of the hub to accept spoke update.
1674
+ # @param spoke_uri [::String]
1675
+ # Required. The URI of the spoke to accept update.
1676
+ # @param spoke_etag [::String]
1677
+ # Required. The etag of the spoke to accept update.
1678
+ # @param request_id [::String]
1679
+ # Optional. A request ID to identify requests. Specify a unique request ID so
1680
+ # that if you must retry your request, the server knows to ignore the request
1681
+ # if it has already been completed. The server guarantees that a request
1682
+ # doesn't result in creation of duplicate commitments for at least 60
1683
+ # minutes.
1684
+ #
1685
+ # For example, consider a situation where you make an initial request and
1686
+ # the request times out. If you make the request again with the same request
1687
+ # ID, the server can check to see whether the original operation
1688
+ # was received. If it was, the server ignores the second request. This
1689
+ # behavior prevents clients from mistakenly creating duplicate commitments.
1690
+ #
1691
+ # The request ID must be a valid UUID, with the exception that zero UUID is
1692
+ # not supported (00000000-0000-0000-0000-000000000000).
1693
+ #
1694
+ # @yield [response, operation] Access the result along with the RPC operation
1695
+ # @yieldparam response [::Gapic::Operation]
1696
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1697
+ #
1698
+ # @return [::Gapic::Operation]
1699
+ #
1700
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1701
+ #
1702
+ # @example Basic example
1703
+ # require "google/cloud/network_connectivity/v1beta"
1704
+ #
1705
+ # # Create a client object. The client can be reused for multiple calls.
1706
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
1707
+ #
1708
+ # # Create a request. To set request fields, pass in keyword arguments.
1709
+ # request = Google::Cloud::NetworkConnectivity::V1beta::AcceptSpokeUpdateRequest.new
1710
+ #
1711
+ # # Call the accept_spoke_update method.
1712
+ # result = client.accept_spoke_update request
1713
+ #
1714
+ # # The returned object is of type Gapic::Operation. You can use it to
1715
+ # # check the status of an operation, cancel it, or wait for results.
1716
+ # # Here is how to wait for a response.
1717
+ # result.wait_until_done! timeout: 60
1718
+ # if result.response?
1719
+ # p result.response
1720
+ # else
1721
+ # puts "No response received."
1722
+ # end
1723
+ #
1724
+ def accept_spoke_update request, options = nil
1725
+ raise ::ArgumentError, "request must be provided" if request.nil?
1726
+
1727
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::AcceptSpokeUpdateRequest
1728
+
1729
+ # Converts hash and nil to an options object
1730
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1731
+
1732
+ # Customize the options with defaults
1733
+ metadata = @config.rpcs.accept_spoke_update.metadata.to_h
1734
+
1735
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1736
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1737
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1738
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
1739
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1740
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1741
+
1742
+ header_params = {}
1743
+ if request.name
1744
+ header_params["name"] = request.name
1745
+ end
1746
+
1747
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1748
+ metadata[:"x-goog-request-params"] ||= request_params_header
1749
+
1750
+ options.apply_defaults timeout: @config.rpcs.accept_spoke_update.timeout,
1751
+ metadata: metadata,
1752
+ retry_policy: @config.rpcs.accept_spoke_update.retry_policy
1753
+
1754
+ options.apply_defaults timeout: @config.timeout,
1755
+ metadata: @config.metadata,
1756
+ retry_policy: @config.retry_policy
1757
+
1758
+ @hub_service_stub.call_rpc :accept_spoke_update, request, options: options do |response, operation|
1759
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1760
+ yield response, operation if block_given?
1761
+ throw :response, response
1762
+ end
1763
+ rescue ::GRPC::BadStatus => e
1764
+ raise ::Google::Cloud::Error.from_error(e)
1765
+ end
1766
+
1767
+ ##
1768
+ # Rejects a proposal to update a Network Connectivity Center spoke in a hub.
1769
+ #
1770
+ # @overload reject_spoke_update(request, options = nil)
1771
+ # Pass arguments to `reject_spoke_update` via a request object, either of type
1772
+ # {::Google::Cloud::NetworkConnectivity::V1beta::RejectSpokeUpdateRequest} or an equivalent Hash.
1773
+ #
1774
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::RejectSpokeUpdateRequest, ::Hash]
1775
+ # A request object representing the call parameters. Required. To specify no
1776
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1777
+ # @param options [::Gapic::CallOptions, ::Hash]
1778
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1779
+ #
1780
+ # @overload reject_spoke_update(name: nil, spoke_uri: nil, spoke_etag: nil, details: nil, request_id: nil)
1781
+ # Pass arguments to `reject_spoke_update` via keyword arguments. Note that at
1782
+ # least one keyword argument is required. To specify no parameters, or to keep all
1783
+ # the default parameter values, pass an empty Hash as a request object (see above).
1784
+ #
1785
+ # @param name [::String]
1786
+ # Required. The name of the hub to reject spoke update.
1787
+ # @param spoke_uri [::String]
1788
+ # Required. The URI of the spoke to reject update.
1789
+ # @param spoke_etag [::String]
1790
+ # Required. The etag of the spoke to reject update.
1791
+ # @param details [::String]
1792
+ # Optional. Additional information provided by the hub administrator.
1793
+ # @param request_id [::String]
1794
+ # Optional. A request ID to identify requests. Specify a unique request ID so
1795
+ # that if you must retry your request, the server knows to ignore the request
1796
+ # if it has already been completed. The server guarantees that a request
1797
+ # doesn't result in creation of duplicate commitments for at least 60
1798
+ # minutes.
1799
+ #
1800
+ # For example, consider a situation where you make an initial request and
1801
+ # the request times out. If you make the request again with the same request
1802
+ # ID, the server can check to see whether the original operation
1803
+ # was received. If it was, the server ignores the second request. This
1804
+ # behavior prevents clients from mistakenly creating duplicate commitments.
1805
+ #
1806
+ # The request ID must be a valid UUID, with the exception that zero UUID is
1807
+ # not supported (00000000-0000-0000-0000-000000000000).
1808
+ #
1809
+ # @yield [response, operation] Access the result along with the RPC operation
1810
+ # @yieldparam response [::Gapic::Operation]
1811
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1812
+ #
1813
+ # @return [::Gapic::Operation]
1814
+ #
1815
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1816
+ #
1817
+ # @example Basic example
1818
+ # require "google/cloud/network_connectivity/v1beta"
1819
+ #
1820
+ # # Create a client object. The client can be reused for multiple calls.
1821
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
1822
+ #
1823
+ # # Create a request. To set request fields, pass in keyword arguments.
1824
+ # request = Google::Cloud::NetworkConnectivity::V1beta::RejectSpokeUpdateRequest.new
1825
+ #
1826
+ # # Call the reject_spoke_update method.
1827
+ # result = client.reject_spoke_update request
1828
+ #
1829
+ # # The returned object is of type Gapic::Operation. You can use it to
1830
+ # # check the status of an operation, cancel it, or wait for results.
1831
+ # # Here is how to wait for a response.
1832
+ # result.wait_until_done! timeout: 60
1833
+ # if result.response?
1834
+ # p result.response
1835
+ # else
1836
+ # puts "No response received."
1837
+ # end
1838
+ #
1839
+ def reject_spoke_update request, options = nil
1840
+ raise ::ArgumentError, "request must be provided" if request.nil?
1841
+
1842
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::RejectSpokeUpdateRequest
1843
+
1844
+ # Converts hash and nil to an options object
1845
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1846
+
1847
+ # Customize the options with defaults
1848
+ metadata = @config.rpcs.reject_spoke_update.metadata.to_h
1849
+
1850
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1851
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1852
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1853
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
1854
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1855
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1856
+
1857
+ header_params = {}
1858
+ if request.name
1859
+ header_params["name"] = request.name
1860
+ end
1861
+
1862
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1863
+ metadata[:"x-goog-request-params"] ||= request_params_header
1864
+
1865
+ options.apply_defaults timeout: @config.rpcs.reject_spoke_update.timeout,
1866
+ metadata: metadata,
1867
+ retry_policy: @config.rpcs.reject_spoke_update.retry_policy
1868
+
1869
+ options.apply_defaults timeout: @config.timeout,
1870
+ metadata: @config.metadata,
1871
+ retry_policy: @config.retry_policy
1872
+
1873
+ @hub_service_stub.call_rpc :reject_spoke_update, request, options: options do |response, operation|
1874
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1875
+ yield response, operation if block_given?
1876
+ throw :response, response
1877
+ end
1878
+ rescue ::GRPC::BadStatus => e
1879
+ raise ::Google::Cloud::Error.from_error(e)
1880
+ end
1881
+
1882
+ ##
1883
+ # Deletes a Network Connectivity Center spoke.
1884
+ #
1885
+ # @overload delete_spoke(request, options = nil)
1886
+ # Pass arguments to `delete_spoke` via a request object, either of type
1887
+ # {::Google::Cloud::NetworkConnectivity::V1beta::DeleteSpokeRequest} or an equivalent Hash.
1888
+ #
1889
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::DeleteSpokeRequest, ::Hash]
1890
+ # A request object representing the call parameters. Required. To specify no
1891
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1892
+ # @param options [::Gapic::CallOptions, ::Hash]
1893
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1894
+ #
1895
+ # @overload delete_spoke(name: nil, request_id: nil)
1896
+ # Pass arguments to `delete_spoke` via keyword arguments. Note that at
1897
+ # least one keyword argument is required. To specify no parameters, or to keep all
1898
+ # the default parameter values, pass an empty Hash as a request object (see above).
1899
+ #
1900
+ # @param name [::String]
1901
+ # Required. The name of the spoke to delete.
1902
+ # @param request_id [::String]
1903
+ # Optional. A request ID to identify requests. Specify a unique request ID so
1904
+ # that if you must retry your request, the server knows to ignore the request
1905
+ # if it has already been completed. The server guarantees that a request
1906
+ # doesn't result in creation of duplicate commitments for at least 60
1907
+ # minutes.
1908
+ #
1909
+ # For example, consider a situation where you make an initial request and
1910
+ # the request times out. If you make the request again with the same request
1911
+ # ID, the server can check to see whether the original operation
1912
+ # was received. If it was, the server ignores the second request. This
1913
+ # behavior prevents clients from mistakenly creating duplicate commitments.
1914
+ #
1915
+ # The request ID must be a valid UUID, with the exception that zero UUID is
1916
+ # not supported (00000000-0000-0000-0000-000000000000).
1917
+ #
1918
+ # @yield [response, operation] Access the result along with the RPC operation
1919
+ # @yieldparam response [::Gapic::Operation]
1920
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1921
+ #
1922
+ # @return [::Gapic::Operation]
1923
+ #
1924
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1925
+ #
1926
+ # @example Basic example
1927
+ # require "google/cloud/network_connectivity/v1beta"
1928
+ #
1929
+ # # Create a client object. The client can be reused for multiple calls.
1930
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
1931
+ #
1932
+ # # Create a request. To set request fields, pass in keyword arguments.
1933
+ # request = Google::Cloud::NetworkConnectivity::V1beta::DeleteSpokeRequest.new
1934
+ #
1935
+ # # Call the delete_spoke method.
1936
+ # result = client.delete_spoke request
1937
+ #
1938
+ # # The returned object is of type Gapic::Operation. You can use it to
1939
+ # # check the status of an operation, cancel it, or wait for results.
1940
+ # # Here is how to wait for a response.
1941
+ # result.wait_until_done! timeout: 60
1942
+ # if result.response?
1943
+ # p result.response
1944
+ # else
1945
+ # puts "No response received."
1946
+ # end
1947
+ #
1948
+ def delete_spoke request, options = nil
1949
+ raise ::ArgumentError, "request must be provided" if request.nil?
1950
+
1951
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::DeleteSpokeRequest
1952
+
1953
+ # Converts hash and nil to an options object
1954
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1955
+
1956
+ # Customize the options with defaults
1957
+ metadata = @config.rpcs.delete_spoke.metadata.to_h
1958
+
1959
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1960
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1961
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1962
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
1963
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1964
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1965
+
1966
+ header_params = {}
1967
+ if request.name
1968
+ header_params["name"] = request.name
1969
+ end
1970
+
1971
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1972
+ metadata[:"x-goog-request-params"] ||= request_params_header
1973
+
1974
+ options.apply_defaults timeout: @config.rpcs.delete_spoke.timeout,
1975
+ metadata: metadata,
1976
+ retry_policy: @config.rpcs.delete_spoke.retry_policy
1977
+
1978
+ options.apply_defaults timeout: @config.timeout,
1979
+ metadata: @config.metadata,
1980
+ retry_policy: @config.retry_policy
1981
+
1982
+ @hub_service_stub.call_rpc :delete_spoke, request, options: options do |response, operation|
1983
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1984
+ yield response, operation if block_given?
1985
+ throw :response, response
1986
+ end
1987
+ rescue ::GRPC::BadStatus => e
1988
+ raise ::Google::Cloud::Error.from_error(e)
1989
+ end
1990
+
1991
+ ##
1992
+ # Gets details about a Network Connectivity Center route table.
1993
+ #
1994
+ # @overload get_route_table(request, options = nil)
1995
+ # Pass arguments to `get_route_table` via a request object, either of type
1996
+ # {::Google::Cloud::NetworkConnectivity::V1beta::GetRouteTableRequest} or an equivalent Hash.
1997
+ #
1998
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::GetRouteTableRequest, ::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 get_route_table(name: nil)
2005
+ # Pass arguments to `get_route_table` 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 name [::String]
2010
+ # Required. The name of the route table resource.
2011
+ #
2012
+ # @yield [response, operation] Access the result along with the RPC operation
2013
+ # @yieldparam response [::Google::Cloud::NetworkConnectivity::V1beta::RouteTable]
2014
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2015
+ #
2016
+ # @return [::Google::Cloud::NetworkConnectivity::V1beta::RouteTable]
2017
+ #
2018
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2019
+ #
2020
+ # @example Basic example
2021
+ # require "google/cloud/network_connectivity/v1beta"
2022
+ #
2023
+ # # Create a client object. The client can be reused for multiple calls.
2024
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
2025
+ #
2026
+ # # Create a request. To set request fields, pass in keyword arguments.
2027
+ # request = Google::Cloud::NetworkConnectivity::V1beta::GetRouteTableRequest.new
2028
+ #
2029
+ # # Call the get_route_table method.
2030
+ # result = client.get_route_table request
2031
+ #
2032
+ # # The returned object is of type Google::Cloud::NetworkConnectivity::V1beta::RouteTable.
2033
+ # p result
2034
+ #
2035
+ def get_route_table request, options = nil
2036
+ raise ::ArgumentError, "request must be provided" if request.nil?
2037
+
2038
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::GetRouteTableRequest
2039
+
2040
+ # Converts hash and nil to an options object
2041
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2042
+
2043
+ # Customize the options with defaults
2044
+ metadata = @config.rpcs.get_route_table.metadata.to_h
2045
+
2046
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2047
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2048
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2049
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
2050
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2051
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2052
+
2053
+ header_params = {}
2054
+ if request.name
2055
+ header_params["name"] = request.name
2056
+ end
2057
+
2058
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2059
+ metadata[:"x-goog-request-params"] ||= request_params_header
2060
+
2061
+ options.apply_defaults timeout: @config.rpcs.get_route_table.timeout,
2062
+ metadata: metadata,
2063
+ retry_policy: @config.rpcs.get_route_table.retry_policy
2064
+
2065
+ options.apply_defaults timeout: @config.timeout,
2066
+ metadata: @config.metadata,
2067
+ retry_policy: @config.retry_policy
2068
+
2069
+ @hub_service_stub.call_rpc :get_route_table, request, options: options do |response, operation|
2070
+ yield response, operation if block_given?
2071
+ end
2072
+ rescue ::GRPC::BadStatus => e
2073
+ raise ::Google::Cloud::Error.from_error(e)
2074
+ end
2075
+
2076
+ ##
2077
+ # Gets details about the specified route.
2078
+ #
2079
+ # @overload get_route(request, options = nil)
2080
+ # Pass arguments to `get_route` via a request object, either of type
2081
+ # {::Google::Cloud::NetworkConnectivity::V1beta::GetRouteRequest} or an equivalent Hash.
2082
+ #
2083
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::GetRouteRequest, ::Hash]
2084
+ # A request object representing the call parameters. Required. To specify no
2085
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2086
+ # @param options [::Gapic::CallOptions, ::Hash]
2087
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2088
+ #
2089
+ # @overload get_route(name: nil)
2090
+ # Pass arguments to `get_route` via keyword arguments. Note that at
2091
+ # least one keyword argument is required. To specify no parameters, or to keep all
2092
+ # the default parameter values, pass an empty Hash as a request object (see above).
2093
+ #
2094
+ # @param name [::String]
2095
+ # Required. The name of the route resource.
2096
+ #
2097
+ # @yield [response, operation] Access the result along with the RPC operation
2098
+ # @yieldparam response [::Google::Cloud::NetworkConnectivity::V1beta::Route]
2099
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2100
+ #
2101
+ # @return [::Google::Cloud::NetworkConnectivity::V1beta::Route]
2102
+ #
2103
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2104
+ #
2105
+ # @example Basic example
2106
+ # require "google/cloud/network_connectivity/v1beta"
2107
+ #
2108
+ # # Create a client object. The client can be reused for multiple calls.
2109
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
2110
+ #
2111
+ # # Create a request. To set request fields, pass in keyword arguments.
2112
+ # request = Google::Cloud::NetworkConnectivity::V1beta::GetRouteRequest.new
2113
+ #
2114
+ # # Call the get_route method.
2115
+ # result = client.get_route request
2116
+ #
2117
+ # # The returned object is of type Google::Cloud::NetworkConnectivity::V1beta::Route.
2118
+ # p result
2119
+ #
2120
+ def get_route request, options = nil
2121
+ raise ::ArgumentError, "request must be provided" if request.nil?
2122
+
2123
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::GetRouteRequest
2124
+
2125
+ # Converts hash and nil to an options object
2126
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2127
+
2128
+ # Customize the options with defaults
2129
+ metadata = @config.rpcs.get_route.metadata.to_h
2130
+
2131
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2132
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2133
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2134
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
2135
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2136
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2137
+
2138
+ header_params = {}
2139
+ if request.name
2140
+ header_params["name"] = request.name
2141
+ end
2142
+
2143
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2144
+ metadata[:"x-goog-request-params"] ||= request_params_header
2145
+
2146
+ options.apply_defaults timeout: @config.rpcs.get_route.timeout,
2147
+ metadata: metadata,
2148
+ retry_policy: @config.rpcs.get_route.retry_policy
2149
+
2150
+ options.apply_defaults timeout: @config.timeout,
2151
+ metadata: @config.metadata,
2152
+ retry_policy: @config.retry_policy
2153
+
2154
+ @hub_service_stub.call_rpc :get_route, request, options: options do |response, operation|
2155
+ yield response, operation if block_given?
2156
+ end
2157
+ rescue ::GRPC::BadStatus => e
2158
+ raise ::Google::Cloud::Error.from_error(e)
2159
+ end
2160
+
2161
+ ##
2162
+ # Lists routes in a given route table.
2163
+ #
2164
+ # @overload list_routes(request, options = nil)
2165
+ # Pass arguments to `list_routes` via a request object, either of type
2166
+ # {::Google::Cloud::NetworkConnectivity::V1beta::ListRoutesRequest} or an equivalent Hash.
2167
+ #
2168
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::ListRoutesRequest, ::Hash]
2169
+ # A request object representing the call parameters. Required. To specify no
2170
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2171
+ # @param options [::Gapic::CallOptions, ::Hash]
2172
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2173
+ #
2174
+ # @overload list_routes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
2175
+ # Pass arguments to `list_routes` via keyword arguments. Note that at
2176
+ # least one keyword argument is required. To specify no parameters, or to keep all
2177
+ # the default parameter values, pass an empty Hash as a request object (see above).
2178
+ #
2179
+ # @param parent [::String]
2180
+ # Required. The parent resource's name.
2181
+ # @param page_size [::Integer]
2182
+ # The maximum number of results to return per page.
2183
+ # @param page_token [::String]
2184
+ # The page token.
2185
+ # @param filter [::String]
2186
+ # An expression that filters the list of results.
2187
+ # @param order_by [::String]
2188
+ # Sort the results by a certain order.
2189
+ #
2190
+ # @yield [response, operation] Access the result along with the RPC operation
2191
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1beta::Route>]
2192
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2193
+ #
2194
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1beta::Route>]
2195
+ #
2196
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2197
+ #
2198
+ # @example Basic example
2199
+ # require "google/cloud/network_connectivity/v1beta"
2200
+ #
2201
+ # # Create a client object. The client can be reused for multiple calls.
2202
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
2203
+ #
2204
+ # # Create a request. To set request fields, pass in keyword arguments.
2205
+ # request = Google::Cloud::NetworkConnectivity::V1beta::ListRoutesRequest.new
2206
+ #
2207
+ # # Call the list_routes method.
2208
+ # result = client.list_routes request
2209
+ #
2210
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2211
+ # # over elements, and API calls will be issued to fetch pages as needed.
2212
+ # result.each do |item|
2213
+ # # Each element is of type ::Google::Cloud::NetworkConnectivity::V1beta::Route.
2214
+ # p item
2215
+ # end
2216
+ #
2217
+ def list_routes request, options = nil
2218
+ raise ::ArgumentError, "request must be provided" if request.nil?
2219
+
2220
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::ListRoutesRequest
2221
+
2222
+ # Converts hash and nil to an options object
2223
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2224
+
2225
+ # Customize the options with defaults
2226
+ metadata = @config.rpcs.list_routes.metadata.to_h
2227
+
2228
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2229
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2230
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2231
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
2232
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2233
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2234
+
2235
+ header_params = {}
2236
+ if request.parent
2237
+ header_params["parent"] = request.parent
2238
+ end
2239
+
2240
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2241
+ metadata[:"x-goog-request-params"] ||= request_params_header
2242
+
2243
+ options.apply_defaults timeout: @config.rpcs.list_routes.timeout,
2244
+ metadata: metadata,
2245
+ retry_policy: @config.rpcs.list_routes.retry_policy
2246
+
2247
+ options.apply_defaults timeout: @config.timeout,
2248
+ metadata: @config.metadata,
2249
+ retry_policy: @config.retry_policy
2250
+
2251
+ @hub_service_stub.call_rpc :list_routes, request, options: options do |response, operation|
2252
+ response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_routes, request, response, operation, options
2253
+ yield response, operation if block_given?
2254
+ throw :response, response
2255
+ end
2256
+ rescue ::GRPC::BadStatus => e
2257
+ raise ::Google::Cloud::Error.from_error(e)
2258
+ end
2259
+
2260
+ ##
2261
+ # Lists route tables in a given hub.
2262
+ #
2263
+ # @overload list_route_tables(request, options = nil)
2264
+ # Pass arguments to `list_route_tables` via a request object, either of type
2265
+ # {::Google::Cloud::NetworkConnectivity::V1beta::ListRouteTablesRequest} or an equivalent Hash.
2266
+ #
2267
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::ListRouteTablesRequest, ::Hash]
2268
+ # A request object representing the call parameters. Required. To specify no
2269
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2270
+ # @param options [::Gapic::CallOptions, ::Hash]
2271
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2272
+ #
2273
+ # @overload list_route_tables(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
2274
+ # Pass arguments to `list_route_tables` via keyword arguments. Note that at
2275
+ # least one keyword argument is required. To specify no parameters, or to keep all
2276
+ # the default parameter values, pass an empty Hash as a request object (see above).
2277
+ #
2278
+ # @param parent [::String]
2279
+ # Required. The parent resource's name.
2280
+ # @param page_size [::Integer]
2281
+ # The maximum number of results to return per page.
2282
+ # @param page_token [::String]
2283
+ # The page token.
2284
+ # @param filter [::String]
2285
+ # An expression that filters the list of results.
2286
+ # @param order_by [::String]
2287
+ # Sort the results by a certain order.
2288
+ #
2289
+ # @yield [response, operation] Access the result along with the RPC operation
2290
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1beta::RouteTable>]
2291
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2292
+ #
2293
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1beta::RouteTable>]
2294
+ #
2295
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2296
+ #
2297
+ # @example Basic example
2298
+ # require "google/cloud/network_connectivity/v1beta"
2299
+ #
2300
+ # # Create a client object. The client can be reused for multiple calls.
2301
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
2302
+ #
2303
+ # # Create a request. To set request fields, pass in keyword arguments.
2304
+ # request = Google::Cloud::NetworkConnectivity::V1beta::ListRouteTablesRequest.new
2305
+ #
2306
+ # # Call the list_route_tables method.
2307
+ # result = client.list_route_tables request
2308
+ #
2309
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2310
+ # # over elements, and API calls will be issued to fetch pages as needed.
2311
+ # result.each do |item|
2312
+ # # Each element is of type ::Google::Cloud::NetworkConnectivity::V1beta::RouteTable.
2313
+ # p item
2314
+ # end
2315
+ #
2316
+ def list_route_tables request, options = nil
2317
+ raise ::ArgumentError, "request must be provided" if request.nil?
2318
+
2319
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::ListRouteTablesRequest
2320
+
2321
+ # Converts hash and nil to an options object
2322
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2323
+
2324
+ # Customize the options with defaults
2325
+ metadata = @config.rpcs.list_route_tables.metadata.to_h
2326
+
2327
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2328
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2329
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2330
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
2331
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2332
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2333
+
2334
+ header_params = {}
2335
+ if request.parent
2336
+ header_params["parent"] = request.parent
2337
+ end
2338
+
2339
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2340
+ metadata[:"x-goog-request-params"] ||= request_params_header
2341
+
2342
+ options.apply_defaults timeout: @config.rpcs.list_route_tables.timeout,
2343
+ metadata: metadata,
2344
+ retry_policy: @config.rpcs.list_route_tables.retry_policy
2345
+
2346
+ options.apply_defaults timeout: @config.timeout,
2347
+ metadata: @config.metadata,
2348
+ retry_policy: @config.retry_policy
2349
+
2350
+ @hub_service_stub.call_rpc :list_route_tables, request, options: options do |response, operation|
2351
+ response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_route_tables, request, response, operation, options
2352
+ yield response, operation if block_given?
2353
+ throw :response, response
2354
+ end
2355
+ rescue ::GRPC::BadStatus => e
2356
+ raise ::Google::Cloud::Error.from_error(e)
2357
+ end
2358
+
2359
+ ##
2360
+ # Gets details about a Network Connectivity Center group.
2361
+ #
2362
+ # @overload get_group(request, options = nil)
2363
+ # Pass arguments to `get_group` via a request object, either of type
2364
+ # {::Google::Cloud::NetworkConnectivity::V1beta::GetGroupRequest} or an equivalent Hash.
2365
+ #
2366
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::GetGroupRequest, ::Hash]
2367
+ # A request object representing the call parameters. Required. To specify no
2368
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2369
+ # @param options [::Gapic::CallOptions, ::Hash]
2370
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2371
+ #
2372
+ # @overload get_group(name: nil)
2373
+ # Pass arguments to `get_group` via keyword arguments. Note that at
2374
+ # least one keyword argument is required. To specify no parameters, or to keep all
2375
+ # the default parameter values, pass an empty Hash as a request object (see above).
2376
+ #
2377
+ # @param name [::String]
2378
+ # Required. The name of the route table resource.
2379
+ #
2380
+ # @yield [response, operation] Access the result along with the RPC operation
2381
+ # @yieldparam response [::Google::Cloud::NetworkConnectivity::V1beta::Group]
2382
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2383
+ #
2384
+ # @return [::Google::Cloud::NetworkConnectivity::V1beta::Group]
2385
+ #
2386
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2387
+ #
2388
+ # @example Basic example
2389
+ # require "google/cloud/network_connectivity/v1beta"
2390
+ #
2391
+ # # Create a client object. The client can be reused for multiple calls.
2392
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
2393
+ #
2394
+ # # Create a request. To set request fields, pass in keyword arguments.
2395
+ # request = Google::Cloud::NetworkConnectivity::V1beta::GetGroupRequest.new
2396
+ #
2397
+ # # Call the get_group method.
2398
+ # result = client.get_group request
2399
+ #
2400
+ # # The returned object is of type Google::Cloud::NetworkConnectivity::V1beta::Group.
2401
+ # p result
2402
+ #
2403
+ def get_group request, options = nil
2404
+ raise ::ArgumentError, "request must be provided" if request.nil?
2405
+
2406
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::GetGroupRequest
2407
+
2408
+ # Converts hash and nil to an options object
2409
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2410
+
2411
+ # Customize the options with defaults
2412
+ metadata = @config.rpcs.get_group.metadata.to_h
2413
+
2414
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2415
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2416
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2417
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
2418
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2419
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2420
+
2421
+ header_params = {}
2422
+ if request.name
2423
+ header_params["name"] = request.name
2424
+ end
2425
+
2426
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2427
+ metadata[:"x-goog-request-params"] ||= request_params_header
2428
+
2429
+ options.apply_defaults timeout: @config.rpcs.get_group.timeout,
2430
+ metadata: metadata,
2431
+ retry_policy: @config.rpcs.get_group.retry_policy
2432
+
2433
+ options.apply_defaults timeout: @config.timeout,
2434
+ metadata: @config.metadata,
2435
+ retry_policy: @config.retry_policy
2436
+
2437
+ @hub_service_stub.call_rpc :get_group, request, options: options do |response, operation|
2438
+ yield response, operation if block_given?
2439
+ end
2440
+ rescue ::GRPC::BadStatus => e
2441
+ raise ::Google::Cloud::Error.from_error(e)
2442
+ end
2443
+
2444
+ ##
2445
+ # Lists groups in a given hub.
2446
+ #
2447
+ # @overload list_groups(request, options = nil)
2448
+ # Pass arguments to `list_groups` via a request object, either of type
2449
+ # {::Google::Cloud::NetworkConnectivity::V1beta::ListGroupsRequest} or an equivalent Hash.
2450
+ #
2451
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::ListGroupsRequest, ::Hash]
2452
+ # A request object representing the call parameters. Required. To specify no
2453
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2454
+ # @param options [::Gapic::CallOptions, ::Hash]
2455
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2456
+ #
2457
+ # @overload list_groups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
2458
+ # Pass arguments to `list_groups` via keyword arguments. Note that at
2459
+ # least one keyword argument is required. To specify no parameters, or to keep all
2460
+ # the default parameter values, pass an empty Hash as a request object (see above).
2461
+ #
2462
+ # @param parent [::String]
2463
+ # Required. The parent resource's name.
2464
+ # @param page_size [::Integer]
2465
+ # The maximum number of results to return per page.
2466
+ # @param page_token [::String]
2467
+ # The page token.
2468
+ # @param filter [::String]
2469
+ # An expression that filters the list of results.
2470
+ # @param order_by [::String]
2471
+ # Sort the results by a certain order.
2472
+ #
2473
+ # @yield [response, operation] Access the result along with the RPC operation
2474
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1beta::Group>]
2475
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2476
+ #
2477
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1beta::Group>]
2478
+ #
2479
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2480
+ #
2481
+ # @example Basic example
2482
+ # require "google/cloud/network_connectivity/v1beta"
2483
+ #
2484
+ # # Create a client object. The client can be reused for multiple calls.
2485
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
2486
+ #
2487
+ # # Create a request. To set request fields, pass in keyword arguments.
2488
+ # request = Google::Cloud::NetworkConnectivity::V1beta::ListGroupsRequest.new
2489
+ #
2490
+ # # Call the list_groups method.
2491
+ # result = client.list_groups request
2492
+ #
2493
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2494
+ # # over elements, and API calls will be issued to fetch pages as needed.
2495
+ # result.each do |item|
2496
+ # # Each element is of type ::Google::Cloud::NetworkConnectivity::V1beta::Group.
2497
+ # p item
2498
+ # end
2499
+ #
2500
+ def list_groups request, options = nil
2501
+ raise ::ArgumentError, "request must be provided" if request.nil?
2502
+
2503
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::ListGroupsRequest
2504
+
2505
+ # Converts hash and nil to an options object
2506
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2507
+
2508
+ # Customize the options with defaults
2509
+ metadata = @config.rpcs.list_groups.metadata.to_h
2510
+
2511
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2512
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2513
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2514
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
2515
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2516
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2517
+
2518
+ header_params = {}
2519
+ if request.parent
2520
+ header_params["parent"] = request.parent
2521
+ end
2522
+
2523
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2524
+ metadata[:"x-goog-request-params"] ||= request_params_header
2525
+
2526
+ options.apply_defaults timeout: @config.rpcs.list_groups.timeout,
2527
+ metadata: metadata,
2528
+ retry_policy: @config.rpcs.list_groups.retry_policy
2529
+
2530
+ options.apply_defaults timeout: @config.timeout,
2531
+ metadata: @config.metadata,
2532
+ retry_policy: @config.retry_policy
2533
+
2534
+ @hub_service_stub.call_rpc :list_groups, request, options: options do |response, operation|
2535
+ response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_groups, request, response, operation, options
2536
+ yield response, operation if block_given?
2537
+ throw :response, response
2538
+ end
2539
+ rescue ::GRPC::BadStatus => e
2540
+ raise ::Google::Cloud::Error.from_error(e)
2541
+ end
2542
+
2543
+ ##
2544
+ # Updates the parameters of a Network Connectivity Center group.
2545
+ #
2546
+ # @overload update_group(request, options = nil)
2547
+ # Pass arguments to `update_group` via a request object, either of type
2548
+ # {::Google::Cloud::NetworkConnectivity::V1beta::UpdateGroupRequest} or an equivalent Hash.
2549
+ #
2550
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::UpdateGroupRequest, ::Hash]
2551
+ # A request object representing the call parameters. Required. To specify no
2552
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2553
+ # @param options [::Gapic::CallOptions, ::Hash]
2554
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2555
+ #
2556
+ # @overload update_group(update_mask: nil, group: nil, request_id: nil)
2557
+ # Pass arguments to `update_group` via keyword arguments. Note that at
2558
+ # least one keyword argument is required. To specify no parameters, or to keep all
2559
+ # the default parameter values, pass an empty Hash as a request object (see above).
2560
+ #
2561
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2562
+ # Optional. In the case of an update to an existing group, field mask is used
2563
+ # to specify the fields to be overwritten. The fields specified in the
2564
+ # update_mask are relative to the resource, not the full request. A field is
2565
+ # overwritten if it is in the mask. If the user does not provide a mask, then
2566
+ # all fields are overwritten.
2567
+ # @param group [::Google::Cloud::NetworkConnectivity::V1beta::Group, ::Hash]
2568
+ # Required. The state that the group should be in after the update.
2569
+ # @param request_id [::String]
2570
+ # Optional. A request ID to identify requests. Specify a unique request ID so
2571
+ # that if you must retry your request, the server knows to ignore the request
2572
+ # if it has already been completed. The server guarantees that a request
2573
+ # doesn't result in creation of duplicate commitments for at least 60
2574
+ # minutes.
2575
+ #
2576
+ # For example, consider a situation where you make an initial request and
2577
+ # the request times out. If you make the request again with the same request
2578
+ # ID, the server can check to see whether the original operation
2579
+ # was received. If it was, the server ignores the second request. This
2580
+ # behavior prevents clients from mistakenly creating duplicate commitments.
2581
+ #
2582
+ # The request ID must be a valid UUID, with the exception that zero UUID is
2583
+ # not supported (00000000-0000-0000-0000-000000000000).
2584
+ #
2585
+ # @yield [response, operation] Access the result along with the RPC operation
2586
+ # @yieldparam response [::Gapic::Operation]
2587
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2588
+ #
2589
+ # @return [::Gapic::Operation]
2590
+ #
2591
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2592
+ #
2593
+ # @example Basic example
2594
+ # require "google/cloud/network_connectivity/v1beta"
2595
+ #
2596
+ # # Create a client object. The client can be reused for multiple calls.
2597
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
2598
+ #
2599
+ # # Create a request. To set request fields, pass in keyword arguments.
2600
+ # request = Google::Cloud::NetworkConnectivity::V1beta::UpdateGroupRequest.new
2601
+ #
2602
+ # # Call the update_group method.
2603
+ # result = client.update_group request
2604
+ #
2605
+ # # The returned object is of type Gapic::Operation. You can use it to
2606
+ # # check the status of an operation, cancel it, or wait for results.
2607
+ # # Here is how to wait for a response.
2608
+ # result.wait_until_done! timeout: 60
2609
+ # if result.response?
2610
+ # p result.response
2611
+ # else
2612
+ # puts "No response received."
2613
+ # end
2614
+ #
2615
+ def update_group request, options = nil
2616
+ raise ::ArgumentError, "request must be provided" if request.nil?
2617
+
2618
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::UpdateGroupRequest
2619
+
2620
+ # Converts hash and nil to an options object
2621
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2622
+
2623
+ # Customize the options with defaults
2624
+ metadata = @config.rpcs.update_group.metadata.to_h
2625
+
2626
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2627
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2628
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2629
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
2630
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2631
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2632
+
2633
+ header_params = {}
2634
+ if request.group&.name
2635
+ header_params["group.name"] = request.group.name
2636
+ end
2637
+
2638
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2639
+ metadata[:"x-goog-request-params"] ||= request_params_header
2640
+
2641
+ options.apply_defaults timeout: @config.rpcs.update_group.timeout,
2642
+ metadata: metadata,
2643
+ retry_policy: @config.rpcs.update_group.retry_policy
2644
+
2645
+ options.apply_defaults timeout: @config.timeout,
2646
+ metadata: @config.metadata,
2647
+ retry_policy: @config.retry_policy
2648
+
2649
+ @hub_service_stub.call_rpc :update_group, request, options: options do |response, operation|
2650
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2651
+ yield response, operation if block_given?
2652
+ throw :response, response
2653
+ end
2654
+ rescue ::GRPC::BadStatus => e
2655
+ raise ::Google::Cloud::Error.from_error(e)
2656
+ end
2657
+
2658
+ ##
2659
+ # Create a GatewayAdvertisedRoute
2660
+ #
2661
+ # @overload create_gateway_advertised_route(request, options = nil)
2662
+ # Pass arguments to `create_gateway_advertised_route` via a request object, either of type
2663
+ # {::Google::Cloud::NetworkConnectivity::V1beta::CreateGatewayAdvertisedRouteRequest} or an equivalent Hash.
2664
+ #
2665
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::CreateGatewayAdvertisedRouteRequest, ::Hash]
2666
+ # A request object representing the call parameters. Required. To specify no
2667
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2668
+ # @param options [::Gapic::CallOptions, ::Hash]
2669
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2670
+ #
2671
+ # @overload create_gateway_advertised_route(parent: nil, gateway_advertised_route_id: nil, gateway_advertised_route: nil, request_id: nil)
2672
+ # Pass arguments to `create_gateway_advertised_route` via keyword arguments. Note that at
2673
+ # least one keyword argument is required. To specify no parameters, or to keep all
2674
+ # the default parameter values, pass an empty Hash as a request object (see above).
2675
+ #
2676
+ # @param parent [::String]
2677
+ # Required. The parent resource.
2678
+ # @param gateway_advertised_route_id [::String]
2679
+ # Required. Unique id for the route to create.
2680
+ # @param gateway_advertised_route [::Google::Cloud::NetworkConnectivity::V1beta::GatewayAdvertisedRoute, ::Hash]
2681
+ # Required. Initial values for the new gateway advertised route.
2682
+ # @param request_id [::String]
2683
+ # Optional. A request ID to identify requests. Specify a unique request ID so
2684
+ # that if you must retry your request, the server knows to ignore the request
2685
+ # if it has already been completed. The server guarantees that a request
2686
+ # doesn't result in creation of duplicate commitments for at least 60
2687
+ # minutes.
2688
+ #
2689
+ # For example, consider a situation where you make an initial request and
2690
+ # the request times out. If you make the request again with the same request
2691
+ # ID, the server can check to see whether the original operation
2692
+ # was received. If it was, the server ignores the second request. This
2693
+ # behavior prevents clients from mistakenly creating duplicate commitments.
2694
+ #
2695
+ # The request ID must be a valid UUID, with the exception that zero UUID is
2696
+ # not supported (00000000-0000-0000-0000-000000000000).
2697
+ #
2698
+ # @yield [response, operation] Access the result along with the RPC operation
2699
+ # @yieldparam response [::Gapic::Operation]
2700
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2701
+ #
2702
+ # @return [::Gapic::Operation]
2703
+ #
2704
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2705
+ #
2706
+ # @example Basic example
2707
+ # require "google/cloud/network_connectivity/v1beta"
2708
+ #
2709
+ # # Create a client object. The client can be reused for multiple calls.
2710
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
2711
+ #
2712
+ # # Create a request. To set request fields, pass in keyword arguments.
2713
+ # request = Google::Cloud::NetworkConnectivity::V1beta::CreateGatewayAdvertisedRouteRequest.new
2714
+ #
2715
+ # # Call the create_gateway_advertised_route method.
2716
+ # result = client.create_gateway_advertised_route request
2717
+ #
2718
+ # # The returned object is of type Gapic::Operation. You can use it to
2719
+ # # check the status of an operation, cancel it, or wait for results.
2720
+ # # Here is how to wait for a response.
2721
+ # result.wait_until_done! timeout: 60
2722
+ # if result.response?
2723
+ # p result.response
2724
+ # else
2725
+ # puts "No response received."
2726
+ # end
2727
+ #
2728
+ def create_gateway_advertised_route request, options = nil
2729
+ raise ::ArgumentError, "request must be provided" if request.nil?
2730
+
2731
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::CreateGatewayAdvertisedRouteRequest
2732
+
2733
+ # Converts hash and nil to an options object
2734
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2735
+
2736
+ # Customize the options with defaults
2737
+ metadata = @config.rpcs.create_gateway_advertised_route.metadata.to_h
2738
+
2739
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2740
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2741
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2742
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
2743
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2744
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2745
+
2746
+ header_params = {}
2747
+ if request.parent
2748
+ header_params["parent"] = request.parent
2749
+ end
2750
+
2751
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2752
+ metadata[:"x-goog-request-params"] ||= request_params_header
2753
+
2754
+ options.apply_defaults timeout: @config.rpcs.create_gateway_advertised_route.timeout,
2755
+ metadata: metadata,
2756
+ retry_policy: @config.rpcs.create_gateway_advertised_route.retry_policy
2757
+
2758
+ options.apply_defaults timeout: @config.timeout,
2759
+ metadata: @config.metadata,
2760
+ retry_policy: @config.retry_policy
2761
+
2762
+ @hub_service_stub.call_rpc :create_gateway_advertised_route, request, options: options do |response, operation|
2763
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2764
+ yield response, operation if block_given?
2765
+ throw :response, response
2766
+ end
2767
+ rescue ::GRPC::BadStatus => e
2768
+ raise ::Google::Cloud::Error.from_error(e)
2769
+ end
2770
+
2771
+ ##
2772
+ # Get a GatewayAdvertisedRoute
2773
+ #
2774
+ # @overload get_gateway_advertised_route(request, options = nil)
2775
+ # Pass arguments to `get_gateway_advertised_route` via a request object, either of type
2776
+ # {::Google::Cloud::NetworkConnectivity::V1beta::GetGatewayAdvertisedRouteRequest} or an equivalent Hash.
2777
+ #
2778
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::GetGatewayAdvertisedRouteRequest, ::Hash]
2779
+ # A request object representing the call parameters. Required. To specify no
2780
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2781
+ # @param options [::Gapic::CallOptions, ::Hash]
2782
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2783
+ #
2784
+ # @overload get_gateway_advertised_route(name: nil)
2785
+ # Pass arguments to `get_gateway_advertised_route` via keyword arguments. Note that at
2786
+ # least one keyword argument is required. To specify no parameters, or to keep all
2787
+ # the default parameter values, pass an empty Hash as a request object (see above).
2788
+ #
2789
+ # @param name [::String]
2790
+ # Required. The name of the gateway advertised route to get.
2791
+ #
2792
+ # @yield [response, operation] Access the result along with the RPC operation
2793
+ # @yieldparam response [::Google::Cloud::NetworkConnectivity::V1beta::GatewayAdvertisedRoute]
2794
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2795
+ #
2796
+ # @return [::Google::Cloud::NetworkConnectivity::V1beta::GatewayAdvertisedRoute]
2797
+ #
2798
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2799
+ #
2800
+ # @example Basic example
2801
+ # require "google/cloud/network_connectivity/v1beta"
2802
+ #
2803
+ # # Create a client object. The client can be reused for multiple calls.
2804
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
2805
+ #
2806
+ # # Create a request. To set request fields, pass in keyword arguments.
2807
+ # request = Google::Cloud::NetworkConnectivity::V1beta::GetGatewayAdvertisedRouteRequest.new
2808
+ #
2809
+ # # Call the get_gateway_advertised_route method.
2810
+ # result = client.get_gateway_advertised_route request
2811
+ #
2812
+ # # The returned object is of type Google::Cloud::NetworkConnectivity::V1beta::GatewayAdvertisedRoute.
2813
+ # p result
2814
+ #
2815
+ def get_gateway_advertised_route request, options = nil
2816
+ raise ::ArgumentError, "request must be provided" if request.nil?
2817
+
2818
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::GetGatewayAdvertisedRouteRequest
2819
+
2820
+ # Converts hash and nil to an options object
2821
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2822
+
2823
+ # Customize the options with defaults
2824
+ metadata = @config.rpcs.get_gateway_advertised_route.metadata.to_h
2825
+
2826
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2827
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2828
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2829
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
2830
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2831
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2832
+
2833
+ header_params = {}
2834
+ if request.name
2835
+ header_params["name"] = request.name
2836
+ end
2837
+
2838
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2839
+ metadata[:"x-goog-request-params"] ||= request_params_header
2840
+
2841
+ options.apply_defaults timeout: @config.rpcs.get_gateway_advertised_route.timeout,
2842
+ metadata: metadata,
2843
+ retry_policy: @config.rpcs.get_gateway_advertised_route.retry_policy
2844
+
2845
+ options.apply_defaults timeout: @config.timeout,
2846
+ metadata: @config.metadata,
2847
+ retry_policy: @config.retry_policy
2848
+
2849
+ @hub_service_stub.call_rpc :get_gateway_advertised_route, request, options: options do |response, operation|
2850
+ yield response, operation if block_given?
2851
+ end
2852
+ rescue ::GRPC::BadStatus => e
2853
+ raise ::Google::Cloud::Error.from_error(e)
2854
+ end
2855
+
2856
+ ##
2857
+ # List GatewayAdvertisedRoutes
2858
+ #
2859
+ # @overload list_gateway_advertised_routes(request, options = nil)
2860
+ # Pass arguments to `list_gateway_advertised_routes` via a request object, either of type
2861
+ # {::Google::Cloud::NetworkConnectivity::V1beta::ListGatewayAdvertisedRoutesRequest} or an equivalent Hash.
2862
+ #
2863
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::ListGatewayAdvertisedRoutesRequest, ::Hash]
2864
+ # A request object representing the call parameters. Required. To specify no
2865
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2866
+ # @param options [::Gapic::CallOptions, ::Hash]
2867
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2868
+ #
2869
+ # @overload list_gateway_advertised_routes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
2870
+ # Pass arguments to `list_gateway_advertised_routes` via keyword arguments. Note that at
2871
+ # least one keyword argument is required. To specify no parameters, or to keep all
2872
+ # the default parameter values, pass an empty Hash as a request object (see above).
2873
+ #
2874
+ # @param parent [::String]
2875
+ # Required. The parent resource's name.
2876
+ # @param page_size [::Integer]
2877
+ # Optional. The maximum number of results per page that should be returned.
2878
+ # @param page_token [::String]
2879
+ # Optional. A page token, received from a previous
2880
+ # `ListGatewayAdvertisedRoutes` call. Provide this to retrieve the subsequent
2881
+ # page.
2882
+ #
2883
+ # When paginating, all other parameters provided to
2884
+ # `ListGatewayAdvertisedRoutes` must match the call that provided the page
2885
+ # token.
2886
+ # @param filter [::String]
2887
+ # An expression that filters the list of results.
2888
+ # @param order_by [::String]
2889
+ # Sort the results by a certain order.
2890
+ #
2891
+ # @yield [response, operation] Access the result along with the RPC operation
2892
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1beta::GatewayAdvertisedRoute>]
2893
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2894
+ #
2895
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1beta::GatewayAdvertisedRoute>]
2896
+ #
2897
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2898
+ #
2899
+ # @example Basic example
2900
+ # require "google/cloud/network_connectivity/v1beta"
2901
+ #
2902
+ # # Create a client object. The client can be reused for multiple calls.
2903
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
2904
+ #
2905
+ # # Create a request. To set request fields, pass in keyword arguments.
2906
+ # request = Google::Cloud::NetworkConnectivity::V1beta::ListGatewayAdvertisedRoutesRequest.new
2907
+ #
2908
+ # # Call the list_gateway_advertised_routes method.
2909
+ # result = client.list_gateway_advertised_routes request
2910
+ #
2911
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2912
+ # # over elements, and API calls will be issued to fetch pages as needed.
2913
+ # result.each do |item|
2914
+ # # Each element is of type ::Google::Cloud::NetworkConnectivity::V1beta::GatewayAdvertisedRoute.
2915
+ # p item
2916
+ # end
2917
+ #
2918
+ def list_gateway_advertised_routes request, options = nil
2919
+ raise ::ArgumentError, "request must be provided" if request.nil?
2920
+
2921
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::ListGatewayAdvertisedRoutesRequest
2922
+
2923
+ # Converts hash and nil to an options object
2924
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2925
+
2926
+ # Customize the options with defaults
2927
+ metadata = @config.rpcs.list_gateway_advertised_routes.metadata.to_h
2928
+
2929
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2930
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2931
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2932
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
2933
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2934
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2935
+
2936
+ header_params = {}
2937
+ if request.parent
2938
+ header_params["parent"] = request.parent
2939
+ end
2940
+
2941
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2942
+ metadata[:"x-goog-request-params"] ||= request_params_header
2943
+
2944
+ options.apply_defaults timeout: @config.rpcs.list_gateway_advertised_routes.timeout,
2945
+ metadata: metadata,
2946
+ retry_policy: @config.rpcs.list_gateway_advertised_routes.retry_policy
2947
+
2948
+ options.apply_defaults timeout: @config.timeout,
2949
+ metadata: @config.metadata,
2950
+ retry_policy: @config.retry_policy
2951
+
2952
+ @hub_service_stub.call_rpc :list_gateway_advertised_routes, request, options: options do |response, operation|
2953
+ response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_gateway_advertised_routes, request, response, operation, options
2954
+ yield response, operation if block_given?
2955
+ throw :response, response
2956
+ end
2957
+ rescue ::GRPC::BadStatus => e
2958
+ raise ::Google::Cloud::Error.from_error(e)
2959
+ end
2960
+
2961
+ ##
2962
+ # Update a GatewayAdvertisedRoute
2963
+ #
2964
+ # @overload update_gateway_advertised_route(request, options = nil)
2965
+ # Pass arguments to `update_gateway_advertised_route` via a request object, either of type
2966
+ # {::Google::Cloud::NetworkConnectivity::V1beta::UpdateGatewayAdvertisedRouteRequest} or an equivalent Hash.
2967
+ #
2968
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::UpdateGatewayAdvertisedRouteRequest, ::Hash]
2969
+ # A request object representing the call parameters. Required. To specify no
2970
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2971
+ # @param options [::Gapic::CallOptions, ::Hash]
2972
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2973
+ #
2974
+ # @overload update_gateway_advertised_route(update_mask: nil, gateway_advertised_route: nil, request_id: nil)
2975
+ # Pass arguments to `update_gateway_advertised_route` via keyword arguments. Note that at
2976
+ # least one keyword argument is required. To specify no parameters, or to keep all
2977
+ # the default parameter values, pass an empty Hash as a request object (see above).
2978
+ #
2979
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2980
+ # Optional. In the case of an update to an existing group, field mask is used
2981
+ # to specify the fields to be overwritten. The fields specified in the
2982
+ # update_mask are relative to the resource, not the full request. A field is
2983
+ # overwritten if it is in the mask. If the user does not provide a mask, then
2984
+ # all fields are overwritten.
2985
+ # @param gateway_advertised_route [::Google::Cloud::NetworkConnectivity::V1beta::GatewayAdvertisedRoute, ::Hash]
2986
+ # Required. The gateway advertised route to update.
2987
+ #
2988
+ # The gateway advertised route's `name` field is used to identify the gateway
2989
+ # advertised route to update. Format:
2990
+ # `projects/{project}/locations/{location}/spokes/{spoke}/gatewayAdvertisedRoutes/{gatewayAdvertisedRoute}`
2991
+ # @param request_id [::String]
2992
+ # Optional. A request ID to identify requests. Specify a unique request ID so
2993
+ # that if you must retry your request, the server knows to ignore the request
2994
+ # if it has already been completed. The server guarantees that a request
2995
+ # doesn't result in creation of duplicate commitments for at least 60
2996
+ # minutes.
2997
+ #
2998
+ # For example, consider a situation where you make an initial request and
2999
+ # the request times out. If you make the request again with the same request
3000
+ # ID, the server can check to see whether the original operation
3001
+ # was received. If it was, the server ignores the second request. This
3002
+ # behavior prevents clients from mistakenly creating duplicate commitments.
3003
+ #
3004
+ # The request ID must be a valid UUID, with the exception that zero UUID is
3005
+ # not supported (00000000-0000-0000-0000-000000000000).
3006
+ #
3007
+ # @yield [response, operation] Access the result along with the RPC operation
3008
+ # @yieldparam response [::Gapic::Operation]
3009
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3010
+ #
3011
+ # @return [::Gapic::Operation]
3012
+ #
3013
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3014
+ #
3015
+ # @example Basic example
3016
+ # require "google/cloud/network_connectivity/v1beta"
3017
+ #
3018
+ # # Create a client object. The client can be reused for multiple calls.
3019
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
3020
+ #
3021
+ # # Create a request. To set request fields, pass in keyword arguments.
3022
+ # request = Google::Cloud::NetworkConnectivity::V1beta::UpdateGatewayAdvertisedRouteRequest.new
3023
+ #
3024
+ # # Call the update_gateway_advertised_route method.
3025
+ # result = client.update_gateway_advertised_route request
3026
+ #
3027
+ # # The returned object is of type Gapic::Operation. You can use it to
3028
+ # # check the status of an operation, cancel it, or wait for results.
3029
+ # # Here is how to wait for a response.
3030
+ # result.wait_until_done! timeout: 60
3031
+ # if result.response?
3032
+ # p result.response
3033
+ # else
3034
+ # puts "No response received."
3035
+ # end
3036
+ #
3037
+ def update_gateway_advertised_route request, options = nil
3038
+ raise ::ArgumentError, "request must be provided" if request.nil?
3039
+
3040
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::UpdateGatewayAdvertisedRouteRequest
3041
+
3042
+ # Converts hash and nil to an options object
3043
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3044
+
3045
+ # Customize the options with defaults
3046
+ metadata = @config.rpcs.update_gateway_advertised_route.metadata.to_h
3047
+
3048
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3049
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3050
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3051
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
3052
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3053
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3054
+
3055
+ header_params = {}
3056
+ if request.gateway_advertised_route&.name
3057
+ header_params["gateway_advertised_route.name"] = request.gateway_advertised_route.name
3058
+ end
3059
+
3060
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3061
+ metadata[:"x-goog-request-params"] ||= request_params_header
3062
+
3063
+ options.apply_defaults timeout: @config.rpcs.update_gateway_advertised_route.timeout,
3064
+ metadata: metadata,
3065
+ retry_policy: @config.rpcs.update_gateway_advertised_route.retry_policy
3066
+
3067
+ options.apply_defaults timeout: @config.timeout,
3068
+ metadata: @config.metadata,
3069
+ retry_policy: @config.retry_policy
3070
+
3071
+ @hub_service_stub.call_rpc :update_gateway_advertised_route, request, options: options do |response, operation|
3072
+ response = ::Gapic::Operation.new response, @operations_client, options: options
3073
+ yield response, operation if block_given?
3074
+ throw :response, response
3075
+ end
3076
+ rescue ::GRPC::BadStatus => e
3077
+ raise ::Google::Cloud::Error.from_error(e)
3078
+ end
3079
+
3080
+ ##
3081
+ # Delete a GatewayAdvertisedRoute
3082
+ #
3083
+ # @overload delete_gateway_advertised_route(request, options = nil)
3084
+ # Pass arguments to `delete_gateway_advertised_route` via a request object, either of type
3085
+ # {::Google::Cloud::NetworkConnectivity::V1beta::DeleteGatewayAdvertisedRouteRequest} or an equivalent Hash.
3086
+ #
3087
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::DeleteGatewayAdvertisedRouteRequest, ::Hash]
3088
+ # A request object representing the call parameters. Required. To specify no
3089
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3090
+ # @param options [::Gapic::CallOptions, ::Hash]
3091
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3092
+ #
3093
+ # @overload delete_gateway_advertised_route(name: nil, request_id: nil)
3094
+ # Pass arguments to `delete_gateway_advertised_route` via keyword arguments. Note that at
3095
+ # least one keyword argument is required. To specify no parameters, or to keep all
3096
+ # the default parameter values, pass an empty Hash as a request object (see above).
3097
+ #
3098
+ # @param name [::String]
3099
+ # Required. The name of the gateway advertised route to delete.
3100
+ # @param request_id [::String]
3101
+ # Optional. A request ID to identify requests. Specify a unique request ID so
3102
+ # that if you must retry your request, the server knows to ignore the request
3103
+ # if it has already been completed. The server guarantees that a request
3104
+ # doesn't result in creation of duplicate commitments for at least 60
3105
+ # minutes.
3106
+ #
3107
+ # For example, consider a situation where you make an initial request and
3108
+ # the request times out. If you make the request again with the same request
3109
+ # ID, the server can check to see whether the original operation
3110
+ # was received. If it was, the server ignores the second request. This
3111
+ # behavior prevents clients from mistakenly creating duplicate commitments.
3112
+ #
3113
+ # The request ID must be a valid UUID, with the exception that zero UUID is
3114
+ # not supported (00000000-0000-0000-0000-000000000000).
3115
+ #
3116
+ # @yield [response, operation] Access the result along with the RPC operation
3117
+ # @yieldparam response [::Gapic::Operation]
3118
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3119
+ #
3120
+ # @return [::Gapic::Operation]
3121
+ #
3122
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3123
+ #
3124
+ # @example Basic example
3125
+ # require "google/cloud/network_connectivity/v1beta"
3126
+ #
3127
+ # # Create a client object. The client can be reused for multiple calls.
3128
+ # client = Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new
3129
+ #
3130
+ # # Create a request. To set request fields, pass in keyword arguments.
3131
+ # request = Google::Cloud::NetworkConnectivity::V1beta::DeleteGatewayAdvertisedRouteRequest.new
3132
+ #
3133
+ # # Call the delete_gateway_advertised_route method.
3134
+ # result = client.delete_gateway_advertised_route request
3135
+ #
3136
+ # # The returned object is of type Gapic::Operation. You can use it to
3137
+ # # check the status of an operation, cancel it, or wait for results.
3138
+ # # Here is how to wait for a response.
3139
+ # result.wait_until_done! timeout: 60
3140
+ # if result.response?
3141
+ # p result.response
3142
+ # else
3143
+ # puts "No response received."
3144
+ # end
3145
+ #
3146
+ def delete_gateway_advertised_route request, options = nil
3147
+ raise ::ArgumentError, "request must be provided" if request.nil?
3148
+
3149
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::DeleteGatewayAdvertisedRouteRequest
3150
+
3151
+ # Converts hash and nil to an options object
3152
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3153
+
3154
+ # Customize the options with defaults
3155
+ metadata = @config.rpcs.delete_gateway_advertised_route.metadata.to_h
3156
+
3157
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3158
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3159
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3160
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION
3161
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3162
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3163
+
3164
+ header_params = {}
3165
+ if request.name
3166
+ header_params["name"] = request.name
3167
+ end
3168
+
3169
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3170
+ metadata[:"x-goog-request-params"] ||= request_params_header
3171
+
3172
+ options.apply_defaults timeout: @config.rpcs.delete_gateway_advertised_route.timeout,
3173
+ metadata: metadata,
3174
+ retry_policy: @config.rpcs.delete_gateway_advertised_route.retry_policy
3175
+
3176
+ options.apply_defaults timeout: @config.timeout,
3177
+ metadata: @config.metadata,
3178
+ retry_policy: @config.retry_policy
3179
+
3180
+ @hub_service_stub.call_rpc :delete_gateway_advertised_route, request, options: options do |response, operation|
3181
+ response = ::Gapic::Operation.new response, @operations_client, options: options
3182
+ yield response, operation if block_given?
3183
+ throw :response, response
3184
+ end
3185
+ rescue ::GRPC::BadStatus => e
3186
+ raise ::Google::Cloud::Error.from_error(e)
3187
+ end
3188
+
3189
+ ##
3190
+ # Configuration class for the HubService API.
3191
+ #
3192
+ # This class represents the configuration for HubService,
3193
+ # providing control over timeouts, retry behavior, logging, transport
3194
+ # parameters, and other low-level controls. Certain parameters can also be
3195
+ # applied individually to specific RPCs. See
3196
+ # {::Google::Cloud::NetworkConnectivity::V1beta::HubService::Client::Configuration::Rpcs}
3197
+ # for a list of RPCs that can be configured independently.
3198
+ #
3199
+ # Configuration can be applied globally to all clients, or to a single client
3200
+ # on construction.
3201
+ #
3202
+ # @example
3203
+ #
3204
+ # # Modify the global config, setting the timeout for
3205
+ # # list_hubs to 20 seconds,
3206
+ # # and all remaining timeouts to 10 seconds.
3207
+ # ::Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.configure do |config|
3208
+ # config.timeout = 10.0
3209
+ # config.rpcs.list_hubs.timeout = 20.0
3210
+ # end
3211
+ #
3212
+ # # Apply the above configuration only to a new client.
3213
+ # client = ::Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new do |config|
3214
+ # config.timeout = 10.0
3215
+ # config.rpcs.list_hubs.timeout = 20.0
3216
+ # end
3217
+ #
3218
+ # @!attribute [rw] endpoint
3219
+ # A custom service endpoint, as a hostname or hostname:port. The default is
3220
+ # nil, indicating to use the default endpoint in the current universe domain.
3221
+ # @return [::String,nil]
3222
+ # @!attribute [rw] credentials
3223
+ # Credentials to send with calls. You may provide any of the following types:
3224
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
3225
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
3226
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
3227
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
3228
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
3229
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
3230
+ # * (`nil`) indicating no credentials
3231
+ #
3232
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
3233
+ # is deprecated. Providing an unvalidated credential configuration to
3234
+ # Google APIs can compromise the security of your systems and data.
3235
+ #
3236
+ # @example
3237
+ #
3238
+ # # The recommended way to provide credentials is to use the `make_creds` method
3239
+ # # on the appropriate credentials class for your environment.
3240
+ #
3241
+ # require "googleauth"
3242
+ #
3243
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
3244
+ # json_key_io: ::File.open("/path/to/keyfile.json")
3245
+ # )
3246
+ #
3247
+ # client = ::Google::Cloud::NetworkConnectivity::V1beta::HubService::Client.new do |config|
3248
+ # config.credentials = credentials
3249
+ # end
3250
+ #
3251
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
3252
+ # external source for authentication to Google Cloud, you must validate it before
3253
+ # providing it to a Google API client library. Providing an unvalidated credential
3254
+ # configuration to Google APIs can compromise the security of your systems and data.
3255
+ # For more information, refer to [Validate credential configurations from external
3256
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
3257
+ # @return [::Object]
3258
+ # @!attribute [rw] scope
3259
+ # The OAuth scopes
3260
+ # @return [::Array<::String>]
3261
+ # @!attribute [rw] lib_name
3262
+ # The library name as recorded in instrumentation and logging
3263
+ # @return [::String]
3264
+ # @!attribute [rw] lib_version
3265
+ # The library version as recorded in instrumentation and logging
3266
+ # @return [::String]
3267
+ # @!attribute [rw] channel_args
3268
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
3269
+ # `GRPC::Core::Channel` object is provided as the credential.
3270
+ # @return [::Hash]
3271
+ # @!attribute [rw] interceptors
3272
+ # An array of interceptors that are run before calls are executed.
3273
+ # @return [::Array<::GRPC::ClientInterceptor>]
3274
+ # @!attribute [rw] timeout
3275
+ # The call timeout in seconds.
3276
+ # @return [::Numeric]
3277
+ # @!attribute [rw] metadata
3278
+ # Additional gRPC headers to be sent with the call.
3279
+ # @return [::Hash{::Symbol=>::String}]
3280
+ # @!attribute [rw] retry_policy
3281
+ # The retry policy. The value is a hash with the following keys:
3282
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3283
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3284
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3285
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3286
+ # trigger a retry.
3287
+ # @return [::Hash]
3288
+ # @!attribute [rw] quota_project
3289
+ # A separate project against which to charge quota.
3290
+ # @return [::String]
3291
+ # @!attribute [rw] universe_domain
3292
+ # The universe domain within which to make requests. This determines the
3293
+ # default endpoint URL. The default value of nil uses the environment
3294
+ # universe (usually the default "googleapis.com" universe).
3295
+ # @return [::String,nil]
3296
+ # @!attribute [rw] logger
3297
+ # A custom logger to use for request/response debug logging, or the value
3298
+ # `:default` (the default) to construct a default logger, or `nil` to
3299
+ # explicitly disable logging.
3300
+ # @return [::Logger,:default,nil]
3301
+ #
3302
+ class Configuration
3303
+ extend ::Gapic::Config
3304
+
3305
+ # @private
3306
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
3307
+ DEFAULT_ENDPOINT = "networkconnectivity.googleapis.com"
3308
+
3309
+ config_attr :endpoint, nil, ::String, nil
3310
+ config_attr :credentials, nil do |value|
3311
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
3312
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
3313
+ allowed.any? { |klass| klass === value }
3314
+ end
3315
+ config_attr :scope, nil, ::String, ::Array, nil
3316
+ config_attr :lib_name, nil, ::String, nil
3317
+ config_attr :lib_version, nil, ::String, nil
3318
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
3319
+ config_attr :interceptors, nil, ::Array, nil
3320
+ config_attr :timeout, nil, ::Numeric, nil
3321
+ config_attr :metadata, nil, ::Hash, nil
3322
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
3323
+ config_attr :quota_project, nil, ::String, nil
3324
+ config_attr :universe_domain, nil, ::String, nil
3325
+ config_attr :logger, :default, ::Logger, nil, :default
3326
+
3327
+ # @private
3328
+ def initialize parent_config = nil
3329
+ @parent_config = parent_config unless parent_config.nil?
3330
+
3331
+ yield self if block_given?
3332
+ end
3333
+
3334
+ ##
3335
+ # Configurations for individual RPCs
3336
+ # @return [Rpcs]
3337
+ #
3338
+ def rpcs
3339
+ @rpcs ||= begin
3340
+ parent_rpcs = nil
3341
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
3342
+ Rpcs.new parent_rpcs
3343
+ end
3344
+ end
3345
+
3346
+ ##
3347
+ # Configuration for the channel pool
3348
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
3349
+ #
3350
+ def channel_pool
3351
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
3352
+ end
3353
+
3354
+ ##
3355
+ # Configuration RPC class for the HubService API.
3356
+ #
3357
+ # Includes fields providing the configuration for each RPC in this service.
3358
+ # Each configuration object is of type `Gapic::Config::Method` and includes
3359
+ # the following configuration fields:
3360
+ #
3361
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
3362
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
3363
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
3364
+ # include the following keys:
3365
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3366
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3367
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3368
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3369
+ # trigger a retry.
3370
+ #
3371
+ class Rpcs
3372
+ ##
3373
+ # RPC-specific configuration for `list_hubs`
3374
+ # @return [::Gapic::Config::Method]
3375
+ #
3376
+ attr_reader :list_hubs
3377
+ ##
3378
+ # RPC-specific configuration for `get_hub`
3379
+ # @return [::Gapic::Config::Method]
3380
+ #
3381
+ attr_reader :get_hub
3382
+ ##
3383
+ # RPC-specific configuration for `create_hub`
3384
+ # @return [::Gapic::Config::Method]
3385
+ #
3386
+ attr_reader :create_hub
3387
+ ##
3388
+ # RPC-specific configuration for `update_hub`
3389
+ # @return [::Gapic::Config::Method]
3390
+ #
3391
+ attr_reader :update_hub
3392
+ ##
3393
+ # RPC-specific configuration for `delete_hub`
3394
+ # @return [::Gapic::Config::Method]
3395
+ #
3396
+ attr_reader :delete_hub
3397
+ ##
3398
+ # RPC-specific configuration for `list_hub_spokes`
3399
+ # @return [::Gapic::Config::Method]
3400
+ #
3401
+ attr_reader :list_hub_spokes
3402
+ ##
3403
+ # RPC-specific configuration for `query_hub_status`
3404
+ # @return [::Gapic::Config::Method]
3405
+ #
3406
+ attr_reader :query_hub_status
3407
+ ##
3408
+ # RPC-specific configuration for `list_spokes`
3409
+ # @return [::Gapic::Config::Method]
3410
+ #
3411
+ attr_reader :list_spokes
3412
+ ##
3413
+ # RPC-specific configuration for `get_spoke`
3414
+ # @return [::Gapic::Config::Method]
3415
+ #
3416
+ attr_reader :get_spoke
3417
+ ##
3418
+ # RPC-specific configuration for `create_spoke`
3419
+ # @return [::Gapic::Config::Method]
3420
+ #
3421
+ attr_reader :create_spoke
3422
+ ##
3423
+ # RPC-specific configuration for `update_spoke`
3424
+ # @return [::Gapic::Config::Method]
3425
+ #
3426
+ attr_reader :update_spoke
3427
+ ##
3428
+ # RPC-specific configuration for `reject_hub_spoke`
3429
+ # @return [::Gapic::Config::Method]
3430
+ #
3431
+ attr_reader :reject_hub_spoke
3432
+ ##
3433
+ # RPC-specific configuration for `accept_hub_spoke`
3434
+ # @return [::Gapic::Config::Method]
3435
+ #
3436
+ attr_reader :accept_hub_spoke
3437
+ ##
3438
+ # RPC-specific configuration for `accept_spoke_update`
3439
+ # @return [::Gapic::Config::Method]
3440
+ #
3441
+ attr_reader :accept_spoke_update
3442
+ ##
3443
+ # RPC-specific configuration for `reject_spoke_update`
3444
+ # @return [::Gapic::Config::Method]
3445
+ #
3446
+ attr_reader :reject_spoke_update
3447
+ ##
3448
+ # RPC-specific configuration for `delete_spoke`
3449
+ # @return [::Gapic::Config::Method]
3450
+ #
3451
+ attr_reader :delete_spoke
3452
+ ##
3453
+ # RPC-specific configuration for `get_route_table`
3454
+ # @return [::Gapic::Config::Method]
3455
+ #
3456
+ attr_reader :get_route_table
3457
+ ##
3458
+ # RPC-specific configuration for `get_route`
3459
+ # @return [::Gapic::Config::Method]
3460
+ #
3461
+ attr_reader :get_route
3462
+ ##
3463
+ # RPC-specific configuration for `list_routes`
3464
+ # @return [::Gapic::Config::Method]
3465
+ #
3466
+ attr_reader :list_routes
3467
+ ##
3468
+ # RPC-specific configuration for `list_route_tables`
3469
+ # @return [::Gapic::Config::Method]
3470
+ #
3471
+ attr_reader :list_route_tables
3472
+ ##
3473
+ # RPC-specific configuration for `get_group`
3474
+ # @return [::Gapic::Config::Method]
3475
+ #
3476
+ attr_reader :get_group
3477
+ ##
3478
+ # RPC-specific configuration for `list_groups`
3479
+ # @return [::Gapic::Config::Method]
3480
+ #
3481
+ attr_reader :list_groups
3482
+ ##
3483
+ # RPC-specific configuration for `update_group`
3484
+ # @return [::Gapic::Config::Method]
3485
+ #
3486
+ attr_reader :update_group
3487
+ ##
3488
+ # RPC-specific configuration for `create_gateway_advertised_route`
3489
+ # @return [::Gapic::Config::Method]
3490
+ #
3491
+ attr_reader :create_gateway_advertised_route
3492
+ ##
3493
+ # RPC-specific configuration for `get_gateway_advertised_route`
3494
+ # @return [::Gapic::Config::Method]
3495
+ #
3496
+ attr_reader :get_gateway_advertised_route
3497
+ ##
3498
+ # RPC-specific configuration for `list_gateway_advertised_routes`
3499
+ # @return [::Gapic::Config::Method]
3500
+ #
3501
+ attr_reader :list_gateway_advertised_routes
3502
+ ##
3503
+ # RPC-specific configuration for `update_gateway_advertised_route`
3504
+ # @return [::Gapic::Config::Method]
3505
+ #
3506
+ attr_reader :update_gateway_advertised_route
3507
+ ##
3508
+ # RPC-specific configuration for `delete_gateway_advertised_route`
3509
+ # @return [::Gapic::Config::Method]
3510
+ #
3511
+ attr_reader :delete_gateway_advertised_route
3512
+
3513
+ # @private
3514
+ def initialize parent_rpcs = nil
3515
+ list_hubs_config = parent_rpcs.list_hubs if parent_rpcs.respond_to? :list_hubs
3516
+ @list_hubs = ::Gapic::Config::Method.new list_hubs_config
3517
+ get_hub_config = parent_rpcs.get_hub if parent_rpcs.respond_to? :get_hub
3518
+ @get_hub = ::Gapic::Config::Method.new get_hub_config
3519
+ create_hub_config = parent_rpcs.create_hub if parent_rpcs.respond_to? :create_hub
3520
+ @create_hub = ::Gapic::Config::Method.new create_hub_config
3521
+ update_hub_config = parent_rpcs.update_hub if parent_rpcs.respond_to? :update_hub
3522
+ @update_hub = ::Gapic::Config::Method.new update_hub_config
3523
+ delete_hub_config = parent_rpcs.delete_hub if parent_rpcs.respond_to? :delete_hub
3524
+ @delete_hub = ::Gapic::Config::Method.new delete_hub_config
3525
+ list_hub_spokes_config = parent_rpcs.list_hub_spokes if parent_rpcs.respond_to? :list_hub_spokes
3526
+ @list_hub_spokes = ::Gapic::Config::Method.new list_hub_spokes_config
3527
+ query_hub_status_config = parent_rpcs.query_hub_status if parent_rpcs.respond_to? :query_hub_status
3528
+ @query_hub_status = ::Gapic::Config::Method.new query_hub_status_config
3529
+ list_spokes_config = parent_rpcs.list_spokes if parent_rpcs.respond_to? :list_spokes
3530
+ @list_spokes = ::Gapic::Config::Method.new list_spokes_config
3531
+ get_spoke_config = parent_rpcs.get_spoke if parent_rpcs.respond_to? :get_spoke
3532
+ @get_spoke = ::Gapic::Config::Method.new get_spoke_config
3533
+ create_spoke_config = parent_rpcs.create_spoke if parent_rpcs.respond_to? :create_spoke
3534
+ @create_spoke = ::Gapic::Config::Method.new create_spoke_config
3535
+ update_spoke_config = parent_rpcs.update_spoke if parent_rpcs.respond_to? :update_spoke
3536
+ @update_spoke = ::Gapic::Config::Method.new update_spoke_config
3537
+ reject_hub_spoke_config = parent_rpcs.reject_hub_spoke if parent_rpcs.respond_to? :reject_hub_spoke
3538
+ @reject_hub_spoke = ::Gapic::Config::Method.new reject_hub_spoke_config
3539
+ accept_hub_spoke_config = parent_rpcs.accept_hub_spoke if parent_rpcs.respond_to? :accept_hub_spoke
3540
+ @accept_hub_spoke = ::Gapic::Config::Method.new accept_hub_spoke_config
3541
+ accept_spoke_update_config = parent_rpcs.accept_spoke_update if parent_rpcs.respond_to? :accept_spoke_update
3542
+ @accept_spoke_update = ::Gapic::Config::Method.new accept_spoke_update_config
3543
+ reject_spoke_update_config = parent_rpcs.reject_spoke_update if parent_rpcs.respond_to? :reject_spoke_update
3544
+ @reject_spoke_update = ::Gapic::Config::Method.new reject_spoke_update_config
3545
+ delete_spoke_config = parent_rpcs.delete_spoke if parent_rpcs.respond_to? :delete_spoke
3546
+ @delete_spoke = ::Gapic::Config::Method.new delete_spoke_config
3547
+ get_route_table_config = parent_rpcs.get_route_table if parent_rpcs.respond_to? :get_route_table
3548
+ @get_route_table = ::Gapic::Config::Method.new get_route_table_config
3549
+ get_route_config = parent_rpcs.get_route if parent_rpcs.respond_to? :get_route
3550
+ @get_route = ::Gapic::Config::Method.new get_route_config
3551
+ list_routes_config = parent_rpcs.list_routes if parent_rpcs.respond_to? :list_routes
3552
+ @list_routes = ::Gapic::Config::Method.new list_routes_config
3553
+ list_route_tables_config = parent_rpcs.list_route_tables if parent_rpcs.respond_to? :list_route_tables
3554
+ @list_route_tables = ::Gapic::Config::Method.new list_route_tables_config
3555
+ get_group_config = parent_rpcs.get_group if parent_rpcs.respond_to? :get_group
3556
+ @get_group = ::Gapic::Config::Method.new get_group_config
3557
+ list_groups_config = parent_rpcs.list_groups if parent_rpcs.respond_to? :list_groups
3558
+ @list_groups = ::Gapic::Config::Method.new list_groups_config
3559
+ update_group_config = parent_rpcs.update_group if parent_rpcs.respond_to? :update_group
3560
+ @update_group = ::Gapic::Config::Method.new update_group_config
3561
+ create_gateway_advertised_route_config = parent_rpcs.create_gateway_advertised_route if parent_rpcs.respond_to? :create_gateway_advertised_route
3562
+ @create_gateway_advertised_route = ::Gapic::Config::Method.new create_gateway_advertised_route_config
3563
+ get_gateway_advertised_route_config = parent_rpcs.get_gateway_advertised_route if parent_rpcs.respond_to? :get_gateway_advertised_route
3564
+ @get_gateway_advertised_route = ::Gapic::Config::Method.new get_gateway_advertised_route_config
3565
+ list_gateway_advertised_routes_config = parent_rpcs.list_gateway_advertised_routes if parent_rpcs.respond_to? :list_gateway_advertised_routes
3566
+ @list_gateway_advertised_routes = ::Gapic::Config::Method.new list_gateway_advertised_routes_config
3567
+ update_gateway_advertised_route_config = parent_rpcs.update_gateway_advertised_route if parent_rpcs.respond_to? :update_gateway_advertised_route
3568
+ @update_gateway_advertised_route = ::Gapic::Config::Method.new update_gateway_advertised_route_config
3569
+ delete_gateway_advertised_route_config = parent_rpcs.delete_gateway_advertised_route if parent_rpcs.respond_to? :delete_gateway_advertised_route
3570
+ @delete_gateway_advertised_route = ::Gapic::Config::Method.new delete_gateway_advertised_route_config
3571
+
3572
+ yield self if block_given?
3573
+ end
3574
+ end
3575
+ end
3576
+ end
3577
+ end
3578
+ end
3579
+ end
3580
+ end
3581
+ end