google-cloud-bigquery-analytics_hub-v1 0.2.1 → 0.4.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.
@@ -144,15 +144,29 @@ module Google
144
144
  @quota_project_id = @config.quota_project
145
145
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
146
146
 
147
+ @operations_client = Operations.new do |config|
148
+ config.credentials = credentials
149
+ config.quota_project = @quota_project_id
150
+ config.endpoint = @config.endpoint
151
+ end
152
+
147
153
  @analytics_hub_service_stub = ::Gapic::ServiceStub.new(
148
154
  ::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Stub,
149
155
  credentials: credentials,
150
156
  endpoint: @config.endpoint,
151
157
  channel_args: @config.channel_args,
152
- interceptors: @config.interceptors
158
+ interceptors: @config.interceptors,
159
+ channel_pool_config: @config.channel_pool
153
160
  )
154
161
  end
155
162
 
163
+ ##
164
+ # Get the associated client for long-running operations.
165
+ #
166
+ # @return [::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Operations]
167
+ #
168
+ attr_reader :operations_client
169
+
156
170
  # Service calls
157
171
 
158
172
  ##
@@ -272,8 +286,8 @@ module Google
272
286
  # the default parameter values, pass an empty Hash as a request object (see above).
273
287
  #
274
288
  # @param organization [::String]
275
- # Required. The organization resource path of the projects containing DataExchanges.
276
- # e.g. `organizations/myorg/locations/US`.
289
+ # Required. The organization resource path of the projects containing
290
+ # DataExchanges. e.g. `organizations/myorg/locations/US`.
277
291
  # @param page_size [::Integer]
278
292
  # The maximum number of results to return in a single response page. Leverage
279
293
  # the page tokens to iterate through the entire collection.
@@ -638,8 +652,8 @@ module Google
638
652
  # the default parameter values, pass an empty Hash as a request object (see above).
639
653
  #
640
654
  # @param name [::String]
641
- # Required. The full name of the data exchange resource that you want to delete.
642
- # For example, `projects/myproject/locations/US/dataExchanges/123`.
655
+ # Required. The full name of the data exchange resource that you want to
656
+ # delete. For example, `projects/myproject/locations/US/dataExchanges/123`.
643
657
  #
644
658
  # @yield [response, operation] Access the result along with the RPC operation
645
659
  # @yieldparam response [::Google::Protobuf::Empty]
@@ -1001,9 +1015,9 @@ module Google
1001
1015
  # the default parameter values, pass an empty Hash as a request object (see above).
1002
1016
  #
1003
1017
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1004
- # Required. Field mask specifies the fields to update in the listing resource. The
1005
- # fields specified in the `updateMask` are relative to the resource and are
1006
- # not a full request.
1018
+ # Required. Field mask specifies the fields to update in the listing
1019
+ # resource. The fields specified in the `updateMask` are relative to the
1020
+ # resource and are not a full request.
1007
1021
  # @param listing [::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing, ::Hash]
1008
1022
  # Required. The listing to update.
1009
1023
  #
@@ -1250,6 +1264,668 @@ module Google
1250
1264
  raise ::Google::Cloud::Error.from_error(e)
1251
1265
  end
1252
1266
 
