list method

Future<ListConversationsResponse> list(
  1. String parent, {
  2. String? filter,
  3. int? pageSize,
  4. String? pageToken,
  5. String? source,
  6. List<String>? sources,
  7. String? $fields,
})

Lists conversations in the given app.

Request parameters:

parent - Required. The resource name of the app to list conversations from. Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/apps/\[^/\]+$.

filter - Optional. Filter to be applied when listing the conversations. See https://google.aip.dev/160 for more details.

pageSize - Optional. Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.

pageToken - Optional. The next_page_token value returned from a previous list AgentService.ListConversations call.

source - Optional. Indicate the source of the conversation. If not set, Source.Live will be applied by default. Will be deprecated in favor of sources field. Possible string values are:

  • "SOURCE_UNSPECIFIED" : Unspecified source.
  • "LIVE" : The conversation is from the live end user.
  • "SIMULATOR" : The conversation is from the simulator.
  • "EVAL" : The conversation is from the evaluation.
  • "AGENT_TOOL" : The conversation is from an agent tool. Agent tool runs the agent in a separate session, which is persisted for testing and debugging purposes.

sources - Optional. Indicate the sources of the conversations. If not set, all available sources will be applied by default.

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

Completes with a ListConversationsResponse.

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<ListConversationsResponse> list(
  core.String parent, {
  core.String? filter,
  core.int? pageSize,
  core.String? pageToken,
  core.String? source,
  core.List<core.String>? sources,
  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],
    'source': ?source == null ? null : [source],
    'sources': ?sources,
    'fields': ?$fields == null ? null : [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/conversations';

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