updateDataSource method

Future<UpdateDataSourceOutput> updateDataSource({
  1. required String dataSourceId,
  2. required String dataSourceName,
})

Updates the DataSourceName of a DataSource.

You can use the GetDataSource operation to view the contents of the updated data element.

May throw InternalServerException. May throw InvalidInputException. May throw ResourceNotFoundException.

Parameter dataSourceId : The ID assigned to the DataSource during creation.

Parameter dataSourceName : A new user-supplied name or description of the DataSource that will replace the current description.

Implementation

Future<UpdateDataSourceOutput> updateDataSource({
  required String dataSourceId,
  required String dataSourceName,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonML_20141212.UpdateDataSource'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DataSourceId': dataSourceId,
      'DataSourceName': dataSourceName,
    },
  );

  return UpdateDataSourceOutput.fromJson(jsonResponse.body);
}