list method
Lists items in a section.
Only spaces can be section items. For details, see Create and organize sections in Google Chat. Requires user authentication with the authorization scope:
https://www.googleapis.com/auth/chat.users.sections-https://www.googleapis.com/auth/chat.users.sections.readonly
Request parameters:
parent - Required. The parent, which is the section resource name that
owns this collection of section items. Only supports listing section items
for the calling user. When you're filtering by space, use the wildcard -
to search across all sections. For example, users/{user}/sections/-.
Format: users/{user}/sections/{section}
Value must have pattern ^users/\[^/\]+/sections/\[^/\]+$.
filter - Optional. A query filter. Currently only supports filtering by
space. For example, space = spaces/{space}. Invalid queries are rejected
with an INVALID_ARGUMENT error.
pageSize - Optional. The maximum number of section items to return. The
service may return fewer than this value. If unspecified, at most 10
section items will be returned. The maximum value is 100. If you use a
value more than 100, it's automatically changed to 100. Negative values
return an INVALID_ARGUMENT error.
pageToken - Optional. A page token, received from a previous list
section items call. Provide this to retrieve the subsequent page. When
paginating, all other parameters provided should match the call that
provided the page token. Passing different values to the other parameters
might lead to unexpected results.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a ListSectionItemsResponse.
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<ListSectionItemsResponse> 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_ = 'v1/' + core.Uri.encodeFull('$parent') + '/items';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListSectionItemsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}