
software.amazon.awssdk.services.s3control.model.S3CopyObjectOperation Maven / Gradle / Ivy
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.s3control.model;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Contains the configuration parameters for a PUT Copy object operation. S3 Batch Operations passes every object to the
* underlying CopyObject
API operation. For more information about the parameters for this operation, see
* CopyObject.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class S3CopyObjectOperation implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField TARGET_RESOURCE_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("TargetResource")
.getter(getter(S3CopyObjectOperation::targetResource))
.setter(setter(Builder::targetResource))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TargetResource")
.unmarshallLocationName("TargetResource").build()).build();
private static final SdkField CANNED_ACCESS_CONTROL_LIST_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("CannedAccessControlList")
.getter(getter(S3CopyObjectOperation::cannedAccessControlListAsString))
.setter(setter(Builder::cannedAccessControlList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CannedAccessControlList")
.unmarshallLocationName("CannedAccessControlList").build()).build();
private static final SdkField> ACCESS_CONTROL_GRANTS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("AccessControlGrants")
.getter(getter(S3CopyObjectOperation::accessControlGrants))
.setter(setter(Builder::accessControlGrants))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AccessControlGrants")
.unmarshallLocationName("AccessControlGrants").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(S3Grant::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").unmarshallLocationName("member").build()).build())
.build()).build();
private static final SdkField METADATA_DIRECTIVE_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("MetadataDirective")
.getter(getter(S3CopyObjectOperation::metadataDirectiveAsString))
.setter(setter(Builder::metadataDirective))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MetadataDirective")
.unmarshallLocationName("MetadataDirective").build()).build();
private static final SdkField MODIFIED_SINCE_CONSTRAINT_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("ModifiedSinceConstraint")
.getter(getter(S3CopyObjectOperation::modifiedSinceConstraint))
.setter(setter(Builder::modifiedSinceConstraint))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ModifiedSinceConstraint")
.unmarshallLocationName("ModifiedSinceConstraint").build()).build();
private static final SdkField NEW_OBJECT_METADATA_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("NewObjectMetadata")
.getter(getter(S3CopyObjectOperation::newObjectMetadata))
.setter(setter(Builder::newObjectMetadata))
.constructor(S3ObjectMetadata::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NewObjectMetadata")
.unmarshallLocationName("NewObjectMetadata").build()).build();
private static final SdkField> NEW_OBJECT_TAGGING_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("NewObjectTagging")
.getter(getter(S3CopyObjectOperation::newObjectTagging))
.setter(setter(Builder::newObjectTagging))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NewObjectTagging")
.unmarshallLocationName("NewObjectTagging").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(S3Tag::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").unmarshallLocationName("member").build()).build())
.build()).build();
private static final SdkField REDIRECT_LOCATION_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("RedirectLocation")
.getter(getter(S3CopyObjectOperation::redirectLocation))
.setter(setter(Builder::redirectLocation))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RedirectLocation")
.unmarshallLocationName("RedirectLocation").build()).build();
private static final SdkField REQUESTER_PAYS_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("RequesterPays")
.getter(getter(S3CopyObjectOperation::requesterPays))
.setter(setter(Builder::requesterPays))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RequesterPays")
.unmarshallLocationName("RequesterPays").build()).build();
private static final SdkField STORAGE_CLASS_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("StorageClass")
.getter(getter(S3CopyObjectOperation::storageClassAsString))
.setter(setter(Builder::storageClass))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StorageClass")
.unmarshallLocationName("StorageClass").build()).build();
private static final SdkField UN_MODIFIED_SINCE_CONSTRAINT_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("UnModifiedSinceConstraint")
.getter(getter(S3CopyObjectOperation::unModifiedSinceConstraint))
.setter(setter(Builder::unModifiedSinceConstraint))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UnModifiedSinceConstraint")
.unmarshallLocationName("UnModifiedSinceConstraint").build()).build();
private static final SdkField SSE_AWS_KMS_KEY_ID_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("SSEAwsKmsKeyId")
.getter(getter(S3CopyObjectOperation::sseAwsKmsKeyId))
.setter(setter(Builder::sseAwsKmsKeyId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SSEAwsKmsKeyId")
.unmarshallLocationName("SSEAwsKmsKeyId").build()).build();
private static final SdkField TARGET_KEY_PREFIX_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("TargetKeyPrefix")
.getter(getter(S3CopyObjectOperation::targetKeyPrefix))
.setter(setter(Builder::targetKeyPrefix))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TargetKeyPrefix")
.unmarshallLocationName("TargetKeyPrefix").build()).build();
private static final SdkField OBJECT_LOCK_LEGAL_HOLD_STATUS_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("ObjectLockLegalHoldStatus")
.getter(getter(S3CopyObjectOperation::objectLockLegalHoldStatusAsString))
.setter(setter(Builder::objectLockLegalHoldStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ObjectLockLegalHoldStatus")
.unmarshallLocationName("ObjectLockLegalHoldStatus").build()).build();
private static final SdkField OBJECT_LOCK_MODE_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("ObjectLockMode")
.getter(getter(S3CopyObjectOperation::objectLockModeAsString))
.setter(setter(Builder::objectLockMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ObjectLockMode")
.unmarshallLocationName("ObjectLockMode").build()).build();
private static final SdkField OBJECT_LOCK_RETAIN_UNTIL_DATE_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("ObjectLockRetainUntilDate")
.getter(getter(S3CopyObjectOperation::objectLockRetainUntilDate))
.setter(setter(Builder::objectLockRetainUntilDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ObjectLockRetainUntilDate")
.unmarshallLocationName("ObjectLockRetainUntilDate").build()).build();
private static final SdkField BUCKET_KEY_ENABLED_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("BucketKeyEnabled")
.getter(getter(S3CopyObjectOperation::bucketKeyEnabled))
.setter(setter(Builder::bucketKeyEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BucketKeyEnabled")
.unmarshallLocationName("BucketKeyEnabled").build()).build();
private static final SdkField CHECKSUM_ALGORITHM_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("ChecksumAlgorithm")
.getter(getter(S3CopyObjectOperation::checksumAlgorithmAsString))
.setter(setter(Builder::checksumAlgorithm))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ChecksumAlgorithm")
.unmarshallLocationName("ChecksumAlgorithm").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TARGET_RESOURCE_FIELD,
CANNED_ACCESS_CONTROL_LIST_FIELD, ACCESS_CONTROL_GRANTS_FIELD, METADATA_DIRECTIVE_FIELD,
MODIFIED_SINCE_CONSTRAINT_FIELD, NEW_OBJECT_METADATA_FIELD, NEW_OBJECT_TAGGING_FIELD, REDIRECT_LOCATION_FIELD,
REQUESTER_PAYS_FIELD, STORAGE_CLASS_FIELD, UN_MODIFIED_SINCE_CONSTRAINT_FIELD, SSE_AWS_KMS_KEY_ID_FIELD,
TARGET_KEY_PREFIX_FIELD, OBJECT_LOCK_LEGAL_HOLD_STATUS_FIELD, OBJECT_LOCK_MODE_FIELD,
OBJECT_LOCK_RETAIN_UNTIL_DATE_FIELD, BUCKET_KEY_ENABLED_FIELD, CHECKSUM_ALGORITHM_FIELD));
private static final long serialVersionUID = 1L;
private final String targetResource;
private final String cannedAccessControlList;
private final List accessControlGrants;
private final String metadataDirective;
private final Instant modifiedSinceConstraint;
private final S3ObjectMetadata newObjectMetadata;
private final List newObjectTagging;
private final String redirectLocation;
private final Boolean requesterPays;
private final String storageClass;
private final Instant unModifiedSinceConstraint;
private final String sseAwsKmsKeyId;
private final String targetKeyPrefix;
private final String objectLockLegalHoldStatus;
private final String objectLockMode;
private final Instant objectLockRetainUntilDate;
private final Boolean bucketKeyEnabled;
private final String checksumAlgorithm;
private S3CopyObjectOperation(BuilderImpl builder) {
this.targetResource = builder.targetResource;
this.cannedAccessControlList = builder.cannedAccessControlList;
this.accessControlGrants = builder.accessControlGrants;
this.metadataDirective = builder.metadataDirective;
this.modifiedSinceConstraint = builder.modifiedSinceConstraint;
this.newObjectMetadata = builder.newObjectMetadata;
this.newObjectTagging = builder.newObjectTagging;
this.redirectLocation = builder.redirectLocation;
this.requesterPays = builder.requesterPays;
this.storageClass = builder.storageClass;
this.unModifiedSinceConstraint = builder.unModifiedSinceConstraint;
this.sseAwsKmsKeyId = builder.sseAwsKmsKeyId;
this.targetKeyPrefix = builder.targetKeyPrefix;
this.objectLockLegalHoldStatus = builder.objectLockLegalHoldStatus;
this.objectLockMode = builder.objectLockMode;
this.objectLockRetainUntilDate = builder.objectLockRetainUntilDate;
this.bucketKeyEnabled = builder.bucketKeyEnabled;
this.checksumAlgorithm = builder.checksumAlgorithm;
}
/**
*
* Specifies the destination bucket Amazon Resource Name (ARN) for the batch copy operation.
*
*
* -
*
* General purpose buckets - For example, to copy objects to a general purpose bucket named
* destinationBucket
, set the TargetResource
property to
* arn:aws:s3:::destinationBucket
.
*
*
* -
*
* Directory buckets - For example, to copy objects to a directory bucket named
* destinationBucket
in the Availability Zone; identified by the AZ ID usw2-az2
, set the
* TargetResource
property to
* arn:aws:s3express:region:account_id:/bucket/destination_bucket_base_name--usw2-az2--x-s3
* .
*
*
*
*
* @return Specifies the destination bucket Amazon Resource Name (ARN) for the batch copy operation.
*
* -
*
* General purpose buckets - For example, to copy objects to a general purpose bucket named
* destinationBucket
, set the TargetResource
property to
* arn:aws:s3:::destinationBucket
.
*
*
* -
*
* Directory buckets - For example, to copy objects to a directory bucket named
* destinationBucket
in the Availability Zone; identified by the AZ ID usw2-az2
,
* set the TargetResource
property to
* arn:aws:s3express:region:account_id:/bucket/destination_bucket_base_name--usw2-az2--x-s3
* .
*
*
*/
public final String targetResource() {
return targetResource;
}
/**
*
*
*
* This functionality is not supported by directory buckets.
*
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #cannedAccessControlList} will return {@link S3CannedAccessControlList#UNKNOWN_TO_SDK_VERSION}. The raw
* value returned by the service is available from {@link #cannedAccessControlListAsString}.
*
*
* @return
*
* This functionality is not supported by directory buckets.
*
* @see S3CannedAccessControlList
*/
public final S3CannedAccessControlList cannedAccessControlList() {
return S3CannedAccessControlList.fromValue(cannedAccessControlList);
}
/**
*
*
*
* This functionality is not supported by directory buckets.
*
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #cannedAccessControlList} will return {@link S3CannedAccessControlList#UNKNOWN_TO_SDK_VERSION}. The raw
* value returned by the service is available from {@link #cannedAccessControlListAsString}.
*
*
* @return
*
* This functionality is not supported by directory buckets.
*
* @see S3CannedAccessControlList
*/
public final String cannedAccessControlListAsString() {
return cannedAccessControlList;
}
/**
* For responses, this returns true if the service returned a value for the AccessControlGrants property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasAccessControlGrants() {
return accessControlGrants != null && !(accessControlGrants instanceof SdkAutoConstructList);
}
/**
*
*
*
* This functionality is not supported by directory buckets.
*
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasAccessControlGrants} method.
*
*
* @return
*
* This functionality is not supported by directory buckets.
*
*/
public final List accessControlGrants() {
return accessControlGrants;
}
/**
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #metadataDirective}
* will return {@link S3MetadataDirective#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #metadataDirectiveAsString}.
*
*
* @return
* @see S3MetadataDirective
*/
public final S3MetadataDirective metadataDirective() {
return S3MetadataDirective.fromValue(metadataDirective);
}
/**
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #metadataDirective}
* will return {@link S3MetadataDirective#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #metadataDirectiveAsString}.
*
*
* @return
* @see S3MetadataDirective
*/
public final String metadataDirectiveAsString() {
return metadataDirective;
}
/**
*
*
* @return
*/
public final Instant modifiedSinceConstraint() {
return modifiedSinceConstraint;
}
/**
*
* If you don't provide this parameter, Amazon S3 copies all the metadata from the original objects. If you specify
* an empty set, the new objects will have no tags. Otherwise, Amazon S3 assigns the supplied tags to the new
* objects.
*
*
* @return If you don't provide this parameter, Amazon S3 copies all the metadata from the original objects. If you
* specify an empty set, the new objects will have no tags. Otherwise, Amazon S3 assigns the supplied tags
* to the new objects.
*/
public final S3ObjectMetadata newObjectMetadata() {
return newObjectMetadata;
}
/**
* For responses, this returns true if the service returned a value for the NewObjectTagging property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasNewObjectTagging() {
return newObjectTagging != null && !(newObjectTagging instanceof SdkAutoConstructList);
}
/**
*
* Specifies a list of tags to add to the destination objects after they are copied. If
* NewObjectTagging
is not specified, the tags of the source objects are copied to destination objects
* by default.
*
*
*
* Directory buckets - Tags aren't supported by directory buckets. If your source objects have tags and your
* destination bucket is a directory bucket, specify an empty tag set in the NewObjectTagging
field to
* prevent copying the source object tags to the directory bucket.
*
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasNewObjectTagging} method.
*
*
* @return Specifies a list of tags to add to the destination objects after they are copied. If
* NewObjectTagging
is not specified, the tags of the source objects are copied to destination
* objects by default.
*
* Directory buckets - Tags aren't supported by directory buckets. If your source objects have tags
* and your destination bucket is a directory bucket, specify an empty tag set in the
* NewObjectTagging
field to prevent copying the source object tags to the directory bucket.
*
*/
public final List newObjectTagging() {
return newObjectTagging;
}
/**
*
* If the destination bucket is configured as a website, specifies an optional metadata property for website
* redirects, x-amz-website-redirect-location
. Allows webpage redirects if the object copy is accessed
* through a website endpoint.
*
*
*
* This functionality is not supported by directory buckets.
*
*
*
* @return If the destination bucket is configured as a website, specifies an optional metadata property for website
* redirects, x-amz-website-redirect-location
. Allows webpage redirects if the object copy is
* accessed through a website endpoint.
*
* This functionality is not supported by directory buckets.
*
*/
public final String redirectLocation() {
return redirectLocation;
}
/**
*
*
*
* This functionality is not supported by directory buckets.
*
*
*
* @return
*
* This functionality is not supported by directory buckets.
*
*/
public final Boolean requesterPays() {
return requesterPays;
}
/**
*
* Specify the storage class for the destination objects in a Copy
operation.
*
*
*
* Directory buckets - This functionality is not supported by directory buckets.
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #storageClass} will
* return {@link S3StorageClass#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #storageClassAsString}.
*
*
* @return Specify the storage class for the destination objects in a Copy
operation.
*
* Directory buckets - This functionality is not supported by directory buckets.
*
* @see S3StorageClass
*/
public final S3StorageClass storageClass() {
return S3StorageClass.fromValue(storageClass);
}
/**
*
* Specify the storage class for the destination objects in a Copy
operation.
*
*
*
* Directory buckets - This functionality is not supported by directory buckets.
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #storageClass} will
* return {@link S3StorageClass#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #storageClassAsString}.
*
*
* @return Specify the storage class for the destination objects in a Copy
operation.
*
* Directory buckets - This functionality is not supported by directory buckets.
*
* @see S3StorageClass
*/
public final String storageClassAsString() {
return storageClass;
}
/**
*
*
* @return
*/
public final Instant unModifiedSinceConstraint() {
return unModifiedSinceConstraint;
}
/**
*
*
*
* This functionality is not supported by directory buckets.
*
*
*
* @return
*
* This functionality is not supported by directory buckets.
*
*/
public final String sseAwsKmsKeyId() {
return sseAwsKmsKeyId;
}
/**
*
* Specifies the folder prefix that you want the objects to be copied into. For example, to copy objects into a
* folder named Folder1
in the destination bucket, set the TargetKeyPrefix
property to
* Folder1
.
*
*
* @return Specifies the folder prefix that you want the objects to be copied into. For example, to copy objects
* into a folder named Folder1
in the destination bucket, set the TargetKeyPrefix
* property to Folder1
.
*/
public final String targetKeyPrefix() {
return targetKeyPrefix;
}
/**
*
* The legal hold status to be applied to all objects in the Batch Operations job.
*
*
*
* This functionality is not supported by directory buckets.
*
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #objectLockLegalHoldStatus} will return {@link S3ObjectLockLegalHoldStatus#UNKNOWN_TO_SDK_VERSION}. The
* raw value returned by the service is available from {@link #objectLockLegalHoldStatusAsString}.
*
*
* @return The legal hold status to be applied to all objects in the Batch Operations job.
*
* This functionality is not supported by directory buckets.
*
* @see S3ObjectLockLegalHoldStatus
*/
public final S3ObjectLockLegalHoldStatus objectLockLegalHoldStatus() {
return S3ObjectLockLegalHoldStatus.fromValue(objectLockLegalHoldStatus);
}
/**
*
* The legal hold status to be applied to all objects in the Batch Operations job.
*
*
*
* This functionality is not supported by directory buckets.
*
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #objectLockLegalHoldStatus} will return {@link S3ObjectLockLegalHoldStatus#UNKNOWN_TO_SDK_VERSION}. The
* raw value returned by the service is available from {@link #objectLockLegalHoldStatusAsString}.
*
*
* @return The legal hold status to be applied to all objects in the Batch Operations job.
*
* This functionality is not supported by directory buckets.
*
* @see S3ObjectLockLegalHoldStatus
*/
public final String objectLockLegalHoldStatusAsString() {
return objectLockLegalHoldStatus;
}
/**
*
* The retention mode to be applied to all objects in the Batch Operations job.
*
*
*
* This functionality is not supported by directory buckets.
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #objectLockMode}
* will return {@link S3ObjectLockMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #objectLockModeAsString}.
*
*
* @return The retention mode to be applied to all objects in the Batch Operations job.
*
* This functionality is not supported by directory buckets.
*
* @see S3ObjectLockMode
*/
public final S3ObjectLockMode objectLockMode() {
return S3ObjectLockMode.fromValue(objectLockMode);
}
/**
*
* The retention mode to be applied to all objects in the Batch Operations job.
*
*
*
* This functionality is not supported by directory buckets.
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #objectLockMode}
* will return {@link S3ObjectLockMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #objectLockModeAsString}.
*
*
* @return The retention mode to be applied to all objects in the Batch Operations job.
*
* This functionality is not supported by directory buckets.
*
* @see S3ObjectLockMode
*/
public final String objectLockModeAsString() {
return objectLockMode;
}
/**
*
* The date when the applied object retention configuration expires on all objects in the Batch Operations job.
*
*
*
* This functionality is not supported by directory buckets.
*
*
*
* @return The date when the applied object retention configuration expires on all objects in the Batch Operations
* job.
*
* This functionality is not supported by directory buckets.
*
*/
public final Instant objectLockRetainUntilDate() {
return objectLockRetainUntilDate;
}
/**
*
* Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using
* Amazon Web Services KMS (SSE-KMS). Setting this header to true
causes Amazon S3 to use an S3 Bucket
* Key for object encryption with SSE-KMS.
*
*
* Specifying this header with an object action doesn’t affect bucket-level settings for S3 Bucket
* Key.
*
*
*
* This functionality is not supported by directory buckets.
*
*
*
* @return Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption
* using Amazon Web Services KMS (SSE-KMS). Setting this header to true
causes Amazon S3 to use
* an S3 Bucket Key for object encryption with SSE-KMS.
*
* Specifying this header with an object action doesn’t affect bucket-level settings for S3
* Bucket Key.
*
*
*
* This functionality is not supported by directory buckets.
*
*/
public final Boolean bucketKeyEnabled() {
return bucketKeyEnabled;
}
/**
*
* Indicates the algorithm that you want Amazon S3 to use to create the checksum. For more information, see Checking object
* integrity in the Amazon S3 User Guide.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #checksumAlgorithm}
* will return {@link S3ChecksumAlgorithm#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #checksumAlgorithmAsString}.
*
*
* @return Indicates the algorithm that you want Amazon S3 to use to create the checksum. For more information, see
* Checking
* object integrity in the Amazon S3 User Guide.
* @see S3ChecksumAlgorithm
*/
public final S3ChecksumAlgorithm checksumAlgorithm() {
return S3ChecksumAlgorithm.fromValue(checksumAlgorithm);
}
/**
*
* Indicates the algorithm that you want Amazon S3 to use to create the checksum. For more information, see Checking object
* integrity in the Amazon S3 User Guide.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #checksumAlgorithm}
* will return {@link S3ChecksumAlgorithm#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #checksumAlgorithmAsString}.
*
*
* @return Indicates the algorithm that you want Amazon S3 to use to create the checksum. For more information, see
* Checking
* object integrity in the Amazon S3 User Guide.
* @see S3ChecksumAlgorithm
*/
public final String checksumAlgorithmAsString() {
return checksumAlgorithm;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(targetResource());
hashCode = 31 * hashCode + Objects.hashCode(cannedAccessControlListAsString());
hashCode = 31 * hashCode + Objects.hashCode(hasAccessControlGrants() ? accessControlGrants() : null);
hashCode = 31 * hashCode + Objects.hashCode(metadataDirectiveAsString());
hashCode = 31 * hashCode + Objects.hashCode(modifiedSinceConstraint());
hashCode = 31 * hashCode + Objects.hashCode(newObjectMetadata());
hashCode = 31 * hashCode + Objects.hashCode(hasNewObjectTagging() ? newObjectTagging() : null);
hashCode = 31 * hashCode + Objects.hashCode(redirectLocation());
hashCode = 31 * hashCode + Objects.hashCode(requesterPays());
hashCode = 31 * hashCode + Objects.hashCode(storageClassAsString());
hashCode = 31 * hashCode + Objects.hashCode(unModifiedSinceConstraint());
hashCode = 31 * hashCode + Objects.hashCode(sseAwsKmsKeyId());
hashCode = 31 * hashCode + Objects.hashCode(targetKeyPrefix());
hashCode = 31 * hashCode + Objects.hashCode(objectLockLegalHoldStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(objectLockModeAsString());
hashCode = 31 * hashCode + Objects.hashCode(objectLockRetainUntilDate());
hashCode = 31 * hashCode + Objects.hashCode(bucketKeyEnabled());
hashCode = 31 * hashCode + Objects.hashCode(checksumAlgorithmAsString());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof S3CopyObjectOperation)) {
return false;
}
S3CopyObjectOperation other = (S3CopyObjectOperation) obj;
return Objects.equals(targetResource(), other.targetResource())
&& Objects.equals(cannedAccessControlListAsString(), other.cannedAccessControlListAsString())
&& hasAccessControlGrants() == other.hasAccessControlGrants()
&& Objects.equals(accessControlGrants(), other.accessControlGrants())
&& Objects.equals(metadataDirectiveAsString(), other.metadataDirectiveAsString())
&& Objects.equals(modifiedSinceConstraint(), other.modifiedSinceConstraint())
&& Objects.equals(newObjectMetadata(), other.newObjectMetadata())
&& hasNewObjectTagging() == other.hasNewObjectTagging()
&& Objects.equals(newObjectTagging(), other.newObjectTagging())
&& Objects.equals(redirectLocation(), other.redirectLocation())
&& Objects.equals(requesterPays(), other.requesterPays())
&& Objects.equals(storageClassAsString(), other.storageClassAsString())
&& Objects.equals(unModifiedSinceConstraint(), other.unModifiedSinceConstraint())
&& Objects.equals(sseAwsKmsKeyId(), other.sseAwsKmsKeyId())
&& Objects.equals(targetKeyPrefix(), other.targetKeyPrefix())
&& Objects.equals(objectLockLegalHoldStatusAsString(), other.objectLockLegalHoldStatusAsString())
&& Objects.equals(objectLockModeAsString(), other.objectLockModeAsString())
&& Objects.equals(objectLockRetainUntilDate(), other.objectLockRetainUntilDate())
&& Objects.equals(bucketKeyEnabled(), other.bucketKeyEnabled())
&& Objects.equals(checksumAlgorithmAsString(), other.checksumAlgorithmAsString());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("S3CopyObjectOperation").add("TargetResource", targetResource())
.add("CannedAccessControlList", cannedAccessControlListAsString())
.add("AccessControlGrants", hasAccessControlGrants() ? accessControlGrants() : null)
.add("MetadataDirective", metadataDirectiveAsString()).add("ModifiedSinceConstraint", modifiedSinceConstraint())
.add("NewObjectMetadata", newObjectMetadata())
.add("NewObjectTagging", hasNewObjectTagging() ? newObjectTagging() : null)
.add("RedirectLocation", redirectLocation()).add("RequesterPays", requesterPays())
.add("StorageClass", storageClassAsString()).add("UnModifiedSinceConstraint", unModifiedSinceConstraint())
.add("SSEAwsKmsKeyId", sseAwsKmsKeyId()).add("TargetKeyPrefix", targetKeyPrefix())
.add("ObjectLockLegalHoldStatus", objectLockLegalHoldStatusAsString())
.add("ObjectLockMode", objectLockModeAsString()).add("ObjectLockRetainUntilDate", objectLockRetainUntilDate())
.add("BucketKeyEnabled", bucketKeyEnabled()).add("ChecksumAlgorithm", checksumAlgorithmAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "TargetResource":
return Optional.ofNullable(clazz.cast(targetResource()));
case "CannedAccessControlList":
return Optional.ofNullable(clazz.cast(cannedAccessControlListAsString()));
case "AccessControlGrants":
return Optional.ofNullable(clazz.cast(accessControlGrants()));
case "MetadataDirective":
return Optional.ofNullable(clazz.cast(metadataDirectiveAsString()));
case "ModifiedSinceConstraint":
return Optional.ofNullable(clazz.cast(modifiedSinceConstraint()));
case "NewObjectMetadata":
return Optional.ofNullable(clazz.cast(newObjectMetadata()));
case "NewObjectTagging":
return Optional.ofNullable(clazz.cast(newObjectTagging()));
case "RedirectLocation":
return Optional.ofNullable(clazz.cast(redirectLocation()));
case "RequesterPays":
return Optional.ofNullable(clazz.cast(requesterPays()));
case "StorageClass":
return Optional.ofNullable(clazz.cast(storageClassAsString()));
case "UnModifiedSinceConstraint":
return Optional.ofNullable(clazz.cast(unModifiedSinceConstraint()));
case "SSEAwsKmsKeyId":
return Optional.ofNullable(clazz.cast(sseAwsKmsKeyId()));
case "TargetKeyPrefix":
return Optional.ofNullable(clazz.cast(targetKeyPrefix()));
case "ObjectLockLegalHoldStatus":
return Optional.ofNullable(clazz.cast(objectLockLegalHoldStatusAsString()));
case "ObjectLockMode":
return Optional.ofNullable(clazz.cast(objectLockModeAsString()));
case "ObjectLockRetainUntilDate":
return Optional.ofNullable(clazz.cast(objectLockRetainUntilDate()));
case "BucketKeyEnabled":
return Optional.ofNullable(clazz.cast(bucketKeyEnabled()));
case "ChecksumAlgorithm":
return Optional.ofNullable(clazz.cast(checksumAlgorithmAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function