updateKnowledgeBase method

Future<UpdateKnowledgeBaseResponse> updateKnowledgeBase({
  1. required String awsAccountId,
  2. required String knowledgeBaseId,
  3. AccessControlConfiguration? accessControlConfiguration,
  4. String? description,
  5. bool? isEmailNotificationOptedForIngestionFailures,
  6. KnowledgeBaseConfiguration? knowledgeBaseConfiguration,
  7. MediaExtractionConfiguration? mediaExtractionConfiguration,
  8. String? name,
})

Updates the properties of an existing knowledge base.

May throw AccessDeniedException. May throw ConflictException. May throw InternalFailureException. May throw InvalidParameterValueException. May throw InvalidRequestException. May throw LimitExceededException. May throw PreconditionNotMetException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter awsAccountId : The ID of the Amazon Web Services account that contains the knowledge base.

Parameter knowledgeBaseId : The unique identifier for the knowledge base.

Parameter accessControlConfiguration : The access control configuration for the knowledge base. If you don't specify this parameter, the existing setting is retained.

Parameter description : A description for the knowledge base. If you don't specify a description, the existing description is retained.

Parameter isEmailNotificationOptedForIngestionFailures : Specifies whether email notifications are enabled for ingestion failures.

Parameter name : The name of the knowledge base. If you don't specify a name, the existing name is retained.

Implementation

Future<UpdateKnowledgeBaseResponse> updateKnowledgeBase({
  required String awsAccountId,
  required String knowledgeBaseId,
  AccessControlConfiguration? accessControlConfiguration,
  String? description,
  bool? isEmailNotificationOptedForIngestionFailures,
  KnowledgeBaseConfiguration? knowledgeBaseConfiguration,
  MediaExtractionConfiguration? mediaExtractionConfiguration,
  String? name,
}) async {
  final $payload = <String, dynamic>{
    if (accessControlConfiguration != null)
      'AccessControlConfiguration': accessControlConfiguration,
    if (description != null) 'Description': description,
    if (isEmailNotificationOptedForIngestionFailures != null)
      'IsEmailNotificationOptedForIngestionFailures':
          isEmailNotificationOptedForIngestionFailures,
    if (knowledgeBaseConfiguration != null)
      'KnowledgeBaseConfiguration': knowledgeBaseConfiguration,
    if (mediaExtractionConfiguration != null)
      'MediaExtractionConfiguration': mediaExtractionConfiguration,
    if (name != null) 'Name': name,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/v1/accounts/${Uri.encodeComponent(awsAccountId)}/knowledge-bases/${Uri.encodeComponent(knowledgeBaseId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateKnowledgeBaseResponse.fromJson(response);
}