All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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 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 getter(Function g) { return obj -> g.apply((S3CopyObjectOperation) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

    * 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 * . *

      *
    • *
    * * @param targetResource * 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 Returns a reference to this object so that method calls can be chained together. */ Builder targetResource(String targetResource); /** *

      * *

      * This functionality is not supported by directory buckets. *

      * * * @param cannedAccessControlList * *

      * This functionality is not supported by directory buckets. *

      * @see S3CannedAccessControlList * @return Returns a reference to this object so that method calls can be chained together. * @see S3CannedAccessControlList */ Builder cannedAccessControlList(String cannedAccessControlList); /** *

      * *

      * This functionality is not supported by directory buckets. *

      *
      * * @param cannedAccessControlList * *

      * This functionality is not supported by directory buckets. *

      * @see S3CannedAccessControlList * @return Returns a reference to this object so that method calls can be chained together. * @see S3CannedAccessControlList */ Builder cannedAccessControlList(S3CannedAccessControlList cannedAccessControlList); /** *

      * *

      * This functionality is not supported by directory buckets. *

      *
      * * @param accessControlGrants * *

      * This functionality is not supported by directory buckets. *

      * @return Returns a reference to this object so that method calls can be chained together. */ Builder accessControlGrants(Collection accessControlGrants); /** *

      * *

      * This functionality is not supported by directory buckets. *

      *
      * * @param accessControlGrants * *

      * This functionality is not supported by directory buckets. *

      * @return Returns a reference to this object so that method calls can be chained together. */ Builder accessControlGrants(S3Grant... accessControlGrants); /** *

      * *

      * This functionality is not supported by directory buckets. *

      *
      This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.s3control.model.S3Grant.Builder} avoiding the need to create one * manually via {@link software.amazon.awssdk.services.s3control.model.S3Grant#builder()}. * *

      * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.s3control.model.S3Grant.Builder#build()} is called immediately and its * result is passed to {@link #accessControlGrants(List)}. * * @param accessControlGrants * a consumer that will call methods on * {@link software.amazon.awssdk.services.s3control.model.S3Grant.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #accessControlGrants(java.util.Collection) */ Builder accessControlGrants(Consumer... accessControlGrants); /** *

      * * @param metadataDirective * @see S3MetadataDirective * @return Returns a reference to this object so that method calls can be chained together. * @see S3MetadataDirective */ Builder metadataDirective(String metadataDirective); /** *

      * * @param metadataDirective * @see S3MetadataDirective * @return Returns a reference to this object so that method calls can be chained together. * @see S3MetadataDirective */ Builder metadataDirective(S3MetadataDirective metadataDirective); /** *

      * * @param modifiedSinceConstraint * @return Returns a reference to this object so that method calls can be chained together. */ Builder modifiedSinceConstraint(Instant 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. *

      * * @param newObjectMetadata * 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 Returns a reference to this object so that method calls can be chained together. */ Builder newObjectMetadata(S3ObjectMetadata newObjectMetadata); /** *

      * 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. *

      * This is a convenience method that creates an instance of the {@link S3ObjectMetadata.Builder} avoiding the * need to create one manually via {@link S3ObjectMetadata#builder()}. * *

      * When the {@link Consumer} completes, {@link S3ObjectMetadata.Builder#build()} is called immediately and its * result is passed to {@link #newObjectMetadata(S3ObjectMetadata)}. * * @param newObjectMetadata * a consumer that will call methods on {@link S3ObjectMetadata.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #newObjectMetadata(S3ObjectMetadata) */ default Builder newObjectMetadata(Consumer newObjectMetadata) { return newObjectMetadata(S3ObjectMetadata.builder().applyMutation(newObjectMetadata).build()); } /** *

      * 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. *

      *
      * * @param newObjectTagging * 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. *

      * @return Returns a reference to this object so that method calls can be chained together. */ Builder newObjectTagging(Collection newObjectTagging); /** *

      * 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. *

      *
      * * @param newObjectTagging * 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. *

      * @return Returns a reference to this object so that method calls can be chained together. */ Builder newObjectTagging(S3Tag... newObjectTagging); /** *

      * 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. *

      *
      This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.s3control.model.S3Tag.Builder} avoiding the need to create one * manually via {@link software.amazon.awssdk.services.s3control.model.S3Tag#builder()}. * *

      * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.s3control.model.S3Tag.Builder#build()} is called immediately and its * result is passed to {@link #newObjectTagging(List)}. * * @param newObjectTagging * a consumer that will call methods on * {@link software.amazon.awssdk.services.s3control.model.S3Tag.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #newObjectTagging(java.util.Collection) */ Builder newObjectTagging(Consumer... 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. *

      *
      * * @param redirectLocation * 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 Returns a reference to this object so that method calls can be chained together. */ Builder redirectLocation(String redirectLocation); /** *

      * *

      * This functionality is not supported by directory buckets. *

      *
      * * @param requesterPays * *

      * This functionality is not supported by directory buckets. *

      * @return Returns a reference to this object so that method calls can be chained together. */ Builder requesterPays(Boolean requesterPays); /** *

      * Specify the storage class for the destination objects in a Copy operation. *

      * *

      * Directory buckets - This functionality is not supported by directory buckets. *

      *
      * * @param storageClass * Specify the storage class for the destination objects in a Copy operation.

      *

      * Directory buckets - This functionality is not supported by directory buckets. *

      * @see S3StorageClass * @return Returns a reference to this object so that method calls can be chained together. * @see S3StorageClass */ Builder storageClass(String storageClass); /** *

      * Specify the storage class for the destination objects in a Copy operation. *

      * *

      * Directory buckets - This functionality is not supported by directory buckets. *

      *
      * * @param storageClass * Specify the storage class for the destination objects in a Copy operation.

      *

      * Directory buckets - This functionality is not supported by directory buckets. *

      * @see S3StorageClass * @return Returns a reference to this object so that method calls can be chained together. * @see S3StorageClass */ Builder storageClass(S3StorageClass storageClass); /** *

      * * @param unModifiedSinceConstraint * @return Returns a reference to this object so that method calls can be chained together. */ Builder unModifiedSinceConstraint(Instant unModifiedSinceConstraint); /** *

      * *

      * This functionality is not supported by directory buckets. *

      *
      * * @param sseAwsKmsKeyId * *

      * This functionality is not supported by directory buckets. *

      * @return Returns a reference to this object so that method calls can be chained together. */ Builder sseAwsKmsKeyId(String 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. *

      * * @param targetKeyPrefix * 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 Returns a reference to this object so that method calls can be chained together. */ Builder targetKeyPrefix(String targetKeyPrefix); /** *

      * The legal hold status to be applied to all objects in the Batch Operations job. *

      * *

      * This functionality is not supported by directory buckets. *

      *
      * * @param objectLockLegalHoldStatus * 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 * @return Returns a reference to this object so that method calls can be chained together. * @see S3ObjectLockLegalHoldStatus */ Builder objectLockLegalHoldStatus(String objectLockLegalHoldStatus); /** *

      * The legal hold status to be applied to all objects in the Batch Operations job. *

      * *

      * This functionality is not supported by directory buckets. *

      *
      * * @param objectLockLegalHoldStatus * 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 * @return Returns a reference to this object so that method calls can be chained together. * @see S3ObjectLockLegalHoldStatus */ Builder objectLockLegalHoldStatus(S3ObjectLockLegalHoldStatus objectLockLegalHoldStatus); /** *

      * The retention mode to be applied to all objects in the Batch Operations job. *

      * *

      * This functionality is not supported by directory buckets. *

      *
      * * @param objectLockMode * The retention mode to be applied to all objects in the Batch Operations job.

      *

      * This functionality is not supported by directory buckets. *

      * @see S3ObjectLockMode * @return Returns a reference to this object so that method calls can be chained together. * @see S3ObjectLockMode */ Builder objectLockMode(String objectLockMode); /** *

      * The retention mode to be applied to all objects in the Batch Operations job. *

      * *

      * This functionality is not supported by directory buckets. *

      *
      * * @param objectLockMode * The retention mode to be applied to all objects in the Batch Operations job.

      *

      * This functionality is not supported by directory buckets. *

      * @see S3ObjectLockMode * @return Returns a reference to this object so that method calls can be chained together. * @see S3ObjectLockMode */ Builder objectLockMode(S3ObjectLockMode 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. *

      *
      * * @param objectLockRetainUntilDate * 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 Returns a reference to this object so that method calls can be chained together. */ Builder objectLockRetainUntilDate(Instant 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. *

      *
      * * @param bucketKeyEnabled * 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 Returns a reference to this object so that method calls can be chained together. */ Builder bucketKeyEnabled(Boolean 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. *

      * * @param 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. * @see S3ChecksumAlgorithm * @return Returns a reference to this object so that method calls can be chained together. * @see S3ChecksumAlgorithm */ Builder checksumAlgorithm(String 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. *

      * * @param 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. * @see S3ChecksumAlgorithm * @return Returns a reference to this object so that method calls can be chained together. * @see S3ChecksumAlgorithm */ Builder checksumAlgorithm(S3ChecksumAlgorithm checksumAlgorithm); } static final class BuilderImpl implements Builder { private String targetResource; private String cannedAccessControlList; private List accessControlGrants = DefaultSdkAutoConstructList.getInstance(); private String metadataDirective; private Instant modifiedSinceConstraint; private S3ObjectMetadata newObjectMetadata; private List newObjectTagging = DefaultSdkAutoConstructList.getInstance(); private String redirectLocation; private Boolean requesterPays; private String storageClass; private Instant unModifiedSinceConstraint; private String sseAwsKmsKeyId; private String targetKeyPrefix; private String objectLockLegalHoldStatus; private String objectLockMode; private Instant objectLockRetainUntilDate; private Boolean bucketKeyEnabled; private String checksumAlgorithm; private BuilderImpl() { } private BuilderImpl(S3CopyObjectOperation model) { targetResource(model.targetResource); cannedAccessControlList(model.cannedAccessControlList); accessControlGrants(model.accessControlGrants); metadataDirective(model.metadataDirective); modifiedSinceConstraint(model.modifiedSinceConstraint); newObjectMetadata(model.newObjectMetadata); newObjectTagging(model.newObjectTagging); redirectLocation(model.redirectLocation); requesterPays(model.requesterPays); storageClass(model.storageClass); unModifiedSinceConstraint(model.unModifiedSinceConstraint); sseAwsKmsKeyId(model.sseAwsKmsKeyId); targetKeyPrefix(model.targetKeyPrefix); objectLockLegalHoldStatus(model.objectLockLegalHoldStatus); objectLockMode(model.objectLockMode); objectLockRetainUntilDate(model.objectLockRetainUntilDate); bucketKeyEnabled(model.bucketKeyEnabled); checksumAlgorithm(model.checksumAlgorithm); } public final String getTargetResource() { return targetResource; } public final void setTargetResource(String targetResource) { this.targetResource = targetResource; } @Override public final Builder targetResource(String targetResource) { this.targetResource = targetResource; return this; } public final String getCannedAccessControlList() { return cannedAccessControlList; } public final void setCannedAccessControlList(String cannedAccessControlList) { this.cannedAccessControlList = cannedAccessControlList; } @Override public final Builder cannedAccessControlList(String cannedAccessControlList) { this.cannedAccessControlList = cannedAccessControlList; return this; } @Override public final Builder cannedAccessControlList(S3CannedAccessControlList cannedAccessControlList) { this.cannedAccessControlList(cannedAccessControlList == null ? null : cannedAccessControlList.toString()); return this; } public final List getAccessControlGrants() { List result = S3GrantListCopier.copyToBuilder(this.accessControlGrants); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setAccessControlGrants(Collection accessControlGrants) { this.accessControlGrants = S3GrantListCopier.copyFromBuilder(accessControlGrants); } @Override public final Builder accessControlGrants(Collection accessControlGrants) { this.accessControlGrants = S3GrantListCopier.copy(accessControlGrants); return this; } @Override @SafeVarargs public final Builder accessControlGrants(S3Grant... accessControlGrants) { accessControlGrants(Arrays.asList(accessControlGrants)); return this; } @Override @SafeVarargs public final Builder accessControlGrants(Consumer... accessControlGrants) { accessControlGrants(Stream.of(accessControlGrants).map(c -> S3Grant.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final String getMetadataDirective() { return metadataDirective; } public final void setMetadataDirective(String metadataDirective) { this.metadataDirective = metadataDirective; } @Override public final Builder metadataDirective(String metadataDirective) { this.metadataDirective = metadataDirective; return this; } @Override public final Builder metadataDirective(S3MetadataDirective metadataDirective) { this.metadataDirective(metadataDirective == null ? null : metadataDirective.toString()); return this; } public final Instant getModifiedSinceConstraint() { return modifiedSinceConstraint; } public final void setModifiedSinceConstraint(Instant modifiedSinceConstraint) { this.modifiedSinceConstraint = modifiedSinceConstraint; } @Override public final Builder modifiedSinceConstraint(Instant modifiedSinceConstraint) { this.modifiedSinceConstraint = modifiedSinceConstraint; return this; } public final S3ObjectMetadata.Builder getNewObjectMetadata() { return newObjectMetadata != null ? newObjectMetadata.toBuilder() : null; } public final void setNewObjectMetadata(S3ObjectMetadata.BuilderImpl newObjectMetadata) { this.newObjectMetadata = newObjectMetadata != null ? newObjectMetadata.build() : null; } @Override public final Builder newObjectMetadata(S3ObjectMetadata newObjectMetadata) { this.newObjectMetadata = newObjectMetadata; return this; } public final List getNewObjectTagging() { List result = S3TagSetCopier.copyToBuilder(this.newObjectTagging); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setNewObjectTagging(Collection newObjectTagging) { this.newObjectTagging = S3TagSetCopier.copyFromBuilder(newObjectTagging); } @Override public final Builder newObjectTagging(Collection newObjectTagging) { this.newObjectTagging = S3TagSetCopier.copy(newObjectTagging); return this; } @Override @SafeVarargs public final Builder newObjectTagging(S3Tag... newObjectTagging) { newObjectTagging(Arrays.asList(newObjectTagging)); return this; } @Override @SafeVarargs public final Builder newObjectTagging(Consumer... newObjectTagging) { newObjectTagging(Stream.of(newObjectTagging).map(c -> S3Tag.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final String getRedirectLocation() { return redirectLocation; } public final void setRedirectLocation(String redirectLocation) { this.redirectLocation = redirectLocation; } @Override public final Builder redirectLocation(String redirectLocation) { this.redirectLocation = redirectLocation; return this; } public final Boolean getRequesterPays() { return requesterPays; } public final void setRequesterPays(Boolean requesterPays) { this.requesterPays = requesterPays; } @Override public final Builder requesterPays(Boolean requesterPays) { this.requesterPays = requesterPays; return this; } public final String getStorageClass() { return storageClass; } public final void setStorageClass(String storageClass) { this.storageClass = storageClass; } @Override public final Builder storageClass(String storageClass) { this.storageClass = storageClass; return this; } @Override public final Builder storageClass(S3StorageClass storageClass) { this.storageClass(storageClass == null ? null : storageClass.toString()); return this; } public final Instant getUnModifiedSinceConstraint() { return unModifiedSinceConstraint; } public final void setUnModifiedSinceConstraint(Instant unModifiedSinceConstraint) { this.unModifiedSinceConstraint = unModifiedSinceConstraint; } @Override public final Builder unModifiedSinceConstraint(Instant unModifiedSinceConstraint) { this.unModifiedSinceConstraint = unModifiedSinceConstraint; return this; } public final String getSseAwsKmsKeyId() { return sseAwsKmsKeyId; } public final void setSseAwsKmsKeyId(String sseAwsKmsKeyId) { this.sseAwsKmsKeyId = sseAwsKmsKeyId; } @Override public final Builder sseAwsKmsKeyId(String sseAwsKmsKeyId) { this.sseAwsKmsKeyId = sseAwsKmsKeyId; return this; } public final String getTargetKeyPrefix() { return targetKeyPrefix; } public final void setTargetKeyPrefix(String targetKeyPrefix) { this.targetKeyPrefix = targetKeyPrefix; } @Override public final Builder targetKeyPrefix(String targetKeyPrefix) { this.targetKeyPrefix = targetKeyPrefix; return this; } public final String getObjectLockLegalHoldStatus() { return objectLockLegalHoldStatus; } public final void setObjectLockLegalHoldStatus(String objectLockLegalHoldStatus) { this.objectLockLegalHoldStatus = objectLockLegalHoldStatus; } @Override public final Builder objectLockLegalHoldStatus(String objectLockLegalHoldStatus) { this.objectLockLegalHoldStatus = objectLockLegalHoldStatus; return this; } @Override public final Builder objectLockLegalHoldStatus(S3ObjectLockLegalHoldStatus objectLockLegalHoldStatus) { this.objectLockLegalHoldStatus(objectLockLegalHoldStatus == null ? null : objectLockLegalHoldStatus.toString()); return this; } public final String getObjectLockMode() { return objectLockMode; } public final void setObjectLockMode(String objectLockMode) { this.objectLockMode = objectLockMode; } @Override public final Builder objectLockMode(String objectLockMode) { this.objectLockMode = objectLockMode; return this; } @Override public final Builder objectLockMode(S3ObjectLockMode objectLockMode) { this.objectLockMode(objectLockMode == null ? null : objectLockMode.toString()); return this; } public final Instant getObjectLockRetainUntilDate() { return objectLockRetainUntilDate; } public final void setObjectLockRetainUntilDate(Instant objectLockRetainUntilDate) { this.objectLockRetainUntilDate = objectLockRetainUntilDate; } @Override public final Builder objectLockRetainUntilDate(Instant objectLockRetainUntilDate) { this.objectLockRetainUntilDate = objectLockRetainUntilDate; return this; } public final Boolean getBucketKeyEnabled() { return bucketKeyEnabled; } public final void setBucketKeyEnabled(Boolean bucketKeyEnabled) { this.bucketKeyEnabled = bucketKeyEnabled; } @Override public final Builder bucketKeyEnabled(Boolean bucketKeyEnabled) { this.bucketKeyEnabled = bucketKeyEnabled; return this; } public final String getChecksumAlgorithm() { return checksumAlgorithm; } public final void setChecksumAlgorithm(String checksumAlgorithm) { this.checksumAlgorithm = checksumAlgorithm; } @Override public final Builder checksumAlgorithm(String checksumAlgorithm) { this.checksumAlgorithm = checksumAlgorithm; return this; } @Override public final Builder checksumAlgorithm(S3ChecksumAlgorithm checksumAlgorithm) { this.checksumAlgorithm(checksumAlgorithm == null ? null : checksumAlgorithm.toString()); return this; } @Override public S3CopyObjectOperation build() { return new S3CopyObjectOperation(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy