UNPKG

@aws-sdk/client-s3

Version:

AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native

75 lines 3.77 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DeleteBucketWebsiteCommand = void 0; const models_0_1 = require("../models/models_0"); const Aws_restXml_1 = require("../protocols/Aws_restXml"); const middleware_bucket_endpoint_1 = require("@aws-sdk/middleware-bucket-endpoint"); const middleware_serde_1 = require("@aws-sdk/middleware-serde"); const smithy_client_1 = require("@aws-sdk/smithy-client"); /** * <p>This operation removes the website configuration for a bucket. Amazon S3 returns a <code>200 * OK</code> response upon successfully deleting a website configuration on the specified * bucket. You will get a <code>200 OK</code> response if the website configuration you are * trying to delete does not exist on the bucket. Amazon S3 returns a <code>404</code> response if * the bucket specified in the request does not exist.</p> * * <p>This DELETE operation requires the <code>S3:DeleteBucketWebsite</code> permission. By * default, only the bucket owner can delete the website configuration attached to a bucket. * However, bucket owners can grant other users permission to delete the website configuration * by writing a bucket policy granting them the <code>S3:DeleteBucketWebsite</code> * permission. </p> * * <p>For more information about hosting websites, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html">Hosting Websites on Amazon S3</a>. </p> * * <p>The following operations are related to <code>DeleteBucketWebsite</code>:</p> * <ul> * <li> * <p> * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketWebsite.html">GetBucketWebsite</a> * </p> * </li> * <li> * <p> * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html">PutBucketWebsite</a> * </p> * </li> * </ul> */ class DeleteBucketWebsiteCommand extends smithy_client_1.Command { // Start section: command_properties // End section: command_properties constructor(input) { // Start section: command_constructor super(); this.input = input; // End section: command_constructor } /** * @internal */ resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize)); this.middlewareStack.use(middleware_bucket_endpoint_1.getBucketEndpointPlugin(configuration)); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "S3Client"; const commandName = "DeleteBucketWebsiteCommand"; const handlerExecutionContext = { logger, clientName, commandName, inputFilterSensitiveLog: models_0_1.DeleteBucketWebsiteRequest.filterSensitiveLog, outputFilterSensitiveLog: (output) => output, }; const { requestHandler } = configuration; return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); } serialize(input, context) { return Aws_restXml_1.serializeAws_restXmlDeleteBucketWebsiteCommand(input, context); } deserialize(output, context) { return Aws_restXml_1.deserializeAws_restXmlDeleteBucketWebsiteCommand(output, context); } } exports.DeleteBucketWebsiteCommand = DeleteBucketWebsiteCommand; //# sourceMappingURL=DeleteBucketWebsiteCommand.js.map