listSubscriptions method

Future<ListSharedResourceSubscriptionsResponse> listSubscriptions(
  1. String resource, {
  2. bool? includeDeletedSubscriptions,
  3. int? pageSize,
  4. String? pageToken,
  5. String? $fields,
})

Lists all subscriptions on a given Data Exchange or Listing.

Request parameters:

resource - Required. Resource name of the requested target. This resource may be either a Listing or a DataExchange. e.g. projects/123/locations/US/dataExchanges/456 OR e.g. projects/123/locations/US/dataExchanges/456/listings/789 Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/dataExchanges/\[^/\]+$.

includeDeletedSubscriptions - If selected, includes deleted subscriptions in the response (up to 63 days after deletion).

pageSize - The maximum number of results to return in a single response page.

pageToken - Page token, returned by a previous call.

$fields - Selector specifying which fields to include in a partial response.

Completes with a ListSharedResourceSubscriptionsResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<ListSharedResourceSubscriptionsResponse> listSubscriptions(
  core.String resource, {
  core.bool? includeDeletedSubscriptions,
  core.int? pageSize,
  core.String? pageToken,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (includeDeletedSubscriptions != null)
      'includeDeletedSubscriptions': ['${includeDeletedSubscriptions}'],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ =
      'v1/' + core.Uri.encodeFull('$resource') + ':listSubscriptions';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return ListSharedResourceSubscriptionsResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}