listInvocationSteps method

Future<ListInvocationStepsResponse> listInvocationSteps({
  1. required String sessionIdentifier,
  2. String? invocationIdentifier,
  3. int? maxResults,
  4. String? nextToken,
})

Lists all invocation steps associated with a session and optionally, an invocation within the session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter sessionIdentifier : The unique identifier for the session associated with the invocation steps. You can specify either the session's sessionId or its Amazon Resource Name (ARN).

Parameter invocationIdentifier : The unique identifier (in UUID format) for the invocation to list invocation steps for.

Parameter maxResults : The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

Parameter nextToken : If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

Implementation

Future<ListInvocationStepsResponse> listInvocationSteps({
  required String sessionIdentifier,
  String? invocationIdentifier,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final $payload = <String, dynamic>{
    if (invocationIdentifier != null)
      'invocationIdentifier': invocationIdentifier,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/sessions/${Uri.encodeComponent(sessionIdentifier)}/invocationSteps/',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListInvocationStepsResponse.fromJson(response);
}