Jump to Content

This API Documentation is now deprecated

We are excited to announce our new API Documentation.

Class GetObjectRetentionCommandProtected

Retrieves an object's retention settings. For more information, see Locking Objects.

This action is not supported by Amazon S3 on Outposts.

The following action is related to GetObjectRetention:

Example

Use a bare-bones client and the command you need to make an API call.

import { S3Client, GetObjectRetentionCommand } from "@aws-sdk/client-s3"; // ES Modules import
// const { S3Client, GetObjectRetentionCommand } = require("@aws-sdk/client-s3"); // CommonJS import
const client = new S3Client(config);
const input = { // GetObjectRetentionRequest
Bucket: "STRING_VALUE", // required
Key: "STRING_VALUE", // required
VersionId: "STRING_VALUE",
RequestPayer: "requester",
ExpectedBucketOwner: "STRING_VALUE",
};
const command = new GetObjectRetentionCommand(input);
const response = await client.send(command);
// { // GetObjectRetentionOutput
// Retention: { // ObjectLockRetention
// Mode: "GOVERNANCE" || "COMPLIANCE",
// RetainUntilDate: new Date("TIMESTAMP"),
// },
// };

Param

GetObjectRetentionCommandInput

Returns

GetObjectRetentionCommandOutput

See

Throws

S3ServiceException

Base exception class for all service exceptions from S3 service.

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

Methods