updateDataSource method
Updates the DataSourceName
of a DataSource
.
You can use the GetDataSource
operation to view the contents
of the updated data element.
May throw InvalidInputException. May throw ResourceNotFoundException. May throw InternalServerException.
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 {
ArgumentError.checkNotNull(dataSourceId, 'dataSourceId');
_s.validateStringLength(
'dataSourceId',
dataSourceId,
1,
64,
isRequired: true,
);
ArgumentError.checkNotNull(dataSourceName, 'dataSourceName');
_s.validateStringLength(
'dataSourceName',
dataSourceName,
0,
1024,
isRequired: true,
);
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);
}