1267
+ ##
1268
+ # Creates a Subscription to a Data Exchange. This is a long-running operation
1269
+ # as it will create one or more linked datasets.
1270
+ #
1271
+ # @overload subscribe_data_exchange(request, options = nil)
1272
+ # Pass arguments to `subscribe_data_exchange` via a request object, either of type
1273
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeDataExchangeRequest} or an equivalent Hash.
1274
+ #
1275
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeDataExchangeRequest, ::Hash]
1276
+ # A request object representing the call parameters. Required. To specify no
1277
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1278
+ # @param options [::Gapic::CallOptions, ::Hash]
1279
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1280
+ #
1281
+ # @overload subscribe_data_exchange(name: nil, destination: nil, subscription: nil, subscriber_contact: nil)
1282
+ # Pass arguments to `subscribe_data_exchange` via keyword arguments. Note that at
1283
+ # least one keyword argument is required. To specify no parameters, or to keep all
1284
+ # the default parameter values, pass an empty Hash as a request object (see above).
1285
+ #
1286
+ # @param name [::String]
1287
+ # Required. Resource name of the Data Exchange.
1288
+ # e.g. `projects/publisherproject/locations/US/dataExchanges/123`
1289
+ # @param destination [::String]
1290
+ # Required. The parent resource path of the Subscription.
1291
+ # e.g. `projects/subscriberproject/locations/US`
1292
+ # @param subscription [::String]
1293
+ # Required. Name of the subscription to create.
1294
+ # e.g. `subscription1`
1295
+ # @param subscriber_contact [::String]
1296
+ # Email of the subscriber.
1297
+ #
1298
+ # @yield [response, operation] Access the result along with the RPC operation
1299
+ # @yieldparam response [::Gapic::Operation]
1300
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1301
+ #
1302
+ # @return [::Gapic::Operation]
1303
+ #
1304
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1305
+ #
1306
+ # @example Basic example
1307
+ # require "google/cloud/bigquery/analytics_hub/v1"
1308
+ #
1309
+ # # Create a client object. The client can be reused for multiple calls.
1310
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
1311
+ #
1312
+ # # Create a request. To set request fields, pass in keyword arguments.
1313
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeDataExchangeRequest.new
1314
+ #
1315
+ # # Call the subscribe_data_exchange method.
1316
+ # result = client.subscribe_data_exchange request
1317
+ #
1318
+ # # The returned object is of type Gapic::Operation. You can use it to
1319
+ # # check the status of an operation, cancel it, or wait for results.
1320
+ # # Here is how to wait for a response.
1321
+ # result.wait_until_done! timeout: 60
1322
+ # if result.response?
1323
+ # p result.response
1324
+ # else
1325
+ # puts "No response received."
1326
+ # end
1327
+ #
1328
+ def subscribe_data_exchange request, options = nil
1329
+ raise ::ArgumentError, "request must be provided" if request.nil?
1330
+
1331
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeDataExchangeRequest
1332
+
1333
+ # Converts hash and nil to an options object
1334
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1335
+
1336
+ # Customize the options with defaults
1337
+ metadata = @config.rpcs.subscribe_data_exchange.metadata.to_h
1338
+
1339
+ # Set x-goog-api-client and x-goog-user-project headers
1340
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1341
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1342
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
1343
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1344
+
1345
+ header_params = {}
1346
+ if request.name
1347
+ header_params["name"] = request.name
1348
+ end
1349
+
1350
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1351
+ metadata[:"x-goog-request-params"] ||= request_params_header
1352
+
1353
+ options.apply_defaults timeout: @config.rpcs.subscribe_data_exchange.timeout,
1354
+ metadata: metadata,
1355
+ retry_policy: @config.rpcs.subscribe_data_exchange.retry_policy
1356
+
1357
+ options.apply_defaults timeout: @config.timeout,
1358
+ metadata: @config.metadata,
1359
+ retry_policy: @config.retry_policy
1360
+
1361
+ @analytics_hub_service_stub.call_rpc :subscribe_data_exchange, request, options: options do |response, operation|
1362
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1363
+ yield response, operation if block_given?
1364
+ return response
1365
+ end
1366
+ rescue ::GRPC::BadStatus => e
1367
+ raise ::Google::Cloud::Error.from_error(e)
1368
+ end
1369
+
1370
+ ##
1371
+ # Refreshes a Subscription to a Data Exchange. A Data Exchange can become
1372
+ # stale when a publisher adds or removes data. This is a long-running
1373
+ # operation as it may create many linked datasets.
1374
+ #
1375
+ # @overload refresh_subscription(request, options = nil)
1376
+ # Pass arguments to `refresh_subscription` via a request object, either of type
1377
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::RefreshSubscriptionRequest} or an equivalent Hash.
1378
+ #
1379
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::RefreshSubscriptionRequest, ::Hash]
1380
+ # A request object representing the call parameters. Required. To specify no
1381
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1382
+ # @param options [::Gapic::CallOptions, ::Hash]
1383
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1384
+ #
1385
+ # @overload refresh_subscription(name: nil)
1386
+ # Pass arguments to `refresh_subscription` via keyword arguments. Note that at
1387
+ # least one keyword argument is required. To specify no parameters, or to keep all
1388
+ # the default parameter values, pass an empty Hash as a request object (see above).
1389
+ #
1390
+ # @param name [::String]
1391
+ # Required. Resource name of the Subscription to refresh.
1392
+ # e.g. `projects/subscriberproject/locations/US/subscriptions/123`
1393
+ #
1394
+ # @yield [response, operation] Access the result along with the RPC operation
1395
+ # @yieldparam response [::Gapic::Operation]
1396
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1397
+ #
1398
+ # @return [::Gapic::Operation]
1399
+ #
1400
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1401
+ #
1402
+ # @example Basic example
1403
+ # require "google/cloud/bigquery/analytics_hub/v1"
1404
+ #
1405
+ # # Create a client object. The client can be reused for multiple calls.
1406
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
1407
+ #
1408
+ # # Create a request. To set request fields, pass in keyword arguments.
1409
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::RefreshSubscriptionRequest.new
1410
+ #
1411
+ # # Call the refresh_subscription method.
1412
+ # result = client.refresh_subscription request
1413
+ #
1414
+ # # The returned object is of type Gapic::Operation. You can use it to
1415
+ # # check the status of an operation, cancel it, or wait for results.
1416
+ # # Here is how to wait for a response.
1417
+ # result.wait_until_done! timeout: 60
1418
+ # if result.response?
1419
+ # p result.response
1420
+ # else
1421
+ # puts "No response received."
1422
+ # end
1423
+ #
1424
+ def refresh_subscription request, options = nil
1425
+ raise ::ArgumentError, "request must be provided" if request.nil?
1426
+
1427
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::RefreshSubscriptionRequest
1428
+
1429
+ # Converts hash and nil to an options object
1430
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1431
+
1432
+ # Customize the options with defaults
1433
+ metadata = @config.rpcs.refresh_subscription.metadata.to_h
1434
+
1435
+ # Set x-goog-api-client and x-goog-user-project headers
1436
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1437
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1438
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
1439
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1440
+
1441
+ header_params = {}
1442
+ if request.name
1443
+ header_params["name"] = request.name
1444
+ end
1445
+
1446
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1447
+ metadata[:"x-goog-request-params"] ||= request_params_header
1448
+
1449
+ options.apply_defaults timeout: @config.rpcs.refresh_subscription.timeout,
1450
+ metadata: metadata,
1451
+ retry_policy: @config.rpcs.refresh_subscription.retry_policy
1452
+
1453
+ options.apply_defaults timeout: @config.timeout,
1454
+ metadata: @config.metadata,
1455
+ retry_policy: @config.retry_policy
1456
+
1457
+ @analytics_hub_service_stub.call_rpc :refresh_subscription, request, options: options do |response, operation|
1458
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1459
+ yield response, operation if block_given?
1460
+ return response
1461
+ end
1462
+ rescue ::GRPC::BadStatus => e
1463
+ raise ::Google::Cloud::Error.from_error(e)
1464
+ end
1465
+
1466
+ ##
1467
+ # Gets the details of a Subscription.
1468
+ #
1469
+ # @overload get_subscription(request, options = nil)
1470
+ # Pass arguments to `get_subscription` via a request object, either of type
1471
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::GetSubscriptionRequest} or an equivalent Hash.
1472
+ #
1473
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::GetSubscriptionRequest, ::Hash]
1474
+ # A request object representing the call parameters. Required. To specify no
1475
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1476
+ # @param options [::Gapic::CallOptions, ::Hash]
1477
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1478
+ #
1479
+ # @overload get_subscription(name: nil)
1480
+ # Pass arguments to `get_subscription` via keyword arguments. Note that at
1481
+ # least one keyword argument is required. To specify no parameters, or to keep all
1482
+ # the default parameter values, pass an empty Hash as a request object (see above).
1483
+ #
1484
+ # @param name [::String]
1485
+ # Required. Resource name of the subscription.
1486
+ # e.g. projects/123/locations/US/subscriptions/456
1487
+ #
1488
+ # @yield [response, operation] Access the result along with the RPC operation
1489
+ # @yieldparam response [::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription]
1490
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1491
+ #
1492
+ # @return [::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription]
1493
+ #
1494
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1495
+ #
1496
+ # @example Basic example
1497
+ # require "google/cloud/bigquery/analytics_hub/v1"
1498
+ #
1499
+ # # Create a client object. The client can be reused for multiple calls.
1500
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
1501
+ #
1502
+ # # Create a request. To set request fields, pass in keyword arguments.
1503
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::GetSubscriptionRequest.new
1504
+ #
1505
+ # # Call the get_subscription method.
1506
+ # result = client.get_subscription request
1507
+ #
1508
+ # # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription.
1509
+ # p result
1510
+ #
1511
+ def get_subscription request, options = nil
1512
+ raise ::ArgumentError, "request must be provided" if request.nil?
1513
+
1514
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::GetSubscriptionRequest
1515
+
1516
+ # Converts hash and nil to an options object
1517
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1518
+
1519
+ # Customize the options with defaults
1520
+ metadata = @config.rpcs.get_subscription.metadata.to_h
1521
+
1522
+ # Set x-goog-api-client and x-goog-user-project headers
1523
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1524
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1525
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
1526
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1527
+
1528
+ header_params = {}
1529
+ if request.name
1530
+ header_params["name"] = request.name
1531
+ end
1532
+
1533
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1534
+ metadata[:"x-goog-request-params"] ||= request_params_header
1535
+
1536
+ options.apply_defaults timeout: @config.rpcs.get_subscription.timeout,
1537
+ metadata: metadata,
1538
+ retry_policy: @config.rpcs.get_subscription.retry_policy
1539
+
1540
+ options.apply_defaults timeout: @config.timeout,
1541
+ metadata: @config.metadata,
1542
+ retry_policy: @config.retry_policy
1543
+
1544
+ @analytics_hub_service_stub.call_rpc :get_subscription, request, options: options do |response, operation|
1545
+ yield response, operation if block_given?
1546
+ return response
1547
+ end
1548
+ rescue ::GRPC::BadStatus => e
1549
+ raise ::Google::Cloud::Error.from_error(e)
1550
+ end
1551
+
1552
+ ##
1553
+ # Lists all subscriptions in a given project and location.
1554
+ #
1555
+ # @overload list_subscriptions(request, options = nil)
1556
+ # Pass arguments to `list_subscriptions` via a request object, either of type
1557
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::ListSubscriptionsRequest} or an equivalent Hash.
1558
+ #
1559
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::ListSubscriptionsRequest, ::Hash]
1560
+ # A request object representing the call parameters. Required. To specify no
1561
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1562
+ # @param options [::Gapic::CallOptions, ::Hash]
1563
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1564
+ #
1565
+ # @overload list_subscriptions(parent: nil, filter: nil, page_size: nil, page_token: nil)
1566
+ # Pass arguments to `list_subscriptions` via keyword arguments. Note that at
1567
+ # least one keyword argument is required. To specify no parameters, or to keep all
1568
+ # the default parameter values, pass an empty Hash as a request object (see above).
1569
+ #
1570
+ # @param parent [::String]
1571
+ # Required. The parent resource path of the subscription.
1572
+ # e.g. projects/myproject/locations/US
1573
+ # @param filter [::String]
1574
+ # The filter expression may be used to filter by Data Exchange or Listing.
1575
+ # @param page_size [::Integer]
1576
+ # The maximum number of results to return in a single response page.
1577
+ # @param page_token [::String]
1578
+ # Page token, returned by a previous call.
1579
+ #
1580
+ # @yield [response, operation] Access the result along with the RPC operation
1581
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription>]
1582
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1583
+ #
1584
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription>]
1585
+ #
1586
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1587
+ #
1588
+ # @example Basic example
1589
+ # require "google/cloud/bigquery/analytics_hub/v1"
1590
+ #
1591
+ # # Create a client object. The client can be reused for multiple calls.
1592
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
1593
+ #
1594
+ # # Create a request. To set request fields, pass in keyword arguments.
1595
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::ListSubscriptionsRequest.new
1596
+ #
1597
+ # # Call the list_subscriptions method.
1598
+ # result = client.list_subscriptions request
1599
+ #
1600
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1601
+ # # over elements, and API calls will be issued to fetch pages as needed.
1602
+ # result.each do |item|
1603
+ # # Each element is of type ::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription.
1604
+ # p item
1605
+ # end
1606
+ #
1607
+ def list_subscriptions request, options = nil
1608
+ raise ::ArgumentError, "request must be provided" if request.nil?
1609
+
1610
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::ListSubscriptionsRequest
1611
+
1612
+ # Converts hash and nil to an options object
1613
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1614
+
1615
+ # Customize the options with defaults
1616
+ metadata = @config.rpcs.list_subscriptions.metadata.to_h
1617
+
1618
+ # Set x-goog-api-client and x-goog-user-project headers
1619
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1620
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1621
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
1622
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1623
+
1624
+ header_params = {}
1625
+ if request.parent
1626
+ header_params["parent"] = request.parent
1627
+ end
1628
+
1629
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1630
+ metadata[:"x-goog-request-params"] ||= request_params_header
1631
+
1632
+ options.apply_defaults timeout: @config.rpcs.list_subscriptions.timeout,
1633
+ metadata: metadata,
1634
+ retry_policy: @config.rpcs.list_subscriptions.retry_policy
1635
+
1636
+ options.apply_defaults timeout: @config.timeout,
1637
+ metadata: @config.metadata,
1638
+ retry_policy: @config.retry_policy
1639
+
1640
+ @analytics_hub_service_stub.call_rpc :list_subscriptions, request, options: options do |response, operation|
1641
+ response = ::Gapic::PagedEnumerable.new @analytics_hub_service_stub, :list_subscriptions, request, response, operation, options
1642
+ yield response, operation if block_given?
1643
+ return response
1644
+ end
1645
+ rescue ::GRPC::BadStatus => e
1646
+ raise ::Google::Cloud::Error.from_error(e)
1647
+ end
1648
+
1649
+ ##
1650
+ # Lists all subscriptions on a given Data Exchange or Listing.
1651
+ #
1652
+ # @overload list_shared_resource_subscriptions(request, options = nil)
1653
+ # Pass arguments to `list_shared_resource_subscriptions` via a request object, either of type
1654
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::ListSharedResourceSubscriptionsRequest} or an equivalent Hash.
1655
+ #
1656
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::ListSharedResourceSubscriptionsRequest, ::Hash]
1657
+ # A request object representing the call parameters. Required. To specify no
1658
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1659
+ # @param options [::Gapic::CallOptions, ::Hash]
1660
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1661
+ #
1662
+ # @overload list_shared_resource_subscriptions(resource: nil, include_deleted_subscriptions: nil, page_size: nil, page_token: nil)
1663
+ # Pass arguments to `list_shared_resource_subscriptions` via keyword arguments. Note that at
1664
+ # least one keyword argument is required. To specify no parameters, or to keep all
1665
+ # the default parameter values, pass an empty Hash as a request object (see above).
1666
+ #
1667
+ # @param resource [::String]
1668
+ # Required. Resource name of the requested target. This resource may be
1669
+ # either a Listing or a DataExchange. e.g.
1670
+ # projects/123/locations/US/dataExchanges/456 OR e.g.
1671
+ # projects/123/locations/US/dataExchanges/456/listings/789
1672
+ # @param include_deleted_subscriptions [::Boolean]
1673
+ # If selected, includes deleted subscriptions in the response
1674
+ # (up to 63 days after deletion).
1675
+ # @param page_size [::Integer]
1676
+ # The maximum number of results to return in a single response page.
1677
+ # @param page_token [::String]
1678
+ # Page token, returned by a previous call.
1679
+ #
1680
+ # @yield [response, operation] Access the result along with the RPC operation
1681
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription>]
1682
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1683
+ #
1684
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription>]
1685
+ #
1686
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1687
+ #
1688
+ # @example Basic example
1689
+ # require "google/cloud/bigquery/analytics_hub/v1"
1690
+ #
1691
+ # # Create a client object. The client can be reused for multiple calls.
1692
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
1693
+ #
1694
+ # # Create a request. To set request fields, pass in keyword arguments.
1695
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::ListSharedResourceSubscriptionsRequest.new
1696
+ #
1697
+ # # Call the list_shared_resource_subscriptions method.
1698
+ # result = client.list_shared_resource_subscriptions request
1699
+ #
1700
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1701
+ # # over elements, and API calls will be issued to fetch pages as needed.
1702
+ # result.each do |item|
1703
+ # # Each element is of type ::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription.
1704
+ # p item
1705
+ # end
1706
+ #
1707
+ def list_shared_resource_subscriptions request, options = nil
1708
+ raise ::ArgumentError, "request must be provided" if request.nil?
1709
+
1710
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::ListSharedResourceSubscriptionsRequest
1711
+
1712
+ # Converts hash and nil to an options object
1713
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1714
+
1715
+ # Customize the options with defaults
1716
+ metadata = @config.rpcs.list_shared_resource_subscriptions.metadata.to_h
1717
+
1718
+ # Set x-goog-api-client and x-goog-user-project headers
1719
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1720
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1721
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
1722
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1723
+
1724
+ header_params = {}
1725
+ if request.resource
1726
+ header_params["resource"] = request.resource
1727
+ end
1728
+
1729
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1730
+ metadata[:"x-goog-request-params"] ||= request_params_header
1731
+
1732
+ options.apply_defaults timeout: @config.rpcs.list_shared_resource_subscriptions.timeout,
1733
+ metadata: metadata,
1734
+ retry_policy: @config.rpcs.list_shared_resource_subscriptions.retry_policy
1735
+
1736
+ options.apply_defaults timeout: @config.timeout,
1737
+ metadata: @config.metadata,
1738
+ retry_policy: @config.retry_policy
1739
+
1740
+ @analytics_hub_service_stub.call_rpc :list_shared_resource_subscriptions, request, options: options do |response, operation|
1741
+ response = ::Gapic::PagedEnumerable.new @analytics_hub_service_stub, :list_shared_resource_subscriptions, request, response, operation, options
1742
+ yield response, operation if block_given?
1743
+ return response
1744
+ end
1745
+ rescue ::GRPC::BadStatus => e
1746
+ raise ::Google::Cloud::Error.from_error(e)
1747
+ end
1748
+
1749
+ ##
1750
+ # Revokes a given subscription.
1751
+ #
1752
+ # @overload revoke_subscription(request, options = nil)
1753
+ # Pass arguments to `revoke_subscription` via a request object, either of type
1754
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::RevokeSubscriptionRequest} or an equivalent Hash.
1755
+ #
1756
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::RevokeSubscriptionRequest, ::Hash]
1757
+ # A request object representing the call parameters. Required. To specify no
1758
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1759
+ # @param options [::Gapic::CallOptions, ::Hash]
1760
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1761
+ #
1762
+ # @overload revoke_subscription(name: nil)
1763
+ # Pass arguments to `revoke_subscription` via keyword arguments. Note that at
1764
+ # least one keyword argument is required. To specify no parameters, or to keep all
1765
+ # the default parameter values, pass an empty Hash as a request object (see above).
1766
+ #
1767
+ # @param name [::String]
1768
+ # Required. Resource name of the subscription to revoke.
1769
+ # e.g. projects/123/locations/US/subscriptions/456
1770
+ #
1771
+ # @yield [response, operation] Access the result along with the RPC operation
1772
+ # @yieldparam response [::Google::Cloud::Bigquery::AnalyticsHub::V1::RevokeSubscriptionResponse]
1773
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1774
+ #
1775
+ # @return [::Google::Cloud::Bigquery::AnalyticsHub::V1::RevokeSubscriptionResponse]
1776
+ #
1777
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1778
+ #
1779
+ # @example Basic example
1780
+ # require "google/cloud/bigquery/analytics_hub/v1"
1781
+ #
1782
+ # # Create a client object. The client can be reused for multiple calls.
1783
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
1784
+ #
1785
+ # # Create a request. To set request fields, pass in keyword arguments.
1786
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::RevokeSubscriptionRequest.new
1787
+ #
1788
+ # # Call the revoke_subscription method.
1789
+ # result = client.revoke_subscription request
1790
+ #
1791
+ # # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::RevokeSubscriptionResponse.
1792
+ # p result
1793
+ #
1794
+ def revoke_subscription request, options = nil
1795
+ raise ::ArgumentError, "request must be provided" if request.nil?
1796
+
1797
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::RevokeSubscriptionRequest
1798
+
1799
+ # Converts hash and nil to an options object
1800
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1801
+
1802
+ # Customize the options with defaults
1803
+ metadata = @config.rpcs.revoke_subscription.metadata.to_h
1804
+
1805
+ # Set x-goog-api-client and x-goog-user-project headers
1806
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1807
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1808
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
1809
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1810
+
1811
+ header_params = {}
1812
+ if request.name
1813
+ header_params["name"] = request.name
1814
+ end
1815
+
1816
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1817
+ metadata[:"x-goog-request-params"] ||= request_params_header
1818
+
1819
+ options.apply_defaults timeout: @config.rpcs.revoke_subscription.timeout,
1820
+ metadata: metadata,
1821
+ retry_policy: @config.rpcs.revoke_subscription.retry_policy
1822
+
1823
+ options.apply_defaults timeout: @config.timeout,
1824
+ metadata: @config.metadata,
1825
+ retry_policy: @config.retry_policy
1826
+
1827
+ @analytics_hub_service_stub.call_rpc :revoke_subscription, request, options: options do |response, operation|
1828
+ yield response, operation if block_given?
1829
+ return response
1830
+ end
1831
+ rescue ::GRPC::BadStatus => e
1832
+ raise ::Google::Cloud::Error.from_error(e)
1833
+ end
1834
+
1835
+ ##
1836
+ # Deletes a subscription.
1837
+ #
1838
+ # @overload delete_subscription(request, options = nil)
1839
+ # Pass arguments to `delete_subscription` via a request object, either of type
1840
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteSubscriptionRequest} or an equivalent Hash.
1841
+ #
1842
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteSubscriptionRequest, ::Hash]
1843
+ # A request object representing the call parameters. Required. To specify no
1844
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1845
+ # @param options [::Gapic::CallOptions, ::Hash]
1846
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1847
+ #
1848
+ # @overload delete_subscription(name: nil)
1849
+ # Pass arguments to `delete_subscription` via keyword arguments. Note that at
1850
+ # least one keyword argument is required. To specify no parameters, or to keep all
1851
+ # the default parameter values, pass an empty Hash as a request object (see above).
1852
+ #
1853
+ # @param name [::String]
1854
+ # Required. Resource name of the subscription to delete.
1855
+ # e.g. projects/123/locations/US/subscriptions/456
1856
+ #
1857
+ # @yield [response, operation] Access the result along with the RPC operation
1858
+ # @yieldparam response [::Gapic::Operation]
1859
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1860
+ #
1861
+ # @return [::Gapic::Operation]
1862
+ #
1863
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1864
+ #
1865
+ # @example Basic example
1866
+ # require "google/cloud/bigquery/analytics_hub/v1"
1867
+ #
1868
+ # # Create a client object. The client can be reused for multiple calls.
1869
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
1870
+ #
1871
+ # # Create a request. To set request fields, pass in keyword arguments.
1872
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteSubscriptionRequest.new
1873
+ #
1874
+ # # Call the delete_subscription method.
1875
+ # result = client.delete_subscription request
1876
+ #
1877
+ # # The returned object is of type Gapic::Operation. You can use it to
1878
+ # # check the status of an operation, cancel it, or wait for results.
1879
+ # # Here is how to wait for a response.
1880
+ # result.wait_until_done! timeout: 60
1881
+ # if result.response?
1882
+ # p result.response
1883
+ # else
1884
+ # puts "No response received."
1885
+ # end
1886
+ #
1887
+ def delete_subscription request, options = nil
1888
+ raise ::ArgumentError, "request must be provided" if request.nil?
1889
+
1890
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteSubscriptionRequest
1891
+
1892
+ # Converts hash and nil to an options object
1893
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1894
+
1895
+ # Customize the options with defaults
1896
+ metadata = @config.rpcs.delete_subscription.metadata.to_h
1897
+
1898
+ # Set x-goog-api-client and x-goog-user-project headers
1899
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1900
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1901
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
1902
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1903
+
1904
+ header_params = {}
1905
+ if request.name
1906
+ header_params["name"] = request.name
1907
+ end
1908
+
1909
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1910
+ metadata[:"x-goog-request-params"] ||= request_params_header
1911
+
1912
+ options.apply_defaults timeout: @config.rpcs.delete_subscription.timeout,
1913
+ metadata: metadata,
1914
+ retry_policy: @config.rpcs.delete_subscription.retry_policy
1915
+
1916
+ options.apply_defaults timeout: @config.timeout,
1917
+ metadata: @config.metadata,
1918
+ retry_policy: @config.retry_policy
1919
+
1920
+ @analytics_hub_service_stub.call_rpc :delete_subscription, request, options: options do |response, operation|
1921
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1922
+ yield response, operation if block_given?
1923
+ return response
1924
+ end
1925
+ rescue ::GRPC::BadStatus => e
1926
+ raise ::Google::Cloud::Error.from_error(e)
1927
+ end
1928
+
1253
1929
  ##
