listTableMetadata method
Lists the metadata for the tables in the specified data catalog database.
May throw InternalServerException. May throw InvalidRequestException. May throw MetadataException.
Parameter catalogName
:
The name of the data catalog for which table metadata should be returned.
Parameter databaseName
:
The name of the database for which table metadata should be returned.
Parameter expression
:
A regex filter that pattern-matches table names. If no expression is
supplied, metadata for all tables are listed.
Parameter maxResults
:
Specifies the maximum number of results to return.
Parameter nextToken
:
A token generated by the Athena service that specifies where to continue
pagination if a previous request was truncated. To obtain the next set of
pages, pass in the NextToken from the response object of the previous page
call.
Implementation
Future<ListTableMetadataOutput> listTableMetadata({
required String catalogName,
required String databaseName,
String? expression,
int? maxResults,
String? nextToken,
}) async {
ArgumentError.checkNotNull(catalogName, 'catalogName');
_s.validateStringLength(
'catalogName',
catalogName,
1,
256,
isRequired: true,
);
ArgumentError.checkNotNull(databaseName, 'databaseName');
_s.validateStringLength(
'databaseName',
databaseName,
1,
128,
isRequired: true,
);
_s.validateStringLength(
'expression',
expression,
0,
256,
);
_s.validateNumRange(
'maxResults',
maxResults,
1,
50,
);
_s.validateStringLength(
'nextToken',
nextToken,
1,
1024,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AmazonAthena.ListTableMetadata'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'CatalogName': catalogName,
'DatabaseName': databaseName,
if (expression != null) 'Expression': expression,
if (maxResults != null) 'MaxResults': maxResults,
if (nextToken != null) 'NextToken': nextToken,
},
);
return ListTableMetadataOutput.fromJson(jsonResponse.body);
}