Class LifecycleRule.Builder
java.lang.Object
software.amazon.awscdk.services.s3.LifecycleRule.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<LifecycleRule>
- Enclosing interface:
LifecycleRule
@Stability(Stable)
public static final class LifecycleRule.Builder
extends Object
implements software.amazon.jsii.Builder<LifecycleRule>
A builder for
LifecycleRule
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabortIncompleteMultipartUploadAfter
(Duration abortIncompleteMultipartUploadAfter) Sets the value ofLifecycleRule.getAbortIncompleteMultipartUploadAfter()
build()
Builds the configured instance.Sets the value ofLifecycleRule.getEnabled()
expiration
(Duration expiration) Sets the value ofLifecycleRule.getExpiration()
expirationDate
(Instant expirationDate) Sets the value ofLifecycleRule.getExpirationDate()
expiredObjectDeleteMarker
(Boolean expiredObjectDeleteMarker) Sets the value ofLifecycleRule.getExpiredObjectDeleteMarker()
Sets the value ofLifecycleRule.getId()
noncurrentVersionExpiration
(Duration noncurrentVersionExpiration) Sets the value ofLifecycleRule.getNoncurrentVersionExpiration()
noncurrentVersionsToRetain
(Number noncurrentVersionsToRetain) Sets the value ofLifecycleRule.getNoncurrentVersionsToRetain()
noncurrentVersionTransitions
(List<? extends NoncurrentVersionTransition> noncurrentVersionTransitions) Sets the value ofLifecycleRule.getNoncurrentVersionTransitions()
objectSizeGreaterThan
(Number objectSizeGreaterThan) Sets the value ofLifecycleRule.getObjectSizeGreaterThan()
objectSizeLessThan
(Number objectSizeLessThan) Sets the value ofLifecycleRule.getObjectSizeLessThan()
Sets the value ofLifecycleRule.getPrefix()
tagFilters
(Map<String, ? extends Object> tagFilters) Sets the value ofLifecycleRule.getTagFilters()
transitions
(List<? extends Transition> transitions) Sets the value ofLifecycleRule.getTransitions()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
abortIncompleteMultipartUploadAfter
@Stability(Stable) public LifecycleRule.Builder abortIncompleteMultipartUploadAfter(Duration abortIncompleteMultipartUploadAfter) Sets the value ofLifecycleRule.getAbortIncompleteMultipartUploadAfter()
- Parameters:
abortIncompleteMultipartUploadAfter
- Specifies a lifecycle rule that aborts incomplete multipart uploads to an Amazon S3 bucket. The AbortIncompleteMultipartUpload property type creates a lifecycle rule that aborts incomplete multipart uploads to an Amazon S3 bucket. When Amazon S3 aborts a multipart upload, it deletes all parts associated with the multipart upload.- Returns:
this
-
enabled
Sets the value ofLifecycleRule.getEnabled()
- Parameters:
enabled
- Whether this rule is enabled.- Returns:
this
-
expiration
Sets the value ofLifecycleRule.getExpiration()
- Parameters:
expiration
- Indicates the number of days after creation when objects are deleted from Amazon S3 and Amazon Glacier. If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time.- Returns:
this
-
expirationDate
Sets the value ofLifecycleRule.getExpirationDate()
- Parameters:
expirationDate
- Indicates when objects are deleted from Amazon S3 and Amazon Glacier. The date value must be in ISO 8601 format. The time is always midnight UTC.If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time.
- Returns:
this
-
expiredObjectDeleteMarker
@Stability(Stable) public LifecycleRule.Builder expiredObjectDeleteMarker(Boolean expiredObjectDeleteMarker) Sets the value ofLifecycleRule.getExpiredObjectDeleteMarker()
- Parameters:
expiredObjectDeleteMarker
- Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired.- Returns:
this
-
id
Sets the value ofLifecycleRule.getId()
- Parameters:
id
- A unique identifier for this rule. The value cannot be more than 255 characters.- Returns:
this
-
noncurrentVersionExpiration
@Stability(Stable) public LifecycleRule.Builder noncurrentVersionExpiration(Duration noncurrentVersionExpiration) Sets the value ofLifecycleRule.getNoncurrentVersionExpiration()
- Parameters:
noncurrentVersionExpiration
- Time between when a new version of the object is uploaded to the bucket and when old versions of the object expire. For buckets with versioning enabled (or suspended), specifies the time, in days, between when a new version of the object is uploaded to the bucket and when old versions of the object expire. When object versions expire, Amazon S3 permanently deletes them. If you specify a transition and expiration time, the expiration time must be later than the transition time.- Returns:
this
-
noncurrentVersionsToRetain
@Stability(Stable) public LifecycleRule.Builder noncurrentVersionsToRetain(Number noncurrentVersionsToRetain) Sets the value ofLifecycleRule.getNoncurrentVersionsToRetain()
- Parameters:
noncurrentVersionsToRetain
- Indicates a maximum number of noncurrent versions to retain. If there are this many more noncurrent versions, Amazon S3 permanently deletes them.- Returns:
this
-
noncurrentVersionTransitions
@Stability(Stable) public LifecycleRule.Builder noncurrentVersionTransitions(List<? extends NoncurrentVersionTransition> noncurrentVersionTransitions) Sets the value ofLifecycleRule.getNoncurrentVersionTransitions()
- Parameters:
noncurrentVersionTransitions
- One or more transition rules that specify when non-current objects transition to a specified storage class. Only for for buckets with versioning enabled (or suspended).If you specify a transition and expiration time, the expiration time must be later than the transition time.
- Returns:
this
-
objectSizeGreaterThan
Sets the value ofLifecycleRule.getObjectSizeGreaterThan()
- Parameters:
objectSizeGreaterThan
- Specifies the minimum object size in bytes for this rule to apply to.- Returns:
this
-
objectSizeLessThan
Sets the value ofLifecycleRule.getObjectSizeLessThan()
- Parameters:
objectSizeLessThan
- Specifies the maximum object size in bytes for this rule to apply to.- Returns:
this
-
prefix
Sets the value ofLifecycleRule.getPrefix()
- Parameters:
prefix
- Object key prefix that identifies one or more objects to which this rule applies.- Returns:
this
-
tagFilters
Sets the value ofLifecycleRule.getTagFilters()
- Parameters:
tagFilters
- The TagFilter property type specifies tags to use to identify a subset of objects for an Amazon S3 bucket.- Returns:
this
-
transitions
Sets the value ofLifecycleRule.getTransitions()
- Parameters:
transitions
- One or more transition rules that specify when an object transitions to a specified storage class. If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<LifecycleRule>
- Returns:
- a new instance of
LifecycleRule
- Throws:
NullPointerException
- if any required attribute was not provided
-