amazonka-s3-2.0: Amazon Simple Storage Service SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.S3.PutObjectRetention

Description

Places an Object Retention configuration on an object. For more information, see Locking Objects. Users or accounts require the s3:PutObjectRetention permission in order to place an Object Retention configuration on objects. Bypassing a Governance Retention configuration requires the s3:BypassGovernanceRetention permission.

This action is not supported by Amazon S3 on Outposts.

Synopsis

Creating a Request

data PutObjectRetention Source #

See: newPutObjectRetention smart constructor.

Constructors

PutObjectRetention' 

Fields

  • bypassGovernanceRetention :: Maybe Bool

    Indicates whether this action should bypass Governance-mode restrictions.

  • checksumAlgorithm :: Maybe ChecksumAlgorithm

    Indicates the algorithm used to create the checksum for the object when using the SDK. This header will not provide any additional functionality if not using the SDK. When sending this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.

    If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

  • contentMD5 :: Maybe Text

    The MD5 hash for the request body.

    For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

  • expectedBucketOwner :: Maybe Text

    The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with the HTTP status code 403 Forbidden (access denied).

  • requestPayer :: Maybe RequestPayer
     
  • retention :: Maybe ObjectLockRetention

    The container element for the Object Retention configuration.

  • versionId :: Maybe ObjectVersionId

    The version ID for the object that you want to apply this Object Retention configuration to.

  • bucket :: BucketName

    The bucket name that contains the object you want to apply this Object Retention configuration to.

    When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.

  • key :: ObjectKey

    The key name for the object that you want to apply this Object Retention configuration to.

Instances

Instances details
ToHeaders PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

ToPath PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

ToQuery PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

ToElement PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

AWSRequest PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

Associated Types

type AWSResponse PutObjectRetention #

Generic PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

Associated Types

type Rep PutObjectRetention :: Type -> Type #

Read PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

Show PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

NFData PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

Methods

rnf :: PutObjectRetention -> () #

Eq PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

Hashable PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

type AWSResponse PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

type Rep PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

newPutObjectRetention Source #

Create a value of PutObjectRetention with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:bypassGovernanceRetention:PutObjectRetention', putObjectRetention_bypassGovernanceRetention - Indicates whether this action should bypass Governance-mode restrictions.

PutObjectRetention, putObjectRetention_checksumAlgorithm - Indicates the algorithm used to create the checksum for the object when using the SDK. This header will not provide any additional functionality if not using the SDK. When sending this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.

If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

$sel:contentMD5:PutObjectRetention', putObjectRetention_contentMD5 - The MD5 hash for the request body.

For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

$sel:expectedBucketOwner:PutObjectRetention', putObjectRetention_expectedBucketOwner - The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with the HTTP status code 403 Forbidden (access denied).

$sel:requestPayer:PutObjectRetention', putObjectRetention_requestPayer - Undocumented member.

$sel:retention:PutObjectRetention', putObjectRetention_retention - The container element for the Object Retention configuration.

PutObjectRetention, putObjectRetention_versionId - The version ID for the object that you want to apply this Object Retention configuration to.

PutObjectRetention, putObjectRetention_bucket - The bucket name that contains the object you want to apply this Object Retention configuration to.

When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.

PutObjectRetention, putObjectRetention_key - The key name for the object that you want to apply this Object Retention configuration to.

Request Lenses

putObjectRetention_bypassGovernanceRetention :: Lens' PutObjectRetention (Maybe Bool) Source #

Indicates whether this action should bypass Governance-mode restrictions.

putObjectRetention_checksumAlgorithm :: Lens' PutObjectRetention (Maybe ChecksumAlgorithm) Source #

Indicates the algorithm used to create the checksum for the object when using the SDK. This header will not provide any additional functionality if not using the SDK. When sending this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.

If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

putObjectRetention_contentMD5 :: Lens' PutObjectRetention (Maybe Text) Source #

The MD5 hash for the request body.

For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

putObjectRetention_expectedBucketOwner :: Lens' PutObjectRetention (Maybe Text) Source #

The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with the HTTP status code 403 Forbidden (access denied).

putObjectRetention_retention :: Lens' PutObjectRetention (Maybe ObjectLockRetention) Source #

The container element for the Object Retention configuration.

putObjectRetention_versionId :: Lens' PutObjectRetention (Maybe ObjectVersionId) Source #

The version ID for the object that you want to apply this Object Retention configuration to.

putObjectRetention_bucket :: Lens' PutObjectRetention BucketName Source #

The bucket name that contains the object you want to apply this Object Retention configuration to.

When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.

putObjectRetention_key :: Lens' PutObjectRetention ObjectKey Source #

The key name for the object that you want to apply this Object Retention configuration to.

Destructuring the Response

data PutObjectRetentionResponse Source #

See: newPutObjectRetentionResponse smart constructor.

Constructors

PutObjectRetentionResponse' 

Fields

Instances

Instances details
Generic PutObjectRetentionResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

Associated Types

type Rep PutObjectRetentionResponse :: Type -> Type #

Read PutObjectRetentionResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

Show PutObjectRetentionResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

NFData PutObjectRetentionResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

Eq PutObjectRetentionResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

type Rep PutObjectRetentionResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

type Rep PutObjectRetentionResponse = D1 ('MetaData "PutObjectRetentionResponse" "Amazonka.S3.PutObjectRetention" "amazonka-s3-2.0-CNZtv1UmVzj28JXsFvwNoj" 'False) (C1 ('MetaCons "PutObjectRetentionResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "requestCharged") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe RequestCharged)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

newPutObjectRetentionResponse Source #

Create a value of PutObjectRetentionResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:requestCharged:PutObjectRetentionResponse', putObjectRetentionResponse_requestCharged - Undocumented member.

$sel:httpStatus:PutObjectRetentionResponse', putObjectRetentionResponse_httpStatus - The response's http status code.

Response Lenses