updateChatResponseConfiguration method

Future<void> updateChatResponseConfiguration({
  1. required String applicationId,
  2. required String chatResponseConfigurationId,
  3. required Map<ResponseConfigurationType, ResponseConfiguration> responseConfigurations,
  4. String? clientToken,
  5. String? displayName,
})

Updates an existing chat response configuration in an Amazon Q Business application. This operation allows administrators to modify configuration settings, display name, and response parameters to refine how the system generates responses.

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

Parameter applicationId : The unique identifier of the Amazon Q Business application containing the chat response configuration to update.

Parameter chatResponseConfigurationId : The unique identifier of the chat response configuration to update within the specified application.

Parameter responseConfigurations : The updated collection of response configuration settings that define how Amazon Q Business generates and formats responses to user queries.

Parameter clientToken : A unique, case-sensitive identifier to ensure idempotency of the request. This helps prevent the same update from being processed multiple times if retries occur.

Parameter displayName : The new human-readable name to assign to the chat response configuration, making it easier to identify among multiple configurations.

Implementation

Future<void> updateChatResponseConfiguration({
  required String applicationId,
  required String chatResponseConfigurationId,
  required Map<ResponseConfigurationType, ResponseConfiguration>
      responseConfigurations,
  String? clientToken,
  String? displayName,
}) async {
  final $payload = <String, dynamic>{
    'responseConfigurations':
        responseConfigurations.map((k, e) => MapEntry(k.value, e)),
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (displayName != null) 'displayName': displayName,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/applications/${Uri.encodeComponent(applicationId)}/chatresponseconfigurations/${Uri.encodeComponent(chatResponseConfigurationId)}',
    exceptionFnMap: _exceptionFns,
  );
}