import { DynamoDBClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBClient"; import { DeleteTableInput, DeleteTableOutput } from "../models/models_0"; import { deserializeAws_json1_0DeleteTableCommand, serializeAws_json1_0DeleteTableCommand, } from "../protocols/Aws_json1_0"; import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { FinalizeHandlerArguments, Handler, HandlerExecutionContext, MiddlewareStack, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, SerdeContext as __SerdeContext, } from "@aws-sdk/types"; export interface DeleteTableCommandInput extends DeleteTableInput {} export interface DeleteTableCommandOutput extends DeleteTableOutput, __MetadataBearer {} /** *

The DeleteTable operation deletes a table and all of its items. After a * DeleteTable request, the specified table is in the DELETING state until * DynamoDB completes the deletion. If the table is in the ACTIVE state, you can delete * it. If a table is in CREATING or UPDATING states, then DynamoDB returns * a ResourceInUseException. If the specified table does not exist, DynamoDB returns a * ResourceNotFoundException. If table is already in the DELETING state, no * error is returned.

* *

DynamoDB might continue to accept data read and write operations, such as GetItem and * PutItem, on a table in the DELETING state until the table deletion is * complete.

*
*

When you delete a table, any indexes on that table are also deleted.

*

If you have DynamoDB Streams enabled on the table, then the corresponding stream on that table goes * into the DISABLED state, and the stream is automatically deleted after 24 hours.

* *

Use the DescribeTable action to check the status of the table.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { DynamoDBClient, DeleteTableCommand } from "@aws-sdk/client-dynamodb"; // ES Modules import * // const { DynamoDBClient, DeleteTableCommand } = require("@aws-sdk/client-dynamodb"); // CommonJS import * const client = new DynamoDBClient(config); * const command = new DeleteTableCommand(input); * const response = await client.send(command); * ``` * * @see {@link DeleteTableCommandInput} for command's `input` shape. * @see {@link DeleteTableCommandOutput} for command's `response` shape. * @see {@link DynamoDBClientResolvedConfig | config} for command's `input` shape. * */ export class DeleteTableCommand extends $Command< DeleteTableCommandInput, DeleteTableCommandOutput, DynamoDBClientResolvedConfig > { // Start section: command_properties // End section: command_properties constructor(readonly input: DeleteTableCommandInput) { // Start section: command_constructor super(); // End section: command_constructor } /** * @internal */ resolveMiddleware( clientStack: MiddlewareStack, configuration: DynamoDBClientResolvedConfig, options?: __HttpHandlerOptions ): Handler { this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "DynamoDBClient"; const commandName = "DeleteTableCommand"; const handlerExecutionContext: HandlerExecutionContext = { logger, clientName, commandName, inputFilterSensitiveLog: DeleteTableInput.filterSensitiveLog, outputFilterSensitiveLog: DeleteTableOutput.filterSensitiveLog, }; const { requestHandler } = configuration; return stack.resolve( (request: FinalizeHandlerArguments) => requestHandler.handle(request.request as __HttpRequest, options || {}), handlerExecutionContext ); } private serialize(input: DeleteTableCommandInput, context: __SerdeContext): Promise<__HttpRequest> { return serializeAws_json1_0DeleteTableCommand(input, context); } private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { return deserializeAws_json1_0DeleteTableCommand(output, context); } // Start section: command_body_extra // End section: command_body_extra }