getDataSource method
Returns a DataSource
that includes metadata and data file
information, as well as the current status of the DataSource
.
GetDataSource
provides results in normal or verbose format.
The verbose format adds the schema description and the list of files
pointed to by the DataSource to the normal format.
May throw InvalidInputException. May throw ResourceNotFoundException. May throw InternalServerException.
Parameter dataSourceId
:
The ID assigned to the DataSource
at creation.
Parameter verbose
:
Specifies whether the GetDataSource
operation should return
DataSourceSchema
.
If true, DataSourceSchema
is returned.
If false, DataSourceSchema
is not returned.
Implementation
Future<GetDataSourceOutput> getDataSource({
required String dataSourceId,
bool? verbose,
}) async {
ArgumentError.checkNotNull(dataSourceId, 'dataSourceId');
_s.validateStringLength(
'dataSourceId',
dataSourceId,
1,
64,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AmazonML_20141212.GetDataSource'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'DataSourceId': dataSourceId,
if (verbose != null) 'Verbose': verbose,
},
);
return GetDataSourceOutput.fromJson(jsonResponse.body);
}