1254
1930
  # Gets the IAM policy.
1255
1931
  #
@@ -1646,6 +2322,14 @@ module Google
1646
2322
  end
1647
2323
  end
1648
2324
 
2325
+ ##
2326
+ # Configuration for the channel pool
2327
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
2328
+ #
2329
+ def channel_pool
2330
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
2331
+ end
2332
+
1649
2333
  ##
1650
2334
  # Configuration RPC class for the AnalyticsHubService API.
1651
2335
  #
@@ -1725,6 +2409,41 @@ module Google
1725
2409
  #
1726
2410
  attr_reader :subscribe_listing
1727
2411
  ##
2412
+ # RPC-specific configuration for `subscribe_data_exchange`
2413
+ # @return [::Gapic::Config::Method]
2414
+ #
2415
+ attr_reader :subscribe_data_exchange
2416
+ ##
2417
+ # RPC-specific configuration for `refresh_subscription`
2418
+ # @return [::Gapic::Config::Method]
2419
+ #
2420
+ attr_reader :refresh_subscription
2421
+ ##
2422
+ # RPC-specific configuration for `get_subscription`
2423
+ # @return [::Gapic::Config::Method]
2424
+ #
2425
+ attr_reader :get_subscription
2426
+ ##
2427
+ # RPC-specific configuration for `list_subscriptions`
2428
+ # @return [::Gapic::Config::Method]
2429
+ #
2430
+ attr_reader :list_subscriptions
2431
+ ##
2432
+ # RPC-specific configuration for `list_shared_resource_subscriptions`
2433
+ # @return [::Gapic::Config::Method]
2434
+ #
2435
+ attr_reader :list_shared_resource_subscriptions
2436
+ ##
2437
+ # RPC-specific configuration for `revoke_subscription`
2438
+ # @return [::Gapic::Config::Method]
2439
+ #
2440
+ attr_reader :revoke_subscription
2441
+ ##
2442
+ # RPC-specific configuration for `delete_subscription`
2443
+ # @return [::Gapic::Config::Method]
2444
+ #
2445
+ attr_reader :delete_subscription
2446
+ ##
1728
2447
  # RPC-specific configuration for `get_iam_policy`
