list method
Lists all or a subset of Item resources.
This API requires an admin or service account to execute. The service account used is the one whitelisted in the corresponding data source.
Request parameters:
name
- The name of the Data Source to list Items. Format:
datasources/{source_id}
Value must have pattern ^datasources/\[^/\]+$
.
brief
- When set to true, the indexing system only populates the
following fields: name, version, queue. metadata.hash, metadata.title,
metadata.sourceRepositoryURL, metadata.objectType, metadata.createTime,
metadata.updateTime, metadata.contentLanguage, metadata.mimeType,
structured_data.hash, content.hash, itemType, itemStatus.code,
itemStatus.processingError.code, itemStatus.repositoryError.type, If this
value is false, then all the fields are populated in Item.
connectorName
- The name of connector making this call. Format:
datasources/{source_id}/connectors/{ID}
debugOptions_enableDebugging
- If you are asked by Google to help with
debugging, set this field. Otherwise, ignore this field.
pageSize
- Maximum number of items to fetch in a request. The max value
is 1000 when brief is true. The max value is 10 if brief is false. The
default value is 10
pageToken
- The next_page_token value returned from a previous List
request, if any.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ListItemsResponse.
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<ListItemsResponse> list(
core.String name, {
core.bool? brief,
core.String? connectorName,
core.bool? debugOptions_enableDebugging,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (brief != null) 'brief': ['${brief}'],
if (connectorName != null) 'connectorName': [connectorName],
if (debugOptions_enableDebugging != null)
'debugOptions.enableDebugging': ['${debugOptions_enableDebugging}'],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/indexing/' + core.Uri.encodeFull('$name') + '/items';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListItemsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}