import { Command as $Command } from "@smithy/smithy-client"; import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import type { RenameObjectOutput, RenameObjectRequest } from "../models/models_0"; import type { S3ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../S3Client"; /** * @public */ export type { __MetadataBearer }; export { $Command }; /** * @public * * The input for {@link RenameObjectCommand}. */ export interface RenameObjectCommandInput extends RenameObjectRequest { } /** * @public * * The output of {@link RenameObjectCommand}. */ export interface RenameObjectCommandOutput extends RenameObjectOutput, __MetadataBearer { } declare const RenameObjectCommand_base: { new (input: RenameObjectCommandInput): import("@smithy/smithy-client").CommandImpl; new (input: RenameObjectCommandInput): import("@smithy/smithy-client").CommandImpl; getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions; }; /** *

Renames an existing object in a directory bucket that uses the S3 Express One Zone storage class. * You can use RenameObject by specifying an existing object’s name as the source and the new * name of the object as the destination within the same directory bucket.

* *

* RenameObject is only supported for objects stored in the S3 Express One Zone storage * class.

*
*

To prevent overwriting an object, you can use the If-None-Match conditional * header.

* *
*
Permissions
*
*

To grant access to the RenameObject operation on a directory bucket, we * recommend that you use the CreateSession operation for session-based authorization. * Specifically, you grant the s3express:CreateSession permission to the directory * bucket in a bucket policy or an IAM identity-based policy. Then, you make the * CreateSession API call on the directory bucket to obtain a session token. With the * session token in your request header, you can make API requests to this operation. After the * session token expires, you make another CreateSession API call to generate a new * session token for use. The Amazon Web Services CLI and SDKs will create and manage your session including * refreshing the session token automatically to avoid service interruptions when a session expires. * In your bucket policy, you can specify the s3express:SessionMode condition key to * control who can create a ReadWrite or ReadOnly session. A * ReadWrite session is required for executing all the Zonal endpoint API operations, * including RenameObject. For more information about authorization, see * CreateSession * . To learn more about Zonal endpoint API operations, see * Authorizing Zonal endpoint API operations with CreateSession in the Amazon S3 User * Guide.

*
*
HTTP Host header syntax
*
*

* Directory buckets - The HTTP Host header syntax is * Bucket-name.s3express-zone-id.region-code.amazonaws.com.

*
*
* *

You must URL encode any signed header values that contain spaces. For example, if your header value is my file.txt, containing two spaces after my, you must URL encode this value to my%20%20file.txt.

*
* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { S3Client, RenameObjectCommand } from "@aws-sdk/client-s3"; // ES Modules import * // const { S3Client, RenameObjectCommand } = require("@aws-sdk/client-s3"); // CommonJS import * // import type { S3ClientConfig } from "@aws-sdk/client-s3"; * const config = {}; // type is S3ClientConfig * const client = new S3Client(config); * const input = { // RenameObjectRequest * Bucket: "STRING_VALUE", // required * Key: "STRING_VALUE", // required * RenameSource: "STRING_VALUE", // required * DestinationIfMatch: "STRING_VALUE", * DestinationIfNoneMatch: "STRING_VALUE", * DestinationIfModifiedSince: new Date("TIMESTAMP"), * DestinationIfUnmodifiedSince: new Date("TIMESTAMP"), * SourceIfMatch: "STRING_VALUE", * SourceIfNoneMatch: "STRING_VALUE", * SourceIfModifiedSince: new Date("TIMESTAMP"), * SourceIfUnmodifiedSince: new Date("TIMESTAMP"), * ClientToken: "STRING_VALUE", * }; * const command = new RenameObjectCommand(input); * const response = await client.send(command); * // {}; * * ``` * * @param RenameObjectCommandInput - {@link RenameObjectCommandInput} * @returns {@link RenameObjectCommandOutput} * @see {@link RenameObjectCommandInput} for command's `input` shape. * @see {@link RenameObjectCommandOutput} for command's `response` shape. * @see {@link S3ClientResolvedConfig | config} for S3Client's `config` shape. * * @throws {@link IdempotencyParameterMismatch} (client fault) *

Parameters on this idempotent request are inconsistent with parameters used in previous request(s).

*

For a list of error codes and more information on Amazon S3 errors, see Error codes.

* *

Idempotency ensures that an API request completes no more than one time. With an idempotent * request, if the original request completes successfully, any subsequent retries complete successfully * without performing any further actions.

*
* * @throws {@link S3ServiceException} *

Base exception class for all service exceptions from S3 service.

* * * @public */ export declare class RenameObjectCommand extends RenameObjectCommand_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: RenameObjectRequest; output: {}; }; sdk: { input: RenameObjectCommandInput; output: RenameObjectCommandOutput; }; }; }