describeTable method

Future<DescribeTableOutput> describeTable({
  1. required String tableName,
})

Returns information about the table, including the current status of the table, when it was created, the primary key schema, and any indexes on the table.

May throw ResourceNotFoundException. May throw InternalServerError.

Parameter tableName : The name of the table to describe.

Implementation

Future<DescribeTableOutput> describeTable({
  required String tableName,
}) async {
  ArgumentError.checkNotNull(tableName, 'tableName');
  _s.validateStringLength(
    'tableName',
    tableName,
    3,
    255,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'DynamoDB_20120810.DescribeTable'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'TableName': tableName,
    },
  );

  return DescribeTableOutput.fromJson(jsonResponse.body);
}