createContentAssociation method
Creates an association between a content resource in a knowledge base and step-by-step guides. Step-by-step guides offer instructions to agents for resolving common customer issues. You create a content association to integrate Amazon Q in Connect and step-by-step guides.
After you integrate Amazon Q and step-by-step guides, when Amazon Q provides a recommendation to an agent based on the intent that it's detected, it also provides them with the option to start the step-by-step guide that you have associated with the content.
Note the following limitations:
- You can create only one content association for each content resource in a knowledge base.
- You can associate a step-by-step guide with multiple content resources.
May throw AccessDeniedException.
May throw ConflictException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw UnauthorizedException.
May throw ValidationException.
Parameter association :
The identifier of the associated resource.
Parameter associationType :
The type of association.
Parameter contentId :
The identifier of the content.
Parameter knowledgeBaseId :
The identifier of the knowledge base.
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 tags :
The tags used to organize, track, or control access for this resource.
Implementation
Future<CreateContentAssociationResponse> createContentAssociation({
required ContentAssociationContents association,
required ContentAssociationType associationType,
required String contentId,
required String knowledgeBaseId,
String? clientToken,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'association': association,
'associationType': associationType.value,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/knowledgeBases/${Uri.encodeComponent(knowledgeBaseId)}/contents/${Uri.encodeComponent(contentId)}/associations',
exceptionFnMap: _exceptionFns,
);
return CreateContentAssociationResponse.fromJson(response);
}