1729
2448
  # @return [::Gapic::Config::Method]
1730
2449
  #
@@ -1766,6 +2485,20 @@ module Google
1766
2485
  @delete_listing = ::Gapic::Config::Method.new delete_listing_config
1767
2486
  subscribe_listing_config = parent_rpcs.subscribe_listing if parent_rpcs.respond_to? :subscribe_listing
1768
2487
  @subscribe_listing = ::Gapic::Config::Method.new subscribe_listing_config
2488
+ subscribe_data_exchange_config = parent_rpcs.subscribe_data_exchange if parent_rpcs.respond_to? :subscribe_data_exchange
2489
+ @subscribe_data_exchange = ::Gapic::Config::Method.new subscribe_data_exchange_config
2490
+ refresh_subscription_config = parent_rpcs.refresh_subscription if parent_rpcs.respond_to? :refresh_subscription
2491
+ @refresh_subscription = ::Gapic::Config::Method.new refresh_subscription_config
2492
+ get_subscription_config = parent_rpcs.get_subscription if parent_rpcs.respond_to? :get_subscription
2493
+ @get_subscription = ::Gapic::Config::Method.new get_subscription_config
2494
+ list_subscriptions_config = parent_rpcs.list_subscriptions if parent_rpcs.respond_to? :list_subscriptions
2495
+ @list_subscriptions = ::Gapic::Config::Method.new list_subscriptions_config
2496
+ list_shared_resource_subscriptions_config = parent_rpcs.list_shared_resource_subscriptions if parent_rpcs.respond_to? :list_shared_resource_subscriptions
2497
+ @list_shared_resource_subscriptions = ::Gapic::Config::Method.new list_shared_resource_subscriptions_config
2498
+ revoke_subscription_config = parent_rpcs.revoke_subscription if parent_rpcs.respond_to? :revoke_subscription
2499
+ @revoke_subscription = ::Gapic::Config::Method.new revoke_subscription_config
2500
+ delete_subscription_config = parent_rpcs.delete_subscription if parent_rpcs.respond_to? :delete_subscription
2501
+ @delete_subscription = ::Gapic::Config::Method.new delete_subscription_config
1769
2502
  get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1770
2503
  @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1771
2504
  set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy