updateDataSource method

Future<void> updateDataSource({
  1. required String id,
  2. required String indexId,
  3. DataSourceConfiguration? configuration,
  4. String? description,
  5. String? name,
  6. String? roleArn,
  7. String? schedule,
})

Updates an existing Amazon Kendra data source.

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

Parameter id : The unique identifier of the data source to update.

Parameter indexId : The identifier of the index that contains the data source to update.

Parameter description : The new description for the data source.

Parameter name : The name of the data source to update. The name of the data source can't be updated. To rename a data source you must delete the data source and re-create it.

Parameter roleArn : The Amazon Resource Name (ARN) of the new role to use when the data source is accessing resources on your behalf.

Parameter schedule : The new update schedule for the data source.

Implementation

Future<void> updateDataSource({
  required String id,
  required String indexId,
  DataSourceConfiguration? configuration,
  String? description,
  String? name,
  String? roleArn,
  String? schedule,
}) async {
  ArgumentError.checkNotNull(id, 'id');
  _s.validateStringLength(
    'id',
    id,
    1,
    100,
    isRequired: true,
  );
  ArgumentError.checkNotNull(indexId, 'indexId');
  _s.validateStringLength(
    'indexId',
    indexId,
    36,
    36,
    isRequired: true,
  );
  _s.validateStringLength(
    'description',
    description,
    0,
    1000,
  );
  _s.validateStringLength(
    'name',
    name,
    1,
    1000,
  );
  _s.validateStringLength(
    'roleArn',
    roleArn,
    1,
    1284,
  );
  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 (description != null) 'Description': description,
      if (name != null) 'Name': name,
      if (roleArn != null) 'RoleArn': roleArn,
      if (schedule != null) 'Schedule': schedule,
    },
  );
}