updateDataSource method

Future<void> updateDataSource({
  1. required String id,
  2. required String indexId,
  3. DataSourceConfiguration? configuration,
  4. CustomDocumentEnrichmentConfiguration? customDocumentEnrichmentConfiguration,
  5. String? description,
  6. String? languageCode,
  7. String? name,
  8. String? roleArn,
  9. String? schedule,
  10. DataSourceVpcConfiguration? vpcConfiguration,
})

Updates an Amazon Kendra data source connector.

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

Parameter id : The identifier of the data source connector you want to update.

Parameter indexId : The identifier of the index used with the data source connector.

Parameter configuration : Configuration information you want to update for the data source connector.

Parameter customDocumentEnrichmentConfiguration : Configuration information you want to update for altering document metadata and content during the document ingestion process.

For more information on how to create, modify and delete document metadata, or make other content alterations when you ingest documents into Amazon Kendra, see Customizing document metadata during the ingestion process.

Parameter description : A new description for the data source connector.

Parameter languageCode : The code for a language you want to update for the data source connector. This allows you to support a language for all documents when updating the data source. English is supported by default. For more information on supported languages, including their codes, see Adding documents in languages other than English.

Parameter name : A new name for the data source connector.

Parameter roleArn : The Amazon Resource Name (ARN) of an IAM role with permission to access the data source and required resources. For more information, see IAM roles for Amazon Kendra.

Parameter schedule : The sync schedule you want to update for the data source connector.

Parameter vpcConfiguration : Configuration information for an Amazon Virtual Private Cloud to connect to your data source. For more information, see Configuring a VPC.

Implementation

Future<void> updateDataSource({
  required String id,
  required String indexId,
  DataSourceConfiguration? configuration,
  CustomDocumentEnrichmentConfiguration?
      customDocumentEnrichmentConfiguration,
  String? description,
  String? languageCode,
  String? name,
  String? roleArn,
  String? schedule,
  DataSourceVpcConfiguration? vpcConfiguration,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSKendraFrontendService.UpdateDataSource'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Id': id,
      'IndexId': indexId,
      if (configuration != null) 'Configuration': configuration,
      if (customDocumentEnrichmentConfiguration != null)
        'CustomDocumentEnrichmentConfiguration':
            customDocumentEnrichmentConfiguration,
      if (description != null) 'Description': description,
      if (languageCode != null) 'LanguageCode': languageCode,
      if (name != null) 'Name': name,
      if (roleArn != null) 'RoleArn': roleArn,
      if (schedule != null) 'Schedule': schedule,
      if (vpcConfiguration != null) 'VpcConfiguration': vpcConfiguration,
    },
  );
}