google-cloud-network_connectivity-v1 0.7.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,6 +34,9 @@ module Google
34
34
  # through a simple, centralized connectivity management model.
35
35
  #
36
36
  class Client
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "networkconnectivity.$UNIVERSE_DOMAIN$"
39
+
37
40
  include Paths
38
41
 
39
42
  # @private
@@ -111,6 +114,15 @@ module Google
111
114
  @config
112
115
  end
113
116
 
117
+ ##
118
+ # The effective universe domain
119
+ #
120
+ # @return [String]
121
+ #
122
+ def universe_domain
123
+ @hub_service_stub.universe_domain
124
+ end
125
+
114
126
  ##
115
127
  # Create a new HubService client object.
116
128
  #
@@ -144,8 +156,9 @@ module Google
144
156
  credentials = @config.credentials
145
157
  # Use self-signed JWT if the endpoint is unchanged from default,
146
158
  # but only if the default endpoint does not have a region prefix.
147
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
148
- !@config.endpoint.split(".").first.include?("-")
159
+ enable_self_signed_jwt = @config.endpoint.nil? ||
160
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
161
+ !@config.endpoint.split(".").first.include?("-"))
149
162
  credentials ||= Credentials.default scope: @config.scope,
150
163
  enable_self_signed_jwt: enable_self_signed_jwt
151
164
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -158,24 +171,29 @@ module Google
158
171
  config.credentials = credentials
159
172
  config.quota_project = @quota_project_id
160
173
  config.endpoint = @config.endpoint
174
+ config.universe_domain = @config.universe_domain
161
175
  end
162
176
 
163
177
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
164
178
  config.credentials = credentials
165
179
  config.quota_project = @quota_project_id
166
180
  config.endpoint = @config.endpoint
181
+ config.universe_domain = @config.universe_domain
167
182
  end
168
183
 
169
184
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
170
185
  config.credentials = credentials
171
186
  config.quota_project = @quota_project_id
172
187
  config.endpoint = @config.endpoint
188
+ config.universe_domain = @config.universe_domain
173
189
  end
174
190
 
175
191
  @hub_service_stub = ::Gapic::ServiceStub.new(
176
192
  ::Google::Cloud::NetworkConnectivity::V1::HubService::Stub,
177
- credentials: credentials,
178
- endpoint: @config.endpoint,
193
+ credentials: credentials,
194
+ endpoint: @config.endpoint,
195
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
196
+ universe_domain: @config.universe_domain,
179
197
  channel_args: @config.channel_args,
180
198
  interceptors: @config.interceptors,
181
199
  channel_pool_config: @config.channel_pool
@@ -226,11 +244,11 @@ module Google
226
244
  # @param parent [::String]
227
245
  # Required. The parent resource's name.
228
246
  # @param page_size [::Integer]
229
- # The maximum number of results per page that should be returned.
247
+ # The maximum number of results per page to return.
230
248
  # @param page_token [::String]
231
249
  # The page token.
232
250
  # @param filter [::String]
233
- # An expression that filters the results listed in the response.
251
+ # An expression that filters the list of results.
234
252
  # @param order_by [::String]
235
253
  # Sort the results by a certain order.
236
254
  #
@@ -413,11 +431,11 @@ module Google
413
431
  # @param hub [::Google::Cloud::NetworkConnectivity::V1::Hub, ::Hash]
414
432
  # Required. The initial values for a new hub.
415
433
  # @param request_id [::String]
416
- # Optional. A unique request ID (optional). If you specify this ID, you can
417
- # use it in cases when you need to retry your request. When you need to
418
- # retry, this ID lets the server know that it can ignore the request if it
419
- # has already been completed. The server guarantees that for at least 60
420
- # minutes after the first request.
434
+ # Optional. A request ID to identify requests. Specify a unique request ID so
435
+ # that if you must retry your request, the server knows to ignore the request
436
+ # if it has already been completed. The server guarantees that a request
437
+ # doesn't result in creation of duplicate commitments for at least 60
438
+ # minutes.
421
439
  #
422
440
  # For example, consider a situation where you make an initial request and
423
441
  # the request times out. If you make the request again with the same request
@@ -528,11 +546,11 @@ module Google
528
546
  # @param hub [::Google::Cloud::NetworkConnectivity::V1::Hub, ::Hash]
529
547
  # Required. The state that the hub should be in after the update.
530
548
  # @param request_id [::String]
531
- # Optional. A unique request ID (optional). If you specify this ID, you can
532
- # use it in cases when you need to retry your request. When you need to
533
- # retry, this ID lets the server know that it can ignore the request if it
534
- # has already been completed. The server guarantees that for at least 60
535
- # minutes after the first request.
549
+ # Optional. A request ID to identify requests. Specify a unique request ID so
550
+ # that if you must retry your request, the server knows to ignore the request
551
+ # if it has already been completed. The server guarantees that a request
552
+ # doesn't result in creation of duplicate commitments for at least 60
553
+ # minutes.
536
554
  #
537
555
  # For example, consider a situation where you make an initial request and
538
556
  # the request times out. If you make the request again with the same request
@@ -636,11 +654,11 @@ module Google
636
654
  # @param name [::String]
637
655
  # Required. The name of the hub to delete.
638
656
  # @param request_id [::String]
639
- # Optional. A unique request ID (optional). If you specify this ID, you can
640
- # use it in cases when you need to retry your request. When you need to
641
- # retry, this ID lets the server know that it can ignore the request if it
642
- # has already been completed. The server guarantees that for at least 60
643
- # minutes after the first request.
657
+ # Optional. A request ID to identify requests. Specify a unique request ID so
658
+ # that if you must retry your request, the server knows to ignore the request
659
+ # if it has already been completed. The server guarantees that a request
660
+ # doesn't result in creation of duplicate commitments for at least 60
661
+ # minutes.
644
662
  #
645
663
  # For example, consider a situation where you make an initial request and
646
664
  # the request times out. If you make the request again with the same request
@@ -723,6 +741,119 @@ module Google
723
741
  raise ::Google::Cloud::Error.from_error(e)
724
742
  end
725
743
 
744
+ ##
745
+ # Lists the Network Connectivity Center spokes associated with a
746
+ # specified hub and location. The list includes both spokes that are attached
747
+ # to the hub and spokes that have been proposed but not yet accepted.
748
+ #
749
+ # @overload list_hub_spokes(request, options = nil)
750
+ # Pass arguments to `list_hub_spokes` via a request object, either of type
751
+ # {::Google::Cloud::NetworkConnectivity::V1::ListHubSpokesRequest} or an equivalent Hash.
752
+ #
753
+ # @param request [::Google::Cloud::NetworkConnectivity::V1::ListHubSpokesRequest, ::Hash]
754
+ # A request object representing the call parameters. Required. To specify no
755
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
756
+ # @param options [::Gapic::CallOptions, ::Hash]
757
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
758
+ #
759
+ # @overload list_hub_spokes(name: nil, spoke_locations: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil)
760
+ # Pass arguments to `list_hub_spokes` via keyword arguments. Note that at
761
+ # least one keyword argument is required. To specify no parameters, or to keep all
762
+ # the default parameter values, pass an empty Hash as a request object (see above).
763
+ #
764
+ # @param name [::String]
765
+ # Required. The name of the hub.
766
+ # @param spoke_locations [::Array<::String>]
767
+ # A list of locations.
768
+ # Specify one of the following: `[global]`, a single region (for
769
+ # example, `[us-central1]`), or a combination of
770
+ # values (for example, `[global, us-central1, us-west1]`).
771
+ # If the spoke_locations field is populated, the list of results
772
+ # includes only spokes in the specified location.
773
+ # If the spoke_locations field is not populated, the list of results
774
+ # includes spokes in all locations.
775
+ # @param page_size [::Integer]
776
+ # The maximum number of results to return per page.
777
+ # @param page_token [::String]
778
+ # The page token.
779
+ # @param filter [::String]
780
+ # An expression that filters the list of results.
781
+ # @param order_by [::String]
782
+ # Sort the results by name or create_time.
783
+ # @param view [::Google::Cloud::NetworkConnectivity::V1::ListHubSpokesRequest::SpokeView]
784
+ # The view of the spoke to return.
785
+ # The view that you use determines which spoke fields are included in the
786
+ # response.
787
+ #
788
+ # @yield [response, operation] Access the result along with the RPC operation
789
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Spoke>]
790
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
791
+ #
792
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Spoke>]
793
+ #
794
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
795
+ #
796
+ # @example Basic example
797
+ # require "google/cloud/network_connectivity/v1"
798
+ #
799
+ # # Create a client object. The client can be reused for multiple calls.
800
+ # client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
801
+ #
802
+ # # Create a request. To set request fields, pass in keyword arguments.
803
+ # request = Google::Cloud::NetworkConnectivity::V1::ListHubSpokesRequest.new
804
+ #
805
+ # # Call the list_hub_spokes method.
806
+ # result = client.list_hub_spokes request
807
+ #
808
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
809
+ # # over elements, and API calls will be issued to fetch pages as needed.
810
+ # result.each do |item|
811
+ # # Each element is of type ::Google::Cloud::NetworkConnectivity::V1::Spoke.
812
+ # p item
813
+ # end
814
+ #
815
+ def list_hub_spokes request, options = nil
816
+ raise ::ArgumentError, "request must be provided" if request.nil?
817
+
818
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::ListHubSpokesRequest
819
+
820
+ # Converts hash and nil to an options object
821
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
822
+
823
+ # Customize the options with defaults
824
+ metadata = @config.rpcs.list_hub_spokes.metadata.to_h
825
+
826
+ # Set x-goog-api-client and x-goog-user-project headers
827
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
828
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
829
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
830
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
831
+
832
+ header_params = {}
833
+ if request.name
834
+ header_params["name"] = request.name
835
+ end
836
+
837
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
838
+ metadata[:"x-goog-request-params"] ||= request_params_header
839
+
840
+ options.apply_defaults timeout: @config.rpcs.list_hub_spokes.timeout,
841
+ metadata: metadata,
842
+ retry_policy: @config.rpcs.list_hub_spokes.retry_policy
843
+
844
+ options.apply_defaults timeout: @config.timeout,
845
+ metadata: @config.metadata,
846
+ retry_policy: @config.retry_policy
847
+
848
+ @hub_service_stub.call_rpc :list_hub_spokes, request, options: options do |response, operation|
849
+ response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_hub_spokes, request, response, operation, options
850
+ yield response, operation if block_given?
851
+ return response
852
+ end
853
+ rescue ::GRPC::BadStatus => e
854
+ raise ::Google::Cloud::Error.from_error(e)
855
+ end
856
+
726
857
  ##
