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

software.amazon.awssdk.services.s3.model.PutObjectRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon S3 module holds the client classes that are used for communicating with Amazon Simple Storage Service

There is a newer version: 2.30.1
Show newest version
/*
 * Copyright 2014-2019 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.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 PutObjectRequest extends S3Request implements ToCopyableBuilder {
    private static final SdkField ACL_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(PutObjectRequest::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 BUCKET_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(PutObjectRequest::bucket))
            .setter(setter(Builder::bucket))
            .traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("Bucket")
                    .unmarshallLocationName("Bucket").build()).build();

    private static final SdkField CACHE_CONTROL_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(PutObjectRequest::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(PutObjectRequest::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(PutObjectRequest::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(PutObjectRequest::contentLanguage))
            .setter(setter(Builder::contentLanguage))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Content-Language")
                    .unmarshallLocationName("Content-Language").build()).build();

    private static final SdkField CONTENT_LENGTH_FIELD = SdkField
            . builder(MarshallingType.LONG)
            .getter(getter(PutObjectRequest::contentLength))
            .setter(setter(Builder::contentLength))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Content-Length")
                    .unmarshallLocationName("Content-Length").build()).build();

    private static final SdkField CONTENT_MD5_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(PutObjectRequest::contentMD5))
            .setter(setter(Builder::contentMD5))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Content-MD5")
                    .unmarshallLocationName("Content-MD5").build()).build();

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

    private static final SdkField EXPIRES_FIELD = SdkField
            . builder(MarshallingType.INSTANT)
            .getter(getter(PutObjectRequest::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(PutObjectRequest::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(PutObjectRequest::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(PutObjectRequest::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(PutObjectRequest::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 KEY_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(PutObjectRequest::key))
            .setter(setter(Builder::key))
            .traits(LocationTrait.builder().location(MarshallLocation.GREEDY_PATH).locationName("Key")
                    .unmarshallLocationName("Key").build()).build();

    private static final SdkField> METADATA_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .getter(getter(PutObjectRequest::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 SERVER_SIDE_ENCRYPTION_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(PutObjectRequest::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(PutObjectRequest::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(PutObjectRequest::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(PutObjectRequest::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(PutObjectRequest::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(PutObjectRequest::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(PutObjectRequest::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 REQUEST_PAYER_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(PutObjectRequest::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(PutObjectRequest::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(PutObjectRequest::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(PutObjectRequest::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(PutObjectRequest::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 List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACL_FIELD, BUCKET_FIELD,
            CACHE_CONTROL_FIELD, CONTENT_DISPOSITION_FIELD, CONTENT_ENCODING_FIELD, CONTENT_LANGUAGE_FIELD, CONTENT_LENGTH_FIELD,
            CONTENT_MD5_FIELD, CONTENT_TYPE_FIELD, EXPIRES_FIELD, GRANT_FULL_CONTROL_FIELD, GRANT_READ_FIELD,
            GRANT_READ_ACP_FIELD, GRANT_WRITE_ACP_FIELD, KEY_FIELD, METADATA_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, REQUEST_PAYER_FIELD, TAGGING_FIELD, OBJECT_LOCK_MODE_FIELD,
            OBJECT_LOCK_RETAIN_UNTIL_DATE_FIELD, OBJECT_LOCK_LEGAL_HOLD_STATUS_FIELD));

    private final String acl;

    private final String bucket;

    private final String cacheControl;

    private final String contentDisposition;

    private final String contentEncoding;

    private final String contentLanguage;

    private final Long contentLength;

    private final String contentMD5;

    private final String contentType;

    private final Instant expires;

    private final String grantFullControl;

    private final String grantRead;

    private final String grantReadACP;

    private final String grantWriteACP;

    private final String key;

    private final Map metadata;

    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 requestPayer;

    private final String tagging;

    private final String objectLockMode;

    private final Instant objectLockRetainUntilDate;

    private final String objectLockLegalHoldStatus;

    private PutObjectRequest(BuilderImpl builder) {
        super(builder);
        this.acl = builder.acl;
        this.bucket = builder.bucket;
        this.cacheControl = builder.cacheControl;
        this.contentDisposition = builder.contentDisposition;
        this.contentEncoding = builder.contentEncoding;
        this.contentLanguage = builder.contentLanguage;
        this.contentLength = builder.contentLength;
        this.contentMD5 = builder.contentMD5;
        this.contentType = builder.contentType;
        this.expires = builder.expires;
        this.grantFullControl = builder.grantFullControl;
        this.grantRead = builder.grantRead;
        this.grantReadACP = builder.grantReadACP;
        this.grantWriteACP = builder.grantWriteACP;
        this.key = builder.key;
        this.metadata = builder.metadata;
        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.requestPayer = builder.requestPayer;
        this.tagging = builder.tagging;
        this.objectLockMode = builder.objectLockMode;
        this.objectLockRetainUntilDate = builder.objectLockRetainUntilDate;
        this.objectLockLegalHoldStatus = builder.objectLockLegalHoldStatus;
    }

    /**
     * 

* 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; } /** *

* Name of the bucket to which the PUT operation was initiated. *

* * @return Name of the bucket to which the PUT operation was initiated. */ public String bucket() { return bucket; } /** *

* 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; } /** *

* Size of the body in bytes. This parameter is useful when the size of the body cannot be determined automatically. *

* * @return Size of the body in bytes. This parameter is useful when the size of the body cannot be determined * automatically. */ public Long contentLength() { return contentLength; } /** *

* The base64-encoded 128-bit MD5 digest of the part data. This parameter is auto-populated when using the command * from the CLI *

* * @return The base64-encoded 128-bit MD5 digest of the part data. This parameter is auto-populated when using the * command from the CLI */ public String contentMD5() { return contentMD5; } /** *

* 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 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; } /** *

* Object key for which the PUT operation was initiated. *

* * @return Object key for which the PUT operation was initiated. */ public String key() { return key; } /** *

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

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

* The Server-side encryption algorithm used when storing this object in S3 (e.g., 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 S3 (e.g., AES256, aws:kms). * @see ServerSideEncryption */ public ServerSideEncryption serverSideEncryption() { return ServerSideEncryption.fromValue(serverSideEncryption); } /** *

* The Server-side encryption algorithm used when storing this object in S3 (e.g., 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 S3 (e.g., 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 (e.g., AES256). *

* * @return Specifies the algorithm to use to when encrypting the object (e.g., 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 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 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 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 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. Documentation on configuring any of the officially * supported AWS SDKs and CLI can be found at * http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version *

* * @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. Documentation on configuring any of * the officially supported AWS SDKs and CLI can be found at * http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version */ public String ssekmsKeyId() { return ssekmsKeyId; } /** * 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. The tag-set must be encoded as URL Query parameters. (For example, "Key1=Value1") *

* * @return The tag-set for the object. The tag-set must be encoded as URL Query parameters. (For example, * "Key1=Value1") */ public String tagging() { return tagging; } /** *

* The Object Lock mode that you want to apply to this 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 this object. * @see ObjectLockMode */ public ObjectLockMode objectLockMode() { return ObjectLockMode.fromValue(objectLockMode); } /** *

* The Object Lock mode that you want to apply to this 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 this object. * @see ObjectLockMode */ public String objectLockModeAsString() { return objectLockMode; } /** *

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

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

* The Legal Hold status that you want to apply to the specified 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 The Legal Hold status that you want to apply to the specified object. * @see ObjectLockLegalHoldStatus */ public ObjectLockLegalHoldStatus objectLockLegalHoldStatus() { return ObjectLockLegalHoldStatus.fromValue(objectLockLegalHoldStatus); } /** *

* The Legal Hold status that you want to apply to the specified 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 The Legal Hold status that you want to apply to the specified object. * @see ObjectLockLegalHoldStatus */ public String objectLockLegalHoldStatusAsString() { return objectLockLegalHoldStatus; } @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 + Objects.hashCode(aclAsString()); hashCode = 31 * hashCode + Objects.hashCode(bucket()); 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(contentLength()); hashCode = 31 * hashCode + Objects.hashCode(contentMD5()); hashCode = 31 * hashCode + Objects.hashCode(contentType()); 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(key()); hashCode = 31 * hashCode + Objects.hashCode(metadata()); 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(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()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof PutObjectRequest)) { return false; } PutObjectRequest other = (PutObjectRequest) obj; return Objects.equals(aclAsString(), other.aclAsString()) && Objects.equals(bucket(), other.bucket()) && Objects.equals(cacheControl(), other.cacheControl()) && Objects.equals(contentDisposition(), other.contentDisposition()) && Objects.equals(contentEncoding(), other.contentEncoding()) && Objects.equals(contentLanguage(), other.contentLanguage()) && Objects.equals(contentLength(), other.contentLength()) && Objects.equals(contentMD5(), other.contentMD5()) && Objects.equals(contentType(), other.contentType()) && 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(key(), other.key()) && Objects.equals(metadata(), other.metadata()) && 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(requestPayerAsString(), other.requestPayerAsString()) && Objects.equals(tagging(), other.tagging()) && Objects.equals(objectLockModeAsString(), other.objectLockModeAsString()) && Objects.equals(objectLockRetainUntilDate(), other.objectLockRetainUntilDate()) && Objects.equals(objectLockLegalHoldStatusAsString(), other.objectLockLegalHoldStatusAsString()); } /** * 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("PutObjectRequest").add("ACL", aclAsString()).add("Bucket", bucket()) .add("CacheControl", cacheControl()).add("ContentDisposition", contentDisposition()) .add("ContentEncoding", contentEncoding()).add("ContentLanguage", contentLanguage()) .add("ContentLength", contentLength()).add("ContentMD5", contentMD5()).add("ContentType", contentType()) .add("Expires", expires()).add("GrantFullControl", grantFullControl()).add("GrantRead", grantRead()) .add("GrantReadACP", grantReadACP()).add("GrantWriteACP", grantWriteACP()).add("Key", key()) .add("Metadata", metadata()).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("RequestPayer", requestPayerAsString()).add("Tagging", tagging()) .add("ObjectLockMode", objectLockModeAsString()).add("ObjectLockRetainUntilDate", objectLockRetainUntilDate()) .add("ObjectLockLegalHoldStatus", objectLockLegalHoldStatusAsString()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ACL": return Optional.ofNullable(clazz.cast(aclAsString())); case "Bucket": return Optional.ofNullable(clazz.cast(bucket())); 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 "ContentLength": return Optional.ofNullable(clazz.cast(contentLength())); case "ContentMD5": return Optional.ofNullable(clazz.cast(contentMD5())); case "ContentType": return Optional.ofNullable(clazz.cast(contentType())); 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 "Key": return Optional.ofNullable(clazz.cast(key())); case "Metadata": return Optional.ofNullable(clazz.cast(metadata())); 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 "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())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((PutObjectRequest) 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); /** *

* Name of the bucket to which the PUT operation was initiated. *

* * @param bucket * Name of the bucket to which the PUT operation was initiated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder bucket(String bucket); /** *

* 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); /** *

* Size of the body in bytes. This parameter is useful when the size of the body cannot be determined * automatically. *

* * @param contentLength * Size of the body in bytes. This parameter is useful when the size of the body cannot be determined * automatically. * @return Returns a reference to this object so that method calls can be chained together. */ Builder contentLength(Long contentLength); /** *

* The base64-encoded 128-bit MD5 digest of the part data. This parameter is auto-populated when using the * command from the CLI *

* * @param contentMD5 * The base64-encoded 128-bit MD5 digest of the part data. This parameter is auto-populated when using * the command from the CLI * @return Returns a reference to this object so that method calls can be chained together. */ Builder contentMD5(String contentMD5); /** *

* 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 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); /** *

* Object key for which the PUT operation was initiated. *

* * @param key * Object key for which the PUT operation was initiated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder key(String key); /** *

* 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); /** *

* The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). *

* * @param serverSideEncryption * The Server-side encryption algorithm used when storing this object in S3 (e.g., 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 S3 (e.g., AES256, aws:kms). *

* * @param serverSideEncryption * The Server-side encryption algorithm used when storing this object in S3 (e.g., 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 (e.g., AES256). *

* * @param sseCustomerAlgorithm * Specifies the algorithm to use to when encrypting the object (e.g., 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 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 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 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 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. Documentation on configuring any of the officially * supported AWS SDKs and CLI can be found at * http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version *

* * @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. Documentation on configuring any of * the officially supported AWS SDKs and CLI can be found at * http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version * @return Returns a reference to this object so that method calls can be chained together. */ Builder ssekmsKeyId(String ssekmsKeyId); /** * 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. The tag-set must be encoded as URL Query parameters. (For example, "Key1=Value1") *

* * @param tagging * The tag-set for the object. The tag-set must be encoded as URL Query parameters. (For example, * "Key1=Value1") * @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 this object. *

* * @param objectLockMode * The Object Lock mode that you want to apply to this 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 this object. *

* * @param objectLockMode * The Object Lock mode that you want to apply to this 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 this object's Object Lock to expire. *

* * @param objectLockRetainUntilDate * The date and time when you want this 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); /** *

* The Legal Hold status that you want to apply to the specified object. *

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

* The Legal Hold status that you want to apply to the specified object. *

* * @param objectLockLegalHoldStatus * The Legal Hold status that you want to apply to the specified object. * @see ObjectLockLegalHoldStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ObjectLockLegalHoldStatus */ Builder objectLockLegalHoldStatus(ObjectLockLegalHoldStatus objectLockLegalHoldStatus); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends S3Request.BuilderImpl implements Builder { private String acl; private String bucket; private String cacheControl; private String contentDisposition; private String contentEncoding; private String contentLanguage; private Long contentLength; private String contentMD5; private String contentType; private Instant expires; private String grantFullControl; private String grantRead; private String grantReadACP; private String grantWriteACP; private String key; private Map metadata = DefaultSdkAutoConstructMap.getInstance(); private String serverSideEncryption; private String storageClass; private String websiteRedirectLocation; private String sseCustomerAlgorithm; private String sseCustomerKey; private String sseCustomerKeyMD5; private String ssekmsKeyId; private String requestPayer; private String tagging; private String objectLockMode; private Instant objectLockRetainUntilDate; private String objectLockLegalHoldStatus; private BuilderImpl() { } private BuilderImpl(PutObjectRequest model) { super(model); acl(model.acl); bucket(model.bucket); cacheControl(model.cacheControl); contentDisposition(model.contentDisposition); contentEncoding(model.contentEncoding); contentLanguage(model.contentLanguage); contentLength(model.contentLength); contentMD5(model.contentMD5); contentType(model.contentType); expires(model.expires); grantFullControl(model.grantFullControl); grantRead(model.grantRead); grantReadACP(model.grantReadACP); grantWriteACP(model.grantWriteACP); key(model.key); metadata(model.metadata); serverSideEncryption(model.serverSideEncryption); storageClass(model.storageClass); websiteRedirectLocation(model.websiteRedirectLocation); sseCustomerAlgorithm(model.sseCustomerAlgorithm); sseCustomerKey(model.sseCustomerKey); sseCustomerKeyMD5(model.sseCustomerKeyMD5); ssekmsKeyId(model.ssekmsKeyId); requestPayer(model.requestPayer); tagging(model.tagging); objectLockMode(model.objectLockMode); objectLockRetainUntilDate(model.objectLockRetainUntilDate); objectLockLegalHoldStatus(model.objectLockLegalHoldStatus); } public final String getAclAsString() { return acl; } @Override public final Builder acl(String acl) { this.acl = acl; return this; } @Override public final Builder acl(ObjectCannedACL acl) { this.acl(acl.toString()); return this; } public final void setAcl(String acl) { this.acl = acl; } public final String getBucket() { return bucket; } @Override public final Builder bucket(String bucket) { this.bucket = bucket; return this; } public final void setBucket(String bucket) { this.bucket = bucket; } 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 Long getContentLength() { return contentLength; } @Override public final Builder contentLength(Long contentLength) { this.contentLength = contentLength; return this; } public final void setContentLength(Long contentLength) { this.contentLength = contentLength; } public final String getContentMD5() { return contentMD5; } @Override public final Builder contentMD5(String contentMD5) { this.contentMD5 = contentMD5; return this; } public final void setContentMD5(String contentMD5) { this.contentMD5 = contentMD5; } 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 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 String getKey() { return key; } @Override public final Builder key(String key) { this.key = key; return this; } public final void setKey(String key) { this.key = key; } 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 getServerSideEncryptionAsString() { return serverSideEncryption; } @Override public final Builder serverSideEncryption(String serverSideEncryption) { this.serverSideEncryption = serverSideEncryption; return this; } @Override public final Builder serverSideEncryption(ServerSideEncryption serverSideEncryption) { this.serverSideEncryption(serverSideEncryption.toString()); return this; } public final void setServerSideEncryption(String serverSideEncryption) { this.serverSideEncryption = serverSideEncryption; } public final String getStorageClassAsString() { return storageClass; } @Override public final Builder storageClass(String storageClass) { this.storageClass = storageClass; return this; } @Override public final Builder storageClass(StorageClass storageClass) { this.storageClass(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 getRequestPayerAsString() { return requestPayer; } @Override public final Builder requestPayer(String requestPayer) { this.requestPayer = requestPayer; return this; } @Override public final Builder requestPayer(RequestPayer requestPayer) { this.requestPayer(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 getObjectLockModeAsString() { return objectLockMode; } @Override public final Builder objectLockMode(String objectLockMode) { this.objectLockMode = objectLockMode; return this; } @Override public final Builder objectLockMode(ObjectLockMode objectLockMode) { this.objectLockMode(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 getObjectLockLegalHoldStatusAsString() { return objectLockLegalHoldStatus; } @Override public final Builder objectLockLegalHoldStatus(String objectLockLegalHoldStatus) { this.objectLockLegalHoldStatus = objectLockLegalHoldStatus; return this; } @Override public final Builder objectLockLegalHoldStatus(ObjectLockLegalHoldStatus objectLockLegalHoldStatus) { this.objectLockLegalHoldStatus(objectLockLegalHoldStatus.toString()); return this; } public final void setObjectLockLegalHoldStatus(String objectLockLegalHoldStatus) { this.objectLockLegalHoldStatus = objectLockLegalHoldStatus; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public PutObjectRequest build() { return new PutObjectRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy