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

software.amazon.awssdk.services.s3.model.CopyObjectRequest 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.s3.model;

import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.traits.TimestampFormatTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.services.s3.internal.TaggingAdapter;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class CopyObjectRequest extends S3Request implements ToCopyableBuilder {
    private static final SdkField ACL_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::aclAsString))
            .setter(setter(Builder::acl))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-acl")
                    .unmarshallLocationName("x-amz-acl").build()).build();

    private static final SdkField CACHE_CONTROL_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::cacheControl))
            .setter(setter(Builder::cacheControl))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Cache-Control")
                    .unmarshallLocationName("Cache-Control").build()).build();

    private static final SdkField CONTENT_DISPOSITION_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::contentDisposition))
            .setter(setter(Builder::contentDisposition))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Content-Disposition")
                    .unmarshallLocationName("Content-Disposition").build()).build();

    private static final SdkField CONTENT_ENCODING_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::contentEncoding))
            .setter(setter(Builder::contentEncoding))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Content-Encoding")
                    .unmarshallLocationName("Content-Encoding").build()).build();

    private static final SdkField CONTENT_LANGUAGE_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::contentLanguage))
            .setter(setter(Builder::contentLanguage))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Content-Language")
                    .unmarshallLocationName("Content-Language").build()).build();

    private static final SdkField CONTENT_TYPE_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::contentType))
            .setter(setter(Builder::contentType))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Content-Type")
                    .unmarshallLocationName("Content-Type").build()).build();

    private static final SdkField COPY_SOURCE_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::copySource))
            .setter(setter(Builder::copySource))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-copy-source")
                    .unmarshallLocationName("x-amz-copy-source").build()).build();

    private static final SdkField COPY_SOURCE_IF_MATCH_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::copySourceIfMatch))
            .setter(setter(Builder::copySourceIfMatch))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-copy-source-if-match")
                    .unmarshallLocationName("x-amz-copy-source-if-match").build()).build();

    private static final SdkField COPY_SOURCE_IF_MODIFIED_SINCE_FIELD = SdkField
            . builder(MarshallingType.INSTANT)
            .getter(getter(CopyObjectRequest::copySourceIfModifiedSince))
            .setter(setter(Builder::copySourceIfModifiedSince))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-copy-source-if-modified-since")
                    .unmarshallLocationName("x-amz-copy-source-if-modified-since").build()).build();

    private static final SdkField COPY_SOURCE_IF_NONE_MATCH_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::copySourceIfNoneMatch))
            .setter(setter(Builder::copySourceIfNoneMatch))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-copy-source-if-none-match")
                    .unmarshallLocationName("x-amz-copy-source-if-none-match").build()).build();

    private static final SdkField COPY_SOURCE_IF_UNMODIFIED_SINCE_FIELD = SdkField
            . builder(MarshallingType.INSTANT)
            .getter(getter(CopyObjectRequest::copySourceIfUnmodifiedSince))
            .setter(setter(Builder::copySourceIfUnmodifiedSince))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
                    .locationName("x-amz-copy-source-if-unmodified-since")
                    .unmarshallLocationName("x-amz-copy-source-if-unmodified-since").build()).build();

    private static final SdkField EXPIRES_FIELD = SdkField
            . builder(MarshallingType.INSTANT)
            .getter(getter(CopyObjectRequest::expires))
            .setter(setter(Builder::expires))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Expires")
                    .unmarshallLocationName("Expires").build()).build();

    private static final SdkField GRANT_FULL_CONTROL_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::grantFullControl))
            .setter(setter(Builder::grantFullControl))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-grant-full-control")
                    .unmarshallLocationName("x-amz-grant-full-control").build()).build();

    private static final SdkField GRANT_READ_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::grantRead))
            .setter(setter(Builder::grantRead))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-grant-read")
                    .unmarshallLocationName("x-amz-grant-read").build()).build();

    private static final SdkField GRANT_READ_ACP_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::grantReadACP))
            .setter(setter(Builder::grantReadACP))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-grant-read-acp")
                    .unmarshallLocationName("x-amz-grant-read-acp").build()).build();

    private static final SdkField GRANT_WRITE_ACP_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::grantWriteACP))
            .setter(setter(Builder::grantWriteACP))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-grant-write-acp")
                    .unmarshallLocationName("x-amz-grant-write-acp").build()).build();

    private static final SdkField> METADATA_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .getter(getter(CopyObjectRequest::metadata))
            .setter(setter(Builder::metadata))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-meta-")
                    .unmarshallLocationName("x-amz-meta-").build(),
                    MapTrait.builder()
                            .keyLocationName("key")
                            .valueLocationName("value")
                            .valueFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("value").unmarshallLocationName("value").build()).build())
                            .build()).build();

    private static final SdkField METADATA_DIRECTIVE_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::metadataDirectiveAsString))
            .setter(setter(Builder::metadataDirective))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-metadata-directive")
                    .unmarshallLocationName("x-amz-metadata-directive").build()).build();

    private static final SdkField TAGGING_DIRECTIVE_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::taggingDirectiveAsString))
            .setter(setter(Builder::taggingDirective))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-tagging-directive")
                    .unmarshallLocationName("x-amz-tagging-directive").build()).build();

    private static final SdkField SERVER_SIDE_ENCRYPTION_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::serverSideEncryptionAsString))
            .setter(setter(Builder::serverSideEncryption))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-server-side-encryption")
                    .unmarshallLocationName("x-amz-server-side-encryption").build()).build();

    private static final SdkField STORAGE_CLASS_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::storageClassAsString))
            .setter(setter(Builder::storageClass))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-storage-class")
                    .unmarshallLocationName("x-amz-storage-class").build()).build();

    private static final SdkField WEBSITE_REDIRECT_LOCATION_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::websiteRedirectLocation))
            .setter(setter(Builder::websiteRedirectLocation))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-website-redirect-location")
                    .unmarshallLocationName("x-amz-website-redirect-location").build()).build();

    private static final SdkField SSE_CUSTOMER_ALGORITHM_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::sseCustomerAlgorithm))
            .setter(setter(Builder::sseCustomerAlgorithm))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
                    .locationName("x-amz-server-side-encryption-customer-algorithm")
                    .unmarshallLocationName("x-amz-server-side-encryption-customer-algorithm").build()).build();

    private static final SdkField SSE_CUSTOMER_KEY_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::sseCustomerKey))
            .setter(setter(Builder::sseCustomerKey))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
                    .locationName("x-amz-server-side-encryption-customer-key")
                    .unmarshallLocationName("x-amz-server-side-encryption-customer-key").build()).build();

    private static final SdkField SSE_CUSTOMER_KEY_MD5_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::sseCustomerKeyMD5))
            .setter(setter(Builder::sseCustomerKeyMD5))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
                    .locationName("x-amz-server-side-encryption-customer-key-MD5")
                    .unmarshallLocationName("x-amz-server-side-encryption-customer-key-MD5").build()).build();

    private static final SdkField SSEKMS_KEY_ID_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::ssekmsKeyId))
            .setter(setter(Builder::ssekmsKeyId))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
                    .locationName("x-amz-server-side-encryption-aws-kms-key-id")
                    .unmarshallLocationName("x-amz-server-side-encryption-aws-kms-key-id").build()).build();

    private static final SdkField SSEKMS_ENCRYPTION_CONTEXT_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::ssekmsEncryptionContext))
            .setter(setter(Builder::ssekmsEncryptionContext))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
                    .locationName("x-amz-server-side-encryption-context")
                    .unmarshallLocationName("x-amz-server-side-encryption-context").build()).build();

    private static final SdkField COPY_SOURCE_SSE_CUSTOMER_ALGORITHM_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::copySourceSSECustomerAlgorithm))
            .setter(setter(Builder::copySourceSSECustomerAlgorithm))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
                    .locationName("x-amz-copy-source-server-side-encryption-customer-algorithm")
                    .unmarshallLocationName("x-amz-copy-source-server-side-encryption-customer-algorithm").build()).build();

    private static final SdkField COPY_SOURCE_SSE_CUSTOMER_KEY_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::copySourceSSECustomerKey))
            .setter(setter(Builder::copySourceSSECustomerKey))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
                    .locationName("x-amz-copy-source-server-side-encryption-customer-key")
                    .unmarshallLocationName("x-amz-copy-source-server-side-encryption-customer-key").build()).build();

    private static final SdkField COPY_SOURCE_SSE_CUSTOMER_KEY_MD5_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::copySourceSSECustomerKeyMD5))
            .setter(setter(Builder::copySourceSSECustomerKeyMD5))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
                    .locationName("x-amz-copy-source-server-side-encryption-customer-key-MD5")
                    .unmarshallLocationName("x-amz-copy-source-server-side-encryption-customer-key-MD5").build()).build();

    private static final SdkField REQUEST_PAYER_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::requestPayerAsString))
            .setter(setter(Builder::requestPayer))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-request-payer")
                    .unmarshallLocationName("x-amz-request-payer").build()).build();

    private static final SdkField TAGGING_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::tagging))
            .setter(setter(Builder::tagging))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-tagging")
                    .unmarshallLocationName("x-amz-tagging").build()).build();

    private static final SdkField OBJECT_LOCK_MODE_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::objectLockModeAsString))
            .setter(setter(Builder::objectLockMode))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-object-lock-mode")
                    .unmarshallLocationName("x-amz-object-lock-mode").build()).build();

    private static final SdkField OBJECT_LOCK_RETAIN_UNTIL_DATE_FIELD = SdkField
            . builder(MarshallingType.INSTANT)
            .getter(getter(CopyObjectRequest::objectLockRetainUntilDate))
            .setter(setter(Builder::objectLockRetainUntilDate))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-object-lock-retain-until-date")
                    .unmarshallLocationName("x-amz-object-lock-retain-until-date").build(),
                    TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();

    private static final SdkField OBJECT_LOCK_LEGAL_HOLD_STATUS_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::objectLockLegalHoldStatusAsString))
            .setter(setter(Builder::objectLockLegalHoldStatus))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-object-lock-legal-hold")
                    .unmarshallLocationName("x-amz-object-lock-legal-hold").build()).build();

    private static final SdkField DESTINATION_BUCKET_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::destinationBucket))
            .setter(setter(Builder::destinationBucket))
            .traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("Bucket")
                    .unmarshallLocationName("Bucket").build()).build();

    private static final SdkField DESTINATION_KEY_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CopyObjectRequest::destinationKey))
            .setter(setter(Builder::destinationKey))
            .traits(LocationTrait.builder().location(MarshallLocation.GREEDY_PATH).locationName("Key")
                    .unmarshallLocationName("Key").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACL_FIELD,
            CACHE_CONTROL_FIELD, CONTENT_DISPOSITION_FIELD, CONTENT_ENCODING_FIELD, CONTENT_LANGUAGE_FIELD, CONTENT_TYPE_FIELD,
            COPY_SOURCE_FIELD, COPY_SOURCE_IF_MATCH_FIELD, COPY_SOURCE_IF_MODIFIED_SINCE_FIELD, COPY_SOURCE_IF_NONE_MATCH_FIELD,
            COPY_SOURCE_IF_UNMODIFIED_SINCE_FIELD, EXPIRES_FIELD, GRANT_FULL_CONTROL_FIELD, GRANT_READ_FIELD,
            GRANT_READ_ACP_FIELD, GRANT_WRITE_ACP_FIELD, METADATA_FIELD, METADATA_DIRECTIVE_FIELD, TAGGING_DIRECTIVE_FIELD,
            SERVER_SIDE_ENCRYPTION_FIELD, STORAGE_CLASS_FIELD, WEBSITE_REDIRECT_LOCATION_FIELD, SSE_CUSTOMER_ALGORITHM_FIELD,
            SSE_CUSTOMER_KEY_FIELD, SSE_CUSTOMER_KEY_MD5_FIELD, SSEKMS_KEY_ID_FIELD, SSEKMS_ENCRYPTION_CONTEXT_FIELD,
            COPY_SOURCE_SSE_CUSTOMER_ALGORITHM_FIELD, COPY_SOURCE_SSE_CUSTOMER_KEY_FIELD, COPY_SOURCE_SSE_CUSTOMER_KEY_MD5_FIELD,
            REQUEST_PAYER_FIELD, TAGGING_FIELD, OBJECT_LOCK_MODE_FIELD, OBJECT_LOCK_RETAIN_UNTIL_DATE_FIELD,
            OBJECT_LOCK_LEGAL_HOLD_STATUS_FIELD, DESTINATION_BUCKET_FIELD, DESTINATION_KEY_FIELD));

    private final String acl;

    private final String cacheControl;

    private final String contentDisposition;

    private final String contentEncoding;

    private final String contentLanguage;

    private final String contentType;

    private final String copySource;

    private final String copySourceIfMatch;

    private final Instant copySourceIfModifiedSince;

    private final String copySourceIfNoneMatch;

    private final Instant copySourceIfUnmodifiedSince;

    private final Instant expires;

    private final String grantFullControl;

    private final String grantRead;

    private final String grantReadACP;

    private final String grantWriteACP;

    private final Map metadata;

    private final String metadataDirective;

    private final String taggingDirective;

    private final String serverSideEncryption;

    private final String storageClass;

    private final String websiteRedirectLocation;

    private final String sseCustomerAlgorithm;

    private final String sseCustomerKey;

    private final String sseCustomerKeyMD5;

    private final String ssekmsKeyId;

    private final String ssekmsEncryptionContext;

    private final String copySourceSSECustomerAlgorithm;

    private final String copySourceSSECustomerKey;

    private final String copySourceSSECustomerKeyMD5;

    private final String requestPayer;

    private final String tagging;

    private final String objectLockMode;

    private final Instant objectLockRetainUntilDate;

    private final String objectLockLegalHoldStatus;

    private final String destinationBucket;

    private final String destinationKey;

    private CopyObjectRequest(BuilderImpl builder) {
        super(builder);
        this.acl = builder.acl;
        this.cacheControl = builder.cacheControl;
        this.contentDisposition = builder.contentDisposition;
        this.contentEncoding = builder.contentEncoding;
        this.contentLanguage = builder.contentLanguage;
        this.contentType = builder.contentType;
        this.copySource = builder.copySource;
        this.copySourceIfMatch = builder.copySourceIfMatch;
        this.copySourceIfModifiedSince = builder.copySourceIfModifiedSince;
        this.copySourceIfNoneMatch = builder.copySourceIfNoneMatch;
        this.copySourceIfUnmodifiedSince = builder.copySourceIfUnmodifiedSince;
        this.expires = builder.expires;
        this.grantFullControl = builder.grantFullControl;
        this.grantRead = builder.grantRead;
        this.grantReadACP = builder.grantReadACP;
        this.grantWriteACP = builder.grantWriteACP;
        this.metadata = builder.metadata;
        this.metadataDirective = builder.metadataDirective;
        this.taggingDirective = builder.taggingDirective;
        this.serverSideEncryption = builder.serverSideEncryption;
        this.storageClass = builder.storageClass;
        this.websiteRedirectLocation = builder.websiteRedirectLocation;
        this.sseCustomerAlgorithm = builder.sseCustomerAlgorithm;
        this.sseCustomerKey = builder.sseCustomerKey;
        this.sseCustomerKeyMD5 = builder.sseCustomerKeyMD5;
        this.ssekmsKeyId = builder.ssekmsKeyId;
        this.ssekmsEncryptionContext = builder.ssekmsEncryptionContext;
        this.copySourceSSECustomerAlgorithm = builder.copySourceSSECustomerAlgorithm;
        this.copySourceSSECustomerKey = builder.copySourceSSECustomerKey;
        this.copySourceSSECustomerKeyMD5 = builder.copySourceSSECustomerKeyMD5;
        this.requestPayer = builder.requestPayer;
        this.tagging = builder.tagging;
        this.objectLockMode = builder.objectLockMode;
        this.objectLockRetainUntilDate = builder.objectLockRetainUntilDate;
        this.objectLockLegalHoldStatus = builder.objectLockLegalHoldStatus;
        this.destinationBucket = builder.destinationBucket;
        this.destinationKey = builder.destinationKey;
    }

    /**
     * 

* The canned ACL to apply to the object. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #acl} will return * {@link ObjectCannedACL#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #aclAsString}. *

* * @return The canned ACL to apply to the object. * @see ObjectCannedACL */ public ObjectCannedACL acl() { return ObjectCannedACL.fromValue(acl); } /** *

* The canned ACL to apply to the object. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #acl} will return * {@link ObjectCannedACL#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #aclAsString}. *

* * @return The canned ACL to apply to the object. * @see ObjectCannedACL */ public String aclAsString() { return acl; } /** *

* Specifies caching behavior along the request/reply chain. *

* * @return Specifies caching behavior along the request/reply chain. */ public String cacheControl() { return cacheControl; } /** *

* Specifies presentational information for the object. *

* * @return Specifies presentational information for the object. */ public String contentDisposition() { return contentDisposition; } /** *

* Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be * applied to obtain the media-type referenced by the Content-Type header field. *

* * @return Specifies what content encodings have been applied to the object and thus what decoding mechanisms must * be applied to obtain the media-type referenced by the Content-Type header field. */ public String contentEncoding() { return contentEncoding; } /** *

* The language the content is in. *

* * @return The language the content is in. */ public String contentLanguage() { return contentLanguage; } /** *

* A standard MIME type describing the format of the object data. *

* * @return A standard MIME type describing the format of the object data. */ public String contentType() { return contentType; } /** *

* The name of the source bucket and key name of the source object, separated by a slash (/). Must be URL-encoded. *

* * @return The name of the source bucket and key name of the source object, separated by a slash (/). Must be * URL-encoded. */ public String copySource() { return copySource; } /** *

* Copies the object if its entity tag (ETag) matches the specified tag. *

* * @return Copies the object if its entity tag (ETag) matches the specified tag. */ public String copySourceIfMatch() { return copySourceIfMatch; } /** *

* Copies the object if it has been modified since the specified time. *

* * @return Copies the object if it has been modified since the specified time. */ public Instant copySourceIfModifiedSince() { return copySourceIfModifiedSince; } /** *

* Copies the object if its entity tag (ETag) is different than the specified ETag. *

* * @return Copies the object if its entity tag (ETag) is different than the specified ETag. */ public String copySourceIfNoneMatch() { return copySourceIfNoneMatch; } /** *

* Copies the object if it hasn't been modified since the specified time. *

* * @return Copies the object if it hasn't been modified since the specified time. */ public Instant copySourceIfUnmodifiedSince() { return copySourceIfUnmodifiedSince; } /** *

* The date and time at which the object is no longer cacheable. *

* * @return The date and time at which the object is no longer cacheable. */ public Instant expires() { return expires; } /** *

* Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. *

* * @return Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. */ public String grantFullControl() { return grantFullControl; } /** *

* Allows grantee to read the object data and its metadata. *

* * @return Allows grantee to read the object data and its metadata. */ public String grantRead() { return grantRead; } /** *

* Allows grantee to read the object ACL. *

* * @return Allows grantee to read the object ACL. */ public String grantReadACP() { return grantReadACP; } /** *

* Allows grantee to write the ACL for the applicable object. *

* * @return Allows grantee to write the ACL for the applicable object. */ public String grantWriteACP() { return grantWriteACP; } /** * Returns true if the Metadata property was specified by the sender (it may be empty), or false if the sender did * not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service. */ public boolean hasMetadata() { return metadata != null && !(metadata instanceof SdkAutoConstructMap); } /** *

* A map of metadata to store with the object in S3. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasMetadata()} to see if a value was sent in this field. *

* * @return A map of metadata to store with the object in S3. */ public Map metadata() { return metadata; } /** *

* Specifies whether the metadata is copied from the source object or replaced with metadata provided in the * request. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #metadataDirective} * will return {@link MetadataDirective#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #metadataDirectiveAsString}. *

* * @return Specifies whether the metadata is copied from the source object or replaced with metadata provided in the * request. * @see MetadataDirective */ public MetadataDirective metadataDirective() { return MetadataDirective.fromValue(metadataDirective); } /** *

* Specifies whether the metadata is copied from the source object or replaced with metadata provided in the * request. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #metadataDirective} * will return {@link MetadataDirective#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #metadataDirectiveAsString}. *

* * @return Specifies whether the metadata is copied from the source object or replaced with metadata provided in the * request. * @see MetadataDirective */ public String metadataDirectiveAsString() { return metadataDirective; } /** *

* Specifies whether the object tag-set are copied from the source object or replaced with tag-set provided in the * request. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #taggingDirective} * will return {@link TaggingDirective#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #taggingDirectiveAsString}. *

* * @return Specifies whether the object tag-set are copied from the source object or replaced with tag-set provided * in the request. * @see TaggingDirective */ public TaggingDirective taggingDirective() { return TaggingDirective.fromValue(taggingDirective); } /** *

* Specifies whether the object tag-set are copied from the source object or replaced with tag-set provided in the * request. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #taggingDirective} * will return {@link TaggingDirective#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #taggingDirectiveAsString}. *

* * @return Specifies whether the object tag-set are copied from the source object or replaced with tag-set provided * in the request. * @see TaggingDirective */ public String taggingDirectiveAsString() { return taggingDirective; } /** *

* The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms). *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #serverSideEncryption} will return {@link ServerSideEncryption#UNKNOWN_TO_SDK_VERSION}. The raw value * returned by the service is available from {@link #serverSideEncryptionAsString}. *

* * @return The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, * aws:kms). * @see ServerSideEncryption */ public ServerSideEncryption serverSideEncryption() { return ServerSideEncryption.fromValue(serverSideEncryption); } /** *

* The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms). *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #serverSideEncryption} will return {@link ServerSideEncryption#UNKNOWN_TO_SDK_VERSION}. The raw value * returned by the service is available from {@link #serverSideEncryptionAsString}. *

* * @return The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, * aws:kms). * @see ServerSideEncryption */ public String serverSideEncryptionAsString() { return serverSideEncryption; } /** *

* The type of storage to use for the object. Defaults to 'STANDARD'. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #storageClass} will * return {@link StorageClass#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #storageClassAsString}. *

* * @return The type of storage to use for the object. Defaults to 'STANDARD'. * @see StorageClass */ public StorageClass storageClass() { return StorageClass.fromValue(storageClass); } /** *

* The type of storage to use for the object. Defaults to 'STANDARD'. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #storageClass} will * return {@link StorageClass#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #storageClassAsString}. *

* * @return The type of storage to use for the object. Defaults to 'STANDARD'. * @see StorageClass */ public String storageClassAsString() { return storageClass; } /** *

* If the bucket is configured as a website, redirects requests for this object to another object in the same bucket * or to an external URL. Amazon S3 stores the value of this header in the object metadata. *

* * @return If the bucket is configured as a website, redirects requests for this object to another object in the * same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata. */ public String websiteRedirectLocation() { return websiteRedirectLocation; } /** *

* Specifies the algorithm to use to when encrypting the object (for example, AES256). *

* * @return Specifies the algorithm to use to when encrypting the object (for example, AES256). */ public String sseCustomerAlgorithm() { return sseCustomerAlgorithm; } /** *

* Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to * store the object and then it is discarded; Amazon S3 does not store the encryption key. The key must be * appropriate for use with the algorithm specified in the * x-amz-server-side​-encryption​-customer-algorithm header. *

* * @return Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is * used to store the object and then it is discarded; Amazon S3 does not store the encryption key. The key * must be appropriate for use with the algorithm specified in the * x-amz-server-side​-encryption​-customer-algorithm header. */ public String sseCustomerKey() { return sseCustomerKey; } /** *

* Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a * message integrity check to ensure that the encryption key was transmitted without error. *

* * @return Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header * for a message integrity check to ensure that the encryption key was transmitted without error. */ public String sseCustomerKeyMD5() { return sseCustomerKeyMD5; } /** *

* Specifies the AWS KMS key ID to use for object encryption. All GET and PUT requests for an object protected by * AWS KMS will fail if not made via SSL or using SigV4. For information about configuring using any of the * officially supported AWS SDKs and AWS CLI, see Specifying the * Signature Version in Request Authentication in the Amazon S3 Developer Guide. *

* * @return Specifies the AWS KMS key ID to use for object encryption. All GET and PUT requests for an object * protected by AWS KMS will fail if not made via SSL or using SigV4. For information about configuring * using any of the officially supported AWS SDKs and AWS CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 Developer Guide. */ public String ssekmsKeyId() { return ssekmsKeyId; } /** *

* Specifies the AWS KMS Encryption Context to use for object encryption. The value of this header is a * base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. *

* * @return Specifies the AWS KMS Encryption Context to use for object encryption. The value of this header is a * base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. */ public String ssekmsEncryptionContext() { return ssekmsEncryptionContext; } /** *

* Specifies the algorithm to use when decrypting the source object (for example, AES256). *

* * @return Specifies the algorithm to use when decrypting the source object (for example, AES256). */ public String copySourceSSECustomerAlgorithm() { return copySourceSSECustomerAlgorithm; } /** *

* Specifies the customer-provided encryption key for Amazon S3 to use to decrypt the source object. The encryption * key provided in this header must be one that was used when the source object was created. *

* * @return Specifies the customer-provided encryption key for Amazon S3 to use to decrypt the source object. The * encryption key provided in this header must be one that was used when the source object was created. */ public String copySourceSSECustomerKey() { return copySourceSSECustomerKey; } /** *

* Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a * message integrity check to ensure that the encryption key was transmitted without error. *

* * @return Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header * for a message integrity check to ensure that the encryption key was transmitted without error. */ public String copySourceSSECustomerKeyMD5() { return copySourceSSECustomerKeyMD5; } /** * Returns the value of the RequestPayer property for this object. *

* If the service returns an enum value that is not available in the current SDK version, {@link #requestPayer} will * return {@link RequestPayer#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #requestPayerAsString}. *

* * @return The value of the RequestPayer property for this object. * @see RequestPayer */ public RequestPayer requestPayer() { return RequestPayer.fromValue(requestPayer); } /** * Returns the value of the RequestPayer property for this object. *

* If the service returns an enum value that is not available in the current SDK version, {@link #requestPayer} will * return {@link RequestPayer#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #requestPayerAsString}. *

* * @return The value of the RequestPayer property for this object. * @see RequestPayer */ public String requestPayerAsString() { return requestPayer; } /** *

* The tag-set for the object destination object this value must be used in conjunction with the * TaggingDirective. The tag-set must be encoded as URL Query parameters. *

* * @return The tag-set for the object destination object this value must be used in conjunction with the * TaggingDirective. The tag-set must be encoded as URL Query parameters. */ public String tagging() { return tagging; } /** *

* The Object Lock mode that you want to apply to the copied object. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #objectLockMode} * will return {@link ObjectLockMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #objectLockModeAsString}. *

* * @return The Object Lock mode that you want to apply to the copied object. * @see ObjectLockMode */ public ObjectLockMode objectLockMode() { return ObjectLockMode.fromValue(objectLockMode); } /** *

* The Object Lock mode that you want to apply to the copied object. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #objectLockMode} * will return {@link ObjectLockMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #objectLockModeAsString}. *

* * @return The Object Lock mode that you want to apply to the copied object. * @see ObjectLockMode */ public String objectLockModeAsString() { return objectLockMode; } /** *

* The date and time when you want the copied object's Object Lock to expire. *

* * @return The date and time when you want the copied object's Object Lock to expire. */ public Instant objectLockRetainUntilDate() { return objectLockRetainUntilDate; } /** *

* Specifies whether you want to apply a Legal Hold to the copied object. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #objectLockLegalHoldStatus} will return {@link ObjectLockLegalHoldStatus#UNKNOWN_TO_SDK_VERSION}. The raw * value returned by the service is available from {@link #objectLockLegalHoldStatusAsString}. *

* * @return Specifies whether you want to apply a Legal Hold to the copied object. * @see ObjectLockLegalHoldStatus */ public ObjectLockLegalHoldStatus objectLockLegalHoldStatus() { return ObjectLockLegalHoldStatus.fromValue(objectLockLegalHoldStatus); } /** *

* Specifies whether you want to apply a Legal Hold to the copied object. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #objectLockLegalHoldStatus} will return {@link ObjectLockLegalHoldStatus#UNKNOWN_TO_SDK_VERSION}. The raw * value returned by the service is available from {@link #objectLockLegalHoldStatusAsString}. *

* * @return Specifies whether you want to apply a Legal Hold to the copied object. * @see ObjectLockLegalHoldStatus */ public String objectLockLegalHoldStatusAsString() { return objectLockLegalHoldStatus; } /** *

* The name of the destination bucket. *

* * @return The name of the destination bucket. * @deprecated Use {@link #destinationBucket()} */ @Deprecated public String bucket() { return destinationBucket; } /** *

* The name of the destination bucket. *

* * @return The name of the destination bucket. */ public String destinationBucket() { return destinationBucket; } /** *

* The key of the destination object. *

* * @return The key of the destination object. * @deprecated Use {@link #destinationKey()} */ @Deprecated public String key() { return destinationKey; } /** *

* The key of the destination object. *

* * @return The key of the destination object. */ public String destinationKey() { return destinationKey; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(aclAsString()); hashCode = 31 * hashCode + Objects.hashCode(cacheControl()); hashCode = 31 * hashCode + Objects.hashCode(contentDisposition()); hashCode = 31 * hashCode + Objects.hashCode(contentEncoding()); hashCode = 31 * hashCode + Objects.hashCode(contentLanguage()); hashCode = 31 * hashCode + Objects.hashCode(contentType()); hashCode = 31 * hashCode + Objects.hashCode(copySource()); hashCode = 31 * hashCode + Objects.hashCode(copySourceIfMatch()); hashCode = 31 * hashCode + Objects.hashCode(copySourceIfModifiedSince()); hashCode = 31 * hashCode + Objects.hashCode(copySourceIfNoneMatch()); hashCode = 31 * hashCode + Objects.hashCode(copySourceIfUnmodifiedSince()); hashCode = 31 * hashCode + Objects.hashCode(expires()); hashCode = 31 * hashCode + Objects.hashCode(grantFullControl()); hashCode = 31 * hashCode + Objects.hashCode(grantRead()); hashCode = 31 * hashCode + Objects.hashCode(grantReadACP()); hashCode = 31 * hashCode + Objects.hashCode(grantWriteACP()); hashCode = 31 * hashCode + Objects.hashCode(metadata()); hashCode = 31 * hashCode + Objects.hashCode(metadataDirectiveAsString()); hashCode = 31 * hashCode + Objects.hashCode(taggingDirectiveAsString()); hashCode = 31 * hashCode + Objects.hashCode(serverSideEncryptionAsString()); hashCode = 31 * hashCode + Objects.hashCode(storageClassAsString()); hashCode = 31 * hashCode + Objects.hashCode(websiteRedirectLocation()); hashCode = 31 * hashCode + Objects.hashCode(sseCustomerAlgorithm()); hashCode = 31 * hashCode + Objects.hashCode(sseCustomerKey()); hashCode = 31 * hashCode + Objects.hashCode(sseCustomerKeyMD5()); hashCode = 31 * hashCode + Objects.hashCode(ssekmsKeyId()); hashCode = 31 * hashCode + Objects.hashCode(ssekmsEncryptionContext()); hashCode = 31 * hashCode + Objects.hashCode(copySourceSSECustomerAlgorithm()); hashCode = 31 * hashCode + Objects.hashCode(copySourceSSECustomerKey()); hashCode = 31 * hashCode + Objects.hashCode(copySourceSSECustomerKeyMD5()); hashCode = 31 * hashCode + Objects.hashCode(requestPayerAsString()); hashCode = 31 * hashCode + Objects.hashCode(tagging()); hashCode = 31 * hashCode + Objects.hashCode(objectLockModeAsString()); hashCode = 31 * hashCode + Objects.hashCode(objectLockRetainUntilDate()); hashCode = 31 * hashCode + Objects.hashCode(objectLockLegalHoldStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(destinationBucket()); hashCode = 31 * hashCode + Objects.hashCode(destinationKey()); return hashCode; } @Override public boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CopyObjectRequest)) { return false; } CopyObjectRequest other = (CopyObjectRequest) obj; return Objects.equals(aclAsString(), other.aclAsString()) && Objects.equals(cacheControl(), other.cacheControl()) && Objects.equals(contentDisposition(), other.contentDisposition()) && Objects.equals(contentEncoding(), other.contentEncoding()) && Objects.equals(contentLanguage(), other.contentLanguage()) && Objects.equals(contentType(), other.contentType()) && Objects.equals(copySource(), other.copySource()) && Objects.equals(copySourceIfMatch(), other.copySourceIfMatch()) && Objects.equals(copySourceIfModifiedSince(), other.copySourceIfModifiedSince()) && Objects.equals(copySourceIfNoneMatch(), other.copySourceIfNoneMatch()) && Objects.equals(copySourceIfUnmodifiedSince(), other.copySourceIfUnmodifiedSince()) && Objects.equals(expires(), other.expires()) && Objects.equals(grantFullControl(), other.grantFullControl()) && Objects.equals(grantRead(), other.grantRead()) && Objects.equals(grantReadACP(), other.grantReadACP()) && Objects.equals(grantWriteACP(), other.grantWriteACP()) && Objects.equals(metadata(), other.metadata()) && Objects.equals(metadataDirectiveAsString(), other.metadataDirectiveAsString()) && Objects.equals(taggingDirectiveAsString(), other.taggingDirectiveAsString()) && Objects.equals(serverSideEncryptionAsString(), other.serverSideEncryptionAsString()) && Objects.equals(storageClassAsString(), other.storageClassAsString()) && Objects.equals(websiteRedirectLocation(), other.websiteRedirectLocation()) && Objects.equals(sseCustomerAlgorithm(), other.sseCustomerAlgorithm()) && Objects.equals(sseCustomerKey(), other.sseCustomerKey()) && Objects.equals(sseCustomerKeyMD5(), other.sseCustomerKeyMD5()) && Objects.equals(ssekmsKeyId(), other.ssekmsKeyId()) && Objects.equals(ssekmsEncryptionContext(), other.ssekmsEncryptionContext()) && Objects.equals(copySourceSSECustomerAlgorithm(), other.copySourceSSECustomerAlgorithm()) && Objects.equals(copySourceSSECustomerKey(), other.copySourceSSECustomerKey()) && Objects.equals(copySourceSSECustomerKeyMD5(), other.copySourceSSECustomerKeyMD5()) && Objects.equals(requestPayerAsString(), other.requestPayerAsString()) && Objects.equals(tagging(), other.tagging()) && Objects.equals(objectLockModeAsString(), other.objectLockModeAsString()) && Objects.equals(objectLockRetainUntilDate(), other.objectLockRetainUntilDate()) && Objects.equals(objectLockLegalHoldStatusAsString(), other.objectLockLegalHoldStatusAsString()) && Objects.equals(destinationBucket(), other.destinationBucket()) && Objects.equals(destinationKey(), other.destinationKey()); } /** * 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 String toString() { return ToString.builder("CopyObjectRequest").add("ACL", aclAsString()).add("CacheControl", cacheControl()) .add("ContentDisposition", contentDisposition()).add("ContentEncoding", contentEncoding()) .add("ContentLanguage", contentLanguage()).add("ContentType", contentType()).add("CopySource", copySource()) .add("CopySourceIfMatch", copySourceIfMatch()).add("CopySourceIfModifiedSince", copySourceIfModifiedSince()) .add("CopySourceIfNoneMatch", copySourceIfNoneMatch()) .add("CopySourceIfUnmodifiedSince", copySourceIfUnmodifiedSince()).add("Expires", expires()) .add("GrantFullControl", grantFullControl()).add("GrantRead", grantRead()).add("GrantReadACP", grantReadACP()) .add("GrantWriteACP", grantWriteACP()).add("Metadata", metadata()) .add("MetadataDirective", metadataDirectiveAsString()).add("TaggingDirective", taggingDirectiveAsString()) .add("ServerSideEncryption", serverSideEncryptionAsString()).add("StorageClass", storageClassAsString()) .add("WebsiteRedirectLocation", websiteRedirectLocation()).add("SSECustomerAlgorithm", sseCustomerAlgorithm()) .add("SSECustomerKey", sseCustomerKey() == null ? null : "*** Sensitive Data Redacted ***") .add("SSECustomerKeyMD5", sseCustomerKeyMD5()) .add("SSEKMSKeyId", ssekmsKeyId() == null ? null : "*** Sensitive Data Redacted ***") .add("SSEKMSEncryptionContext", ssekmsEncryptionContext() == null ? null : "*** Sensitive Data Redacted ***") .add("CopySourceSSECustomerAlgorithm", copySourceSSECustomerAlgorithm()) .add("CopySourceSSECustomerKey", copySourceSSECustomerKey() == null ? null : "*** Sensitive Data Redacted ***") .add("CopySourceSSECustomerKeyMD5", copySourceSSECustomerKeyMD5()).add("RequestPayer", requestPayerAsString()) .add("Tagging", tagging()).add("ObjectLockMode", objectLockModeAsString()) .add("ObjectLockRetainUntilDate", objectLockRetainUntilDate()) .add("ObjectLockLegalHoldStatus", objectLockLegalHoldStatusAsString()) .add("DestinationBucket", destinationBucket()).add("DestinationKey", destinationKey()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ACL": return Optional.ofNullable(clazz.cast(aclAsString())); case "CacheControl": return Optional.ofNullable(clazz.cast(cacheControl())); case "ContentDisposition": return Optional.ofNullable(clazz.cast(contentDisposition())); case "ContentEncoding": return Optional.ofNullable(clazz.cast(contentEncoding())); case "ContentLanguage": return Optional.ofNullable(clazz.cast(contentLanguage())); case "ContentType": return Optional.ofNullable(clazz.cast(contentType())); case "CopySource": return Optional.ofNullable(clazz.cast(copySource())); case "CopySourceIfMatch": return Optional.ofNullable(clazz.cast(copySourceIfMatch())); case "CopySourceIfModifiedSince": return Optional.ofNullable(clazz.cast(copySourceIfModifiedSince())); case "CopySourceIfNoneMatch": return Optional.ofNullable(clazz.cast(copySourceIfNoneMatch())); case "CopySourceIfUnmodifiedSince": return Optional.ofNullable(clazz.cast(copySourceIfUnmodifiedSince())); case "Expires": return Optional.ofNullable(clazz.cast(expires())); case "GrantFullControl": return Optional.ofNullable(clazz.cast(grantFullControl())); case "GrantRead": return Optional.ofNullable(clazz.cast(grantRead())); case "GrantReadACP": return Optional.ofNullable(clazz.cast(grantReadACP())); case "GrantWriteACP": return Optional.ofNullable(clazz.cast(grantWriteACP())); case "Metadata": return Optional.ofNullable(clazz.cast(metadata())); case "MetadataDirective": return Optional.ofNullable(clazz.cast(metadataDirectiveAsString())); case "TaggingDirective": return Optional.ofNullable(clazz.cast(taggingDirectiveAsString())); case "ServerSideEncryption": return Optional.ofNullable(clazz.cast(serverSideEncryptionAsString())); case "StorageClass": return Optional.ofNullable(clazz.cast(storageClassAsString())); case "WebsiteRedirectLocation": return Optional.ofNullable(clazz.cast(websiteRedirectLocation())); case "SSECustomerAlgorithm": return Optional.ofNullable(clazz.cast(sseCustomerAlgorithm())); case "SSECustomerKey": return Optional.ofNullable(clazz.cast(sseCustomerKey())); case "SSECustomerKeyMD5": return Optional.ofNullable(clazz.cast(sseCustomerKeyMD5())); case "SSEKMSKeyId": return Optional.ofNullable(clazz.cast(ssekmsKeyId())); case "SSEKMSEncryptionContext": return Optional.ofNullable(clazz.cast(ssekmsEncryptionContext())); case "CopySourceSSECustomerAlgorithm": return Optional.ofNullable(clazz.cast(copySourceSSECustomerAlgorithm())); case "CopySourceSSECustomerKey": return Optional.ofNullable(clazz.cast(copySourceSSECustomerKey())); case "CopySourceSSECustomerKeyMD5": return Optional.ofNullable(clazz.cast(copySourceSSECustomerKeyMD5())); case "RequestPayer": return Optional.ofNullable(clazz.cast(requestPayerAsString())); case "Tagging": return Optional.ofNullable(clazz.cast(tagging())); case "ObjectLockMode": return Optional.ofNullable(clazz.cast(objectLockModeAsString())); case "ObjectLockRetainUntilDate": return Optional.ofNullable(clazz.cast(objectLockRetainUntilDate())); case "ObjectLockLegalHoldStatus": return Optional.ofNullable(clazz.cast(objectLockLegalHoldStatusAsString())); case "DestinationBucket": return Optional.ofNullable(clazz.cast(destinationBucket())); case "Bucket": return Optional.ofNullable(clazz.cast(destinationBucket())); case "DestinationKey": return Optional.ofNullable(clazz.cast(destinationKey())); case "Key": return Optional.ofNullable(clazz.cast(destinationKey())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CopyObjectRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends S3Request.Builder, SdkPojo, CopyableBuilder { /** *

* The canned ACL to apply to the object. *

* * @param acl * The canned ACL to apply to the object. * @see ObjectCannedACL * @return Returns a reference to this object so that method calls can be chained together. * @see ObjectCannedACL */ Builder acl(String acl); /** *

* The canned ACL to apply to the object. *

* * @param acl * The canned ACL to apply to the object. * @see ObjectCannedACL * @return Returns a reference to this object so that method calls can be chained together. * @see ObjectCannedACL */ Builder acl(ObjectCannedACL acl); /** *

* Specifies caching behavior along the request/reply chain. *

* * @param cacheControl * Specifies caching behavior along the request/reply chain. * @return Returns a reference to this object so that method calls can be chained together. */ Builder cacheControl(String cacheControl); /** *

* Specifies presentational information for the object. *

* * @param contentDisposition * Specifies presentational information for the object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder contentDisposition(String contentDisposition); /** *

* Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be * applied to obtain the media-type referenced by the Content-Type header field. *

* * @param contentEncoding * Specifies what content encodings have been applied to the object and thus what decoding mechanisms * must be applied to obtain the media-type referenced by the Content-Type header field. * @return Returns a reference to this object so that method calls can be chained together. */ Builder contentEncoding(String contentEncoding); /** *

* The language the content is in. *

* * @param contentLanguage * The language the content is in. * @return Returns a reference to this object so that method calls can be chained together. */ Builder contentLanguage(String contentLanguage); /** *

* A standard MIME type describing the format of the object data. *

* * @param contentType * A standard MIME type describing the format of the object data. * @return Returns a reference to this object so that method calls can be chained together. */ Builder contentType(String contentType); /** *

* The name of the source bucket and key name of the source object, separated by a slash (/). Must be * URL-encoded. *

* * @param copySource * The name of the source bucket and key name of the source object, separated by a slash (/). Must be * URL-encoded. * @return Returns a reference to this object so that method calls can be chained together. */ Builder copySource(String copySource); /** *

* Copies the object if its entity tag (ETag) matches the specified tag. *

* * @param copySourceIfMatch * Copies the object if its entity tag (ETag) matches the specified tag. * @return Returns a reference to this object so that method calls can be chained together. */ Builder copySourceIfMatch(String copySourceIfMatch); /** *

* Copies the object if it has been modified since the specified time. *

* * @param copySourceIfModifiedSince * Copies the object if it has been modified since the specified time. * @return Returns a reference to this object so that method calls can be chained together. */ Builder copySourceIfModifiedSince(Instant copySourceIfModifiedSince); /** *

* Copies the object if its entity tag (ETag) is different than the specified ETag. *

* * @param copySourceIfNoneMatch * Copies the object if its entity tag (ETag) is different than the specified ETag. * @return Returns a reference to this object so that method calls can be chained together. */ Builder copySourceIfNoneMatch(String copySourceIfNoneMatch); /** *

* Copies the object if it hasn't been modified since the specified time. *

* * @param copySourceIfUnmodifiedSince * Copies the object if it hasn't been modified since the specified time. * @return Returns a reference to this object so that method calls can be chained together. */ Builder copySourceIfUnmodifiedSince(Instant copySourceIfUnmodifiedSince); /** *

* The date and time at which the object is no longer cacheable. *

* * @param expires * The date and time at which the object is no longer cacheable. * @return Returns a reference to this object so that method calls can be chained together. */ Builder expires(Instant expires); /** *

* Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. *

* * @param grantFullControl * Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder grantFullControl(String grantFullControl); /** *

* Allows grantee to read the object data and its metadata. *

* * @param grantRead * Allows grantee to read the object data and its metadata. * @return Returns a reference to this object so that method calls can be chained together. */ Builder grantRead(String grantRead); /** *

* Allows grantee to read the object ACL. *

* * @param grantReadACP * Allows grantee to read the object ACL. * @return Returns a reference to this object so that method calls can be chained together. */ Builder grantReadACP(String grantReadACP); /** *

* Allows grantee to write the ACL for the applicable object. *

* * @param grantWriteACP * Allows grantee to write the ACL for the applicable object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder grantWriteACP(String grantWriteACP); /** *

* A map of metadata to store with the object in S3. *

* * @param metadata * A map of metadata to store with the object in S3. * @return Returns a reference to this object so that method calls can be chained together. */ Builder metadata(Map metadata); /** *

* Specifies whether the metadata is copied from the source object or replaced with metadata provided in the * request. *

* * @param metadataDirective * Specifies whether the metadata is copied from the source object or replaced with metadata provided in * the request. * @see MetadataDirective * @return Returns a reference to this object so that method calls can be chained together. * @see MetadataDirective */ Builder metadataDirective(String metadataDirective); /** *

* Specifies whether the metadata is copied from the source object or replaced with metadata provided in the * request. *

* * @param metadataDirective * Specifies whether the metadata is copied from the source object or replaced with metadata provided in * the request. * @see MetadataDirective * @return Returns a reference to this object so that method calls can be chained together. * @see MetadataDirective */ Builder metadataDirective(MetadataDirective metadataDirective); /** *

* Specifies whether the object tag-set are copied from the source object or replaced with tag-set provided in * the request. *

* * @param taggingDirective * Specifies whether the object tag-set are copied from the source object or replaced with tag-set * provided in the request. * @see TaggingDirective * @return Returns a reference to this object so that method calls can be chained together. * @see TaggingDirective */ Builder taggingDirective(String taggingDirective); /** *

* Specifies whether the object tag-set are copied from the source object or replaced with tag-set provided in * the request. *

* * @param taggingDirective * Specifies whether the object tag-set are copied from the source object or replaced with tag-set * provided in the request. * @see TaggingDirective * @return Returns a reference to this object so that method calls can be chained together. * @see TaggingDirective */ Builder taggingDirective(TaggingDirective taggingDirective); /** *

* The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, * aws:kms). *

* * @param serverSideEncryption * The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, * aws:kms). * @see ServerSideEncryption * @return Returns a reference to this object so that method calls can be chained together. * @see ServerSideEncryption */ Builder serverSideEncryption(String serverSideEncryption); /** *

* The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, * aws:kms). *

* * @param serverSideEncryption * The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, * aws:kms). * @see ServerSideEncryption * @return Returns a reference to this object so that method calls can be chained together. * @see ServerSideEncryption */ Builder serverSideEncryption(ServerSideEncryption serverSideEncryption); /** *

* The type of storage to use for the object. Defaults to 'STANDARD'. *

* * @param storageClass * The type of storage to use for the object. Defaults to 'STANDARD'. * @see StorageClass * @return Returns a reference to this object so that method calls can be chained together. * @see StorageClass */ Builder storageClass(String storageClass); /** *

* The type of storage to use for the object. Defaults to 'STANDARD'. *

* * @param storageClass * The type of storage to use for the object. Defaults to 'STANDARD'. * @see StorageClass * @return Returns a reference to this object so that method calls can be chained together. * @see StorageClass */ Builder storageClass(StorageClass storageClass); /** *

* If the bucket is configured as a website, redirects requests for this object to another object in the same * bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata. *

* * @param websiteRedirectLocation * If the bucket is configured as a website, redirects requests for this object to another object in the * same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata. * @return Returns a reference to this object so that method calls can be chained together. */ Builder websiteRedirectLocation(String websiteRedirectLocation); /** *

* Specifies the algorithm to use to when encrypting the object (for example, AES256). *

* * @param sseCustomerAlgorithm * Specifies the algorithm to use to when encrypting the object (for example, AES256). * @return Returns a reference to this object so that method calls can be chained together. */ Builder sseCustomerAlgorithm(String sseCustomerAlgorithm); /** *

* Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to * store the object and then it is discarded; Amazon S3 does not store the encryption key. The key must be * appropriate for use with the algorithm specified in the * x-amz-server-side​-encryption​-customer-algorithm header. *

* * @param sseCustomerKey * Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is * used to store the object and then it is discarded; Amazon S3 does not store the encryption key. The * key must be appropriate for use with the algorithm specified in the * x-amz-server-side​-encryption​-customer-algorithm header. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sseCustomerKey(String sseCustomerKey); /** *

* Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for * a message integrity check to ensure that the encryption key was transmitted without error. *

* * @param sseCustomerKeyMD5 * Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this * header for a message integrity check to ensure that the encryption key was transmitted without error. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sseCustomerKeyMD5(String sseCustomerKeyMD5); /** *

* Specifies the AWS KMS key ID to use for object encryption. All GET and PUT requests for an object protected * by AWS KMS will fail if not made via SSL or using SigV4. For information about configuring using any of the * officially supported AWS SDKs and AWS CLI, see Specifying * the Signature Version in Request Authentication in the Amazon S3 Developer Guide. *

* * @param ssekmsKeyId * Specifies the AWS KMS key ID to use for object encryption. All GET and PUT requests for an object * protected by AWS KMS will fail if not made via SSL or using SigV4. For information about configuring * using any of the officially supported AWS SDKs and AWS CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 Developer * Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ssekmsKeyId(String ssekmsKeyId); /** *

* Specifies the AWS KMS Encryption Context to use for object encryption. The value of this header is a * base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. *

* * @param ssekmsEncryptionContext * Specifies the AWS KMS Encryption Context to use for object encryption. The value of this header is a * base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ssekmsEncryptionContext(String ssekmsEncryptionContext); /** *

* Specifies the algorithm to use when decrypting the source object (for example, AES256). *

* * @param copySourceSSECustomerAlgorithm * Specifies the algorithm to use when decrypting the source object (for example, AES256). * @return Returns a reference to this object so that method calls can be chained together. */ Builder copySourceSSECustomerAlgorithm(String copySourceSSECustomerAlgorithm); /** *

* Specifies the customer-provided encryption key for Amazon S3 to use to decrypt the source object. The * encryption key provided in this header must be one that was used when the source object was created. *

* * @param copySourceSSECustomerKey * Specifies the customer-provided encryption key for Amazon S3 to use to decrypt the source object. The * encryption key provided in this header must be one that was used when the source object was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder copySourceSSECustomerKey(String copySourceSSECustomerKey); /** *

* Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for * a message integrity check to ensure that the encryption key was transmitted without error. *

* * @param copySourceSSECustomerKeyMD5 * Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this * header for a message integrity check to ensure that the encryption key was transmitted without error. * @return Returns a reference to this object so that method calls can be chained together. */ Builder copySourceSSECustomerKeyMD5(String copySourceSSECustomerKeyMD5); /** * Sets the value of the RequestPayer property for this object. * * @param requestPayer * The new value for the RequestPayer property for this object. * @see RequestPayer * @return Returns a reference to this object so that method calls can be chained together. * @see RequestPayer */ Builder requestPayer(String requestPayer); /** * Sets the value of the RequestPayer property for this object. * * @param requestPayer * The new value for the RequestPayer property for this object. * @see RequestPayer * @return Returns a reference to this object so that method calls can be chained together. * @see RequestPayer */ Builder requestPayer(RequestPayer requestPayer); /** *

* The tag-set for the object destination object this value must be used in conjunction with the * TaggingDirective. The tag-set must be encoded as URL Query parameters. *

* * @param tagging * The tag-set for the object destination object this value must be used in conjunction with the * TaggingDirective. The tag-set must be encoded as URL Query parameters. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tagging(String tagging); Builder tagging(Tagging tagging); /** *

* The Object Lock mode that you want to apply to the copied object. *

* * @param objectLockMode * The Object Lock mode that you want to apply to the copied object. * @see ObjectLockMode * @return Returns a reference to this object so that method calls can be chained together. * @see ObjectLockMode */ Builder objectLockMode(String objectLockMode); /** *

* The Object Lock mode that you want to apply to the copied object. *

* * @param objectLockMode * The Object Lock mode that you want to apply to the copied object. * @see ObjectLockMode * @return Returns a reference to this object so that method calls can be chained together. * @see ObjectLockMode */ Builder objectLockMode(ObjectLockMode objectLockMode); /** *

* The date and time when you want the copied object's Object Lock to expire. *

* * @param objectLockRetainUntilDate * The date and time when you want the copied object's Object Lock to expire. * @return Returns a reference to this object so that method calls can be chained together. */ Builder objectLockRetainUntilDate(Instant objectLockRetainUntilDate); /** *

* Specifies whether you want to apply a Legal Hold to the copied object. *

* * @param objectLockLegalHoldStatus * Specifies whether you want to apply a Legal Hold to the copied object. * @see ObjectLockLegalHoldStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ObjectLockLegalHoldStatus */ Builder objectLockLegalHoldStatus(String objectLockLegalHoldStatus); /** *

* Specifies whether you want to apply a Legal Hold to the copied object. *

* * @param objectLockLegalHoldStatus * Specifies whether you want to apply a Legal Hold to the copied object. * @see ObjectLockLegalHoldStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ObjectLockLegalHoldStatus */ Builder objectLockLegalHoldStatus(ObjectLockLegalHoldStatus objectLockLegalHoldStatus); /** *

* The name of the destination bucket. *

* * @param destinationBucket * The name of the destination bucket. * @return Returns a reference to this object so that method calls can be chained together. */ Builder destinationBucket(String destinationBucket); /** *

* The name of the destination bucket. *

* * @param destinationBucket * The name of the destination bucket. * @return Returns a reference to this object so that method calls can be chained together. * @deprecated Use {@link #destinationBucket(String)} */ @Deprecated Builder bucket(String destinationBucket); /** *

* The key of the destination object. *

* * @param destinationKey * The key of the destination object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder destinationKey(String destinationKey); /** *

* The key of the destination object. *

* * @param destinationKey * The key of the destination object. * @return Returns a reference to this object so that method calls can be chained together. * @deprecated Use {@link #destinationKey(String)} */ @Deprecated Builder key(String destinationKey); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends S3Request.BuilderImpl implements Builder { private String acl; private String cacheControl; private String contentDisposition; private String contentEncoding; private String contentLanguage; private String contentType; private String copySource; private String copySourceIfMatch; private Instant copySourceIfModifiedSince; private String copySourceIfNoneMatch; private Instant copySourceIfUnmodifiedSince; private Instant expires; private String grantFullControl; private String grantRead; private String grantReadACP; private String grantWriteACP; private Map metadata = DefaultSdkAutoConstructMap.getInstance(); private String metadataDirective; private String taggingDirective; private String serverSideEncryption; private String storageClass; private String websiteRedirectLocation; private String sseCustomerAlgorithm; private String sseCustomerKey; private String sseCustomerKeyMD5; private String ssekmsKeyId; private String ssekmsEncryptionContext; private String copySourceSSECustomerAlgorithm; private String copySourceSSECustomerKey; private String copySourceSSECustomerKeyMD5; private String requestPayer; private String tagging; private String objectLockMode; private Instant objectLockRetainUntilDate; private String objectLockLegalHoldStatus; private String destinationBucket; private String destinationKey; private BuilderImpl() { } private BuilderImpl(CopyObjectRequest model) { super(model); acl(model.acl); cacheControl(model.cacheControl); contentDisposition(model.contentDisposition); contentEncoding(model.contentEncoding); contentLanguage(model.contentLanguage); contentType(model.contentType); copySource(model.copySource); copySourceIfMatch(model.copySourceIfMatch); copySourceIfModifiedSince(model.copySourceIfModifiedSince); copySourceIfNoneMatch(model.copySourceIfNoneMatch); copySourceIfUnmodifiedSince(model.copySourceIfUnmodifiedSince); expires(model.expires); grantFullControl(model.grantFullControl); grantRead(model.grantRead); grantReadACP(model.grantReadACP); grantWriteACP(model.grantWriteACP); metadata(model.metadata); metadataDirective(model.metadataDirective); taggingDirective(model.taggingDirective); serverSideEncryption(model.serverSideEncryption); storageClass(model.storageClass); websiteRedirectLocation(model.websiteRedirectLocation); sseCustomerAlgorithm(model.sseCustomerAlgorithm); sseCustomerKey(model.sseCustomerKey); sseCustomerKeyMD5(model.sseCustomerKeyMD5); ssekmsKeyId(model.ssekmsKeyId); ssekmsEncryptionContext(model.ssekmsEncryptionContext); copySourceSSECustomerAlgorithm(model.copySourceSSECustomerAlgorithm); copySourceSSECustomerKey(model.copySourceSSECustomerKey); copySourceSSECustomerKeyMD5(model.copySourceSSECustomerKeyMD5); requestPayer(model.requestPayer); tagging(model.tagging); objectLockMode(model.objectLockMode); objectLockRetainUntilDate(model.objectLockRetainUntilDate); objectLockLegalHoldStatus(model.objectLockLegalHoldStatus); destinationBucket(model.destinationBucket); destinationKey(model.destinationKey); } public final String getAcl() { return acl; } @Override public final Builder acl(String acl) { this.acl = acl; return this; } @Override public final Builder acl(ObjectCannedACL acl) { this.acl(acl == null ? null : acl.toString()); return this; } public final void setAcl(String acl) { this.acl = acl; } public final String getCacheControl() { return cacheControl; } @Override public final Builder cacheControl(String cacheControl) { this.cacheControl = cacheControl; return this; } public final void setCacheControl(String cacheControl) { this.cacheControl = cacheControl; } public final String getContentDisposition() { return contentDisposition; } @Override public final Builder contentDisposition(String contentDisposition) { this.contentDisposition = contentDisposition; return this; } public final void setContentDisposition(String contentDisposition) { this.contentDisposition = contentDisposition; } public final String getContentEncoding() { return contentEncoding; } @Override public final Builder contentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } public final void setContentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; } public final String getContentLanguage() { return contentLanguage; } @Override public final Builder contentLanguage(String contentLanguage) { this.contentLanguage = contentLanguage; return this; } public final void setContentLanguage(String contentLanguage) { this.contentLanguage = contentLanguage; } public final String getContentType() { return contentType; } @Override public final Builder contentType(String contentType) { this.contentType = contentType; return this; } public final void setContentType(String contentType) { this.contentType = contentType; } public final String getCopySource() { return copySource; } @Override public final Builder copySource(String copySource) { this.copySource = copySource; return this; } public final void setCopySource(String copySource) { this.copySource = copySource; } public final String getCopySourceIfMatch() { return copySourceIfMatch; } @Override public final Builder copySourceIfMatch(String copySourceIfMatch) { this.copySourceIfMatch = copySourceIfMatch; return this; } public final void setCopySourceIfMatch(String copySourceIfMatch) { this.copySourceIfMatch = copySourceIfMatch; } public final Instant getCopySourceIfModifiedSince() { return copySourceIfModifiedSince; } @Override public final Builder copySourceIfModifiedSince(Instant copySourceIfModifiedSince) { this.copySourceIfModifiedSince = copySourceIfModifiedSince; return this; } public final void setCopySourceIfModifiedSince(Instant copySourceIfModifiedSince) { this.copySourceIfModifiedSince = copySourceIfModifiedSince; } public final String getCopySourceIfNoneMatch() { return copySourceIfNoneMatch; } @Override public final Builder copySourceIfNoneMatch(String copySourceIfNoneMatch) { this.copySourceIfNoneMatch = copySourceIfNoneMatch; return this; } public final void setCopySourceIfNoneMatch(String copySourceIfNoneMatch) { this.copySourceIfNoneMatch = copySourceIfNoneMatch; } public final Instant getCopySourceIfUnmodifiedSince() { return copySourceIfUnmodifiedSince; } @Override public final Builder copySourceIfUnmodifiedSince(Instant copySourceIfUnmodifiedSince) { this.copySourceIfUnmodifiedSince = copySourceIfUnmodifiedSince; return this; } public final void setCopySourceIfUnmodifiedSince(Instant copySourceIfUnmodifiedSince) { this.copySourceIfUnmodifiedSince = copySourceIfUnmodifiedSince; } public final Instant getExpires() { return expires; } @Override public final Builder expires(Instant expires) { this.expires = expires; return this; } public final void setExpires(Instant expires) { this.expires = expires; } public final String getGrantFullControl() { return grantFullControl; } @Override public final Builder grantFullControl(String grantFullControl) { this.grantFullControl = grantFullControl; return this; } public final void setGrantFullControl(String grantFullControl) { this.grantFullControl = grantFullControl; } public final String getGrantRead() { return grantRead; } @Override public final Builder grantRead(String grantRead) { this.grantRead = grantRead; return this; } public final void setGrantRead(String grantRead) { this.grantRead = grantRead; } public final String getGrantReadACP() { return grantReadACP; } @Override public final Builder grantReadACP(String grantReadACP) { this.grantReadACP = grantReadACP; return this; } public final void setGrantReadACP(String grantReadACP) { this.grantReadACP = grantReadACP; } public final String getGrantWriteACP() { return grantWriteACP; } @Override public final Builder grantWriteACP(String grantWriteACP) { this.grantWriteACP = grantWriteACP; return this; } public final void setGrantWriteACP(String grantWriteACP) { this.grantWriteACP = grantWriteACP; } public final Map getMetadata() { return metadata; } @Override public final Builder metadata(Map metadata) { this.metadata = MetadataCopier.copy(metadata); return this; } public final void setMetadata(Map metadata) { this.metadata = MetadataCopier.copy(metadata); } public final String getMetadataDirective() { return metadataDirective; } @Override public final Builder metadataDirective(String metadataDirective) { this.metadataDirective = metadataDirective; return this; } @Override public final Builder metadataDirective(MetadataDirective metadataDirective) { this.metadataDirective(metadataDirective == null ? null : metadataDirective.toString()); return this; } public final void setMetadataDirective(String metadataDirective) { this.metadataDirective = metadataDirective; } public final String getTaggingDirective() { return taggingDirective; } @Override public final Builder taggingDirective(String taggingDirective) { this.taggingDirective = taggingDirective; return this; } @Override public final Builder taggingDirective(TaggingDirective taggingDirective) { this.taggingDirective(taggingDirective == null ? null : taggingDirective.toString()); return this; } public final void setTaggingDirective(String taggingDirective) { this.taggingDirective = taggingDirective; } public final String getServerSideEncryption() { return serverSideEncryption; } @Override public final Builder serverSideEncryption(String serverSideEncryption) { this.serverSideEncryption = serverSideEncryption; return this; } @Override public final Builder serverSideEncryption(ServerSideEncryption serverSideEncryption) { this.serverSideEncryption(serverSideEncryption == null ? null : serverSideEncryption.toString()); return this; } public final void setServerSideEncryption(String serverSideEncryption) { this.serverSideEncryption = serverSideEncryption; } public final String getStorageClass() { return storageClass; } @Override public final Builder storageClass(String storageClass) { this.storageClass = storageClass; return this; } @Override public final Builder storageClass(StorageClass storageClass) { this.storageClass(storageClass == null ? null : storageClass.toString()); return this; } public final void setStorageClass(String storageClass) { this.storageClass = storageClass; } public final String getWebsiteRedirectLocation() { return websiteRedirectLocation; } @Override public final Builder websiteRedirectLocation(String websiteRedirectLocation) { this.websiteRedirectLocation = websiteRedirectLocation; return this; } public final void setWebsiteRedirectLocation(String websiteRedirectLocation) { this.websiteRedirectLocation = websiteRedirectLocation; } public final String getSseCustomerAlgorithm() { return sseCustomerAlgorithm; } @Override public final Builder sseCustomerAlgorithm(String sseCustomerAlgorithm) { this.sseCustomerAlgorithm = sseCustomerAlgorithm; return this; } public final void setSseCustomerAlgorithm(String sseCustomerAlgorithm) { this.sseCustomerAlgorithm = sseCustomerAlgorithm; } public final String getSseCustomerKey() { return sseCustomerKey; } @Override public final Builder sseCustomerKey(String sseCustomerKey) { this.sseCustomerKey = sseCustomerKey; return this; } public final void setSseCustomerKey(String sseCustomerKey) { this.sseCustomerKey = sseCustomerKey; } public final String getSseCustomerKeyMD5() { return sseCustomerKeyMD5; } @Override public final Builder sseCustomerKeyMD5(String sseCustomerKeyMD5) { this.sseCustomerKeyMD5 = sseCustomerKeyMD5; return this; } public final void setSseCustomerKeyMD5(String sseCustomerKeyMD5) { this.sseCustomerKeyMD5 = sseCustomerKeyMD5; } public final String getSsekmsKeyId() { return ssekmsKeyId; } @Override public final Builder ssekmsKeyId(String ssekmsKeyId) { this.ssekmsKeyId = ssekmsKeyId; return this; } public final void setSsekmsKeyId(String ssekmsKeyId) { this.ssekmsKeyId = ssekmsKeyId; } public final String getSsekmsEncryptionContext() { return ssekmsEncryptionContext; } @Override public final Builder ssekmsEncryptionContext(String ssekmsEncryptionContext) { this.ssekmsEncryptionContext = ssekmsEncryptionContext; return this; } public final void setSsekmsEncryptionContext(String ssekmsEncryptionContext) { this.ssekmsEncryptionContext = ssekmsEncryptionContext; } public final String getCopySourceSSECustomerAlgorithm() { return copySourceSSECustomerAlgorithm; } @Override public final Builder copySourceSSECustomerAlgorithm(String copySourceSSECustomerAlgorithm) { this.copySourceSSECustomerAlgorithm = copySourceSSECustomerAlgorithm; return this; } public final void setCopySourceSSECustomerAlgorithm(String copySourceSSECustomerAlgorithm) { this.copySourceSSECustomerAlgorithm = copySourceSSECustomerAlgorithm; } public final String getCopySourceSSECustomerKey() { return copySourceSSECustomerKey; } @Override public final Builder copySourceSSECustomerKey(String copySourceSSECustomerKey) { this.copySourceSSECustomerKey = copySourceSSECustomerKey; return this; } public final void setCopySourceSSECustomerKey(String copySourceSSECustomerKey) { this.copySourceSSECustomerKey = copySourceSSECustomerKey; } public final String getCopySourceSSECustomerKeyMD5() { return copySourceSSECustomerKeyMD5; } @Override public final Builder copySourceSSECustomerKeyMD5(String copySourceSSECustomerKeyMD5) { this.copySourceSSECustomerKeyMD5 = copySourceSSECustomerKeyMD5; return this; } public final void setCopySourceSSECustomerKeyMD5(String copySourceSSECustomerKeyMD5) { this.copySourceSSECustomerKeyMD5 = copySourceSSECustomerKeyMD5; } public final String getRequestPayer() { return requestPayer; } @Override public final Builder requestPayer(String requestPayer) { this.requestPayer = requestPayer; return this; } @Override public final Builder requestPayer(RequestPayer requestPayer) { this.requestPayer(requestPayer == null ? null : requestPayer.toString()); return this; } public final void setRequestPayer(String requestPayer) { this.requestPayer = requestPayer; } public final String getTagging() { return tagging; } @Override public final Builder tagging(String tagging) { this.tagging = tagging; return this; } public final void setTagging(String tagging) { this.tagging = tagging; } public Builder tagging(Tagging tagging) { tagging(TaggingAdapter.instance().adapt(tagging)); return this; } public final String getObjectLockMode() { return objectLockMode; } @Override public final Builder objectLockMode(String objectLockMode) { this.objectLockMode = objectLockMode; return this; } @Override public final Builder objectLockMode(ObjectLockMode objectLockMode) { this.objectLockMode(objectLockMode == null ? null : objectLockMode.toString()); return this; } public final void setObjectLockMode(String objectLockMode) { this.objectLockMode = objectLockMode; } public final Instant getObjectLockRetainUntilDate() { return objectLockRetainUntilDate; } @Override public final Builder objectLockRetainUntilDate(Instant objectLockRetainUntilDate) { this.objectLockRetainUntilDate = objectLockRetainUntilDate; return this; } public final void setObjectLockRetainUntilDate(Instant objectLockRetainUntilDate) { this.objectLockRetainUntilDate = objectLockRetainUntilDate; } public final String getObjectLockLegalHoldStatus() { return objectLockLegalHoldStatus; } @Override public final Builder objectLockLegalHoldStatus(String objectLockLegalHoldStatus) { this.objectLockLegalHoldStatus = objectLockLegalHoldStatus; return this; } @Override public final Builder objectLockLegalHoldStatus(ObjectLockLegalHoldStatus objectLockLegalHoldStatus) { this.objectLockLegalHoldStatus(objectLockLegalHoldStatus == null ? null : objectLockLegalHoldStatus.toString()); return this; } public final void setObjectLockLegalHoldStatus(String objectLockLegalHoldStatus) { this.objectLockLegalHoldStatus = objectLockLegalHoldStatus; } public final String getDestinationBucket() { return destinationBucket; } @Override public final Builder destinationBucket(String destinationBucket) { this.destinationBucket = destinationBucket; return this; } @Override public final Builder bucket(String destinationBucket) { this.destinationBucket = destinationBucket; return this; } public final void setDestinationBucket(String destinationBucket) { this.destinationBucket = destinationBucket; } /** * @deprecated Use {@link #setDestinationBucket} instead */ @Deprecated public final void setBucket(String destinationBucket) { this.destinationBucket = destinationBucket; } public final String getDestinationKey() { return destinationKey; } @Override public final Builder destinationKey(String destinationKey) { this.destinationKey = destinationKey; return this; } @Override public final Builder key(String destinationKey) { this.destinationKey = destinationKey; return this; } public final void setDestinationKey(String destinationKey) { this.destinationKey = destinationKey; } /** * @deprecated Use {@link #setDestinationKey} instead */ @Deprecated public final void setKey(String destinationKey) { this.destinationKey = destinationKey; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public CopyObjectRequest build() { return new CopyObjectRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy