updateMessageTemplate method
Updates the Amazon Q in Connect message template. Partial update is
supported. If any field is not supplied, it will remain unchanged for the
message template that is referenced by the $LATEST qualifier.
Any modification will only apply to the message template that is
referenced by the $LATEST qualifier. The fields for all
available versions will remain unchanged.
May throw AccessDeniedException.
May throw ConflictException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter knowledgeBaseId :
The identifier of the knowledge base. Can be either the ID or the ARN.
URLs cannot contain the ARN.
Parameter messageTemplateId :
The identifier of the message template. Can be either the ID or the ARN.
It cannot contain any qualifier.
Parameter content :
The content of the message template.
Parameter defaultAttributes :
An object that specifies the default values to use for variables in the
message template. This object contains different categories of key-value
pairs. Each key defines a variable or placeholder in the message template.
The corresponding value defines the default value for that variable.
Parameter language :
The language code value for the language in which the quick response is
written. The supported language codes include de_DE,
en_US, es_ES, fr_FR,
id_ID, it_IT, ja_JP,
ko_KR, pt_BR, zh_CN,
zh_TW
Parameter sourceConfiguration :
The source configuration of the message template. Only set this argument
for WHATSAPP channel subtype.
Implementation
Future<UpdateMessageTemplateResponse> updateMessageTemplate({
required String knowledgeBaseId,
required String messageTemplateId,
MessageTemplateContentProvider? content,
MessageTemplateAttributes? defaultAttributes,
String? language,
MessageTemplateSourceConfiguration? sourceConfiguration,
}) async {
final $payload = <String, dynamic>{
if (content != null) 'content': content,
if (defaultAttributes != null) 'defaultAttributes': defaultAttributes,
if (language != null) 'language': language,
if (sourceConfiguration != null)
'sourceConfiguration': sourceConfiguration,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/knowledgeBases/${Uri.encodeComponent(knowledgeBaseId)}/messageTemplates/${Uri.encodeComponent(messageTemplateId)}',
exceptionFnMap: _exceptionFns,
);
return UpdateMessageTemplateResponse.fromJson(response);
}