727
858
  # Lists the Network Connectivity Center spokes in a specified project and
728
859
  # location.
@@ -745,11 +876,11 @@ module Google
745
876
  # @param parent [::String]
746
877
  # Required. The parent resource.
747
878
  # @param page_size [::Integer]
748
- # The maximum number of results per page that should be returned.
879
+ # The maximum number of results to return per page.
749
880
  # @param page_token [::String]
750
881
  # The page token.
751
882
  # @param filter [::String]
752
- # An expression that filters the results listed in the response.
883
+ # An expression that filters the list of results.
753
884
  # @param order_by [::String]
754
885
  # Sort the results by a certain order.
755
886
  #
@@ -932,11 +1063,11 @@ module Google
932
1063
  # @param spoke [::Google::Cloud::NetworkConnectivity::V1::Spoke, ::Hash]
933
1064
  # Required. The initial values for a new spoke.
934
1065
  # @param request_id [::String]
935
- # Optional. A unique request ID (optional). If you specify this ID, you can
936
- # use it in cases when you need to retry your request. When you need to
937
- # retry, this ID lets the server know that it can ignore the request if it
938
- # has already been completed. The server guarantees that for at least 60
939
- # minutes after the first request.
1066
+ # Optional. A request ID to identify requests. Specify a unique request ID so
1067
+ # that if you must retry your request, the server knows to ignore the request
1068
+ # if it has already been completed. The server guarantees that a request
1069
+ # doesn't result in creation of duplicate commitments for at least 60
1070
+ # minutes.
940
1071
  #
941
1072
  # For example, consider a situation where you make an initial request and
942
1073
  # the request times out. If you make the request again with the same request
@@ -1046,11 +1177,11 @@ module Google
1046
1177
  # @param spoke [::Google::Cloud::NetworkConnectivity::V1::Spoke, ::Hash]
1047
1178
  # Required. The state that the spoke should be in after the update.
1048
1179
  # @param request_id [::String]
1049
- # Optional. A unique request ID (optional). If you specify this ID, you can
1050
- # use it in cases when you need to retry your request. When you need to
1051
- # retry, this ID lets the server know that it can ignore the request if it
1052
- # has already been completed. The server guarantees that for at least 60
1053
- # minutes after the first request.
1180
+ # Optional. A request ID to identify requests. Specify a unique request ID so
1181
+ # that if you must retry your request, the server knows to ignore the request
1182
+ # if it has already been completed. The server guarantees that a request
1183
+ # doesn't result in creation of duplicate commitments for at least 60
1184
+ # minutes.
1054
1185
  #
1055
1186
  # For example, consider a situation where you make an initial request and
1056
1187
  # the request times out. If you make the request again with the same request
@@ -1133,6 +1264,232 @@ module Google
1133
1264
  raise ::Google::Cloud::Error.from_error(e)
1134
1265
  end
1135
1266
 
