list method

Future<GoogleCloudDialogflowV2ListDocumentsResponse> list(
  1. String parent, {
  2. String? filter,
  3. int? pageSize,
  4. String? pageToken,
  5. String? $fields,
})

Returns the list of all documents of the knowledge base.

Request parameters:

parent - Required. The knowledge base to list all documents for. Format: projects//locations//knowledgeBases/. Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/knowledgeBases/\[^/\]+$.

filter - The filter expression used to filter documents returned by the list method. The expression has the following syntax: [AND ] ... The following fields and operators are supported: * knowledge_types with has(:) operator * display_name with has(:) operator * state with equals(=) operator Examples: * "knowledge_types:FAQ" matches documents with FAQ knowledge type. * "display_name:customer" matches documents whose display name contains "customer". * "state=ACTIVE" matches documents with ACTIVE state. * "knowledge_types:FAQ AND state=ACTIVE" matches all active FAQ documents. For more information about filtering, see API Filtering.

pageSize - The maximum number of items to return in a single page. By default 10 and at most 100.

pageToken - The next_page_token value returned from a previous list request.

$fields - Selector specifying which fields to include in a partial response.

Completes with a GoogleCloudDialogflowV2ListDocumentsResponse.

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<GoogleCloudDialogflowV2ListDocumentsResponse> 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_ = 'v2/' + core.Uri.encodeFull('$parent') + '/documents';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return GoogleCloudDialogflowV2ListDocumentsResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}