list method
Lists reactions to a message.
For an example, see List reactions for a message. Requires user authentication.
Request parameters:
parent
- Required. The message users reacted to. Format:
spaces/{space}/messages/{message}
Value must have pattern ^spaces/\[^/\]+/messages/\[^/\]+$
.
filter
- Optional. A query filter. You can filter reactions by
emoji
(either emoji.unicode
or emoji.custom_emoji.uid
) and
user
(user.name
). To filter reactions for multiple emojis or users, join
similar fields with the OR
operator, such as emoji.unicode = "🙂" OR emoji.unicode = "👍"
and user.name = "users/AAAAAA" OR user.name = "users/BBBBBB"
. To filter reactions by emoji and user, use the AND
operator, such as emoji.unicode = "🙂" AND user.name = "users/AAAAAA"
.
If your query uses both AND
and OR
, group them with parentheses. For
example, the following queries are valid: user.name = "users/{user}" emoji.unicode = "🙂" emoji.custom_emoji.uid = "{uid}" emoji.unicode = "🙂" OR emoji.unicode = "👍" emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" emoji.unicode = "🙂" AND user.name = "users/{user}" (emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}") AND user.name = "users/{user}"
The following queries are invalid: emoji.unicode = "🙂" AND emoji.unicode = "👍" emoji.unicode = "🙂" AND emoji.custom_emoji.uid = "{uid}" emoji.unicode = "🙂" OR user.name = "users/{user}" emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" OR user.name = "users/{user}" emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" AND user.name = "users/{user}"
Invalid queries are rejected by the server with an
INVALID_ARGUMENT
error.
pageSize
- Optional. The maximum number of reactions returned. The
service can return fewer reactions than this value. If unspecified, the
default value is 25. The maximum value is 200; values above 200 are
changed to 200.
pageToken
- Optional. (If resuming from a previous query.) A page token
received from a previous list reactions call. Provide this to retrieve the
subsequent page. When paginating, the filter value should match the call
that provided the page token. Passing a different value might lead to
unexpected results.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ListReactionsResponse.
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<ListReactionsResponse> 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>>{
if (filter != null) 'filter': [filter],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/reactions';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListReactionsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}