1267
+ ##
1268
+ # Rejects a Network Connectivity Center spoke from being attached to a hub.
1269
+ # If the spoke was previously in the `ACTIVE` state, it
1270
+ # transitions to the `INACTIVE` state and is no longer able to
1271
+ # connect to other spokes that are attached to the hub.
1272
+ #
1273
+ # @overload reject_hub_spoke(request, options = nil)
1274
+ # Pass arguments to `reject_hub_spoke` via a request object, either of type
1275
+ # {::Google::Cloud::NetworkConnectivity::V1::RejectHubSpokeRequest} or an equivalent Hash.
1276
+ #
1277
+ # @param request [::Google::Cloud::NetworkConnectivity::V1::RejectHubSpokeRequest, ::Hash]
1278
+ # A request object representing the call parameters. Required. To specify no
1279
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1280
+ # @param options [::Gapic::CallOptions, ::Hash]
1281
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1282
+ #
1283
+ # @overload reject_hub_spoke(name: nil, spoke_uri: nil, request_id: nil, details: nil)
1284
+ # Pass arguments to `reject_hub_spoke` via keyword arguments. Note that at
1285
+ # least one keyword argument is required. To specify no parameters, or to keep all
1286
+ # the default parameter values, pass an empty Hash as a request object (see above).
1287
+ #
1288
+ # @param name [::String]
1289
+ # Required. The name of the hub from which to reject the spoke.
1290
+ # @param spoke_uri [::String]
1291
+ # Required. The URI of the spoke to reject from the hub.
1292
+ # @param request_id [::String]
1293
+ # Optional. A request ID to identify requests. Specify a unique request ID so
1294
+ # that if you must retry your request, the server knows to ignore the request
1295
+ # if it has already been completed. The server guarantees that a request
1296
+ # doesn't result in creation of duplicate commitments for at least 60
1297
+ # minutes.
1298
+ #
1299
+ # For example, consider a situation where you make an initial request and
1300
+ # the request times out. If you make the request again with the same request
1301
+ # ID, the server can check to see whether the original operation
1302
+ # was received. If it was, the server ignores the second request. This
1303
+ # behavior prevents clients from mistakenly creating duplicate commitments.
1304
+ #
1305
+ # The request ID must be a valid UUID, with the exception that zero UUID is
1306
+ # not supported (00000000-0000-0000-0000-000000000000).
1307
+ # @param details [::String]
1308
+ # Optional. Additional information provided by the hub administrator.
1309
+ #
1310
+ # @yield [response, operation] Access the result along with the RPC operation
1311
+ # @yieldparam response [::Gapic::Operation]
1312
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1313
+ #
1314
+ # @return [::Gapic::Operation]
1315
+ #
1316
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1317
+ #
1318
+ # @example Basic example
1319
+ # require "google/cloud/network_connectivity/v1"
1320
+ #
1321
+ # # Create a client object. The client can be reused for multiple calls.
1322
+ # client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
1323
+ #
1324
+ # # Create a request. To set request fields, pass in keyword arguments.
1325
+ # request = Google::Cloud::NetworkConnectivity::V1::RejectHubSpokeRequest.new
1326
+ #
1327
+ # # Call the reject_hub_spoke method.
1328
+ # result = client.reject_hub_spoke request
1329
+ #
1330
+ # # The returned object is of type Gapic::Operation. You can use it to
1331
+ # # check the status of an operation, cancel it, or wait for results.
1332
+ # # Here is how to wait for a response.
1333
+ # result.wait_until_done! timeout: 60
1334
+ # if result.response?
1335
+ # p result.response
1336
+ # else
1337
+ # puts "No response received."
1338
+ # end
1339
+ #
1340
+ def reject_hub_spoke request, options = nil
1341
+ raise ::ArgumentError, "request must be provided" if request.nil?
1342
+
1343
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::RejectHubSpokeRequest
1344
+
1345
+ # Converts hash and nil to an options object
1346
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1347
+
1348
+ # Customize the options with defaults
1349
+ metadata = @config.rpcs.reject_hub_spoke.metadata.to_h
1350
+
1351
+ # Set x-goog-api-client and x-goog-user-project headers
1352
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1353
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1354
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
1355
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1356
+
1357
+ header_params = {}
1358
+ if request.name
1359
+ header_params["name"] = request.name
1360
+ end
1361
+
1362
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1363
+ metadata[:"x-goog-request-params"] ||= request_params_header
1364
+
1365
+ options.apply_defaults timeout: @config.rpcs.reject_hub_spoke.timeout,
1366
+ metadata: metadata,
1367
+ retry_policy: @config.rpcs.reject_hub_spoke.retry_policy
1368
+
1369
+ options.apply_defaults timeout: @config.timeout,
1370
+ metadata: @config.metadata,
1371
+ retry_policy: @config.retry_policy
1372
+
1373
+ @hub_service_stub.call_rpc :reject_hub_spoke, request, options: options do |response, operation|
1374
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1375
+ yield response, operation if block_given?
1376
+ return response
1377
+ end
1378
+ rescue ::GRPC::BadStatus => e
1379
+ raise ::Google::Cloud::Error.from_error(e)
1380
+ end
1381
+
1382
+ ##
1383
+ # Accepts a proposal to attach a Network Connectivity Center spoke
1384
+ # to a hub.
1385
+ #
1386
+ # @overload accept_hub_spoke(request, options = nil)
1387
+ # Pass arguments to `accept_hub_spoke` via a request object, either of type
1388
+ # {::Google::Cloud::NetworkConnectivity::V1::AcceptHubSpokeRequest} or an equivalent Hash.
1389
+ #
1390
+ # @param request [::Google::Cloud::NetworkConnectivity::V1::AcceptHubSpokeRequest, ::Hash]
1391
+ # A request object representing the call parameters. Required. To specify no
1392
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1393
+ # @param options [::Gapic::CallOptions, ::Hash]
1394
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1395
+ #
1396
+ # @overload accept_hub_spoke(name: nil, spoke_uri: nil, request_id: nil)
1397
+ # Pass arguments to `accept_hub_spoke` via keyword arguments. Note that at
1398
+ # least one keyword argument is required. To specify no parameters, or to keep all
1399
+ # the default parameter values, pass an empty Hash as a request object (see above).
1400
+ #
1401
+ # @param name [::String]
1402
+ # Required. The name of the hub into which to accept the spoke.
1403
+ # @param spoke_uri [::String]
1404
+ # Required. The URI of the spoke to accept into the hub.
1405
+ # @param request_id [::String]
1406
+ # Optional. A request ID to identify requests. Specify a unique request ID so
1407
+ # that if you must retry your request, the server knows to ignore the request
1408
+ # if it has already been completed. The server guarantees that a request
1409
+ # doesn't result in creation of duplicate commitments for at least 60
1410
+ # minutes.
1411
+ #
1412
+ # For example, consider a situation where you make an initial request and
1413
+ # the request times out. If you make the request again with the same request
1414
+ # ID, the server can check to see whether the original operation
1415
+ # was received. If it was, the server ignores the second request. This
1416
+ # behavior prevents clients from mistakenly creating duplicate commitments.
1417
+ #
1418
+ # The request ID must be a valid UUID, with the exception that zero UUID is
1419
+ # not supported (00000000-0000-0000-0000-000000000000).
1420
+ #
1421
+ # @yield [response, operation] Access the result along with the RPC operation
1422
+ # @yieldparam response [::Gapic::Operation]
1423
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1424
+ #
1425
+ # @return [::Gapic::Operation]
1426
+ #
1427
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1428
+ #
1429
+ # @example Basic example
1430
+ # require "google/cloud/network_connectivity/v1"
1431
+ #
1432
+ # # Create a client object. The client can be reused for multiple calls.
1433
+ # client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
1434
+ #
1435
+ # # Create a request. To set request fields, pass in keyword arguments.
1436
+ # request = Google::Cloud::NetworkConnectivity::V1::AcceptHubSpokeRequest.new
1437
+ #
1438
+ # # Call the accept_hub_spoke method.
1439
+ # result = client.accept_hub_spoke request
1440
+ #
1441
+ # # The returned object is of type Gapic::Operation. You can use it to
1442
+ # # check the status of an operation, cancel it, or wait for results.
1443
+ # # Here is how to wait for a response.
1444
+ # result.wait_until_done! timeout: 60
1445
+ # if result.response?
1446
+ # p result.response
1447
+ # else
1448
+ # puts "No response received."
1449
+ # end
1450
+ #
1451
+ def accept_hub_spoke request, options = nil
1452
+ raise ::ArgumentError, "request must be provided" if request.nil?
1453
+
1454
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::AcceptHubSpokeRequest
1455
+
1456
+ # Converts hash and nil to an options object
1457
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1458
+
1459
+ # Customize the options with defaults
1460
+ metadata = @config.rpcs.accept_hub_spoke.metadata.to_h
1461
+
1462
+ # Set x-goog-api-client and x-goog-user-project headers
1463
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1464
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1465
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
1466
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1467
+
1468
+ header_params = {}
1469
+ if request.name
1470
+ header_params["name"] = request.name
1471
+ end
1472
+
1473
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1474
+ metadata[:"x-goog-request-params"] ||= request_params_header
1475
+
1476
+ options.apply_defaults timeout: @config.rpcs.accept_hub_spoke.timeout,
1477
+ metadata: metadata,
1478
+ retry_policy: @config.rpcs.accept_hub_spoke.retry_policy
1479
+
1480
+ options.apply_defaults timeout: @config.timeout,
1481
+ metadata: @config.metadata,
1482
+ retry_policy: @config.retry_policy
1483
+
1484
+ @hub_service_stub.call_rpc :accept_hub_spoke, request, options: options do |response, operation|
1485
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1486
+ yield response, operation if block_given?
1487
+ return response
1488
+ end
1489
+ rescue ::GRPC::BadStatus => e
1490
+ raise ::Google::Cloud::Error.from_error(e)
1491
+ end
1492
+
1136
1493
  ##
