software.amazon.awssdk.services.s3.model.UploadPartCopyRequest Maven / Gradle / Ivy
Show all versions of s3 Show documentation
/*
* 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.HashMap;
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.RequiredTrait;
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 UploadPartCopyRequest extends S3Request implements
ToCopyableBuilder {
private static final SdkField COPY_SOURCE_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("CopySource")
.getter(getter(UploadPartCopyRequest::copySource))
.setter(setter(Builder::copySource))
.traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-copy-source")
.unmarshallLocationName("x-amz-copy-source").build(), RequiredTrait.create()).build();
private static final SdkField COPY_SOURCE_IF_MATCH_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("CopySourceIfMatch")
.getter(getter(UploadPartCopyRequest::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)
.memberName("CopySourceIfModifiedSince")
.getter(getter(UploadPartCopyRequest::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)
.memberName("CopySourceIfNoneMatch")
.getter(getter(UploadPartCopyRequest::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)
.memberName("CopySourceIfUnmodifiedSince")
.getter(getter(UploadPartCopyRequest::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 COPY_SOURCE_RANGE_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("CopySourceRange")
.getter(getter(UploadPartCopyRequest::copySourceRange))
.setter(setter(Builder::copySourceRange))
.traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-copy-source-range")
.unmarshallLocationName("x-amz-copy-source-range").build()).build();
private static final SdkField PART_NUMBER_FIELD = SdkField
. builder(MarshallingType.INTEGER)
.memberName("PartNumber")
.getter(getter(UploadPartCopyRequest::partNumber))
.setter(setter(Builder::partNumber))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("partNumber")
.unmarshallLocationName("partNumber").build(), RequiredTrait.create()).build();
private static final SdkField UPLOAD_ID_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("UploadId")
.getter(getter(UploadPartCopyRequest::uploadId))
.setter(setter(Builder::uploadId))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("uploadId")
.unmarshallLocationName("uploadId").build(), RequiredTrait.create()).build();
private static final SdkField SSE_CUSTOMER_ALGORITHM_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("SSECustomerAlgorithm")
.getter(getter(UploadPartCopyRequest::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)
.memberName("SSECustomerKey")
.getter(getter(UploadPartCopyRequest::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)
.memberName("SSECustomerKeyMD5")
.getter(getter(UploadPartCopyRequest::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 COPY_SOURCE_SSE_CUSTOMER_ALGORITHM_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("CopySourceSSECustomerAlgorithm")
.getter(getter(UploadPartCopyRequest::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)
.memberName("CopySourceSSECustomerKey")
.getter(getter(UploadPartCopyRequest::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)
.memberName("CopySourceSSECustomerKeyMD5")
.getter(getter(UploadPartCopyRequest::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)
.memberName("RequestPayer")
.getter(getter(UploadPartCopyRequest::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 EXPECTED_BUCKET_OWNER_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("ExpectedBucketOwner")
.getter(getter(UploadPartCopyRequest::expectedBucketOwner))
.setter(setter(Builder::expectedBucketOwner))
.traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-expected-bucket-owner")
.unmarshallLocationName("x-amz-expected-bucket-owner").build()).build();
private static final SdkField EXPECTED_SOURCE_BUCKET_OWNER_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("ExpectedSourceBucketOwner")
.getter(getter(UploadPartCopyRequest::expectedSourceBucketOwner))
.setter(setter(Builder::expectedSourceBucketOwner))
.traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-source-expected-bucket-owner")
.unmarshallLocationName("x-amz-source-expected-bucket-owner").build()).build();
private static final SdkField DESTINATION_BUCKET_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("DestinationBucket")
.getter(getter(UploadPartCopyRequest::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)
.memberName("DestinationKey")
.getter(getter(UploadPartCopyRequest::destinationKey))
.setter(setter(Builder::destinationKey))
.traits(LocationTrait.builder().location(MarshallLocation.GREEDY_PATH).locationName("Key")
.unmarshallLocationName("Key").build()).build();
private static final SdkField SOURCE_BUCKET_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("SourceBucket")
.getter(getter(UploadPartCopyRequest::sourceBucket))
.setter(setter(Builder::sourceBucket))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceBucket")
.unmarshallLocationName("SourceBucket").build()).build();
private static final SdkField SOURCE_KEY_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("SourceKey")
.getter(getter(UploadPartCopyRequest::sourceKey))
.setter(setter(Builder::sourceKey))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceKey")
.unmarshallLocationName("SourceKey").build()).build();
private static final SdkField SOURCE_VERSION_ID_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("SourceVersionId")
.getter(getter(UploadPartCopyRequest::sourceVersionId))
.setter(setter(Builder::sourceVersionId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceVersionId")
.unmarshallLocationName("SourceVersionId").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(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, COPY_SOURCE_RANGE_FIELD, PART_NUMBER_FIELD, UPLOAD_ID_FIELD,
SSE_CUSTOMER_ALGORITHM_FIELD, SSE_CUSTOMER_KEY_FIELD, SSE_CUSTOMER_KEY_MD5_FIELD,
COPY_SOURCE_SSE_CUSTOMER_ALGORITHM_FIELD, COPY_SOURCE_SSE_CUSTOMER_KEY_FIELD, COPY_SOURCE_SSE_CUSTOMER_KEY_MD5_FIELD,
REQUEST_PAYER_FIELD, EXPECTED_BUCKET_OWNER_FIELD, EXPECTED_SOURCE_BUCKET_OWNER_FIELD, DESTINATION_BUCKET_FIELD,
DESTINATION_KEY_FIELD, SOURCE_BUCKET_FIELD, SOURCE_KEY_FIELD, SOURCE_VERSION_ID_FIELD));
private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();
private final String copySource;
private final String copySourceIfMatch;
private final Instant copySourceIfModifiedSince;
private final String copySourceIfNoneMatch;
private final Instant copySourceIfUnmodifiedSince;
private final String copySourceRange;
private final Integer partNumber;
private final String uploadId;
private final String sseCustomerAlgorithm;
private final String sseCustomerKey;
private final String sseCustomerKeyMD5;
private final String copySourceSSECustomerAlgorithm;
private final String copySourceSSECustomerKey;
private final String copySourceSSECustomerKeyMD5;
private final String requestPayer;
private final String expectedBucketOwner;
private final String expectedSourceBucketOwner;
private final String destinationBucket;
private final String destinationKey;
private final String sourceBucket;
private final String sourceKey;
private final String sourceVersionId;
private UploadPartCopyRequest(BuilderImpl builder) {
super(builder);
this.copySource = builder.copySource;
this.copySourceIfMatch = builder.copySourceIfMatch;
this.copySourceIfModifiedSince = builder.copySourceIfModifiedSince;
this.copySourceIfNoneMatch = builder.copySourceIfNoneMatch;
this.copySourceIfUnmodifiedSince = builder.copySourceIfUnmodifiedSince;
this.copySourceRange = builder.copySourceRange;
this.partNumber = builder.partNumber;
this.uploadId = builder.uploadId;
this.sseCustomerAlgorithm = builder.sseCustomerAlgorithm;
this.sseCustomerKey = builder.sseCustomerKey;
this.sseCustomerKeyMD5 = builder.sseCustomerKeyMD5;
this.copySourceSSECustomerAlgorithm = builder.copySourceSSECustomerAlgorithm;
this.copySourceSSECustomerKey = builder.copySourceSSECustomerKey;
this.copySourceSSECustomerKeyMD5 = builder.copySourceSSECustomerKeyMD5;
this.requestPayer = builder.requestPayer;
this.expectedBucketOwner = builder.expectedBucketOwner;
this.expectedSourceBucketOwner = builder.expectedSourceBucketOwner;
this.destinationBucket = builder.destinationBucket;
this.destinationKey = builder.destinationKey;
this.sourceBucket = builder.sourceBucket;
this.sourceKey = builder.sourceKey;
this.sourceVersionId = builder.sourceVersionId;
}
/**
*
* Specifies the source object for the copy operation. You specify the value in one of two formats, depending on
* whether you want to access the source object through an access point:
*
*
* -
*
* For objects not accessed through an access point, specify the name of the source bucket and key of the source
* object, separated by a slash (/). For example, to copy the object reports/january.pdf
from the
* bucket awsexamplebucket
, use awsexamplebucket/reports/january.pdf
. The value must be
* URL-encoded.
*
*
* -
*
* For objects accessed through access points, specify the Amazon Resource Name (ARN) of the object as accessed
* through the access point, in the format
* arn:aws:s3:<Region>:<account-id>:accesspoint/<access-point-name>/object/<key>
* . For example, to copy the object reports/january.pdf
through access point
* my-access-point
owned by account 123456789012
in Region us-west-2
, use the
* URL encoding of
* arn:aws:s3:us-west-2:123456789012:accesspoint/my-access-point/object/reports/january.pdf
. The value
* must be URL encoded.
*
*
*
* -
*
* Amazon S3 supports copy operations using Access points only when the source and destination buckets are in the
* same Amazon Web Services Region.
*
*
* -
*
* Access points are not supported by directory buckets.
*
*
*
*
*
* Alternatively, for objects accessed through Amazon S3 on Outposts, specify the ARN of the object as accessed in
* the format
* arn:aws:s3-outposts:<Region>:<account-id>:outpost/<outpost-id>/object/<key>
.
* For example, to copy the object reports/january.pdf
through outpost my-outpost
owned by
* account 123456789012
in Region us-west-2
, use the URL encoding of
* arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/object/reports/january.pdf
. The value
* must be URL-encoded.
*
*
*
*
* If your bucket has versioning enabled, you could have multiple versions of the same object. By default,
* x-amz-copy-source
identifies the current version of the source object to copy. To copy a specific
* version of the source object to copy, append ?versionId=<version-id>
to the
* x-amz-copy-source
request header (for example,
* x-amz-copy-source: /awsexamplebucket/reports/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893
* ).
*
*
* If the current version is a delete marker and you don't specify a versionId in the x-amz-copy-source
* request header, Amazon S3 returns a 404 Not Found
error, because the object does not exist. If you
* specify versionId in the x-amz-copy-source
and the versionId is a delete marker, Amazon S3 returns
* an HTTP 400 Bad Request
error, because you are not allowed to specify a delete marker as a version
* for the x-amz-copy-source
.
*
*
*
* Directory buckets - S3 Versioning isn't enabled and supported for directory buckets.
*
*
*
* @return Specifies the source object for the copy operation. You specify the value in one of two formats,
* depending on whether you want to access the source object through an access point:
*
* -
*
* For objects not accessed through an access point, specify the name of the source bucket and key of the
* source object, separated by a slash (/). For example, to copy the object reports/january.pdf
* from the bucket awsexamplebucket
, use awsexamplebucket/reports/january.pdf
. The
* value must be URL-encoded.
*
*
* -
*
* For objects accessed through access points, specify the Amazon Resource Name (ARN) of the object as
* accessed through the access point, in the format
* arn:aws:s3:<Region>:<account-id>:accesspoint/<access-point-name>/object/<key>
* . For example, to copy the object reports/january.pdf
through access point
* my-access-point
owned by account 123456789012
in Region us-west-2
,
* use the URL encoding of
* arn:aws:s3:us-west-2:123456789012:accesspoint/my-access-point/object/reports/january.pdf
.
* The value must be URL encoded.
*
*
*
* -
*
* Amazon S3 supports copy operations using Access points only when the source and destination buckets are
* in the same Amazon Web Services Region.
*
*
* -
*
* Access points are not supported by directory buckets.
*
*
*
*
*
* Alternatively, for objects accessed through Amazon S3 on Outposts, specify the ARN of the object as
* accessed in the format
* arn:aws:s3-outposts:<Region>:<account-id>:outpost/<outpost-id>/object/<key>
* . For example, to copy the object reports/january.pdf
through outpost
* my-outpost
owned by account 123456789012
in Region us-west-2
, use
* the URL encoding of
* arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/object/reports/january.pdf
.
* The value must be URL-encoded.
*
*
*
*
* If your bucket has versioning enabled, you could have multiple versions of the same object. By default,
* x-amz-copy-source
identifies the current version of the source object to copy. To copy a
* specific version of the source object to copy, append ?versionId=<version-id>
to the
* x-amz-copy-source
request header (for example,
* x-amz-copy-source: /awsexamplebucket/reports/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893
* ).
*
*
* If the current version is a delete marker and you don't specify a versionId in the
* x-amz-copy-source
request header, Amazon S3 returns a 404 Not Found
error,
* because the object does not exist. If you specify versionId in the x-amz-copy-source
and the
* versionId is a delete marker, Amazon S3 returns an HTTP 400 Bad Request
error, because you
* are not allowed to specify a delete marker as a version for the x-amz-copy-source
.
*
*
*
* Directory buckets - S3 Versioning isn't enabled and supported for directory buckets.
*
* @deprecated The {@code copySource} parameter has been deprecated in favor of the more user-friendly
* {@code sourceBucket}, {@code sourceKey}, and {@code sourceVersionId} parameters. The
* {@code copySource} parameter will remain fully functional, but it must not be used in conjunction
* with its replacement parameters.
*/
@Deprecated
public final String copySource() {
return copySource;
}
/**
*
* Copies the object if its entity tag (ETag) matches the specified tag.
*
*
* If both of the x-amz-copy-source-if-match
and x-amz-copy-source-if-unmodified-since
* headers are present in the request as follows:
*
*
* x-amz-copy-source-if-match
condition evaluates to true
, and;
*
*
* x-amz-copy-source-if-unmodified-since
condition evaluates to false
;
*
*
* Amazon S3 returns 200 OK
and copies the data.
*
*
* @return Copies the object if its entity tag (ETag) matches the specified tag.
*
* If both of the x-amz-copy-source-if-match
and
* x-amz-copy-source-if-unmodified-since
headers are present in the request as follows:
*
*
* x-amz-copy-source-if-match
condition evaluates to true
, and;
*
*
* x-amz-copy-source-if-unmodified-since
condition evaluates to false
;
*
*
* Amazon S3 returns 200 OK
and copies the data.
*/
public final String copySourceIfMatch() {
return copySourceIfMatch;
}
/**
*
* Copies the object if it has been modified since the specified time.
*
*
* If both of the x-amz-copy-source-if-none-match
and x-amz-copy-source-if-modified-since
* headers are present in the request as follows:
*
*
* x-amz-copy-source-if-none-match
condition evaluates to false
, and;
*
*
* x-amz-copy-source-if-modified-since
condition evaluates to true
;
*
*
* Amazon S3 returns 412 Precondition Failed
response code.
*
*
* @return Copies the object if it has been modified since the specified time.
*
* If both of the x-amz-copy-source-if-none-match
and
* x-amz-copy-source-if-modified-since
headers are present in the request as follows:
*
*
* x-amz-copy-source-if-none-match
condition evaluates to false
, and;
*
*
* x-amz-copy-source-if-modified-since
condition evaluates to true
;
*
*
* Amazon S3 returns 412 Precondition Failed
response code.
*/
public final Instant copySourceIfModifiedSince() {
return copySourceIfModifiedSince;
}
/**
*
* Copies the object if its entity tag (ETag) is different than the specified ETag.
*
*
* If both of the x-amz-copy-source-if-none-match
and x-amz-copy-source-if-modified-since
* headers are present in the request as follows:
*
*
* x-amz-copy-source-if-none-match
condition evaluates to false
, and;
*
*
* x-amz-copy-source-if-modified-since
condition evaluates to true
;
*
*
* Amazon S3 returns 412 Precondition Failed
response code.
*
*
* @return Copies the object if its entity tag (ETag) is different than the specified ETag.
*
* If both of the x-amz-copy-source-if-none-match
and
* x-amz-copy-source-if-modified-since
headers are present in the request as follows:
*
*
* x-amz-copy-source-if-none-match
condition evaluates to false
, and;
*
*
* x-amz-copy-source-if-modified-since
condition evaluates to true
;
*
*
* Amazon S3 returns 412 Precondition Failed
response code.
*/
public final String copySourceIfNoneMatch() {
return copySourceIfNoneMatch;
}
/**
*
* Copies the object if it hasn't been modified since the specified time.
*
*
* If both of the x-amz-copy-source-if-match
and x-amz-copy-source-if-unmodified-since
* headers are present in the request as follows:
*
*
* x-amz-copy-source-if-match
condition evaluates to true
, and;
*
*
* x-amz-copy-source-if-unmodified-since
condition evaluates to false
;
*
*
* Amazon S3 returns 200 OK
and copies the data.
*
*
* @return Copies the object if it hasn't been modified since the specified time.
*
* If both of the x-amz-copy-source-if-match
and
* x-amz-copy-source-if-unmodified-since
headers are present in the request as follows:
*
*
* x-amz-copy-source-if-match
condition evaluates to true
, and;
*
*
* x-amz-copy-source-if-unmodified-since
condition evaluates to false
;
*
*
* Amazon S3 returns 200 OK
and copies the data.
*/
public final Instant copySourceIfUnmodifiedSince() {
return copySourceIfUnmodifiedSince;
}
/**
*
* The range of bytes to copy from the source object. The range value must use the form bytes=first-last, where the
* first and last are the zero-based byte offsets to copy. For example, bytes=0-9 indicates that you want to copy
* the first 10 bytes of the source. You can copy a range only if the source object is greater than 5 MB.
*
*
* @return The range of bytes to copy from the source object. The range value must use the form bytes=first-last,
* where the first and last are the zero-based byte offsets to copy. For example, bytes=0-9 indicates that
* you want to copy the first 10 bytes of the source. You can copy a range only if the source object is
* greater than 5 MB.
*/
public final String copySourceRange() {
return copySourceRange;
}
/**
*
* Part number of part being copied. This is a positive integer between 1 and 10,000.
*
*
* @return Part number of part being copied. This is a positive integer between 1 and 10,000.
*/
public final Integer partNumber() {
return partNumber;
}
/**
*
* Upload ID identifying the multipart upload whose part is being copied.
*
*
* @return Upload ID identifying the multipart upload whose part is being copied.
*/
public final String uploadId() {
return uploadId;
}
/**
*
* Specifies the algorithm to use when encrypting the object (for example, AES256).
*
*
*
* This functionality is not supported when the destination bucket is a directory bucket.
*
*
*
* @return Specifies the algorithm to use when encrypting the object (for example, AES256).
*
* This functionality is not supported when the destination bucket is a directory bucket.
*
*/
public final 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. This must be the same encryption key
* specified in the initiate multipart upload request.
*
*
*
* This functionality is not supported when the destination bucket is a directory bucket.
*
*
*
* @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. This must be the same encryption key
* specified in the initiate multipart upload request.
*
* This functionality is not supported when the destination bucket is a directory bucket.
*
*/
public final 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.
*
*
*
* This functionality is not supported when the destination bucket is a directory bucket.
*
*
*
* @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.
*
* This functionality is not supported when the destination bucket is a directory bucket.
*
*/
public final String sseCustomerKeyMD5() {
return sseCustomerKeyMD5;
}
/**
*
* Specifies the algorithm to use when decrypting the source object (for example, AES256
).
*
*
*
* This functionality is not supported when the source object is in a directory bucket.
*
*
*
* @return Specifies the algorithm to use when decrypting the source object (for example, AES256
).
*
*
* This functionality is not supported when the source object is in a directory bucket.
*
*/
public final 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.
*
*
*
* This functionality is not supported when the source object is in a directory bucket.
*
*
*
* @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.
*
*
* This functionality is not supported when the source object is in a directory bucket.
*
*/
public final 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.
*
*
*
* This functionality is not supported when the source object is in a directory bucket.
*
*
*
* @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.
*
* This functionality is not supported when the source object is in a directory bucket.
*
*/
public final 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 final 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 final String requestPayerAsString() {
return requestPayer;
}
/**
*
* The account ID of the expected destination bucket owner. If the account ID that you provide does not match the
* actual owner of the destination bucket, the request fails with the HTTP status code 403 Forbidden
* (access denied).
*
*
* @return The account ID of the expected destination bucket owner. If the account ID that you provide does not
* match the actual owner of the destination bucket, the request fails with the HTTP status code
* 403 Forbidden
(access denied).
*/
public final String expectedBucketOwner() {
return expectedBucketOwner;
}
/**
*
* The account ID of the expected source bucket owner. If the account ID that you provide does not match the actual
* owner of the source bucket, the request fails with the HTTP status code 403 Forbidden
(access
* denied).
*
*
* @return The account ID of the expected source bucket owner. If the account ID that you provide does not match the
* actual owner of the source bucket, the request fails with the HTTP status code 403 Forbidden
* (access denied).
*/
public final String expectedSourceBucketOwner() {
return expectedSourceBucketOwner;
}
/**
*
* The bucket name.
*
*
* Directory buckets - When you use this operation with a directory bucket, you must use virtual-hosted-style
* requests in the format Bucket-name.s3express-zone-id.region-code.amazonaws.com
* . Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability
* Zone or Local Zone). Bucket names must follow the format
* bucket-base-name--zone-id--x-s3
(for example,
* DOC-EXAMPLE-BUCKET--usw2-az1--x-s3
). For information about bucket naming
* restrictions, see Directory bucket
* naming rules in the Amazon S3 User Guide.
*
*
*
* Copying objects across different Amazon Web Services Regions isn't supported when the source or destination
* bucket is in Amazon Web Services Local Zones. The source and destination buckets must have the same parent Amazon
* Web Services Region. Otherwise, you get an HTTP 400 Bad Request
error with the error code
* InvalidRequest
.
*
*
*
* Access points - When you use this action with an access point, you must provide the alias of the access
* point in place of the bucket name or specify the access point ARN. When using the access point ARN, you must
* direct requests to the access point hostname. The access point hostname takes the form
* AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with
* an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket
* name. For more information about access point ARNs, see Using access points in
* the Amazon S3 User Guide.
*
*
*
* Access points and Object Lambda access points are not supported by directory buckets.
*
*
*
* S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must direct requests to the S3
* on Outposts hostname. The S3 on Outposts hostname takes the form
* AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com
.
* When you use this action with S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts
* access point ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see What is S3 on Outposts? in the
* Amazon S3 User Guide.
*
*
* @return The bucket name.
*
* Directory buckets - When you use this operation with a directory bucket, you must use
* virtual-hosted-style requests in the format
* Bucket-name.s3express-zone-id.region-code.amazonaws.com
. Path-style
* requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone
* or Local Zone). Bucket names must follow the format
* bucket-base-name--zone-id--x-s3
(for example,
* DOC-EXAMPLE-BUCKET--usw2-az1--x-s3
). For information about bucket naming
* restrictions, see Directory
* bucket naming rules in the Amazon S3 User Guide.
*
*
*
* Copying objects across different Amazon Web Services Regions isn't supported when the source or
* destination bucket is in Amazon Web Services Local Zones. The source and destination buckets must have
* the same parent Amazon Web Services Region. Otherwise, you get an HTTP 400 Bad Request
error
* with the error code InvalidRequest
.
*
*
*
* Access points - When you use this action with an access point, you must provide the alias of the
* access point in place of the bucket name or specify the access point ARN. When using the access point
* ARN, you must direct requests to the access point hostname. The access point hostname takes the form
* AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this
* action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in
* place of the bucket name. For more information about access point ARNs, see Using access
* points in the Amazon S3 User Guide.
*
*
*
* Access points and Object Lambda access points are not supported by directory buckets.
*
*
*
* S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must direct requests to
* the S3 on Outposts hostname. The S3 on Outposts hostname takes the form
* AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com
* . When you use this action with S3 on Outposts through the Amazon Web Services SDKs, you provide the
* Outposts access point ARN in place of the bucket name. For more information about S3 on Outposts ARNs,
* see What is S3 on
* Outposts? in the Amazon S3 User Guide.
* @deprecated Use {@link #destinationBucket()}
*/
@Deprecated
public final String bucket() {
return destinationBucket;
}
/**
*
* The bucket name.
*
*
* Directory buckets - When you use this operation with a directory bucket, you must use virtual-hosted-style
* requests in the format Bucket-name.s3express-zone-id.region-code.amazonaws.com
* . Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability
* Zone or Local Zone). Bucket names must follow the format
* bucket-base-name--zone-id--x-s3
(for example,
* DOC-EXAMPLE-BUCKET--usw2-az1--x-s3
). For information about bucket naming
* restrictions, see Directory bucket
* naming rules in the Amazon S3 User Guide.
*
*
*
* Copying objects across different Amazon Web Services Regions isn't supported when the source or destination
* bucket is in Amazon Web Services Local Zones. The source and destination buckets must have the same parent Amazon
* Web Services Region. Otherwise, you get an HTTP 400 Bad Request
error with the error code
* InvalidRequest
.
*
*
*
* Access points - When you use this action with an access point, you must provide the alias of the access
* point in place of the bucket name or specify the access point ARN. When using the access point ARN, you must
* direct requests to the access point hostname. The access point hostname takes the form
* AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with
* an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket
* name. For more information about access point ARNs, see Using access points in
* the Amazon S3 User Guide.
*
*
*
* Access points and Object Lambda access points are not supported by directory buckets.
*
*
*
* S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must direct requests to the S3
* on Outposts hostname. The S3 on Outposts hostname takes the form
* AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com
.
* When you use this action with S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts
* access point ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see What is S3 on Outposts? in the
* Amazon S3 User Guide.
*
*
* @return The bucket name.
*
* Directory buckets - When you use this operation with a directory bucket, you must use
* virtual-hosted-style requests in the format
* Bucket-name.s3express-zone-id.region-code.amazonaws.com
. Path-style
* requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone
* or Local Zone). Bucket names must follow the format
* bucket-base-name--zone-id--x-s3
(for example,
* DOC-EXAMPLE-BUCKET--usw2-az1--x-s3
). For information about bucket naming
* restrictions, see Directory
* bucket naming rules in the Amazon S3 User Guide.
*
*
*
* Copying objects across different Amazon Web Services Regions isn't supported when the source or
* destination bucket is in Amazon Web Services Local Zones. The source and destination buckets must have
* the same parent Amazon Web Services Region. Otherwise, you get an HTTP 400 Bad Request
error
* with the error code InvalidRequest
.
*
*
*
* Access points - When you use this action with an access point, you must provide the alias of the
* access point in place of the bucket name or specify the access point ARN. When using the access point
* ARN, you must direct requests to the access point hostname. The access point hostname takes the form
* AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this
* action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in
* place of the bucket name. For more information about access point ARNs, see Using access
* points in the Amazon S3 User Guide.
*
*
*
* Access points and Object Lambda access points are not supported by directory buckets.
*
*
*
* S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must direct requests to
* the S3 on Outposts hostname. The S3 on Outposts hostname takes the form
* AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com
* . When you use this action with S3 on Outposts through the Amazon Web Services SDKs, you provide the
* Outposts access point ARN in place of the bucket name. For more information about S3 on Outposts ARNs,
* see What is S3 on
* Outposts? in the Amazon S3 User Guide.
*/
public final String destinationBucket() {
return destinationBucket;
}
/**
*
* Object key for which the multipart upload was initiated.
*
*
* @return Object key for which the multipart upload was initiated.
* @deprecated Use {@link #destinationKey()}
*/
@Deprecated
public final String key() {
return destinationKey;
}
/**
*
* Object key for which the multipart upload was initiated.
*
*
* @return Object key for which the multipart upload was initiated.
*/
public final String destinationKey() {
return destinationKey;
}
/**
* The name of the bucket containing the object to copy. The provided input will be URL encoded. The
* {@code sourceBucket}, {@code sourceKey}, and {@code sourceVersionId} parameters must not be used in conjunction
* with the {@code copySource} parameter.
*
* @return The name of the bucket containing the object to copy. The provided input will be URL encoded. The
* {@code sourceBucket}, {@code sourceKey}, and {@code sourceVersionId} parameters must not be used in
* conjunction with the {@code copySource} parameter.
*/
public final String sourceBucket() {
return sourceBucket;
}
/**
* The key of the object to copy. The provided input will be URL encoded. The {@code sourceBucket},
* {@code sourceKey}, and {@code sourceVersionId} parameters must not be used in conjunction with the
* {@code copySource} parameter.
*
* @return The key of the object to copy. The provided input will be URL encoded. The {@code sourceBucket},
* {@code sourceKey}, and {@code sourceVersionId} parameters must not be used in conjunction with the
* {@code copySource} parameter.
*/
public final String sourceKey() {
return sourceKey;
}
/**
* Specifies a particular version of the source object to copy. By default the latest version is copied. The
* {@code sourceBucket}, {@code sourceKey}, and {@code sourceVersionId} parameters must not be used in conjunction
* with the {@code copySource} parameter.
*
* @return Specifies a particular version of the source object to copy. By default the latest version is copied. The
* {@code sourceBucket}, {@code sourceKey}, and {@code sourceVersionId} parameters must not be used in
* conjunction with the {@code copySource} parameter.
*/
public final String sourceVersionId() {
return sourceVersionId;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
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(copySourceRange());
hashCode = 31 * hashCode + Objects.hashCode(partNumber());
hashCode = 31 * hashCode + Objects.hashCode(uploadId());
hashCode = 31 * hashCode + Objects.hashCode(sseCustomerAlgorithm());
hashCode = 31 * hashCode + Objects.hashCode(sseCustomerKey());
hashCode = 31 * hashCode + Objects.hashCode(sseCustomerKeyMD5());
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(expectedBucketOwner());
hashCode = 31 * hashCode + Objects.hashCode(expectedSourceBucketOwner());
hashCode = 31 * hashCode + Objects.hashCode(destinationBucket());
hashCode = 31 * hashCode + Objects.hashCode(destinationKey());
hashCode = 31 * hashCode + Objects.hashCode(sourceBucket());
hashCode = 31 * hashCode + Objects.hashCode(sourceKey());
hashCode = 31 * hashCode + Objects.hashCode(sourceVersionId());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof UploadPartCopyRequest)) {
return false;
}
UploadPartCopyRequest other = (UploadPartCopyRequest) obj;
return 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(copySourceRange(), other.copySourceRange()) && Objects.equals(partNumber(), other.partNumber())
&& Objects.equals(uploadId(), other.uploadId())
&& Objects.equals(sseCustomerAlgorithm(), other.sseCustomerAlgorithm())
&& Objects.equals(sseCustomerKey(), other.sseCustomerKey())
&& Objects.equals(sseCustomerKeyMD5(), other.sseCustomerKeyMD5())
&& Objects.equals(copySourceSSECustomerAlgorithm(), other.copySourceSSECustomerAlgorithm())
&& Objects.equals(copySourceSSECustomerKey(), other.copySourceSSECustomerKey())
&& Objects.equals(copySourceSSECustomerKeyMD5(), other.copySourceSSECustomerKeyMD5())
&& Objects.equals(requestPayerAsString(), other.requestPayerAsString())
&& Objects.equals(expectedBucketOwner(), other.expectedBucketOwner())
&& Objects.equals(expectedSourceBucketOwner(), other.expectedSourceBucketOwner())
&& Objects.equals(destinationBucket(), other.destinationBucket())
&& Objects.equals(destinationKey(), other.destinationKey())
&& Objects.equals(sourceBucket(), other.sourceBucket()) && Objects.equals(sourceKey(), other.sourceKey())
&& Objects.equals(sourceVersionId(), other.sourceVersionId());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("UploadPartCopyRequest").add("CopySource", copySource())
.add("CopySourceIfMatch", copySourceIfMatch()).add("CopySourceIfModifiedSince", copySourceIfModifiedSince())
.add("CopySourceIfNoneMatch", copySourceIfNoneMatch())
.add("CopySourceIfUnmodifiedSince", copySourceIfUnmodifiedSince()).add("CopySourceRange", copySourceRange())
.add("PartNumber", partNumber()).add("UploadId", uploadId()).add("SSECustomerAlgorithm", sseCustomerAlgorithm())
.add("SSECustomerKey", sseCustomerKey() == null ? null : "*** Sensitive Data Redacted ***")
.add("SSECustomerKeyMD5", sseCustomerKeyMD5())
.add("CopySourceSSECustomerAlgorithm", copySourceSSECustomerAlgorithm())
.add("CopySourceSSECustomerKey", copySourceSSECustomerKey() == null ? null : "*** Sensitive Data Redacted ***")
.add("CopySourceSSECustomerKeyMD5", copySourceSSECustomerKeyMD5()).add("RequestPayer", requestPayerAsString())
.add("ExpectedBucketOwner", expectedBucketOwner()).add("ExpectedSourceBucketOwner", expectedSourceBucketOwner())
.add("DestinationBucket", destinationBucket()).add("DestinationKey", destinationKey())
.add("SourceBucket", sourceBucket()).add("SourceKey", sourceKey()).add("SourceVersionId", sourceVersionId())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
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 "CopySourceRange":
return Optional.ofNullable(clazz.cast(copySourceRange()));
case "PartNumber":
return Optional.ofNullable(clazz.cast(partNumber()));
case "UploadId":
return Optional.ofNullable(clazz.cast(uploadId()));
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 "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 "ExpectedBucketOwner":
return Optional.ofNullable(clazz.cast(expectedBucketOwner()));
case "ExpectedSourceBucketOwner":
return Optional.ofNullable(clazz.cast(expectedSourceBucketOwner()));
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()));
case "SourceBucket":
return Optional.ofNullable(clazz.cast(sourceBucket()));
case "SourceKey":
return Optional.ofNullable(clazz.cast(sourceKey()));
case "SourceVersionId":
return Optional.ofNullable(clazz.cast(sourceVersionId()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Map> memberNameToFieldInitializer() {
Map> map = new HashMap<>();
map.put("x-amz-copy-source", COPY_SOURCE_FIELD);
map.put("x-amz-copy-source-if-match", COPY_SOURCE_IF_MATCH_FIELD);
map.put("x-amz-copy-source-if-modified-since", COPY_SOURCE_IF_MODIFIED_SINCE_FIELD);
map.put("x-amz-copy-source-if-none-match", COPY_SOURCE_IF_NONE_MATCH_FIELD);
map.put("x-amz-copy-source-if-unmodified-since", COPY_SOURCE_IF_UNMODIFIED_SINCE_FIELD);
map.put("x-amz-copy-source-range", COPY_SOURCE_RANGE_FIELD);
map.put("partNumber", PART_NUMBER_FIELD);
map.put("uploadId", UPLOAD_ID_FIELD);
map.put("x-amz-server-side-encryption-customer-algorithm", SSE_CUSTOMER_ALGORITHM_FIELD);
map.put("x-amz-server-side-encryption-customer-key", SSE_CUSTOMER_KEY_FIELD);
map.put("x-amz-server-side-encryption-customer-key-MD5", SSE_CUSTOMER_KEY_MD5_FIELD);
map.put("x-amz-copy-source-server-side-encryption-customer-algorithm", COPY_SOURCE_SSE_CUSTOMER_ALGORITHM_FIELD);
map.put("x-amz-copy-source-server-side-encryption-customer-key", COPY_SOURCE_SSE_CUSTOMER_KEY_FIELD);
map.put("x-amz-copy-source-server-side-encryption-customer-key-MD5", COPY_SOURCE_SSE_CUSTOMER_KEY_MD5_FIELD);
map.put("x-amz-request-payer", REQUEST_PAYER_FIELD);
map.put("x-amz-expected-bucket-owner", EXPECTED_BUCKET_OWNER_FIELD);
map.put("x-amz-source-expected-bucket-owner", EXPECTED_SOURCE_BUCKET_OWNER_FIELD);
map.put("Bucket", DESTINATION_BUCKET_FIELD);
map.put("Key", DESTINATION_KEY_FIELD);
map.put("SourceBucket", SOURCE_BUCKET_FIELD);
map.put("SourceKey", SOURCE_KEY_FIELD);
map.put("SourceVersionId", SOURCE_VERSION_ID_FIELD);
return Collections.unmodifiableMap(map);
}
private static Function