import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; import { PutBucketAclRequest } from "../models/models_0"; import { S3ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../S3Client"; /** * @public * * The input for {@link PutBucketAclCommand}. */ export interface PutBucketAclCommandInput extends PutBucketAclRequest { } /** * @public * * The output of {@link PutBucketAclCommand}. */ export interface PutBucketAclCommandOutput extends __MetadataBearer { } /** * @public *

Sets the permissions on an existing bucket using access control lists (ACL). For more * information, see Using ACLs. To set * the ACL of a bucket, you must have WRITE_ACP permission.

*

You can use one of the following two ways to set a bucket's permissions:

* * *

You cannot specify access permission using both the body and the request * headers.

*
*

Depending on your application needs, you may choose to set the ACL on a bucket using * either the request body or the headers. For example, if you have an existing application * that updates a bucket ACL using the request body, then you can continue to use that * approach.

* *

If your bucket uses the bucket owner enforced setting for S3 Object Ownership, ACLs are disabled and no longer affect permissions. * You must use policies to grant access to your bucket and the objects in it. Requests to set ACLs or update ACLs fail and * return the AccessControlListNotSupported error code. Requests to read ACLs are still supported. * For more information, see Controlling object ownership * in the Amazon S3 User Guide.

*
*

* Access Permissions *

*

You can set access permissions using one of the following methods:

* *

You can use either a canned ACL or specify access permissions explicitly. You cannot do * both.

*

* Grantee Values *

*

You can specify the person (grantee) to whom you're assigning access rights (using * request elements) in the following ways:

* *

* Related Resources *

* * @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { S3Client, PutBucketAclCommand } from "@aws-sdk/client-s3"; // ES Modules import * // const { S3Client, PutBucketAclCommand } = require("@aws-sdk/client-s3"); // CommonJS import * const client = new S3Client(config); * const input = { // PutBucketAclRequest * ACL: "private" || "public-read" || "public-read-write" || "authenticated-read", * AccessControlPolicy: { // AccessControlPolicy * Grants: [ // Grants * { // Grant * Grantee: { // Grantee * DisplayName: "STRING_VALUE", * EmailAddress: "STRING_VALUE", * ID: "STRING_VALUE", * URI: "STRING_VALUE", * Type: "CanonicalUser" || "AmazonCustomerByEmail" || "Group", // required * }, * Permission: "FULL_CONTROL" || "WRITE" || "WRITE_ACP" || "READ" || "READ_ACP", * }, * ], * Owner: { // Owner * DisplayName: "STRING_VALUE", * ID: "STRING_VALUE", * }, * }, * Bucket: "STRING_VALUE", // required * ContentMD5: "STRING_VALUE", * ChecksumAlgorithm: "CRC32" || "CRC32C" || "SHA1" || "SHA256", * GrantFullControl: "STRING_VALUE", * GrantRead: "STRING_VALUE", * GrantReadACP: "STRING_VALUE", * GrantWrite: "STRING_VALUE", * GrantWriteACP: "STRING_VALUE", * ExpectedBucketOwner: "STRING_VALUE", * }; * const command = new PutBucketAclCommand(input); * const response = await client.send(command); * ``` * * @param PutBucketAclCommandInput - {@link PutBucketAclCommandInput} * @returns {@link PutBucketAclCommandOutput} * @see {@link PutBucketAclCommandInput} for command's `input` shape. * @see {@link PutBucketAclCommandOutput} for command's `response` shape. * @see {@link S3ClientResolvedConfig | config} for S3Client's `config` shape. * * * @example Put bucket acl * ```javascript * // The following example replaces existing ACL on a bucket. The ACL grants the bucket owner (specified using the owner ID) and write permission to the LogDelivery group. Because this is a replace operation, you must specify all the grants in your request. To incrementally add or remove ACL grants, you might use the console. * const input = { * "Bucket": "examplebucket", * "GrantFullControl": "id=examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484", * "GrantWrite": "uri=http://acs.amazonaws.com/groups/s3/LogDelivery" * }; * const command = new PutBucketAclCommand(input); * await client.send(command); * // example id: put-bucket-acl-1482260397033 * ``` * */ export declare class PutBucketAclCommand extends $Command { readonly input: PutBucketAclCommandInput; static getEndpointParameterInstructions(): EndpointParameterInstructions; /** * @public */ constructor(input: PutBucketAclCommandInput); /** * @internal */ resolveMiddleware(clientStack: MiddlewareStack, configuration: S3ClientResolvedConfig, options?: __HttpHandlerOptions): Handler; /** * @internal */ private serialize; /** * @internal */ private deserialize; }