1137
1494
  # Deletes a Network Connectivity Center spoke.
1138
1495
  #
@@ -1154,11 +1511,11 @@ module Google
1154
1511
  # @param name [::String]
1155
1512
  # Required. The name of the spoke to delete.
1156
1513
  # @param request_id [::String]
1157
- # Optional. A unique request ID (optional). If you specify this ID, you can
1158
- # use it in cases when you need to retry your request. When you need to
1159
- # retry, this ID lets the server know that it can ignore the request if it
1160
- # has already been completed. The server guarantees that for at least 60
1161
- # minutes after the first request.
1514
+ # Optional. A request ID to identify requests. Specify a unique request ID so
1515
+ # that if you must retry your request, the server knows to ignore the request
1516
+ # if it has already been completed. The server guarantees that a request
1517
+ # doesn't result in creation of duplicate commitments for at least 60
1518
+ # minutes.
1162
1519
  #
1163
1520
  # For example, consider a situation where you make an initial request and
1164
1521
  # the request times out. If you make the request again with the same request
@@ -1241,6 +1598,555 @@ module Google
1241
1598
  raise ::Google::Cloud::Error.from_error(e)
1242
1599
  end
1243
1600
 
1601
+ ##
1602
+ # Gets details about a Network Connectivity Center route table.
1603
+ #
1604
+ # @overload get_route_table(request, options = nil)
1605
+ # Pass arguments to `get_route_table` via a request object, either of type
1606
+ # {::Google::Cloud::NetworkConnectivity::V1::GetRouteTableRequest} or an equivalent Hash.
1607
+ #
1608
+ # @param request [::Google::Cloud::NetworkConnectivity::V1::GetRouteTableRequest, ::Hash]
1609
+ # A request object representing the call parameters. Required. To specify no
1610
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1611
+ # @param options [::Gapic::CallOptions, ::Hash]
1612
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1613
+ #
1614
+ # @overload get_route_table(name: nil)
1615
+ # Pass arguments to `get_route_table` via keyword arguments. Note that at
1616
+ # least one keyword argument is required. To specify no parameters, or to keep all
1617
+ # the default parameter values, pass an empty Hash as a request object (see above).
1618
+ #
1619
+ # @param name [::String]
1620
+ # Required. The name of the route table resource.
1621
+ #
1622
+ # @yield [response, operation] Access the result along with the RPC operation
1623
+ # @yieldparam response [::Google::Cloud::NetworkConnectivity::V1::RouteTable]
1624
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1625
+ #
1626
+ # @return [::Google::Cloud::NetworkConnectivity::V1::RouteTable]
1627
+ #
1628
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1629
+ #
1630
+ # @example Basic example
1631
+ # require "google/cloud/network_connectivity/v1"
1632
+ #
1633
+ # # Create a client object. The client can be reused for multiple calls.
1634
+ # client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
1635
+ #
1636
+ # # Create a request. To set request fields, pass in keyword arguments.
1637
+ # request = Google::Cloud::NetworkConnectivity::V1::GetRouteTableRequest.new
1638
+ #
1639
+ # # Call the get_route_table method.
1640
+ # result = client.get_route_table request
1641
+ #
1642
+ # # The returned object is of type Google::Cloud::NetworkConnectivity::V1::RouteTable.
1643
+ # p result
1644
+ #
1645
+ def get_route_table request, options = nil
1646
+ raise ::ArgumentError, "request must be provided" if request.nil?
1647
+
1648
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::GetRouteTableRequest
1649
+
1650
+ # Converts hash and nil to an options object
1651
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1652
+
1653
+ # Customize the options with defaults
1654
+ metadata = @config.rpcs.get_route_table.metadata.to_h
1655
+
1656
+ # Set x-goog-api-client and x-goog-user-project headers
1657
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1658
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1659
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
1660
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1661
+
1662
+ header_params = {}
1663
+ if request.name
1664
+ header_params["name"] = request.name
1665
+ end
1666
+
1667
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1668
+ metadata[:"x-goog-request-params"] ||= request_params_header
1669
+
1670
+ options.apply_defaults timeout: @config.rpcs.get_route_table.timeout,
1671
+ metadata: metadata,
1672
+ retry_policy: @config.rpcs.get_route_table.retry_policy
1673
+
1674
+ options.apply_defaults timeout: @config.timeout,
1675
+ metadata: @config.metadata,
1676
+ retry_policy: @config.retry_policy
1677
+
1678
+ @hub_service_stub.call_rpc :get_route_table, request, options: options do |response, operation|
1679
+ yield response, operation if block_given?
1680
+ return response
1681
+ end
1682
+ rescue ::GRPC::BadStatus => e
1683
+ raise ::Google::Cloud::Error.from_error(e)
1684
+ end
1685
+
1686
+ ##
1687
+ # Gets details about the specified route.
1688
+ #
1689
+ # @overload get_route(request, options = nil)
1690
+ # Pass arguments to `get_route` via a request object, either of type
1691
+ # {::Google::Cloud::NetworkConnectivity::V1::GetRouteRequest} or an equivalent Hash.
1692
+ #
1693
+ # @param request [::Google::Cloud::NetworkConnectivity::V1::GetRouteRequest, ::Hash]
1694
+ # A request object representing the call parameters. Required. To specify no
1695
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1696
+ # @param options [::Gapic::CallOptions, ::Hash]
1697
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1698
+ #
1699
+ # @overload get_route(name: nil)
1700
+ # Pass arguments to `get_route` via keyword arguments. Note that at
1701
+ # least one keyword argument is required. To specify no parameters, or to keep all
1702
+ # the default parameter values, pass an empty Hash as a request object (see above).
1703
+ #
1704
+ # @param name [::String]
1705
+ # Required. The name of the route resource.
1706
+ #
1707
+ # @yield [response, operation] Access the result along with the RPC operation
1708
+ # @yieldparam response [::Google::Cloud::NetworkConnectivity::V1::Route]
1709
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1710
+ #
1711
+ # @return [::Google::Cloud::NetworkConnectivity::V1::Route]
1712
+ #
1713
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1714
+ #
1715
+ # @example Basic example
1716
+ # require "google/cloud/network_connectivity/v1"
1717
+ #
1718
+ # # Create a client object. The client can be reused for multiple calls.
1719
+ # client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
1720
+ #
1721
+ # # Create a request. To set request fields, pass in keyword arguments.
1722
+ # request = Google::Cloud::NetworkConnectivity::V1::GetRouteRequest.new
1723
+ #
1724
+ # # Call the get_route method.
1725
+ # result = client.get_route request
1726
+ #
1727
+ # # The returned object is of type Google::Cloud::NetworkConnectivity::V1::Route.
1728
+ # p result
1729
+ #
1730
+ def get_route request, options = nil
1731
+ raise ::ArgumentError, "request must be provided" if request.nil?
1732
+
1733
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::GetRouteRequest
1734
+
1735
+ # Converts hash and nil to an options object
1736
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1737
+
1738
+ # Customize the options with defaults
1739
+ metadata = @config.rpcs.get_route.metadata.to_h
1740
+
1741
+ # Set x-goog-api-client and x-goog-user-project headers
1742
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1743
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1744
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
1745
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1746
+
1747
+ header_params = {}
1748
+ if request.name
1749
+ header_params["name"] = request.name
1750
+ end
1751
+
1752
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1753
+ metadata[:"x-goog-request-params"] ||= request_params_header
1754
+
1755
+ options.apply_defaults timeout: @config.rpcs.get_route.timeout,
1756
+ metadata: metadata,
1757
+ retry_policy: @config.rpcs.get_route.retry_policy
1758
+
1759
+ options.apply_defaults timeout: @config.timeout,
1760
+ metadata: @config.metadata,
1761
+ retry_policy: @config.retry_policy
1762
+
1763
+ @hub_service_stub.call_rpc :get_route, request, options: options do |response, operation|
1764
+ yield response, operation if block_given?
1765
+ return response
1766
+ end
1767
+ rescue ::GRPC::BadStatus => e
1768
+ raise ::Google::Cloud::Error.from_error(e)
1769
+ end
1770
+
1771
+ ##
1772
+ # Lists routes in a given project.
1773
+ #
1774
+ # @overload list_routes(request, options = nil)
1775
+ # Pass arguments to `list_routes` via a request object, either of type
1776
+ # {::Google::Cloud::NetworkConnectivity::V1::ListRoutesRequest} or an equivalent Hash.
1777
+ #
1778
+ # @param request [::Google::Cloud::NetworkConnectivity::V1::ListRoutesRequest, ::Hash]
1779
+ # A request object representing the call parameters. Required. To specify no
1780
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1781
+ # @param options [::Gapic::CallOptions, ::Hash]
1782
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1783
+ #
1784
+ # @overload list_routes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1785
+ # Pass arguments to `list_routes` via keyword arguments. Note that at
1786
+ # least one keyword argument is required. To specify no parameters, or to keep all
1787
+ # the default parameter values, pass an empty Hash as a request object (see above).
1788
+ #
1789
+ # @param parent [::String]
1790
+ # Required. The parent resource's name.
1791
+ # @param page_size [::Integer]
1792
+ # The maximum number of results to return per page.
1793
+ # @param page_token [::String]
1794
+ # The page token.
1795
+ # @param filter [::String]
1796
+ # An expression that filters the list of results.
1797
+ # @param order_by [::String]
1798
+ # Sort the results by a certain order.
1799
+ #
1800
+ # @yield [response, operation] Access the result along with the RPC operation
1801
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Route>]
1802
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1803
+ #
1804
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Route>]
1805
+ #
1806
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1807
+ #
1808
+ # @example Basic example
1809
+ # require "google/cloud/network_connectivity/v1"
1810
+ #
1811
+ # # Create a client object. The client can be reused for multiple calls.
1812
+ # client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
1813
+ #
1814
+ # # Create a request. To set request fields, pass in keyword arguments.
1815
+ # request = Google::Cloud::NetworkConnectivity::V1::ListRoutesRequest.new
1816
+ #
1817
+ # # Call the list_routes method.
1818
+ # result = client.list_routes request
1819
+ #
1820
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1821
+ # # over elements, and API calls will be issued to fetch pages as needed.
1822
+ # result.each do |item|
1823
+ # # Each element is of type ::Google::Cloud::NetworkConnectivity::V1::Route.
1824
+ # p item
1825
+ # end
1826
+ #
1827
+ def list_routes request, options = nil
1828
+ raise ::ArgumentError, "request must be provided" if request.nil?
1829
+
1830
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::ListRoutesRequest
1831
+
1832
+ # Converts hash and nil to an options object
1833
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1834
+
1835
+ # Customize the options with defaults
1836
+ metadata = @config.rpcs.list_routes.metadata.to_h
1837
+
1838
+ # Set x-goog-api-client and x-goog-user-project headers
1839
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1840
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1841
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
1842
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1843
+
1844
+ header_params = {}
1845
+ if request.parent
1846
+ header_params["parent"] = request.parent
1847
+ end
1848
+
1849
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1850
+ metadata[:"x-goog-request-params"] ||= request_params_header
1851
+
1852
+ options.apply_defaults timeout: @config.rpcs.list_routes.timeout,
1853
+ metadata: metadata,
1854
+ retry_policy: @config.rpcs.list_routes.retry_policy
1855
+
1856
+ options.apply_defaults timeout: @config.timeout,
1857
+ metadata: @config.metadata,
1858
+ retry_policy: @config.retry_policy
1859
+
1860
+ @hub_service_stub.call_rpc :list_routes, request, options: options do |response, operation|
1861
+ response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_routes, request, response, operation, options
1862
+ yield response, operation if block_given?
1863
+ return response
1864
+ end
1865
+ rescue ::GRPC::BadStatus => e
1866
+ raise ::Google::Cloud::Error.from_error(e)
1867
+ end
1868
+
1869
+ ##
1870
+ # Lists route tables in a given project.
1871
+ #
1872
+ # @overload list_route_tables(request, options = nil)
1873
+ # Pass arguments to `list_route_tables` via a request object, either of type
1874
+ # {::Google::Cloud::NetworkConnectivity::V1::ListRouteTablesRequest} or an equivalent Hash.
1875
+ #
1876
+ # @param request [::Google::Cloud::NetworkConnectivity::V1::ListRouteTablesRequest, ::Hash]
1877
+ # A request object representing the call parameters. Required. To specify no
1878
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1879
+ # @param options [::Gapic::CallOptions, ::Hash]
1880
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1881
+ #
1882
+ # @overload list_route_tables(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1883
+ # Pass arguments to `list_route_tables` via keyword arguments. Note that at
1884
+ # least one keyword argument is required. To specify no parameters, or to keep all
1885
+ # the default parameter values, pass an empty Hash as a request object (see above).
1886
+ #
1887
+ # @param parent [::String]
1888
+ # Required. The parent resource's name.
1889
+ # @param page_size [::Integer]
1890
+ # The maximum number of results to return per page.
1891
+ # @param page_token [::String]
1892
+ # The page token.
1893
+ # @param filter [::String]
1894
+ # An expression that filters the list of results.
1895
+ # @param order_by [::String]
1896
+ # Sort the results by a certain order.
1897
+ #
1898
+ # @yield [response, operation] Access the result along with the RPC operation
1899
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::RouteTable>]
1900
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1901
+ #
1902
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::RouteTable>]
1903
+ #
1904
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1905
+ #
1906
+ # @example Basic example
1907
+ # require "google/cloud/network_connectivity/v1"
1908
+ #
1909
+ # # Create a client object. The client can be reused for multiple calls.
1910
+ # client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
1911
+ #
1912
+ # # Create a request. To set request fields, pass in keyword arguments.
1913
+ # request = Google::Cloud::NetworkConnectivity::V1::ListRouteTablesRequest.new
1914
+ #
1915
+ # # Call the list_route_tables method.
1916
+ # result = client.list_route_tables request
1917
+ #
1918
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1919
+ # # over elements, and API calls will be issued to fetch pages as needed.
1920
+ # result.each do |item|
1921
+ # # Each element is of type ::Google::Cloud::NetworkConnectivity::V1::RouteTable.
1922
+ # p item
1923
+ # end
1924
+ #
1925
+ def list_route_tables request, options = nil
1926
+ raise ::ArgumentError, "request must be provided" if request.nil?
1927
+
1928
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::ListRouteTablesRequest
1929
+
1930
+ # Converts hash and nil to an options object
1931
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1932
+
1933
+ # Customize the options with defaults
1934
+ metadata = @config.rpcs.list_route_tables.metadata.to_h
1935
+
1936
+ # Set x-goog-api-client and x-goog-user-project headers
1937
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1938
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1939
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
1940
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1941
+
1942
+ header_params = {}
1943
+ if request.parent
1944
+ header_params["parent"] = request.parent
1945
+ end
1946
+
1947
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1948
+ metadata[:"x-goog-request-params"] ||= request_params_header
1949
+
1950
+ options.apply_defaults timeout: @config.rpcs.list_route_tables.timeout,
1951
+ metadata: metadata,
1952
+ retry_policy: @config.rpcs.list_route_tables.retry_policy
1953
+
1954
+ options.apply_defaults timeout: @config.timeout,
1955
+ metadata: @config.metadata,
1956
+ retry_policy: @config.retry_policy
1957
+
1958
+ @hub_service_stub.call_rpc :list_route_tables, request, options: options do |response, operation|
1959
+ response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_route_tables, request, response, operation, options
1960
+ yield response, operation if block_given?
1961
+ return response
1962
+ end
1963
+ rescue ::GRPC::BadStatus => e
1964
+ raise ::Google::Cloud::Error.from_error(e)
1965
+ end
1966
+
1967
+ ##
1968
+ # Gets details about a Network Connectivity Center group.
1969
+ #
1970
+ # @overload get_group(request, options = nil)
1971
+ # Pass arguments to `get_group` via a request object, either of type
1972
+ # {::Google::Cloud::NetworkConnectivity::V1::GetGroupRequest} or an equivalent Hash.
1973
+ #
1974
+ # @param request [::Google::Cloud::NetworkConnectivity::V1::GetGroupRequest, ::Hash]
1975
+ # A request object representing the call parameters. Required. To specify no
1976
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1977
+ # @param options [::Gapic::CallOptions, ::Hash]
1978
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1979
+ #
1980
+ # @overload get_group(name: nil)
1981
+ # Pass arguments to `get_group` via keyword arguments. Note that at
1982
+ # least one keyword argument is required. To specify no parameters, or to keep all
1983
+ # the default parameter values, pass an empty Hash as a request object (see above).
1984
+ #
1985
+ # @param name [::String]
1986
+ # Required. The name of the route table resource.
1987
+ #
1988
+ # @yield [response, operation] Access the result along with the RPC operation
1989
+ # @yieldparam response [::Google::Cloud::NetworkConnectivity::V1::Group]
1990
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1991
+ #
1992
+ # @return [::Google::Cloud::NetworkConnectivity::V1::Group]
1993
+ #
1994
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1995
+ #
1996
+ # @example Basic example
1997
+ # require "google/cloud/network_connectivity/v1"
1998
+ #
1999
+ # # Create a client object. The client can be reused for multiple calls.
2000
+ # client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
2001
+ #
2002
+ # # Create a request. To set request fields, pass in keyword arguments.
2003
+ # request = Google::Cloud::NetworkConnectivity::V1::GetGroupRequest.new
2004
+ #
2005
+ # # Call the get_group method.
2006
+ # result = client.get_group request
2007
+ #
2008
+ # # The returned object is of type Google::Cloud::NetworkConnectivity::V1::Group.
2009
+ # p result
2010
+ #
2011
+ def get_group request, options = nil
2012
+ raise ::ArgumentError, "request must be provided" if request.nil?
2013
+
2014
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::GetGroupRequest
2015
+
2016
+ # Converts hash and nil to an options object
2017
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2018
+
2019
+ # Customize the options with defaults
2020
+ metadata = @config.rpcs.get_group.metadata.to_h
2021
+
2022
+ # Set x-goog-api-client and x-goog-user-project headers
2023
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2024
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2025
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
2026
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2027
+
2028
+ header_params = {}
2029
+ if request.name
2030
+ header_params["name"] = request.name
2031
+ end
2032
+
2033
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2034
+ metadata[:"x-goog-request-params"] ||= request_params_header
2035
+
2036
+ options.apply_defaults timeout: @config.rpcs.get_group.timeout,
2037
+ metadata: metadata,
2038
+ retry_policy: @config.rpcs.get_group.retry_policy
2039
+
2040
+ options.apply_defaults timeout: @config.timeout,
2041
+ metadata: @config.metadata,
2042
+ retry_policy: @config.retry_policy
2043
+
2044
+ @hub_service_stub.call_rpc :get_group, request, options: options do |response, operation|
2045
+ yield response, operation if block_given?
2046
+ return response
2047
+ end
2048
+ rescue ::GRPC::BadStatus => e
2049
+ raise ::Google::Cloud::Error.from_error(e)
2050
+ end
2051
+
2052
+ ##
2053
+ # Lists groups in a given hub.
2054
+ #
2055
+ # @overload list_groups(request, options = nil)
2056
+ # Pass arguments to `list_groups` via a request object, either of type
2057
+ # {::Google::Cloud::NetworkConnectivity::V1::ListGroupsRequest} or an equivalent Hash.
2058
+ #
2059
+ # @param request [::Google::Cloud::NetworkConnectivity::V1::ListGroupsRequest, ::Hash]
2060
+ # A request object representing the call parameters. Required. To specify no
2061
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2062
+ # @param options [::Gapic::CallOptions, ::Hash]
2063
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2064
+ #
2065
+ # @overload list_groups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
2066
+ # Pass arguments to `list_groups` via keyword arguments. Note that at
2067
+ # least one keyword argument is required. To specify no parameters, or to keep all
2068
+ # the default parameter values, pass an empty Hash as a request object (see above).
2069
+ #
2070
+ # @param parent [::String]
2071
+ # Required. The parent resource's name.
2072
+ # @param page_size [::Integer]
2073
+ # The maximum number of results to return per page.
2074
+ # @param page_token [::String]
2075
+ # The page token.
2076
+ # @param filter [::String]
2077
+ # An expression that filters the list of results.
2078
+ # @param order_by [::String]
2079
+ # Sort the results by a certain order.
2080
+ #
2081
+ # @yield [response, operation] Access the result along with the RPC operation
2082
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Group>]
2083
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2084
+ #
2085
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Group>]
2086
+ #
2087
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2088
+ #
2089
+ # @example Basic example
2090
+ # require "google/cloud/network_connectivity/v1"
2091
+ #
2092
+ # # Create a client object. The client can be reused for multiple calls.
2093
+ # client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
2094
+ #
2095
+ # # Create a request. To set request fields, pass in keyword arguments.
2096
+ # request = Google::Cloud::NetworkConnectivity::V1::ListGroupsRequest.new
2097
+ #
2098
+ # # Call the list_groups method.
2099
+ # result = client.list_groups request
2100
+ #
2101
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2102
+ # # over elements, and API calls will be issued to fetch pages as needed.
2103
+ # result.each do |item|
2104
+ # # Each element is of type ::Google::Cloud::NetworkConnectivity::V1::Group.
2105
+ # p item
2106
+ # end
2107
+ #
2108
+ def list_groups request, options = nil
2109
+ raise ::ArgumentError, "request must be provided" if request.nil?
2110
+
2111
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::ListGroupsRequest
2112
+
2113
+ # Converts hash and nil to an options object
2114
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2115
+
2116
+ # Customize the options with defaults
2117
+ metadata = @config.rpcs.list_groups.metadata.to_h
2118
+
2119
+ # Set x-goog-api-client and x-goog-user-project headers
2120
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2121
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2122
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
2123
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2124
+
2125
+ header_params = {}
2126
+ if request.parent
2127
+ header_params["parent"] = request.parent
2128
+ end
2129
+
2130
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2131
+ metadata[:"x-goog-request-params"] ||= request_params_header
2132
+
2133
+ options.apply_defaults timeout: @config.rpcs.list_groups.timeout,
2134
+ metadata: metadata,
2135
+ retry_policy: @config.rpcs.list_groups.retry_policy
2136
+
2137
+ options.apply_defaults timeout: @config.timeout,
2138
+ metadata: @config.metadata,
2139
+ retry_policy: @config.retry_policy
2140
+
2141
+ @hub_service_stub.call_rpc :list_groups, request, options: options do |response, operation|
2142
+ response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_groups, request, response, operation, options
2143
+ yield response, operation if block_given?
2144
+ return response
2145
+ end
2146
+ rescue ::GRPC::BadStatus => e
2147
+ raise ::Google::Cloud::Error.from_error(e)
2148
+ end
2149
+
1244
2150
  ##
