list method
Lists all active subscriptions for a given subscriber.
This can be filtered, for example, by user or data type.
Request parameters:
parent - Required. The parent subscriber. Format:
projects/{project}/subscribers/{subscriber} The {subscriber} ID is
user-settable (4-36 characters, matching
/[a-z]([a-z0-9-]{2,34}[a-z0-9])/) if provided during creation, or
system-generated otherwise.
Value must have pattern ^projects/\[^/\]+/subscribers/\[^/\]+$.
filter - Optional. A filter to apply to the list of subscriptions. The
filter syntax is described in https://google.aip.dev/160. The filter can
be applied to the following fields: - user - data_type The user
identifier (e.g., user1 in users/user1) refers to the public
health_user_id Example: user = "users/user1" Example: user =
"users/user1" OR user = "users/user2" Example: user = "users/user1" AND
(data_type = "sleep" OR data_type = "weight")
pageSize - Optional. The maximum number of subscriptions to return. The
service may return fewer than this value. If unspecified, at most 50
subscriptions will be returned. The maximum value is 1000; values above
1000 will be coerced to 1000.
pageToken - Optional. A page token, received from a previous
ListSubscriptions call. Provide this to retrieve the subsequent page.
When paginating, all other parameters provided to ListSubscriptions must
match the call that provided the page token.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a ListSubscriptionsResponse.
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<ListSubscriptionsResponse> list(
core.String parent, {
core.String? filter,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v4/' + core.Uri.encodeFull('$parent') + '/subscriptions';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListSubscriptionsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}