listTables method

Future<ListTablesOutput> listTables({
  1. String? exclusiveStartTableName,
  2. int? limit,
})

Returns an array of table names associated with the current account and endpoint. The output from ListTables is paginated, with each page returning a maximum of 100 table names.

May throw InternalServerError.

Parameter exclusiveStartTableName : The first table name that this operation will evaluate. Use the value that was returned for LastEvaluatedTableName in a previous operation, so that you can obtain the next page of results.

Parameter limit : A maximum number of table names to return. If this parameter is not specified, the limit is 100.

Implementation

Future<ListTablesOutput> listTables({
  String? exclusiveStartTableName,
  int? limit,
}) async {
  _s.validateStringLength(
    'exclusiveStartTableName',
    exclusiveStartTableName,
    3,
    255,
  );
  _s.validateNumRange(
    'limit',
    limit,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'DynamoDB_20120810.ListTables'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (exclusiveStartTableName != null)
        'ExclusiveStartTableName': exclusiveStartTableName,
      if (limit != null) 'Limit': limit,
    },
  );

  return ListTablesOutput.fromJson(jsonResponse.body);
}