1245
2151
  # Configuration class for the HubService API.
1246
2152
  #
@@ -1271,9 +2177,9 @@ module Google
1271
2177
  # end
1272
2178
  #
1273
2179
  # @!attribute [rw] endpoint
1274
- # The hostname or hostname:port of the service endpoint.
1275
- # Defaults to `"networkconnectivity.googleapis.com"`.
1276
- # @return [::String]
2180
+ # A custom service endpoint, as a hostname or hostname:port. The default is
2181
+ # nil, indicating to use the default endpoint in the current universe domain.
2182
+ # @return [::String,nil]
1277
2183
  # @!attribute [rw] credentials
1278
2184
  # Credentials to send with calls. You may provide any of the following types:
1279
2185
  # * (`String`) The path to a service account key file in JSON format
@@ -1319,13 +2225,20 @@ module Google
1319
2225
  # @!attribute [rw] quota_project
1320
2226
  # A separate project against which to charge quota.
1321
2227
  # @return [::String]
2228
+ # @!attribute [rw] universe_domain
2229
+ # The universe domain within which to make requests. This determines the
2230
+ # default endpoint URL. The default value of nil uses the environment
2231
+ # universe (usually the default "googleapis.com" universe).
2232
+ # @return [::String,nil]
1322
2233
  #
