deleteDataSource method

Future<void> deleteDataSource({
  1. required String id,
  2. required String indexId,
})

Deletes an Amazon Kendra data source. An exception is not thrown if the data source is already being deleted. While the data source is being deleted, the Status field returned by a call to the operation is set to DELETING. For more information, see Deleting Data Sources.

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

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

Parameter indexId : The unique identifier of the index associated with the data source.

Implementation

Future<void> deleteDataSource({
  required String id,
  required String indexId,
}) 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,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSKendraFrontendService.DeleteDataSource'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Id': id,
      'IndexId': indexId,
    },
  );
}