updateSession method
Updates a session. A session is a contextual container used for generating recommendations. Amazon Connect updates the existing Amazon Q in Connect session for each contact on which Amazon Q in Connect is enabled.
May throw AccessDeniedException.
May throw ResourceNotFoundException.
May throw UnauthorizedException.
May throw ValidationException.
Parameter assistantId :
The identifier of the Amazon Q in Connect assistant. Can be either the ID
or the ARN. URLs cannot contain the ARN.
Parameter sessionId :
The identifier of the session. Can be either the ID or the ARN. URLs
cannot contain the ARN.
Parameter aiAgentConfiguration :
The configuration of the AI Agents (mapped by AI Agent Type to AI Agent
version) that should be used by Amazon Q in Connect for this Session.
Parameter description :
The description.
Parameter orchestratorConfigurationList :
The updated list of orchestrator configurations for the session.
Parameter removeOrchestratorConfigurationList :
The list of orchestrator configurations to remove from the session.
Parameter tagFilter :
An object that can be used to specify Tag conditions.
Implementation
Future<UpdateSessionResponse> updateSession({
required String assistantId,
required String sessionId,
Map<AIAgentType, AIAgentConfigurationData>? aiAgentConfiguration,
String? description,
List<OrchestratorConfigurationEntry>? orchestratorConfigurationList,
bool? removeOrchestratorConfigurationList,
TagFilter? tagFilter,
}) async {
final $payload = <String, dynamic>{
if (aiAgentConfiguration != null)
'aiAgentConfiguration':
aiAgentConfiguration.map((k, e) => MapEntry(k.value, e)),
if (description != null) 'description': description,
if (orchestratorConfigurationList != null)
'orchestratorConfigurationList': orchestratorConfigurationList,
if (removeOrchestratorConfigurationList != null)
'removeOrchestratorConfigurationList':
removeOrchestratorConfigurationList,
if (tagFilter != null) 'tagFilter': tagFilter,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/assistants/${Uri.encodeComponent(assistantId)}/sessions/${Uri.encodeComponent(sessionId)}',
exceptionFnMap: _exceptionFns,
);
return UpdateSessionResponse.fromJson(response);
}