1323
2234
  class Configuration
1324
2235
  extend ::Gapic::Config
1325
2236
 
2237
+ # @private
2238
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1326
2239
  DEFAULT_ENDPOINT = "networkconnectivity.googleapis.com"
1327
2240
 
1328
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
2241
+ config_attr :endpoint, nil, ::String, nil
1329
2242
  config_attr :credentials, nil do |value|
1330
2243
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1331
2244
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -1340,6 +2253,7 @@ module Google
1340
2253
  config_attr :metadata, nil, ::Hash, nil
1341
2254
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1342
2255
  config_attr :quota_project, nil, ::String, nil
2256
+ config_attr :universe_domain, nil, ::String, nil
1343
2257
 
1344
2258
  # @private
1345
2259
  def initialize parent_config = nil
@@ -1412,6 +2326,11 @@ module Google
1412
2326
  #
1413
2327
  attr_reader :delete_hub
1414
2328
  ##
2329
+ # RPC-specific configuration for `list_hub_spokes`
2330
+ # @return [::Gapic::Config::Method]
2331
+ #
2332
+ attr_reader :list_hub_spokes
2333
+ ##
1415
2334
  # RPC-specific configuration for `list_spokes`
1416
2335
  # @return [::Gapic::Config::Method]
1417
2336
  #
