createQuickResponse method

Future<CreateQuickResponseResponse> createQuickResponse({
  1. required QuickResponseDataProvider content,
  2. required String knowledgeBaseId,
  3. required String name,
  4. List<String>? channels,
  5. String? clientToken,
  6. String? contentType,
  7. String? description,
  8. GroupingConfiguration? groupingConfiguration,
  9. bool? isActive,
  10. String? language,
  11. String? shortcutKey,
  12. Map<String, String>? tags,
})

Creates a Wisdom quick response.

May throw AccessDeniedException. May throw ConflictException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ValidationException.

Parameter content : The content of the quick response.

Parameter knowledgeBaseId : The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base if you're storing Wisdom Content resource to it. Can be either the ID or the ARN. URLs cannot contain the ARN.

Parameter name : The name of the quick response.

Parameter channels : The Amazon Connect channels this quick response applies to.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.

Parameter contentType : The media type of the quick response content.

  • Use application/x.quickresponse;format=plain for a quick response written in plain text.
  • Use application/x.quickresponse;format=markdown for a quick response written in richtext.

Parameter description : The description of the quick response.

Parameter groupingConfiguration : The configuration information of the user groups that the quick response is accessible to.

Parameter isActive : Whether the quick response is active.

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 shortcutKey : The shortcut key of the quick response. The value should be unique across the knowledge base.

Parameter tags : The tags used to organize, track, or control access for this resource.

Implementation

Future<CreateQuickResponseResponse> createQuickResponse({
  required QuickResponseDataProvider content,
  required String knowledgeBaseId,
  required String name,
  List<String>? channels,
  String? clientToken,
  String? contentType,
  String? description,
  GroupingConfiguration? groupingConfiguration,
  bool? isActive,
  String? language,
  String? shortcutKey,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'content': content,
    'name': name,
    if (channels != null) 'channels': channels,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (contentType != null) 'contentType': contentType,
    if (description != null) 'description': description,
    if (groupingConfiguration != null)
      'groupingConfiguration': groupingConfiguration,
    if (isActive != null) 'isActive': isActive,
    if (language != null) 'language': language,
    if (shortcutKey != null) 'shortcutKey': shortcutKey,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/knowledgeBases/${Uri.encodeComponent(knowledgeBaseId)}/quickResponses',
    exceptionFnMap: _exceptionFns,
  );
  return CreateQuickResponseResponse.fromJson(response);
}