listTables method

Future<ListTablesResponse> listTables({
  1. String? databaseName,
  2. int? maxResults,
  3. String? nextToken,
})

Provides a list of tables, along with the name, status, and retention properties of each table. See code sample for details.

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

Parameter databaseName : The name of the Timestream database.

Parameter maxResults : The total number of items to return in the output. If the total number of items available is more than the value specified, a NextToken is provided in the output. To resume pagination, provide the NextToken value as argument of a subsequent API invocation.

Parameter nextToken : The pagination token. To resume pagination, provide the NextToken value as argument of a subsequent API invocation.

Implementation

Future<ListTablesResponse> listTables({
  String? databaseName,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    20,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'Timestream_20181101.ListTables'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (databaseName != null) 'DatabaseName': databaseName,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListTablesResponse.fromJson(jsonResponse.body);
}