@@ -1432,10 +2351,50 @@ module Google
1432
2351
  #
1433
2352
  attr_reader :update_spoke
1434
2353
  ##
2354
+ # RPC-specific configuration for `reject_hub_spoke`
2355
+ # @return [::Gapic::Config::Method]
2356
+ #
2357
+ attr_reader :reject_hub_spoke
2358
+ ##
2359
+ # RPC-specific configuration for `accept_hub_spoke`
2360
+ # @return [::Gapic::Config::Method]
2361
+ #
2362
+ attr_reader :accept_hub_spoke
2363
+ ##
1435
2364
  # RPC-specific configuration for `delete_spoke`
1436
2365
  # @return [::Gapic::Config::Method]
1437
2366
  #
1438
2367
  attr_reader :delete_spoke
2368
+ ##
2369
+ # RPC-specific configuration for `get_route_table`
2370
+ # @return [::Gapic::Config::Method]
2371
+ #
2372
+ attr_reader :get_route_table
2373
+ ##
2374
+ # RPC-specific configuration for `get_route`
2375
+ # @return [::Gapic::Config::Method]
2376
+ #
2377
+ attr_reader :get_route
2378
+ ##
2379
+ # RPC-specific configuration for `list_routes`
2380
+ # @return [::Gapic::Config::Method]
2381
+ #
2382
+ attr_reader :list_routes
2383
+ ##
2384
+ # RPC-specific configuration for `list_route_tables`
2385
+ # @return [::Gapic::Config::Method]
2386
+ #
2387
+ attr_reader :list_route_tables
2388
+ ##
2389
+ # RPC-specific configuration for `get_group`
2390
+ # @return [::Gapic::Config::Method]
2391
+ #
2392
+ attr_reader :get_group
2393
+ ##
2394
+ # RPC-specific configuration for `list_groups`
2395
+ # @return [::Gapic::Config::Method]
2396
+ #
2397
+ attr_reader :list_groups
1439
2398
 
