queryFolderContents method
Returns the contents of a given Folder.
Request parameters:
folder - Required. Resource name of the Folder to list contents for.
Format: projects / * /locations / * /folders / *
Value must have pattern
^projects/\[^/\]+/locations/\[^/\]+/folders/\[^/\]+$.
filter - Optional. Optional filtering for the returned list. Filtering
is currently only supported on the display_name field. Example: *
filter="display_name="MyFolder""
orderBy - Optional. Field to additionally sort results by. Will order
Folders before Repositories, and then by order_by in ascending order.
Supported keywords: display_name (default), create_time,
last_modified_time. Examples: * orderBy="display_name" *
orderBy="display_name desc"
pageSize - Optional. Maximum number of paths to return. The server may
return fewer items than requested. If unspecified, the server will pick an
appropriate default.
pageToken - Optional. Page token received from a previous
QueryFolderContents call. Provide this to retrieve the subsequent page.
When paginating, all other parameters provided to QueryFolderContents,
with the exception of page_size, must match the call that provided the
page token.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a QueryFolderContentsResponse.
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<QueryFolderContentsResponse> queryFolderContents(
core.String folder, {
core.String? filter,
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'orderBy': ?orderBy == null ? null : [orderBy],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' + core.Uri.encodeFull('$folder') + ':queryFolderContents';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return QueryFolderContentsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}