listGlobalTables method

Future<ListGlobalTablesOutput> listGlobalTables({
  1. String? exclusiveStartGlobalTableName,
  2. int? limit,
  3. String? regionName,
})

Lists all global tables that have a replica in the specified Region.

May throw InternalServerError.

Parameter exclusiveStartGlobalTableName : The first global table name that this operation will evaluate.

Parameter limit : The maximum number of table names to return, if the parameter is not specified DynamoDB defaults to 100.

If the number of global tables DynamoDB finds reaches this limit, it stops the operation and returns the table names collected up to that point, with a table name in the LastEvaluatedGlobalTableName to apply in a subsequent operation to the ExclusiveStartGlobalTableName parameter.

Parameter regionName : Lists the global tables in a specific Region.

Implementation

Future<ListGlobalTablesOutput> listGlobalTables({
  String? exclusiveStartGlobalTableName,
  int? limit,
  String? regionName,
}) async {
  _s.validateStringLength(
    'exclusiveStartGlobalTableName',
    exclusiveStartGlobalTableName,
    3,
    255,
  );
  _s.validateNumRange(
    'limit',
    limit,
    1,
    1152921504606846976,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'DynamoDB_20120810.ListGlobalTables'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (exclusiveStartGlobalTableName != null)
        'ExclusiveStartGlobalTableName': exclusiveStartGlobalTableName,
      if (limit != null) 'Limit': limit,
      if (regionName != null) 'RegionName': regionName,
    },
  );

  return ListGlobalTablesOutput.fromJson(jsonResponse.body);
}