1440
2399
  # @private
1441
2400
  def initialize parent_rpcs = nil
@@ -1449,6 +2408,8 @@ module Google
1449
2408
  @update_hub = ::Gapic::Config::Method.new update_hub_config
1450
2409
  delete_hub_config = parent_rpcs.delete_hub if parent_rpcs.respond_to? :delete_hub
1451
2410
  @delete_hub = ::Gapic::Config::Method.new delete_hub_config
2411
+ list_hub_spokes_config = parent_rpcs.list_hub_spokes if parent_rpcs.respond_to? :list_hub_spokes
2412
+ @list_hub_spokes = ::Gapic::Config::Method.new list_hub_spokes_config
1452
2413
  list_spokes_config = parent_rpcs.list_spokes if parent_rpcs.respond_to? :list_spokes
1453
2414
  @list_spokes = ::Gapic::Config::Method.new list_spokes_config
1454
2415
  get_spoke_config = parent_rpcs.get_spoke if parent_rpcs.respond_to? :get_spoke
@@ -1457,8 +2418,24 @@ module Google
1457
2418
  @create_spoke = ::Gapic::Config::Method.new create_spoke_config
1458
2419
  update_spoke_config = parent_rpcs.update_spoke if parent_rpcs.respond_to? :update_spoke
1459
2420
  @update_spoke = ::Gapic::Config::Method.new update_spoke_config
2421
+ reject_hub_spoke_config = parent_rpcs.reject_hub_spoke if parent_rpcs.respond_to? :reject_hub_spoke
2422
+ @reject_hub_spoke = ::Gapic::Config::Method.new reject_hub_spoke_config
2423
+ accept_hub_spoke_config = parent_rpcs.accept_hub_spoke if parent_rpcs.respond_to? :accept_hub_spoke
2424
+ @accept_hub_spoke = ::Gapic::Config::Method.new accept_hub_spoke_config
1460
2425
  delete_spoke_config = parent_rpcs.delete_spoke if parent_rpcs.respond_to? :delete_spoke
1461
2426
  @delete_spoke = ::Gapic::Config::Method.new delete_spoke_config
2427
+ get_route_table_config = parent_rpcs.get_route_table if parent_rpcs.respond_to? :get_route_table
2428
+ @get_route_table = ::Gapic::Config::Method.new get_route_table_config
2429
+ get_route_config = parent_rpcs.get_route if parent_rpcs.respond_to? :get_route
2430
+ @get_route = ::Gapic::Config::Method.new get_route_config
2431
+ list_routes_config = parent_rpcs.list_routes if parent_rpcs.respond_to? :list_routes
2432
+ @list_routes = ::Gapic::Config::Method.new list_routes_config
2433
+ list_route_tables_config = parent_rpcs.list_route_tables if parent_rpcs.respond_to? :list_route_tables
2434
+ @list_route_tables = ::Gapic::Config::Method.new list_route_tables_config
2435
+ get_group_config = parent_rpcs.get_group if parent_rpcs.respond_to? :get_group
2436
+ @get_group = ::Gapic::Config::Method.new get_group_config
2437
+ list_groups_config = parent_rpcs.list_groups if parent_rpcs.respond_to? :list_groups
2438
+ @list_groups = ::Gapic::Config::Method.new list_groups_config
1462
2439
 
1463
2440
  yield self if block_given?
1464
2441
  end