updateSession method

Future<UpdateSessionResponse> updateSession({
  1. required String sessionIdentifier,
  2. Map<String, String>? sessionMetadata,
})

Updates the metadata or encryption settings of a session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

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

Parameter sessionIdentifier : The unique identifier of the session to modify. You can specify either the session's sessionId or its Amazon Resource Name (ARN).

Parameter sessionMetadata : A map of key-value pairs containing attributes to be persisted across the session. For example the user's ID, their language preference, and the type of device they are using.

Implementation

Future<UpdateSessionResponse> updateSession({
  required String sessionIdentifier,
  Map<String, String>? sessionMetadata,
}) async {
  final $payload = <String, dynamic>{
    if (sessionMetadata != null) 'sessionMetadata': sessionMetadata,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/sessions/${Uri.encodeComponent(sessionIdentifier)}/',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateSessionResponse.fromJson(response);
}