Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
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.
Permissions
When the Object Lock retention mode is set to compliance, you need
s3:PutObjectRetention
and s3:BypassGovernanceRetention
permissions.
For other requests to PutObjectRetention
, only s3:PutObjectRetention
permissions are required.
Synopsis
- data PutObjectRetention = PutObjectRetention' {}
- newPutObjectRetention :: BucketName -> ObjectKey -> PutObjectRetention
- putObjectRetention_retention :: Lens' PutObjectRetention (Maybe ObjectLockRetention)
- putObjectRetention_versionId :: Lens' PutObjectRetention (Maybe ObjectVersionId)
- putObjectRetention_requestPayer :: Lens' PutObjectRetention (Maybe RequestPayer)
- putObjectRetention_contentMD5 :: Lens' PutObjectRetention (Maybe Text)
- putObjectRetention_bypassGovernanceRetention :: Lens' PutObjectRetention (Maybe Bool)
- putObjectRetention_expectedBucketOwner :: Lens' PutObjectRetention (Maybe Text)
- putObjectRetention_bucket :: Lens' PutObjectRetention BucketName
- putObjectRetention_key :: Lens' PutObjectRetention ObjectKey
- data PutObjectRetentionResponse = PutObjectRetentionResponse' {}
- newPutObjectRetentionResponse :: Int -> PutObjectRetentionResponse
- putObjectRetentionResponse_requestCharged :: Lens' PutObjectRetentionResponse (Maybe RequestCharged)
- putObjectRetentionResponse_httpStatus :: Lens' PutObjectRetentionResponse Int
Creating a Request
data PutObjectRetention Source #
See: newPutObjectRetention
smart constructor.
PutObjectRetention' | |
|
Instances
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:retention:PutObjectRetention'
, putObjectRetention_retention
- The container element for the Object Retention configuration.
$sel:versionId:PutObjectRetention'
, putObjectRetention_versionId
- The version ID for the object that you want to apply this Object
Retention configuration to.
$sel:requestPayer:PutObjectRetention'
, putObjectRetention_requestPayer
- Undocumented member.
$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:bypassGovernanceRetention:PutObjectRetention'
, putObjectRetention_bypassGovernanceRetention
- Indicates whether this action should bypass Governance-mode
restrictions.
$sel:expectedBucketOwner:PutObjectRetention'
, putObjectRetention_expectedBucketOwner
- The account ID of the expected bucket owner. If the bucket is owned by a
different account, the request will fail with an HTTP
403 (Access Denied)
error.
$sel:bucket: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.
$sel:key:PutObjectRetention'
, putObjectRetention_key
- The key name for the object that you want to apply this Object Retention
configuration to.
Request Lenses
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_requestPayer :: Lens' PutObjectRetention (Maybe RequestPayer) Source #
Undocumented member.
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_bypassGovernanceRetention :: Lens' PutObjectRetention (Maybe Bool) Source #
Indicates whether this action should bypass Governance-mode restrictions.
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 will fail with an HTTP
403 (Access Denied)
error.
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.
PutObjectRetentionResponse' | |
|
Instances
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
putObjectRetentionResponse_requestCharged :: Lens' PutObjectRetentionResponse (Maybe RequestCharged) Source #
Undocumented member.
putObjectRetentionResponse_httpStatus :: Lens' PutObjectRetentionResponse Int Source #
The response's http status code.